Custom Post Issue
-
Hi,
I cannot get my custom posts to show for some reason, Can some one please help!
Here is my functions.php code:
//Custom Post Types add_action('init', 'product_register'); function product_register() { $args = array( 'label' => __('For Sale'), 'singular_label' => __('forsale'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => true, 'menu_icon' => 'http://example.com/images/for-sale-icon.png', 'supports' => array('title', 'editor') ); register_post_type( 'forsale' , $args ); }Here is my custom template file:
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <h2><?php the_title(); ?></h2> <div id="fb"><a href="http://www.facebook.com/pages/pontlottyn-mid-glamorgan/South-Wales-Customs/139115299461925"><img alt="South Wales Customs Facebook Page" src="<?php bloginfo('template_directory'); ?>/images/fb.png" /></a></div> <h3><?php the_title(); ?></h3> <?php the_content(); ?> <?php $loop = new WP_Query( array( 'post_type' => 'forsale', 'posts_per_page' => 100 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php endwhile; ?> <div class="clear"></div> <p><a href="contactus.html"><img alt="South Wales Motorcycle Mot Centre" src="<?php bloginfo('template_directory'); ?>/images/mot-banner.png" /></a></p> </div><!--content--> <?php endwhile; ?>Please can someone help!!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Custom Post Issue’ is closed to new replies.