I want my script to load only in one certain post page in my blog.
Example page: www.name.com/this-is-cool-post/
How can i call my script if for example my script is in another .php file?
<?php if(is_page('this-is-cool-post')){ ?>
<?php include("myscript.php"); ?>
<?php } ?>
this is not working for me and i don’t know where to problem is :S
This may not be the most programmatic way of doing it, but how about creating a custom blog post template, call it blog-specific.php or whatever you want, add the following to the top of it:
Then add your script (
<?php include("myscript.php"); ?>
) only to this template:You should then be able to change the template of a particular post in the Single Post Template dropdown option when editing a post:
I think the problem is the location of your script.
If you work on a theme, try to include your script like this
I hope that help u.