• Hi Jagadish Timilsina! Can you make category titles clickable, so you can see all posts in category on front page? It will be very nice feature.
    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Agree

    In the file front-page.php find this line in section <!– Featured Block One –>:

    <h2 class="block-title"><span class="bordertitle-red"></span><?php echo $cat_name; ?></h2>

    and change it to:

    <?php
    // Get the ID of a given category
    $category_id = get_cat_ID( $cat_name );
    
    // Get the URL of this category
    $category_link = get_category_link( $category_id );
    ?>
    
    <a href="<?php echo esc_url( $category_link ); ?>" title="<?php echo $cat_name; ?>"><h2 class="block-title"><span class="bordertitle-red"></span><?php echo $cat_name; ?></h2></a>

    And of course you have to do the same for Featured Block Two, Three etc. if you want those category titles also to be clickable.

    Thank you, it worked 🙂

    Thank you but the link is not added successfully here in my site

    I just started the site for my friend, pretty much empty, I set the first block area to point to a category “HomePage” that already has 4 posts with pictures.

    As you can see, the title is correctly displayed as “HomePage” which is the category’s name, but no href tag added to it if you inspect the source.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Make category Title clickable’ is closed to new replies.