Echo short code syntax

the error is saying to change ; to . – you will also want to remove the extra .: <?php echo do_shortcode(“[svg-flag flag=\”” . get_post_meta($post->ID, ‘ozellikler_text’, true) . “\”]”); ?>

AJAX and custom pages

I think there’s a misunderstanding here about how browser page requests work, and how PHP loads and runs WordPress When you make a request to WordPress, PHP loads WordPress and processes the page, then it’s all cleaned up and thrown away. Unlike other platforms such as Java or Python, there is no continuously running program … Read more

Call a single function on two different methods with hooks

I’m not sure what you’re hoping for, but all you can really do is just move the code from one function into the other. global $post is also not doing anything, so removing that will save you a couple of lines: /** * Register template */ public static function register_styles_templates() { add_filter(‘single_template’, function($single_template) { if … Read more

Link to index.php from home.php?

You can’t link between templates. Not directly. The template files are just the files that WordPress will use to render the posts it’s found, based on the URL. You can see how WordPress decides which template to load under which circumstances in the Template Hierarchy. So to solve this issue we need to determine when … Read more