Site logo

Archived topic

A way to show unique id in front of the title of every post ?

9 replies · Started by priyankeshu on October 2, 2022

Viewing posts 1–10 of 10

is there a way to show unique ID in the TITLE suffix so it is easy to identify the posts?
let me know!
thanks!

Hello Priyankeshu,

For reference, can you provide a link to a post in your site?

hello thanks
i tried and it seems to work, but now the title is going in new line

something like

2856
TITLE GOES HERE

i want something like this

2856 - TITLE GOES HERE - DATE - TAG

also can you suggest how can i customize the code snippet to add TAGs/Categories or CUSTOMCategories in it?

thank you , really appreciate this!

Change the snippet to this:

add_filter( 'generate_get_the_title_parameters', function($params){
	
	$params['before'] = '<h2>' . get_the_ID() . '</h2> - ' . $params['before'];
	return $params;
},10);

Then, add this in Appearance > Customize > Additional CSS:

header.entry-header h2 {
    display: inline;
}

thanks! man! really appreciate this! i love generatepress support!

last question,
can you suggest me through any tutorial where i can learn more about about this? i mean for example, if i want to learn how to add specific categories tags etc. in similar method.

You're welcome!

Do you mean all categories/tags of a specific post, or just a specific category in general?

This archived topic is closed to new replies.