Archived topic
Page title, where to edit?
6 replies · Started by Anonymous on February 12, 2016
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.
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/
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 .= " …";
}
return $title;
}
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
