Question about Category link & Tag on Category page

I am using the plugin for the member directory for a chamber of commerce. When you go to one of the main category pages, for example http://www.huenemechamber.com/category/advertising-media/
The title "Category: Advertising & Media" links to a specific listing instead of that category page. I tried disabling the link for the title but when I do that it also disables the link to the individual listing pages. How can I have the title of the category link to that category page and not one of the businesses listed on the page?

Also, when you look at the bottom of the page next to "Tagged With" it shows the tag of one of the businesses, which makes it seem like all the businesses on that page have are tagged with the same thing, which they are not.
Is there a way to either have all the tags for the business that display on the category page be listed? Or to not have a tag display on the main category page?
Thank you!

  • Vaughan
    • Support/SLS MockingJay

    Hi @debbieg,

    You can remove the tags from the category listing page using CSS, just add the following to your themes CSS:

    .tax-listing_category .directory_listing .post-meta .tags {
        display: none;
    }

    I'm not actually sure with the category title, could you switch to a different theme and see if it still does the same?

    Thanks

  • Debbie
    • Webb Weaver

    Awesome, thanks Vaughn, tags gone from category listing page!

    I did a quick switch to twentyfourteen & the category title was not a link. The site is live so I can't leave the theme switched.
    I'm guessing that it must be something with the theme, which is the Prose theme for the Genesis framework. I understand that someone else's theme doesn't fall under your support, but could you steer me towards how I might be able to force the category title not to link?

    Thank you!

  • Vaughan
    • Support/SLS MockingJay

    Hi,

    It looks like the themes archive template or category archive is adding the last posts permalink to the category title.

    Could you provide FTP login details so I can take a look at the theme files?

    Can you send your details using the following contact form (select i have a different question from the dropdown.)

    https://premium.wpmudev.org/contact/

    Mark for attn: Vaughan
    Include a ref URL to this thread.

    Please include site login details (super-admin if on multisite)
    Also include FTP login details so I can take a look at the theme files.

    Thanks

  • Vaughan
    • Support/SLS MockingJay

    Hi @debbieg,

    I'm working on this now.

    You can't remove the tags on an empty page as I can't find a unique CSS class to bind it to, so I will also need to look at the template files to do that too, it may be easier if I add a class to the 'Not Found' div. I'll let you know as soon as i've sorted it.

    Apologies for the delay.

    Thanks

  • Hoang Ngo
    • Code Slayer

    Hi there @debbieg,

    I hope you are well today and I'm very sorry about the issue.

    This issue is related to your child theme as Jack said, some custom template will help.

    Can you please send in:

    - Mark to my attention - ATTN: Hoang Ngo
    - Link back to this thread
    - Include admin/network access
    - Include cPanel (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Best regards,
    Hoang

  • Hoang Ngo
    • Code Slayer

    Hi @debbieg,

    I hope you are well today. I have added the code below to your child theme functions.php. It will check does the categories/tags empty or not, if empty, it will remove the text.

    add_filter('genesis_post_categories_shortcode','hide_categories_if_empty',10,2);
    function hide_categories_if_empty($content,$atts){
    	$cats = get_the_category_list( trim( $atts['sep'] ) . ' ' );
    	if(empty($cats)){
    		return '';
    	}
    	return $content;
    }
    add_filter('genesis_post_tags_shortcode','hide_tags_if_empty',10,2);
    function hide_tags_if_empty($content,$atts){
    	$tags = get_the_tag_list( $atts['before'], trim( $atts['sep'] ) . ' ', $atts['after'] );
    	if(empty($tag)){
    		return '';
    	}
    	return $content;
    }

    If you have any issues please don't hesitate to let us know so we can assist

    Best regards,
    Hoang

  • Debbie
    • Webb Weaver

    Hi @Hoang,

    Thank you so much for this custom code! The categories & tags are now hidden when there's no listings in a category, fantastic!

    However now the tags are hidden on all the listings, only the category appears. Is it possible make a change so that both the categories & tag still appear on the listings? For example, this listing is in the category Real Estate, Moving & Storage and tagged with Real Estate - Residential but only the category appears.
    http://www.huenemechamber.com/directory-listing/troop-real-estate-inc-faith-cosby/

    Thanks!
    Debbie

  • Hoang Ngo
    • Code Slayer

    Hi @debbieg,

    I have some modification to the code, for now, it will be like this

    add_filter('genesis_post_categories_shortcode','hide_categories_if_empty',10,2);
    function hide_categories_if_empty($content,$atts){
        $cats = get_the_category_list( trim( $atts['sep'] ) . ' ' );
        if(empty($cats)){
            return '';
        }
        return $content;
    }
    add_filter('genesis_post_tags_shortcode','hide_tags_if_empty',10,2);
    function hide_tags_if_empty($content,$atts){
        $tags = get_the_tag_list( $atts['before'], trim( $atts['sep'] ) . ' ', $atts['after'] );
        $check = str_replace('Tagged With:', '', $tags);
        $check= trim($check);
        if(empty($check)){
            return '';
        }
        return $content;
    }

    If you have any issues please don't hesitate to let us know so we can assist

    Best regards,
    Hoang

  • Debbie
    • Webb Weaver

    Hi @Hoang,

    Awesome, it's now displaying how & when they want! I appreciate your help with this, thank you!!!

    Best,
    Debbie

    @Hoang, @Vaughn, @Jack - you've all been very helpful with this, I'm going to give you all points, although I'm not sure how many one is supposed to give, please forgive me if I "under" point :>:wink:

  • Vaughan
    • Support/SLS MockingJay

    Hi @debbieg,

    Thanks for confirming this has finally been resolved & many thanks to @Hoang Ngo for finding a solution to this.

    1 point is always fine Debbie for staff :slight_smile: it's the kind messages we always appreciate the most :slight_smile:

    If you need any further assistance, please don't hesitate to ask.

    Thanks

  • Hoang Ngo
    • Code Slayer

    Hi @debbieg,

    I hope you are well today.

    It's seem like the file /home/huenemec/public_html/phcc/wp-content/themes/prose/loop-taxonomy.php, when uploading to your server, have broken.

    Can you please re-upload that file and let see if it work?

    Thanks.

    Best regards,
    Hoang

  • Hoang Ngo
    • Code Slayer

    Hi @debbieg,

    I hope you are well today

    Hmm, do you have any backup before the issue happen, if that, we can use that file. Also, I will need to check your broken file too, I have try to use the old information but no luck :slight_frown:. Can you please send in:

    - Mark to my attention - ATTN: Hoang Ngo
    - Link back to this thread
    - Include admin/network access
    - Include cPanel (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks!

    Best regards,
    Hoang

  • Debbie
    • Webb Weaver

    Hi @Hoang,

    I'm off to a good start today, hope you're doing well too!

    Since the loop-taxonomy.php is not part of the original theme files I decided to delete it from the server & see if that solved the problem. It does! Now the categories are displaying as they should. Meaning when you go to the main member directory page here http://www.huenemechamber.com/member-directory/ & click on any of the categories, it now lists all the businesses in that category, and no longer displays the error message referencing loop-taxonomy.php

    I think the loop-taxonomy.php file was added early in this process & now it seems it's no longer needed. However, while the directory seems to be functioning properly again, I do see that loop-taxonomy.php is referenced in the page-listings.php. Should I be concerned with that? Or is it fine as long as the directory is functioning well?

    Something else I see is that even though the order is specified ASC in the page-listings.php, it is displaying in descending order in the directory. Is there somewhere else I should look to make sure the order is ASC?
    Or would you still like me to send you the info to access the files?

    Thank you!
    Debbie

  • Vinod Dalvi
    • WP Unicorn

    However, while the directory seems to be functioning properly again, I do see that loop-taxonomy.php is referenced in the page-listings.php. Should I be concerned with that? Or is it fine as long as the directory is functioning well?

    You don't need to concern about it because the code it contains just checks whether loop-taxonomy.php file is in your theme if not then it loads it from Directory plugin.

    You can try removing( Take back up of it first ) it and check whether it affects directory listing page functionality. I think it will not affect directory listing page if you have not made any custom changes in it.

    Something else I see is that even though the order is specified ASC in the page-listings.php, it is displaying in descending order in the directory. Is there somewhere else I should look to make sure the order is ASC?
    Or would you still like me to send you the info to access the files?

    Have you made any custom changes in the page-listings.php file to change the order?

    Could you please share me your page-listings.php file by attaching it to your reply?

    Kind Regards,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hi Vinod,
    Thank you for explaining about the loop-taxonomy.php.

    I have an additional problem today: the directory categories & tags are not displaying, I get a 404 error. I re-uploaded the loop-taxonomy.php to see if that would solve the problem & it did not. Please see what I mean on these pages:
    http://www.huenemechamber.com/category/business-professional-services/
    http://www.huenemechamber.com/tag/mailing-services/
    However when I go directly to a directly listing page it displays, see here
    http://www.huenemechamber.com/directory-listing/the-ups-store/

    I tried deactivating & reactivating the Directory plugin & that did not solve the problem.

    I'll attach both files. The original problem of the syntax error on the last line of loop-taxonomy.php has note been resolved. Also, these two files are not part of the original theme files. They were created as a solution to my original request.

    Thank you in advance for your help. I'm grateful for all help to get this directory functioning properly again!

    Debbie

  • Vaughan
    • Support/SLS MockingJay

    Hi @debbieg,

    There were some changes in the latest releases of directory & classifieds which changed the location of the custom templates.

    You should now place any custom templates for directory inside a folder called directory in your current theme folder.

    So you have

    /wp-content/themes/your-theme/directory/loop-taxonomy.php
    /wp-content/themes/your-theme/directory/single-listing.php

    instead of

    /wp-content/themes/your-theme/loop-taxonomy.php
    /wp-content/themes/your-theme/single-listing.php

    Try that & hopefully that should fix it, let us know how it goes.

    Hope this helps

  • Debbie
    • Webb Weaver

    Hi @Vaughn,

    I created a directory folder inside the theme folder & moved the loop-taxonomy.php & single-listing.php inside that folder.
    I also deleted the loop-taxonomy.php & single-listing.php from the main theme folder.
    However there is no change. I still get the not found error when I try to view any of the categories.

    Thanks,
    Debbie

  • Vaughan
    • Support/SLS MockingJay

    Hi Debbie,

    Can you grant support access so we can take a look?

    Dashboard > wpmudev > support > support access

    Have you tried regenerating your permalinks in Dashboard > settings > permalinks?

    Sometimes that can help.

    I'll also ask @Hoang Ngo again for some assistance, to see about those changes he made earlier.

    Thanks

  • Debbie
    • Webb Weaver

    Hi Vaughn,

    I had tried re-saving the permalinks & that hadn't helped.
    Out of curiosity I just tried saving the permalinks to the default, and that resulted in the directory categories displaying, however still not in ASC order. And the permalinks really do need to be post name.

    I just granted support access in the dashboard. Please let me know if you need anything else to access what you need.

    Thanks!

  • Vinod Dalvi
    • WP Unicorn

    Hi @debbieg,

    Thank you for granting us support staff access.

    Your directory listings category is having wrong URL http://www.huenemechamber.com/category/agriculture-fishing-forestry/ instead it should be http://www.huenemechamber.com/listings-category/agriculture-fishing-forestry/

    I can also see the direcory plugin menu in the admin area has label "Directory Listings" instead of "Listings"

    Have you made any changes in the plugin using custompress?

    I can see the changes made in the listing_category in custompress settings on the following path.

    Admin Area -> CustomPress -> Content Types -> Taxonomies -> listing_category ( Edit )

    The settings of listing_category in custompress should be as displayed in the attached screenshot.

    I tried to make the changes but the changed are not getting saved.

    Are you using any caching/security plugin?

    If yes try temporary deactivating it to make the changes.

    Also try deleting and reinstalling the Directory plugin.

    Regarding your order issue you didn't answer my question that have you made any changes in the files( page-listings.php & loop-taxonomy.php ) after copying it from Directory plugin and also you missed to attach the files?

    Could you please do it so that i can help you?

    Regards,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hi Vinod,
    Thank you! I've disabled the security plugin & made the changes to
    Admin Area -> CustomPress -> Content Types -> Taxonomies -> listing_category

    Things are now displaying (which is good!) however, what is now displaying on this page http://www.huenemechamber.com/member-directory/
    are the listing tags, not the categories. The categories are what need to be displayed on that page.

    And on this page http://www.huenemechamber.com/listing_tag/business-services-consultants/
    at the bottom where it displays
    Filed Under: Business Services & Consultants Tagged With: Business & Professional Services
    The "Filed Under" is showing the listing tag & it needs to show the listing category & display the text "Category" instead of "Filed Under".
    The "Tagged With" is showing the listing category & it needs to show the listing tag & if it will work to change the display text to "Business Classification" instead of "Tagged With" that would be ideal. If the display text needs to stay "Tagged With" that will be fine.

    I thought I had attached the page-listings.php & loop-taxonomy.php files. I will try again.

    Thank you for your help!

    • Vinod Dalvi
      • WP Unicorn

      Hi @debbieg,

      I checked the listings category settings on your site and found the changes have not been made similar to as displayed in the screenshot shared in my previous reply therefore listing category is being considered as listing tag.
      ( See the attached screenshots here taken from your settings page )

      If the settings made is not getting saved then take a backup of your database and delete the listing_category and listing_tag taxonomies from CustomPress. After deleting it just deactivate the Directory plugin and reactivate it again so that it will be created again.

      You can also just try on your development site deactivating all other plugins and using default WordPress theme like Twenty Thirteen as displayed in the flowchart on the following page to know which theme/ plugin is conflicting if any.

      https://premium.wpmudev.org/manuals/getting-support/

      This is the second time you have not answered my following question.

      Have you made any changes in the files( page-listings.php & loop-taxonomy.php ) after copying it from Directory plugin?

      If you have not then you don't need to share it to me or if you are not sure then just delete it from your themes and copy it again from the Directory plugin.

      Regards,
      Vinod Dalvi

      • Debbie
        • Webb Weaver

        Hi @Vinod,

        I did make the changes as you sent in your previous reply & they had saved. I do not know why they are no longer saved.

        I have now deleted the listing_category and listing_tag taxonomies from CustomPress. I deactivated the Directory plugin & reactivated it. Now the categories are displaying properly on this page http://www.huenemechamber.com/member-directory/
        And the categories & tags are displaying correctly on a listing page like this one http://www.huenemechamber.com/directory-listing/the-ups-store/
        Yay!! Thank you Vinod!

        I am sorry not to have answered your question about changes to the page-listings.php & loop-taxonomy.php files, I was focused on trying to get them attached.
        I did not put those files in the theme folder nor have I ever made any changes in those files. They had been put in the theme folder after my earlier requests to customize how the categories & tags display. The person(s) that helped with that may have made changes to those files after copying them from the Directory plugin. Could you please look at the files. I tried a zip file but it denied the attachment. The only file format I've been able to successfully attached are these PDFs. And the screenshots I sent yesterday.

        In addition to the listings not being in ASC order on the listing category pages, see how on this page it displays "Filed Under: Business & Professional Services" "Tagged With: Mailing Services"
        http://www.huenemechamber.com/directory-listing/the-ups-store/"
        Is it possible to change the "Filed Under" to "Category" and the "Tagged With" to "Business Classification"?
        Would you be able to direct me to where I can make those changes? Or would you be able to make those changes if that's easier?

        Thank you!
        Debbie

        • Debbie
          • Webb Weaver

          Hi Vinod,
          If you make the changes to the text "Filed Under" & "Tagged With", could you please change "Filed Under" to "Category" and "Tagged With" to "Classification" (leave out the word business).
          Although it would be great if that's something you can direct me to where I can make that change.
          Thank you for your help!
          Debbie

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    Thanks for sharing the code.

    I have tested the shared files on my test site and faced the same syntax error that you are getting.

    To fix the syntax error add the following line of code in your template file loop-taxonomy.php on line number 48 or use loop-taxonomy.php file attached to this reply which contains this modification.

    <?php endif; ?>

    After making this change it worked fine on my test site displaying listings in the ascending order of listing title.

    n addition to the listings not being in ASC order on the listing category pages, see how on this page it displays "Filed Under: Business & Professional Services" "Tagged With: Mailing Services"
    http://www.huenemechamber.com/directory-listing/the-ups-store/"
    Is it possible to change the "Filed Under" to "Category" and the "Tagged With" to "Business Classification"?
    Would you be able to direct me to where I can make those changes? Or would you be able to make those changes if that's easier?

    You can change it in the page.php template file of your child theme or change it by translating your theme( If it is translation ready ) using the information provided on the following page.

    https://premium.wpmudev.org/blog/how-to-translate-a-wordpress-theme/

    You can also use the following plugin to translate the theme.

    http://wordpress.org/plugins/codestyling-localization/

    If you can't do this then please grant us support staff access again as it is revoked so that we can provide you more detailed instructions to do it.

    Best Regards,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hi Vinod,

    Thank you for the fix to the syntax error. I am not seeing the categories display in ascending order. Some categories are not displaying in order and others are displaying in descending order. I will look into what other settings in the Directory or Custom Press may be causing that.

    Thank you for the suggestions about how to change the "Filed Under" & "Tagged With" text. Although I don't understand how translating will help; what I want to do is change the text that displays in front of the category & tag on the individual directory listing page. I will do more research on how I can accomplish that.

    Thank you again for fixing the syntax error.
    Debbie

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    Some categories are not displaying in order and others are displaying in descending order. I will look into what other settings in the Directory or Custom Press may be causing that.

    If you need any further assistance from us about this then please grant us support staff access so that we can troubleshoot it.

    Although I don't understand how translating will help; what I want to do is change the text that displays in front of the category & tag on the individual directory listing page.

    You don't need to translate your theme in other language. You have to just translate your theme in to same English language that you are using but just change the strings.

    Find more information about it on the following pages.

    http://ronangelo.com/change-or-translate-text-on-a-wordpress-theme/
    https://www.ostraining.com/blog/wordpress/language-strings-wordpress/

    Best Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    Thank you for your patience.

    Could you please try temporary using the modified directory temporary files loop-taxonomy.php and page-listings.php directly copying it in the following folder of your directory plugin overwriting existing files?

    wp-content/plugins/directory/ui-front/general/

    Regards,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hi Vinod,

    That solved it, the categories are now displaying alphabetically in ascending order, thank you!

    Going forward will I need to copy the modified versions of loop-taxonomy.php & page-listings.php into this folder
    wp-content/plugins/directory/ui-front/general/
    every time there is an update to the plugin?

    Thanks,
    Debbie

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    Glad it's working for you now :slight_smile:

    Going forward will I need to copy the modified versions of loop-taxonomy.php & page-listings.php into this folder
    wp-content/plugins/directory/ui-front/general/
    every time there is an update to the plugin?

    Yes you will have to copy it as it will be overwritten.

    We are updating the plugin so that the plugin template files will overwritten by copying it in to directory folder of your theme and you don't need to copy it again on updating plugin as the theme files will not be overwritten.

    The plugin version including this update will be released soon in the meanwhile you can just use it as above.

    Cheers,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hello fine support folks!

    I just updated the Directory plugin & now the categories are not displaying in alphabetical ascending order again. After updating the plugin I tried uploading the modified versions of loop-taxonomy.php & page-listings.php into this folder
    wp-content/plugins/directory/ui-front/general/ & it did not help.

    I have granted support access when you're ready to look into this.

    Thank you!

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    I just updated the Directory plugin & now the categories are not displaying in alphabetical ascending order again.

    I tried to access admin area of your site using support staff access but whenever i try to access the URL http://www.huenemechamber.com/phcc/wp-admin it is getting redirected to http://www.huenemechamber.com/phcc/

    After updating the plugin I tried uploading the modified versions of loop-taxonomy.php & page-listings.php into this folder
    wp-content/plugins/directory/ui-front/general/ & it did not help.

    Have you tried overwriting this file in your child theme by copying it in to the theme folder called directory?

    Please advise.

    Regards,
    Vinod Dalvi

  • Vinod Dalvi
    • WP Unicorn

    Hi Debbie,

    The admin url is http://www.huenemechamber.com/phcc/wp-admin/ - I haven't made any changes to that so I'm not sure why you were unable to access it. The Support Access screen shows that you logged in, hopefully having this url will help.

    Yes i tried to access the URL http://www.huenemechamber.com/phcc/wp-admin/ but it's getting redirected to http://www.huenemechamber.com/phcc

    Are you not getting redirected when you try to access the URL http://www.huenemechamber.com/phcc/wp-admin/ without logging in?

    Please advise.

    The Support Access screen may be showing that i am logged in because i clicked on "Support Staff Login" button to access it but it's getting redirected.

    Yes, I did also overwrite the loop-taxonomy.php & page-listings.php in directory in the theme folder.

    I could confirm that the plugin template files oop-taxonomy.php & page-listings.php are not getting overwritten by copying it in the directory folder of default WordPress theme therefore i have notified the plugin developer to fix it.

    I tried making changes in these files directly in the following plugin folder and found the changes are getting reflected successfully.

    directory/ui-front/general/

    Please temporary make changes directly in the plugin files until the issue gets fixed.

    If the changes made in the plugin files don't work for you then to troubleshoot it just send log in info through our secured contact form: https://premium.wpmudev.org/contact/
    - Choose "I have a different question"
    - Include my name in the subject "Vinod Dalvi"
    - Include the URL of this post in your message so that I may track this issue better
    - Include login information (Wordpress admin info username + password )
    - Include FTP Details

    Please let me know if you have not changed your log in/FTP details that you have sent to us previously instead of sending it again so that i can reuse it.

    Regards,
    Vinod Dalvi

  • Debbie
    • Webb Weaver

    Hi Vinod,

    Thank you for checking into this. I was able to find the version of the loop-taxonomy.php & page-listings.php files that had your fix, and before the recent directory plugin update. I copied them in both the directory/ui-front/general/ in the plugin folder, and in the directory folder inside the them folder - the listings are displaying correctly again.

    Thank you!
    Debbie

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.