Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #89773
    a2h2
    Participant

    Hi,

    I love the theme but when I create a new category menu item, the title of that particular page is Category: ‘name of category’.

    I would like to remove the Category: part but do not know what I need to do to get that particular tag removed from my page.

    Any help is welcome.

    #89798
    Mahesh
    Keymaster

    @a2h2: You’ll need to create a child theme for this. You can find more on creating child theme HERE. Then in your child theme’s functions.php add the following codes.

    add_filter( 'get_the_archive_title', function ($title) {
    
        if ( is_category() ) {
    
                $title = single_cat_title( '', false );
    
            } elseif ( is_tag() ) {
    
                $title = single_tag_title( '', false );
    
            } elseif ( is_author() ) {
    
                $title = '<span class="vcard">' . get_the_author() . '</span>' ;
    
            }
    
        return $title;
    
    });

    Regards,
    Mahesh

    #90637

    What if you want to change the text in the box? I don’t mind the text box, but I would like to edit what it says… not “Category: ‘name of category’”.

    Thanks!

    #90638

    What if you want to change the text in the box? I don’t mind the text box, but I would like to edit what it says… not “Category: ‘name of category’”.

    Thanks!

    #90663
    Mahesh
    Keymaster

    @pennythepennstatgnome: Can you please clarify more with a screenshot and your site url.

    Regards,
    Mahesh

    #90696

    http://www.pennythepennstategnome.com/

    When you click one of my categories such as North America or Europe, there is a box that states “Category Archives: North America” or “Category Archives: Europe” :
    http://www.pennythepennstategnome.com/category/north-america/

    I would like to edit that text. Can I do that?
    I want to be able to have all my posts listed in this box, so if there is one a reader wants to view, they can click and get to it, instead of scrolling thru all the posts.

    (i dont know how to send a screen shot thru this)

    #90892
    Mahesh
    Keymaster

    @pennythepennstategnome: You are using Adventurous Theme. In adventurous theme, the above code won’t work, it is for Studio Theme.
    For Adventurous theme, create child theme and then copy archive.php from Adventurous theme to you child theme folder. Then edit archive.php file, go to line 23 and change the text Category Archives to your desired text and save it.
    For listing all posts in the box without pagination, add the following codes in archive.php just above <?php if ( have_posts() ) : ?> line.

    <?php
        global $wp_query;
        query_posts(
            array_merge(
                $wp_query->query,
                array('posts_per_page' => -1)
            )
        );
    ?>

    Regards,
    Mahesh

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Title Tag in Category’ is closed to new replies.