Tag Info

Hot answers tagged

2

Plugins load before themes. The earliest hooks available to plugins is plugins_loaded (or muplugins_loaded for mu-plugins), while themes run on after_setup_theme and later hooks. So you better just load the file [that contains the class] on a specific hook in your plugin. It probably is best to load it on a lower priority than the default 10. Below I use 5 ...


2

include the conditional tag is_paged() within your if statement; example: if ( $i == 1 && !is_paged() ) :


1

I think that your problem is ajaxurl is not available for your script. Try to defined that varibale before your js code is loaded. The best way is using wp_localize_script: The PHP: add_action( 'wp_enqueue_scripts', 'cyb_enqueue_scripts' ); function cyb_enqueue_scripts() { //Change the key and url with yours wp_register_script('my-js', ...


1

I found the solution from a Wordpress forum and this is what they used. Works perfect <?php if (has_post_thumbnail( $post->ID ) ): ?> <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), '' ); $image = $image[0]; ?> <?php else : $image = get_bloginfo('stylesheet_directory') . ...



Only top voted, non community-wiki answers of a minimum length are eligible