• Resolved da_sprite

    (@da_sprite)


    Hi,

    I seem to be unable to get the “Tags_and” parameter to work properly.

    Some background:
    I have a business directory where companies can be sorted by type (cafes, grocers, etc) and country (Australia, USA, etc). I let categories represent “type” while tags represent “country”.

    When i try to show categories that contain only posts with the tag “australia”, i run the shortcode:
    [pcig category=all-categories hide_empty=true links=subcategory_name tags_and=australia]

    This should work, but i seem to be getting posts with the tag “USA” appearing as well.

    Can anyone help?

    Really appreciate it, thanks.

    https://www.ads-software.com/extend/plugins/post-category-index-generator/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marco Constancio

    (@marco-constancio)

    You have to use the parameter show. If you don’t, the plugin will not display anything if that category doesn’t have any subcategories,

    I changed the installation page to better indicate this.

    Thread Starter da_sprite

    (@da_sprite)

    Thanks Marco for your reply.

    I found that when i used the “show” parameter, the post (containing the desired tag) and the top category appear.

    To be absolutely clear, i’m trying to show only subcategories which contain posts tagged with my specific keyword. I’m not looking to display the posts.
    The opposite remains true: i’m trying to hide only subcategories which contain posts not tagged with my specific keyword.

    Appreciate your help greatly, Thanks!

    Plugin Author Marco Constancio

    (@marco-constancio)

    The plugin uses the default wordpress function, so the tag function are only applied post and not categories. So, in order to do that you have to remove the categories by javascript.

    Add wp_enqueue_script( 'jquery' ); to the header.php of you theme and add, to the post after the shortcode, the following code:

    <script type="text/javascript">
    jQuery('.pcig-category').each(function(index, value) {
      if(jQuery(this).parent().next().is('li')){ jQuery(this).parent().remove(); } });
    </script>

    and it should do what you want.

    Thread Starter da_sprite

    (@da_sprite)

    Works like a charm. Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Tags_and not working?’ is closed to new replies.