My theme is Masonic. I made a different page template and copied over the index.php code:
<?php /* Template Name: pagetemplate*/ ?>
<?php get_header(); ?>
<div class="site-content">
<div id="container" class="wrapper clear">
<?php if (have_posts()) : ?>
<?php /* Start the Loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part('content', get_post_format());
?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part('content', 'none'); ?>
<?php endif; ?>
</div><!-- #container -->
<div class="wrapper">
<?php masonic_paging_nav(); ?>
</div>
</div><!-- #site-content -->
<?php get_footer(); ?>
Then under my page template I chose the above template and using display post short cut plugin I am trying to display all my posts using the following line on my page:
[display-posts posts_per_page=”1000″ order=”DESC”]
However, the page is now displaying no posts but the format seems to be correct. Here is a link to the page:
https://www.smellthespice.com/main-dishes/
Any help is much appreciated.
]]>My theme is Masonic. I made a different page template and copied over the index.php code:
<?php /* Template Name: pagetemplate*/ ?>
<?php get_header(); ?>
<div class="site-content">
<div id="container" class="wrapper clear">
<?php if (have_posts()) : ?>
<?php /* Start the Loop */ ?>
<?php while (have_posts()) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part('content', get_post_format());
?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part('content', 'none'); ?>
<?php endif; ?>
</div><!-- #container -->
<div class="wrapper">
<?php masonic_paging_nav(); ?>
</div>
</div><!-- #site-content -->
<?php get_footer(); ?>
Then under my page template I chose the above template and using display post short cut plugin I am trying to display all my posts using the following line on my page:
[display-posts posts_per_page="1000" order="DESC"]
However, the page is now displaying no posts but the format seems to be correct. Here is a link to the page:
https://www.smellthespice.com/main-dishes/
Any help is much appreciated.
]]>I am trying to format my Post pages, with a single column on the right. I got it working on the pages as you can set the template.
Where can you set the template on the Post Page?
Thanks Robert
]]>Can’t find where I would make these changes or where in the code I would put the
<hr> code, if that’s what I need to do.
Thanks for the input.
tiger
pawupclose.net
You will notice it is a drop down with post cats, I dont want it to be like this but I have to because I cant get the post page working correctly. I think I am messing the code up for the post page template and is why I cant get it work. Does anyone have the correct code for the post page? Im pretty good at linking templates to headers to style sheets ect, as the whole site has many different headers and css files to work.
Now the really odd thing is that when I publish the post page it references the correct style sheet (style-archive.css) but when i make it the post page in WP options it then references the wrong style sheet (style.css)… Why would it do this???
here is my code
header file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head profile="https://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php if (function_exists('seo_title_tag')) { seo_title_tag(); } else { bloginfo('name'); wp_title();} ?></title>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style_archive.css" type="text/css" media="screen" />
<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/ie7.css" media="screen" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/ie6.css" media="screen" />
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
</head>
<body class="custom">
<div id="container">
<div id="masthead">
<h2><a id="home" href="https://www.bostonstandardplumbing.com">
<?php bloginfo('description'); ?></a></h2>
<h3>p: 617-288-2911</h3><br /><br />
<p>247 Savin Hill Ave<br />
Boston, Ma 02125</p>
<?php /*?> <?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php */?>
</div>
<div class="clear">
</div>
<?php if (function_exists('suckerfish')) {suckerfish();} ?>
<?php /*?><ul id="nav">
<li><a <?php if (is_page('about')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/about/">About Us</a></li>
<li><a <?php if (is_page('contact-us')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/contact-us/">Heating</a></li>
<li><a <?php if (is_archive() || is_page('archives')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/archives/">Plumbing</a></li>
<li><a <?php if (is_home()) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>">Home</a></li>
</ul><?php */?>
<div id="header_img">
<?php if (is_page('home')) { ?>
<img src="<?php bloginfo('template_url'); ?>/images/blog-header1.jpg" width="898" height="350" alt="<?php bloginfo('name'); ?> home page header image" title="<?php bloginfo('name'); ?> home page header image" />
<?php } elseif (is_page('about')) { ?>
<img src="<?php bloginfo('template_url'); ?>/images/blog-header1.jpg" width="898" height="350" alt="<?php bloginfo('name'); ?> about page header image" title="<?php bloginfo('name'); ?> about page header image" />
<?php } else { ?>
<img src="<?php bloginfo('template_url'); ?>/images/blog-header1.jpg"<?php echo(rand(1,1)); ?>.jpg" width="898" height="350" alt="<?php bloginfo('name'); ?> random header image" title="<?php bloginfo('name'); ?> " />
<?php } ?>
<!-- <h2>Boston Standard</h2>
-->
<?php wp_quotes_random(); ?>
</div>
DIY.php < page template
<?php
/*
Template Name: diy
*/
?>
<?php include (TEMPLATEPATH . '/header_archive.php'); ?>
<div id="content_box">
<div id="content" class="posts">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php include (TEMPLATEPATH . '/navigation.php'); ?>
<div class="post_header">
<div class="post_header_img">
</div>
<h1><?php the_title(); ?></h1>
<p><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> · <?php the_category(' · ') ?></p>
</div>
<div class="entry">
<?php the_content('<p>Read the rest of this entry »</p>'); ?>
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
<p class="tagged"><strong>Tags</span>:</strong> <?php the_tags(' ',' · ') ?><span class="add_comment"><a href="#comments"></a></span></p>
</div>
<div class="clear"></div>
<?php endwhile; else: ?>
<h2 class="page_header">Uh oh.</h2>
<div class="entry">
<p>Sorry, no posts matched your criteria. Wanna search instead?</p>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
]]>I have a static home page for CMS reasons. I have a blog section as well. I need my blog post to go to a “post page” which yes in wordpress (settings > reading) just select the page. So I create the template, call the correct header which inturns calls the correct style sheet. The page works and looks perfect. Now when I go to set the “post page” (in the settings) so the post show up on it, It reverts to stlye.css when it should be using style2.css and is calling the wrong header???
I dont think the code I have in my post page template is correct, does anyone here have the php code I need?
this is what i am using
post page template: < this is what i think is wrong
<?php
/*
Template Name: diy
*/
?>
<?php include (TEMPLATEPATH . '/header_archive.php'); ?>
<div id="content_box">
<div id="content" class="posts">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php include (TEMPLATEPATH . '/navigation.php'); ?>
<div class="post_header">
<div class="post_header_img">
</div>
<h1><?php the_title(); ?></h1>
<p><?php the_time('F jS, Y') ?><!-- by <?php the_author() ?> --> · <?php the_category(' · ') ?></p>
</div>
<div class="entry">
<?php the_content('<p>Read the rest of this entry »</p>'); ?>
<?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
<p class="tagged"><strong>Tags</span>:</strong> <?php the_tags(' ',' · ') ?><span class="add_comment"><a href="#comments"></a></span></p>
</div>
<div class="clear"></div>
<?php endwhile; else: ?>
<h2 class="page_header">Uh oh.</h2>
<div class="entry">
<p>Sorry, no posts matched your criteria. Wanna search instead?</p>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</div>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>
header:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head profile="https://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php if (function_exists('seo_title_tag')) { seo_title_tag(); } else { bloginfo('name'); wp_title();} ?></title>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style_archive.css" type="text/css" media="screen" />
]]>