Can I change a variable in a content part while calling it?

Currently, you have your variable defined below the include which would be too late. If you defined the variable above the include it should be accessible by whatever file is included. $hssHeading = “A new different Title”; include( locate_template( ‘cp/heroSectionSmall.php’, false, false ) ); <!– heroSectionSmall.php –> echo $hssHeading; Maybe a better solution though is … Read more

Showing Co-Authors on post page

Your error is that you’ve written an if inside the sprintf argument list. You can’t do that. Instead, you could use the ternary operator, which has syntax <condition> ? <result if true> : <result if false> e.g. $byline = sprintf( __(‘by %s’), function_exists(‘coauthors_posts_links’) ? (‘<span class=”author vcard”>’ . coauthors_posts_links( null, null, null, null, false ) … Read more