get custom post type thumbnail

Please update the while loop with this: It will print the thumbnail url for you ** POST FETCHING ARGUMENTS ** <?php /**** Slider Call Function ****/ function callTheSlider() { $args = array(‘post_type’=> ‘expro_slider’, ‘post_status’ => ‘publish’, ‘order’ => ‘DESC’); ?> <ul> <?php wp_reset_query(); $query = new WP_Query($args); while($query->have_posts()) : $query->the_post(); if(has_post_thumbnail()) { ?> <li> <?php … Read more

How to remove slugs from multiple custom post types

Looks like you have your if doing the opposite of what you want. You’re returning the unaltered link if you’re on ‘furniture-type’ or ‘pop-tags’. This should work: function hf_remove_slug( $post_link, $post, $leavename ) { if((‘pop-tags’ == $post->post_type || ‘furniture-type’ == $post->post_type) && ‘publish’ == $post->post_status) { $post_link = str_replace( “https://wordpress.stackexchange.com/” . $post->post_type . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/”, … Read more

Show custom post type randomly in any page

You can write a custom query to get some random posts for your template. The simplest possible solution will be this query: <?php // Set the post type here, and sort them randomly $args = array( ‘post_type’ => ‘YOUR-POST-TYPE’, ‘posts_per_page’=> 5, ‘order_by’ => ‘rand’, ); // Initiate a custom query $my_query = new WP_Query($args); // … Read more