Site logo

Page title, where to edit?

Home Forums Support Page title, where to edit?

Home Forums Support Page title, where to edit?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #172343
    Erik

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

    #172368
    Tony

    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?

    #172391
    Tom
    Lead Developer
    Lead Developer

    If that’s the case, it’s the text field right below the “Add New Page” heading when you’re adding a new page 🙂

    #173626
    Erik

    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 :/

    #173646
    Tom
    Lead Developer
    Lead Developer

    Hi Erik,

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

    #174155
    Erik

    Yes, but going through every post to edit it manually will take ages 🙂
    If i look at the twentyfifteen theme, the part i’m looking for is right there:
    while ( have_posts() ) : the_post();

    This is what i’m planning to do:”
    http://www.doc4design.com/articles/wordpress-5ways-shorten-titles/

    #174203
    Tom
    Lead Developer
    Lead Developer

    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/

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.