Site logo

Archived topic

Page title, where to edit?

6 replies · Started by Anonymous on February 12, 2016

Viewing posts 1–7 of 7

Where do i edit the page title?
Can't find it anywhere.
Or maybe i just overlooked it :/
Regards
Erik

I think you're asking about the text you type into the field at the top of the page when you edit it or create a new one?

If that's the case, it's the text field right below the "Add New Page" heading when you're adding a new page :)

Hi, thanks for the replies :)
I meant the post title which could get longer than i want.
Looking for code that looks something like this:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
And look for the post title but can't find it anywhere :/

Hi Erik,

You won't find your post title anywhere in the code - it's all handled from inside your WP Dashboard.

In that case, you may want to try this function:

add_filter( 'the_title', 'short_title' );
function short_title( $title ) { 
    $chars = 20; 
    if ( strlen( $title ) > $chars ) { 
        $title = substr( $title, 0, $chars ); 
        $title .= " &hellip;"; 
    } 
    return $title;
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

This archived topic is closed to new replies.