wp_enqueue_scripts not called on search page?

I’ve written a custom theme. It’s pretty complex so I won’t post a huge code block here for everyone’s sanity. In my functions.php file I have the following hook being called: function DA_script_enqueue() { if( is_404() ){ //load scripts with wp_enqueue_script() } if( is_search() ){ //load scripts with wp_enqueue_script() } } add_action( ‘wp_enqueue_scripts’, ‘DA_script_enqueue’); What … Read more

Adding callback function for wp_ajax_ has no effect

I was trying to add one more callback function to the WordPress AJAX action woocommerce_apply_coupon. This action is defined in the WooCommerce plugin, I want to add my own callback function to this action from my plugin file. What I have tried: add_action( ‘wp_ajax_nopriv_woocommerce_apply_coupon’,’darn’,999); add_action( ‘wp_ajax_woocommerce_apply_coupon’, ‘darn’,999); function darn(){ print_r($_REQUEST); exit; } Doing this in … Read more

Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields

I am inserting posts into a database using wp_insert_post function once the post is inserted using below line of PHP $postId = wp_insert_post($array) I can insert values in my advanced custom fields using add_post_meta function but I didn’t find anything to insert the SEO title or the meta description specifically in the Yoast SEO plugin. … Read more

Add body class based on existance of post thumbnail. Code works but receiving PHP Notice

What I’m trying to do is add a body class based on whether there is a post thumbnail. The following works, but I get a PHP Notice. How can I fix the PHP Notice below? function add_featured_image_body_class( $classes ) { if( has_post_thumbnail() ) { $classes[] = ‘has-featured-image’; } return $classes; } add_filter( ‘body_class’, ‘add_featured_image_body_class’ ); … Read more

How to use WP-FirePHP extension?

http://wordpress.org/extend/plugins/wp-firephp/ I’m simply supposed to call fb(‘Error message’,’Lable’) but it doesn’t work all the time. I can’t figure out when and where the relevant files are being included and classes defined in order to make the call to the said method/function. For example it doesn’t work even when I call fb() from wp-content\plugins\wp-firephp\FirePHPCore\fb.php itself and … Read more