How to show users search phrase in SEO Title

Pulling my comment as an answer: Assuming you want your page to interact with the google search, I don’t think that’s possible, at least without “black hat” measures and potentially getting blacklisted by Google. The “current” best practice is to either have a “meat delivery” page that lists your locations or have n amount of … Read more

Is it possible to create 2 unique titles for an Events custom post type: Upcoming Events and Past Events?

Try this: in archive-header.php line 8 – 10 by interecepting the variable “period=past” or ( I guess) “period = future” of current URL <?php else : if( !empty($_GET[‘period’] ) && $_GET[‘period’] == ‘past’) { echo “Past Events”; } elseif( !empty($_GET[‘period’] ) && $_GET[‘period’] == ‘future’ /*or whatever*/){ echo “Upcoming Events”; } else{ echo esc_html(lsvr_pressville_get_event_archive_title());//the default … Read more

Display text if title in archive has specific word

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

Modify WordPress Page Title ()

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

Changing Title Tag on Shop Archive Page (current solution reverting to Title of First Product in Loop)

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