• Is it possible to display the category instead of the tag below the post (specifically below sticky posts)?

    Many thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • Theme Author GavickPro

    (@gavickpro)

    Hello,

    Yes, it is possible. In the content.php file please replace:

    $tag_list = get_the_tag_list('<ul class="tags-links"><li>',', </li><li>','</li></ul>');
    if ($tag_list) {
    	echo $tag_list;
    }

    to:

    $tag_list = get_the_category_list('</li><li>');
    if ($tag_list) {
    	echo '<ul class="tags-links"><li>' . $tag_list . '</li></ul>';
    }
    Thread Starter daniish

    (@daniish)

    Thank you.

    On the WordPress Codex page I found this:

    <?php
    /* Get all Sticky Posts */
    $sticky = get_option( 'sticky_posts' );
    ?>

    Can you tell me how I would create a conditional statement with your code above, so that it displays just the category, but only for sticky posts?

    Thread Starter daniish

    (@daniish)

    GavickPro, alas it seems your code doesn’t actually work.

    You can see it here: https://www.globexposure.net/willowgallery/

    And is it possible to replace it by title of the post?

    Theme Author GavickPro

    (@gavickpro)

    @karolinabadz – yes, it is possible – you have to use the get_the_title() function.

    Do you mind sharing the entire part of the code that has to be replaced?

    Theme Author GavickPro

    (@gavickpro)

    @karolinabadz – please replace:

    $tag_list = get_the_category_list('</li><li>');
    if ($tag_list) {
    	echo '<ul class="tags-links"><li>' . $tag_list . '</li></ul>';
    }

    to:

    echo get_the_title();

    It can need some additional CSS adjustments – if you don’t know how to do it, please wait for a new version of the theme – we will add a possibility to display categories and titles instead of tags.

    I replaced that but it didn’t change the tags to the titles. I will just wait for the new version then..

    By the way, I love the theme! You can see web here: https://www.madebyanulka.com/

    Theme Author GavickPro

    (@gavickpro)

    We will inform you as soon as we will implement this feature – it will be available at our repository probably few days before the official release.

    Very nice implementation – it would be greate if you will share your opinion about our theme in the reviews section ??

    Theme Author GavickPro

    (@gavickpro)

    Here you can download version with this feature: https://github.com/GavickPro/Portfolio-Free-WordPress-Theme/archive/master.zip – you can select the category display in the static front page section of Theme Cusotmizer.

    Thank you for the direction. I was able to update the tag to category at the bottom of the post. I want to inquire how to remove the “Posted In – Category” from the sub-headline.

    Theme Author GavickPro

    (@gavickpro)

    @lilangelaq – if you will navigate to the single post in theme customizer you will be able to disable the category display under single post item settings.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Display Category instead of Tag’ is closed to new replies.