Envira Gallery Documentation

Documentation, Reference Materials and Tutorials for Envira Gallery

Featured Content Addon

Share This Post!

Would you like to create a gallery based on particular post types or categories? The Featured Content Addon for Envira Gallery allows you to create a Gallery based on Posts, Pages and/or Custom Post Types. Using the Featured Content Addon is extremely quick and easy to set up.


Requirements

Installation

Please follow our instructions on how to install and activate addons.

In this instance, you’ll be activating the Envira Featured Content Addon.

Setup

Once the Featured Content Addon is activated, your first step is to create a new gallery. Next, click on the External Tab to click the Featured Content icon.

On the Images Tab of the gallery you can configure your gallery options to select your post type, your category and other options for your gallery. See below for a complete list of option to choose and configure.

Images Tab - Query Settings

  • Select Your Post Type(s) – Determines the post types to query. When you click this dropdown all the post types listed on your site from your theme and plugins will show here.
  • Select Your Taxonomy Term(s) – Determines the taxonomy terms that should be queried based on post type selection. This dropdown will show you every taxonomy you have on your site. Options include but not limited to categories and tags.
  • Taxonomy Term(s) Relation – Determines whether all or any taxonomy terms must be present in the above Posts.
    Available options: Posts must have ALL of the above taxonomy terms (AND), Posts must have ANY of the above taxonomy terms (IN).
  • Only add the Selected Post(s) – Will include only the selected post(s). When you click this dropdown it will give you a list of post titles created from all post types title to specifically include in your gallery. For example, a complete list of all of your blog article titles.
  • Exclude Selected Post(s) – Will exclude the selected post(s) from inclusion in the Gallery. As with the above option, this dropdown will also show a list of available post type titles to specifically exclude from your gallery.
  • Include Sticky Posts – If enabled, forces any Posts that are marked as Sticky to be at the start of the resultset. If disabled, Sticky Posts are treated as ordinary Posts, and will only appear if they meet the other criteria set above and below.
  • Sort Posts By – Determines how the posts are sorted in the gallery. Available options: Date, ID, Author, Title, Menu Order, Random, Comment Count, Post Name, Modified Date, Meta Value and Meta Value (Numeric).
  • Meta Key – The meta key to use when ordering Posts. Used when Sort Posts By = Meta Value. This option is more for technical queries.
  • Order Posts By – Determines how the posts are ordered in the gallery. Available options: Ascending Order or Descending Order.
  • Number of Posts
    The number of posts in your Featured Content gallery.
  • Posts Offset – The number of posts to offset in the query. For example, you may want to skip the first 3 posts because you already have them listed elsewhere on the page (such as a homepage showing the latest 3 posts automatically).
  • Post Status – Determines the post status to use for the query. Available options: Published, Scheduled, Draft, Pending or Private. There could also be more options depending on the plugins you have activated on your site.

Images Tab - Content Settings

  • Link Image to Post URL? – Links to the image to the post URL.
  • Fallback Image URL – This image URL is used if no image URL can be found for a post.
Q: Why aren’t any of my images showing?

A: The images used for a Featured Content gallery will be the featured image of the post type you are using. If you have not set a featured image for each post that you are using in your gallery, please make sure you have set a fallback image under the Fallback Image URL setting from the Images Tab.

This table describes the available configuration options for your Envira Galleries when using this Addon.

The Programmatic Name and Programmatic Values columns are used when configuring the Dynamic Addon’s shortcode or template tag, or when overriding the default settings for creating a new Gallery.

Images Tab

You will see the following new options in the Images tab for Galleries.

Config Item Description Options Programmatic Name Programmatic Values
Select Your Post Type(s) Determines the post types to query. Post Types fc_post_types Array of Post Types
Select Your Taxonomy Term(s) Determines the taxonomy terms that should be queried based on post type selection. Taxonomy Terms fc_terms Array of Taxonomy Terms
Taxonomy Term(s) Relation Determines whether all or any taxonomy terms must be present in the above Posts. Posts must have ALL of the above taxonomy terms (AND)
Posts must have ANY of the above taxonomy terms (IN)
fc_terms_relation AND, IN
Include / Exclude Items Will include or exclude ONLY the selected post(s). Include
Exclude
fc_query include, exclude
Include Sticky Posts Determines how the posts are sorted in the gallery. Date
Post ID
Author
Title
Menu Order
Random
Comment Count
Post Name
Post Modified Date
Meta Value
Meta Value (Numeric)
fc_orderby date, ID, author, title, menu_order, rand, comment_count, name, modified, meta_value, meta_value_num
Meta Key The meta key to use when ordering Posts. Used when Sort Posts By = Meta Value String fc_meta_key String
Order Posts By Determines how the posts are ordered in the gallery. Ascending
Descending
fc_order DESC, ASC
DESC, ASC If enabled, prompts a file download in the browser instead of display the image in a new browser window/tab. Enabled/Disabled download_force 0,1
Number of Posts The number of posts in your Featured Content gallery. Number fc_number Integer
Posts Offset The number of posts to offset in the query. Number fc_offset Integer
Post Status Determines the post status to use for the query. Published
Scheduled
Draft
Pending
Prviate
fc_status publish, future, draft, pending, private
Link Image to Post URL? Links to the image to the post URL. Enabled / Disabled fc_post_url 0,1
Fallback Image URL This image URL is used if no image URL can be found for a post. URL fc_fallback URL

Developers

Filters

FileFilter NameArguments
/includes/global/common.php
 envira_featured_content_excluded_post_typesapply_filters( 'envira_featured_content_excluded_post_types', array( 'attachment', 'soliloquy', 'envira', 'envira_album' )
 envira_featured_content_excluded_taxonomiesapply_filters( 'envira_featured_content_excluded_taxonomies', array( 'nav_menu' )
 envira_featured_content_taxonomy_relationsapply_filters( 'envira_featured_content_taxonomy_relations', $relations )
 envira_featured_content_orderbyapply_filters( 'envira_featured_content_orderby', $orderby )
 envira_featured_content_orderapply_filters( 'envira_featured_content_order', $order )
 envira_featured_content_statusesapply_filters( 'envira_featured_content_statuses', $statuses )
 envira_featured_content_content_typesapply_filters( 'envira_featured_content_content_types', $types )
/includes/global/shortcode.php
 envira_dynamic_get_fc_image_dataapply_filters( 'envira_dynamic_get_fc_image_data', Envira_Gallery::get_instance()
 envira_featured_content_imageapply_filters( 'envira_featured_content_image', $prep, $posts, $data, $post )
 envira_featured_content_suppress_filtersapply_filters( 'envira_featured_content_suppress_filters', true, $query_args, $id, $data )
 envira_featured_content_query_argsapply_filters( 'envira_featured_content_query_args', $query_args, $id, $data )
 envira_featured_content_post_dataapply_filters( 'envira_featured_content_post_data', $posts, $query, $id, $data )
 envira_featured_content_thumbnail_idapply_filters( 'envira_featured_content_thumbnail_id', get_post_thumbnail_id( $post->ID )
 envira_featured_content_image_srcapply_filters( 'envira_featured_content_image_src', $src, $post, $data )
/includes/admin/ajax.php
 envira_featured_content_max_queried_postsapply_filters( 'envira_featured_content_max_queried_posts', 500 )
/includes/admin/metaboxes.php
 envira_featured_content_saveapply_filters( 'envira_featured_content_save', $settings, $post_id )

Actions

No actions for this Addon exist.

Share This Post!