Post title not displaying as recorded in the wp_posts table
Post title not displaying as recorded in the wp_posts table
Post title not displaying as recorded in the wp_posts table
You may use string comparison. I could illustrate a simple example code. It is assumed that the user with the following knowledge/experience PHP – understand what is variables, static value WordPress templates and how to modify them There are many ways to test string such as php string comparison strpos() (simple) php regular expression preg_match() … Read more
It’s important to read the documentation for filters. The documentation for pre_get_document_title says (emphasis mine): Filters the document title before it is generated. and $title (string) The document title. Default empty string. So when using pre_get_document_title, the title has not been set yet, so when you do this: return $title . ‘ new title’; $title … Read more
Seems like the solution I was looking for was !in_the_loop() Full: add_filter( ‘the_title’, ‘custom_account_endpoint_titles’, 10, 2 ); function custom_account_endpoint_titles( $title ) { if (is_shop() && !in_the_loop() && ! is_admin() && ( ! defined( ‘DOING_AJAX’ ) || ! DOING_AJAX )) { return ‘Shop – Parure.co’; } } Note: the !is_admin and !DOING_AJAX functions are to prevent … Read more
You need to trim this things for title tag or for heading of any template or in any php file? because – RC Cars Xmas Gifts is looks like site title. please share your code which you are trying.
Display Most Recent Post Widget Title On Page
Filter the title to only affect the_title() template function
How to ignore WP_ERROR caused by “get_the_excerpt” method in an AJAX call?
You can use the_title filter to modify the post_title prior to printing on the screen. add_filter(“the_title”, function($title, $id)){ $user = wp_get_current_user(); if((!is_user_logged_in() || in_array(“pending”, $user->roles)) && “post” === get_post_type($id)){ $title = “Custom title”; } return $title; }, 10, 2); source: https://developer.wordpress.org/reference/hooks/the_title/
Are you sure you are not using a custom taxonomy in your custom post type? Taxonomies for Custom Post Types have to use get_terms instead of get_category. More information on get_terms from the WordPress Codex: http://codex.wordpress.org/Function_Reference/get_terms