how to place ELSE on if function on multipostthumbnails? [closed]

Either if ( class_exists(‘MultiPostThumbnails’) ) : MultiPostThumbnails::the_post_thumbnail(get_post_type()); else: //someimage endif; OR if ( class_exists(‘MultiPostThumbnails’) ) { MultiPostThumbnails::the_post_thumbnail(get_post_type()); } else { //someimage } In regards to your comment: if ( class_exists(‘MultiPostThumbnails’) ) : $image = MultiPostThumbnails::get_the_post_thumbnail( get_post_type(), ‘secondary-image’, NULL, ‘proimg’, array(‘class’ => ‘img-responsive imgwid’) ); if ( !empty( $image ) ) { echo $image; } else … Read more

Showing wordpress latest post thumbnails in slider with auto increment

You can achieve this by developing custom code like following. You can find more information about WP_Query here https://codex.wordpress.org/Class_Reference/WP_Query <?php $args = array( ‘posts_per_page’ => 100, ‘meta_key’ => ‘_thumbnail_id’, ‘ignore_sticky_posts’ => 1 ); // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { … Read more

How to filter wp_get_recent_posts() to only posts that have thumbnails?

You can pass arguments to pass meta_query to your wp_get_recent_posts() function. wp_get_recent_posts() makes call for get_posts(), so you can make use of all the arguments get_posts() or WP_Query uses. As per your need. $args= array( ‘meta_query’ => array(array(‘key’ => ‘_thumbnail_id’)) ); $recent_posts = wp_get_recent_posts($args); Along with other arguments you want to pass to your function. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)