WordPress.org

Forums

Enhanced Media Library
[resolved] Seach by tags (2 posts)

  1. BassieB
    Member
    Posted 1 year ago #

    I enabled the tag-taxonomy.
    How can I show my tagged media (or its attachment-page) when I do:
    http://mysite.com/tag/sometag/

    http://wordpress.org/plugins/enhanced-media-library/

  2. webbistro
    Member
    Plugin Author

    Posted 1 year ago #

    Hello @BassieB,

    I am very sorry for my silence for so long time.

    To solve this add following code to your functions.php

    add_action( 'pre_get_posts', 'custom_pre_get_posts' );
    
    function custom_pre_get_posts( $query )
    {
    	if ( $query->is_main_query() && is_tag() && !is_admin() )
    	{
    		$query->set( 'post_type', 'attachment' );
    		$query->set( 'post_status', 'inherit' );
    	}
    }

    Don't forget to renew Settings -> Permalinks

    Nadia

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Enhanced Media Library
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic