Jump to content
Sign in to follow this  
cj94111

Custom post type posts do not display on home page

Recommended Posts

cj94111

Hello,

 

I have installed the custom post type UI. The plugin is very easy to use and I have no problem creating a new custom post. However, they do not display on my home page with the other posts. What file do I have edit to make this work?

 

Thank you,

 

Roger

Share this post


Link to post
Share on other sites
greenfly

cj94111 

 

Do you have a link to your site and some examples of what you have tried? 


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
cj94111

Thank you for the response. My site is expertsqa.allbusiness.com

 

I've now solved half of this problem. My custom post now display on the home page, but not on their respective category pages. I have used this code on the funcitons.php file. How do I get them to display on the category pages?

 

add_filter( 'pre_get_posts', 'my_get_posts' );
 
function my_get_posts( $query ) {
 
if ( ( is_home() || is_tag() ) && empty( $query->query_vars['suppress_filters'] ) )
$query->set( 'post_type', array( 'post', 'slideshows' ) );
 
return $query;
}

Share this post


Link to post
Share on other sites
James B

Hi Roger

 

Unfortunately PHP customizations are outside of our support specturm, so we're unable to assist you on the above as part of the moderator team.

 

I would assume changing is_home for is_category in the code? Try it, worth a go :-)


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×