WordPress query posts by custom post type not workng

It’s a bad use of Query you may look at this post In this case use a secondary query with your own instance of WP Query. query_posts() is not recommanded here cause it overrides the main query. <?php $args = array( ‘post_type’ => ‘instrument’, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => 1, ); $my_query = new WP_Query( … Read more

Custom post not showing

Please update your .htaccess file. Once you will able to update it, your issue will be solved. Currently your .htaccess file doesnot have “portfolio” slug , so you need to update it. Hope this helps Thanks

All custom posts are not showing up

What you need to do is , first create a the CPT. Once the CPT with scholarship is created then create your custom taxonomy i.e scholarship which will be hierarchal. So when you will add your custom taxonomy as scholarship, then in the 2nd argument please provide the slug of your CPT ie. “scholarship”. register_taxonomy( … Read more

How do I get the posts from single page custom post type from a sidebar to display in a page?

It sounds as though you just need to create your post type templates. The archive of storylist posts will look for a template named archive-storylist.php to display posts. A single post of type storylist will attempt to use single-storylist.php to display that post. In either situation, if those files do not exist, WordPress follows the … Read more

How to return custom posts in loop?

The following code Worked with the code above: <?php $loop = new WP_Query( array( ‘post_type’ => ‘yourposttypehere’, ‘posts_per_page’ => -1 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> The stuff you want to loop goes in here <?php endwhile; wp_reset_query(); ?> Source: link