WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Custom post type won't show on the home page, but it should.... (2 posts)

  1. paologanino
    Member
    Posted 1 year ago #

    Hi,
    I have created a new custom post type (foto) with type but it is not showing on the home page, while other custom posts do.

    That is my code, the other custom posts were created with post types plugin and they show up

    <?php
    
    $args= array('orderby' => 'id', 'order' => 'DESC', 'posts_per_page'=>12, 'category_name'=>'gli-approfondimenti-della-settimana', 'post_type' => array('post','interviste','opinioni','fotostorie','foto','post__not_in' => $top_id));
    $the_query = new WP_Query( $args );

    Any idea?

    Thanks

    http://wordpress.org/extend/plugins/types/

  2. mbigul
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Paologanino,

    Please confirm it is working with following code.

    $args = array( 'post_type' => 'foto', 'posts_per_page' => 10 );
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
    	the_title();
    	echo '<div class="entry-content">';
    	the_content();
    	echo '</div>';
    endwhile;

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    [ Signature moderated. ]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.