- This topic has 9 replies, 2 voices, and was last updated 3 years, 7 months ago by
Fernando.
-
AuthorPosts
-
October 2, 2022 at 6:56 pm #2360959
priyankeshu
is there a way to show unique ID in the TITLE suffix so it is easy to identify the posts?
let me know!
thanks!October 2, 2022 at 8:05 pm #2360994Fernando Customer Support
Hello Priyankeshu,
For reference, can you provide a link to a post in your site?
October 3, 2022 at 7:05 pm #2362126priyankeshu
something similar to this
https://generatepress.com/forums/topic/how-to-suffix-or-prefix-the-post-title-in-elements/#post-730638i don’t know if ELEMENTS is the way to show it?
basically i want post titles to go like
UID – Post title – CUSTOMPOSTTAG/category
example-
765 – How to think about dreams – R1 –October 3, 2022 at 7:55 pm #2362141Fernando Customer Support
I see. Try adding this PHP:
add_filter( 'generate_get_the_title_parameters', function($params){ $params['before'] = '<h1>' . get_the_ID() . '</h1> - ' . $params['before']; return $params; },10);Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
October 5, 2022 at 2:55 am #2363821priyankeshu
hello thanks
i tried and it seems to work, but now the title is going in new linesomething like
2856
TITLE GOES HEREi 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!
October 5, 2022 at 5:00 pm #2364613Fernando Customer Support
Can you share the link to the site in question? We might need to add some custom CSS to address this.
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
October 5, 2022 at 5:17 pm #2364617priyankeshu
hi, i had shared it above,
October 5, 2022 at 9:25 pm #2364752Fernando Customer Support
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; }October 5, 2022 at 9:34 pm #2364757priyankeshu
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.October 5, 2022 at 9:41 pm #2364764Fernando Customer Support
You’re welcome!
Do you mean all categories/tags of a specific post, or just a specific category in general?
-
AuthorPosts
- You must be logged in to reply to this topic.