Skip to main content

Questions tagged [title]

Title is the main label on a piece of information. In WP the term is mainly used to label a whole html page, a post, a widget or an attachment.

Filter by
Sorted by
Tagged with
0 votes
1 answer
38 views

I want the Title of page/post to show up topmost when reading the post/page

I want the Title of page/post (in content area) to show up topmost when reading the post/page. If you use #anchor link you can only link to the topmost textblock, but then the Title of the post ...
ThomasMox's user avatar
0 votes
1 answer
38 views

How to edit specific title instead of all the title calls

I would like to add an html element right before the title of the blog posts. The code I'm using is as follows: function add_html_above_title($title, $post_id) { if (is_single() && $...
s.sufi's user avatar
  • 3
1 vote
1 answer
38 views

Is it possible to create dynamic templates for block themes directly from the site editor?

For example, you can create a posts template within the site editor, but how do you make it so that the content for each respective single post displays dynamically? Here's my single post template ...
WPdummy's user avatar
  • 23
0 votes
1 answer
28 views

Different titles on homepage vs single based on category

For better understanding what I need, I'll give as example the image below. As you can see, on CAT LOVERS category, I have the full title as "Basic Health & Care Tips to Keep Your Cat ...
Vali Dragomir's user avatar
0 votes
1 answer
58 views

twentytwenty children theme, using gutenberg, changing a title change them all

I started to look forward modifying thèmes and i made a children theme from twentytwenty. On the landing page, using gutenberg, i edited page name at top, then added some paragraph, gallery and when ...
akalabete's user avatar
0 votes
1 answer
32 views

Hide page title on dedicated posts page

My entrypage on my website is a static page. The post page is another one called "Beiträge". How can I remove the page title "Beiträge" on the posts page?
Dirk's user avatar
  • 21
0 votes
1 answer
179 views

If/else statement for specific WordPress page title

I'm very new to the world of php coding and have been learning basic php including 'if'/ 'else' rules but I've hit a brick wall and no amount of Googling has helped. I am currently working on a ...
Yasmin's user avatar
  • 1
0 votes
0 answers
61 views

Change HTML Document Title On Localhost but not Server

I am trying to change the title of a page based on the URL query params. It works on localhost but not server. I used the following hooks and all not working on server wp_title ‎document_title_parts‎ ...
Amir Latif's user avatar
0 votes
2 answers
371 views

Wrong site title and description in google search

as i said in the topic, i can't change the title and the description of the google search of my website (new website btw). I tried to change the title by Theme description, by wordpress settings and ...
Giorgio's user avatar
0 votes
1 answer
448 views

Wrap post titles containing slashes on narrow viewports

I have a post title consisting of two words with a slash between. It seems that the web considers this to be one word rather than two, and it doesn’t wrap when viewed on a phone. I would like for this ...
Brett Donald's user avatar
0 votes
1 answer
195 views

How to fix special characters when the title or excerpt is shortened [closed]

I have this code for the title <?php $thetitle = $post->post_title; $getlength = strlen($thetitle); $thelength = 26; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo &...
unopermanente's user avatar
0 votes
1 answer
119 views

How to change Post title background size?

I'm using a theme called "Blockst" from DeoThemes. On each Post title, I have an incredibly large title background. Unfortunately, I have no idea why or how it became so large. Unfortunately,...
Eric F's user avatar
  • 3
0 votes
1 answer
67 views

Custom Post-Rename Function Does Not Function in WordPress 6.x

I have the following function in functions.php in a child theme: <?php add_filter( 'wp_insert_post_data' , 'modify_post_title' , '99', 1 ); // Grabs the inserted post data so you can modify it. ...
Zyniker's user avatar
  • 105
0 votes
1 answer
56 views

Custom post type split title, setup permalink accordingly

I am currently working on a project, where I need to do this - Create a custom post type called authors Create first name and last name field for authors Single author permalink structure must be ...
Arafat Jamil's user avatar
0 votes
1 answer
153 views

Add string to page title if post in specific category

Can someone please help me add a string to WP page title depending on category of a post ? I did this with post title (code below) however I want to extend it to page title. function recipe_titles ($...
TBV Translation's user avatar
0 votes
0 answers
52 views

Cannot retrieve categories for post in The Loop

add_filter('the_title', 'filter_title_add_post_category'); function filter_title_add_post_category($title) { global $post; $debug = ''; if ( is_single() &&...
Antony Gibbs's user avatar
0 votes
1 answer
15 views

Address as a content type post

I want to create CPT that have a location address as the title. So the person comes on a page, enter an address, it load suggestions and when he click save it autogenerate the title of the post as the ...
Camille B.'s user avatar
0 votes
1 answer
40 views

How to put post title or keyphrase in content on different places automatically?

I want to repeat my title/keyword in different places in my content. for example, my title is "Dog" I want to replace "Dog" everywhere I have inserted *** or any hint. how this is ...
Muhammad Imran's user avatar
0 votes
1 answer
636 views

Auto Generate Post Title from 2 Custom Fields

I would like to generate the post title from 2 custom fields, 'job', which is a taxonomy, plus 'date' which is a date picker, not the date of the post. This is for a custom post type called 'job-...
Michael's user avatar
0 votes
1 answer
51 views

Delete a repeated part of post title in WordPress

All of my posts have the words (With Table) at the end of post title. I want to delete this part in every post title but can't do it manually because there are 10,000+ posts I tried Better Search ...
Sandeep's user avatar
  • 177
0 votes
1 answer
861 views

Getting the Image Title (not the post title)

I've tried over a dozen variations of getting the title now, with mixed results. I get an error, blank output, or the post title, but not the image title. For reference, here's the complete image code ...
WPdummy's user avatar
  • 23
0 votes
0 answers
20 views

Set document title through shortcode plugin

I have a plugin a web hosting company made for us, and I need the "current challenge" page to show the challenges name as the document page title. Currently it just displays the page name &...
WASasquatch's user avatar
0 votes
0 answers
48 views

struggling to order by title

i have the following page https://gundog.world/my-favorites/ (to view,user=stack pass=exchange) the page functions correctly but i am trying to put the generated list into ascending order by post ...
martin's user avatar
  • 1
0 votes
1 answer
108 views

Can't split the_title() by white space

I am having issues splitting the_title() by white space in my template. $title_split = explode(" ", trim(the_title())); and (from here: https://stackoverflow.com/questions/23206953/split-...
WASasquatch's user avatar
1 vote
1 answer
28 views

An extra ' is displayed in the title

I've found a string that's showing the posts title - blogname as title in the browser, but it's adding an extra ' This is the code I'm using: <title><?php wp_title(‘ | ‘, ‘echo’, ‘right’); ?&...
Adam Larsson's user avatar
0 votes
0 answers
60 views

Change post title but not in widgets/menu/etc

I have searched and searched, and can't find what I'm doing wrong. I am using a shortcode and custom field to edit the title of a post by adding an audio player right behind the title. At first I was ...
Olandir's user avatar
  • 101
0 votes
2 answers
476 views

Adding Text after Post Title based on Category using IF Condition - But not for menu items

Some posts have a more "readable value" even though they are free to read. To highlight their increased reader value, I've managed to get together this piece of code. "Problem" is, ...
Marcus Wood's user avatar
0 votes
1 answer
169 views

Shortcode to appear and show the date not code in Title and description of Social Media sites

I have used some shortcodes for my few posts. You can see here on of the post I have included the shortcode. But when I am sharing this code to any social media it is not able to show the date. Right ...
wasim akram's user avatar
1 vote
1 answer
597 views

Using several custom fields as custom post title

I have stumbled upon a brilliant piece of code that just fits my needs on this thread : Using custom field as custom post title by @chrisguitarguy and I was hoping there might be a way to tweak it to ...
TonioLip's user avatar
0 votes
1 answer
204 views

how to change the title of tag page?

what is the correct function or hook to change the title of tag page ? I want to insert something at the beginning the tag title page.
Mohammad Mahdi Aghakhani's user avatar
0 votes
0 answers
551 views

how to replace h1 entry title with h2 in category pages only

This is the function im using: function change_title_h1_h2( $title, $id = null ) { return '<h2>'.$title.'</h2>'; } add_filter( 'the_title', 'change_title_h1_h2', 10, 2 ); Is there ...
will's user avatar
  • 9
0 votes
2 answers
992 views

Change Page Title

I have successfully changed the name of a specific page using this code in my functions.php file: add_filter('pre_get_document_title', 'change_my_property_title'); function change_my_property_title($...
Joey Lawrence's user avatar
0 votes
1 answer
297 views

how to add dynamic text before and after of post title

In twenty twenty one theme how to add dynamic text before and after of post title. I want to add “Premium” word before title and “today” word after the title. Please help me
Shashi Ranjan's user avatar
0 votes
1 answer
121 views

Use of comment_reply_link_args filter

i am trying to create a filter like this add_filter('comment_reply_link_args','change_author_title'); function change_author_title( $args ) { $defaults = array( 'add_below' => '...
Honoluluman's user avatar
1 vote
2 answers
569 views

How to change page title (from a plugin) in twentytwentyone theme

First, is it even possible to change the page title from a plugin (specifically, from a shortcode defined in a plugin)? This answer says no, but there are certainly reasonable use cases for it. Like, ...
GHolmes's user avatar
  • 63
0 votes
2 answers
64 views

Posts title instead of Pages and Category titles - PHP Wordpress

In order to have two blogs on one website, I was able to put in the menu two categories: DOCUMENTATION and ACTUALITES. My problem is in the header. The titles are displayed well however for both ...
user205282's user avatar
0 votes
1 answer
82 views

I want to add number after post tittle for each category

There is one plugin called auto numbering posts whose function is to add a number next to the post title, but the drawback of this plugin is that it doesn't sort by category. I want the posts in each ...
Guruh's user avatar
  • 3
0 votes
2 answers
392 views

Shortcode To Display Post Custom Field Value in Post Title, Post Content

I want to create a shortcode that pulls value from a custom field of a post and parses that value on Post title, post content. So if the custom field value is Icecream for Post 1. On the admin side ...
Discover's user avatar
0 votes
1 answer
40 views

Move the post title to another field

i added a new field (property_second) to the admin area of the theme. and i want this field value to be the same as the post title. so if the post title changes, let it change here. how can I do it? ...
devo-zara's user avatar
0 votes
0 answers
102 views

add_filter( 'the_title' gets through this if statement twice

I am using the accepted answer shown here: Apply the_title() filter in post & page title, but not in menu title For some reason, the code is getting through this if statement twice: if ( ! ...
l_r's user avatar
  • 21
1 vote
1 answer
299 views

Set a maxlength for the title input in a custom post type

I'm creating a new custom post type. But I need to limit the max length for the title. This is how I'm creating the field in my code: array( 'key' => 'title', 'label' => 'Title', '...
Santiago Mendoza Ramirez's user avatar
1 vote
2 answers
1k views

Disable title block on edit screen for a custom post type

I have a custom post type with a custom block to collect required data and store it in post meta data or standard fields like title or slug, so I don't want to display the Title block. I can't disable ...
Jeremy Skelton's user avatar
0 votes
1 answer
3k views

How to solve the site <title> tag being displayed twice?

My website theme header.php uses this code: <title><?php wp_title('&lsaquo;', true, 'right'); ?></title> And I'm seeing two <title> tags in the page source. How can I ...
anusha's user avatar
  • 11
0 votes
1 answer
65 views

Filter Post Title without affecting screen-reader-text

Let's consider this code: add_filter('the_title', static function ($title) { return $title. '-boom'; }); Works fine, and adds '-boom' near all the titles. But, I also noticed that in some themes (...
Dudo1985's user avatar
  • 223
0 votes
0 answers
64 views

Link to products with the same image title (woocommerce)

I have products with a generic image. The image title is for example abc.png. I would like to generate a link to all products with that image title. Any help would be appreciated. Thank you.
Renier's user avatar
  • 1
0 votes
1 answer
372 views

Add text to the first "title"=>get_the_title($post->ID), and shorten

I use this code to display the title : $imageAttr = array( "class"=>"alignnone size-medium", "alt"=>get_the_title($post->ID), ...
sa eu's user avatar
  • 3
0 votes
1 answer
25 views

Prefix the title tag, if IP address is the dev server

I want to conditionally prefix the contents of the tag if the IP address matches the dev server. I cobbled something together, and it will output the title tag correctly, but the original title tag ...
whakawaehere's user avatar
1 vote
1 answer
409 views

Changing title & add Breadcrumbs

Im wondering the possibilities of making the title of a page change depending how the user got there? For example, if they are on the homepage and make a search, would it be possible to display what ...
Chris's user avatar
  • 11
1 vote
1 answer
190 views

How to edit title on Edit post pages?

The <title> tag in pages for post edit is Edit Post < Site name — WordPress. I want to change it to Edit Post < Site name – The title of the post in editing. Is this possible? Where can I ...
Ooker's user avatar
  • 332
1 vote
1 answer
2k views

How do I shorten the title lenghs with Elementor theme? [closed]

Hi guys I've searched this for too long and I am getting tired now. I need to set a limit on my post titles but I don't know how to do it. On google there are snippets of 300000000 codes to do the ...
Lorenzo's user avatar
  • 11

1
2 3 4 5
14