Small bit of customizing help hopefully
-
Hey all readers,
I’m looking to add a variable to my Yoast-generated TITLE tags, an inclusion from another WP Add-On called Post Formats where I choose “Review, Interview, Editorial” etc in check boxes on the post page, and then on my home page it shows as “A Review” “An Interview” “An Editorial”.
I’d like to include that in my Title so that it would read “%%title%% – %%post_format%% by %%name%%” or as it reads out, “Game of Thrones – An Interview by Colin Poole”
The code that pulls that post format into my pages is:
<?php $posttags = get_the_terms(get_the_ID(), ‘post-format’); if ($posttags) { foreach($posttags as $tag) {echo $tag->name . ‘ ‘; }} ?>I’ve looked around for the %%xxxxx%% variables in the Yoast config files and it seems that I need to edit/add in support via the wpseo-functions.php file where lines like this appear:
‘%%category%%’ => wpseo_get_terms( $r->ID, ‘category’ ),however as I don’t know PHP well at all, any time I try to take portions of the $posttags line and insert it as a new %%variable%% I am getting everything from no change at all, to full blown 500 server errors, so it’s clear I don’t know what I’m doing. Could anyone offer advice?
- The topic ‘Small bit of customizing help hopefully’ is closed to new replies.