Tagged Questions
0
votes
1answer
305 views
if custom posts type exists and there are posts load script
I have registered a custom post type 'featured_post'. I am looking for a way to test if the blog home page has any 'featured_post' posts on it and if it has load a javascript file.
The ...
0
votes
1answer
112 views
wp_enqueue_scripts called twice?
I had some problem with WP recognizing a is_single condition for loading scripts called in function.php.
I put a error_log(is_single()) to check what was going on.
When opening a post page the log ...
1
vote
1answer
206 views
Check if page/post has any anchors that link to an image jpg/gif/png
What I'm aiming to do is add fancybox to a site I'm developing, but I only want to enqueue the JS/CSS etc if the page/post needs it.
My thoughts are that I would need to check all the anchor tags on ...
2
votes
1answer
517 views
Problem using is_single() to enqueue script from functions.php
I'm having trouble only adding scripts to single post pages. I need to both include and exclude certain scripts using is_single() but it doesn't work either way I try it.
I have the template tag on ...
1
vote
2answers
62 views
Same Conditionals Not Working on Two Different Hooks
Everyone!
I am new to WP and trying to build a plugin. I have the following codes working properly:
add_filter('the_content', 'say_hello');
function say_hello($content){
if(is_single() || ...