Custom post types

Posted in: Newspaper
Post count: 317

Hi

I added a custom post type to my site and added a custom template for it. I named the custom template “single-products.php” but it is connecting with the theme’s “single.php” and its not showing the code from single-products.php. the code for single-products.php is:

<?php 
/* 
Template Name: Products
Author: Mehedi
*/

get_header(); ?>

	<div id="content" class="narrowcolumn">

	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

			<div class="post" id="post-<?php the_ID(); ?>">
                <div class="post-top">
                    <div class="post-title">
                        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php if ( function_exists('the_title_attribute')) the_title_attribute(); else the_title(); ?>"><?php the_title(); ?></a></h2>
						<h4><?php comments_number('0', '1', '%'); ?></h4>
                    </div>
					<h3>
						Added to the database on <?php the_time('d-m-Y') ?>
					</h3>
					
					<?php the_post_thumbnail('medium',array('style'=>'float:left;'));?>
					
					<div style="float:left;padding:150px 20px 20px 20px;font-size:large;"><?php the_meta();?></div>
					
                </div>

				<div class="entry" style="clear:both;">
					<?php the_content('Read the rest of this entry &raquo;'); ?>
				</div>
			</div>

	<?php comments_template(); ?>

	<?php endwhile; else: ?>

		<p>Sorry, no posts matched your criteria.</p>

<?php endif; ?>

	</div>

<?php get_footer(); ?>

Any idea?

Post count: 6600

Hi,

Please try to search the web for a solution.
This may help:
http://codex.wordpress.org/Post_Type_Templates

Thanks

Post count: 317

Hi,

I fixed it already.

Thanks anyway!

Please check this: https://forum.tagdiv.com/topic/bug-4-2-responsive-ad-divs-doesnt-work-on-tablet-tp-and-mobile/ and https://forum.tagdiv.com/topic/how-to-use-shortcodes-on-theme-files-to-display-blocks/

They’re very urgent, would be great if you kindly help me 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.