Include category name in page template
You can use get_queried_object to return the name of the current category page you are on $cc = get_queried_object(); echo $cc->cat_name; //display the name of current category page
You can use get_queried_object to return the name of the current category page you are on $cc = get_queried_object(); echo $cc->cat_name; //display the name of current category page
get_the_title takes an int, not an array of ints, and therefore returns a string, not an array of strings. So just break that bit out into a loop: $titles=””; foreach ($act_name as $act_name_item) { $titles .= ($titles ? ‘,’ : ”) . get_the_title ($act_name_item); }
You should use WordPress conditionals to determine which page you’re on, build the title based on that, then print the title. <?php $sep = ‘ | ‘; $name = get_bloginfo( ‘name’ ); if( is_home() || is_front_page() ) $title = $name . $sep . get_bloginfo( ‘description’ ); if( is_single() || is_page() ) $title = wp_title( $sep, … Read more
I’d leave the public-facing titles (the_title()) alone so you don’t have to mess with filtering things if you change plugins or themes. Adding postmeta is not a big deal, and it’s not hard to maintain/sustain. It also will not get removed/overwritten with updates. The biggest benefit here is that if you forget to add a … Read more
There are a lot of things that can be improved in the code, like the use of global variables, but Im guessing you are learning so I’ll answer your question first. You can try this technique to alter the title only in the page, keeping the menu intact. Try this tutorial Basically Go to Appearance … Read more
Display title of custom post type dynamically
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
Their is no real issue to fix this. After some researchs and test, I figured out that the way the person copy-pasted or wrote the titles was wrong with the ‘ Ciel d<del>’</del>Afrique et pattes de gazelle Versus the good way Ciel d<del>'</del>Afrique et pattes de gazelle Closing this tread.
First, in WordPress lingo ‘content’ does not include ‘title’. (Also, be careful with ‘title’. Sometimes it means ‘the heading above the main content, and below the site navigation and/or masthead’, and sometimes it means the html title, which is a piece of text the browser shows at the top of the window or tab, in … Read more
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