4 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
VickiMcLeod says
Hi there, we are only really using your blog design in a simplified way. See here: http://finest-holidays.com/blogs/ but I want to have two separate pages : one for Winter News and one for SUmmer News. However when i ask Summer News to be a blog template it copies what is already on the Winter News page…. Is there a way to have a fresh blog on this second page rather than a duplicate? Sorry to bother you, hope you can help me!
824 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+5 more
Gareth_Gillman says

The only way to do it is to create a new template (copy the index.php and rename to something else.

Now in the page, add the following straight after the first <?php


/* Template Name: Summer Blog */

change the loop from:

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

to:


<?php $the_query = new WP_Query( 'category_name=summer' );
while ( $the_query->have_posts() ) : ?>

Now go down the page and find the following:

<?php endwhile; endif; ?>

and change too:

<?php endwhile;
wp_reset_query();
wp_reset_postdata(); ?>

Now go to the page you created for the summer blog, and change the template to the Summer Blog option (right hand side of page).

Now all being good, it should now only display the content from a category called summer.

4 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
VickiMcLeod says

Thank you Gareth, I am going to have a go at that later today, I shall report back!

4 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
VickiMcLeod says

Hi Gareth

Sorry to bother you. I have copied the index.php but I don´t know where to put the copy. Could you let me know please where I should be copying it to?

Thank you


The only way to do it is to create a new template (copy the index.php and rename to something else.

Now in the page, add the following straight after the first <?php


/* Template Name: Summer Blog */

change the loop from:

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

to:


<?php $the_query = new WP_Query( 'category_name=summer' );
while ( $the_query->have_posts() ) : ?>

Now go down the page and find the following:

<?php endwhile; endif; ?>

and change too:

<?php endwhile;
wp_reset_query();
wp_reset_postdata(); ?>

Now go to the page you created for the summer blog, and change the template to the Summer Blog option (right hand side of page).

Now all being good, it should now only display the content from a category called summer.
572 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $1,000+ on Envato Market
  • Won a Most Wanted contest
  • Has been a beta tester for an Envato feature
+4 more
kriskorn says

You need to create a new blank file and put the content you copied there.

4 posts
  • Has been part of the Envato Community for over 2 years
  • Has collected 1+ items on Envato Market
VickiMcLeod says

Thank you Kris, I´m doing something which I haven´t done before and it is making me nervous!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by