• Resolved Marco

    (@marco020)


    Hi suppport,

    I am trying to find how to display the page title on my Blog listing page (between the site header and the blog grid cards). I am using theme Twenty Twenty and I have created a child theme. I know a (little) bit of modifying templates on the back-end (ftp).

    I hope you can help me.

    Best regards,
    Marco

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Twentig

    (@twentig)

    Hi Marco,

    To display a title on your Blog listing page, copy the index.php file from the Twenty Twenty theme and paste it inside your child theme (if you don’t already have done it).

    Line 55, add the following code and change “Your title” as you want:

    elseif ( is_home() ) {
        $archive_title = "Your title";
    }

    After inserting the code you should have these lines (line 52 to 59):

    } elseif ( ! is_home() ) {
    	$archive_title    = get_the_archive_title();
    	$archive_subtitle = get_the_archive_description();
    } elseif ( is_home() ) {
    	$archive_title = "Your title";
    }
    
    if ( $archive_title || $archive_subtitle ) {

    You might need to add CSS to fit the title with your site’s design.

    Hope that helps,
    Tom

    Thread Starter Marco

    (@marco020)

    Hi Tom,

    Your code worked like a charm! Thanks for your help and time!

    Best regards,
    Marco

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add page-title to blog listing page’ is closed to new replies.