Get title from IDs in a string

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); }

Customise the_title in admin area

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

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