Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Include a specific post in a template

Featured Replies

I'm trying to make a one page template on wordpress by modyfing twentythirteen, but I noticed that if I don't use the blog index page, I can only put the content of only one page in my index.

 

Is there a way to use wordpress's page codes to show the content of another page? I tried adding again the same codes I used for the first part of the content in that page, but editing them with ids from other pages doesn't seem to do much.

 

Any advice to get around this?

Edited by guru8bit

  • 2 weeks later...

First you will want to create a child theme, this way if the theme updates you wont loose your pages.

 

Once you have that all setup you create a new file and call it "page-my-awesome-page.php"

 

In that page you can copy the following to the top

<?php
/**
 * Template Name: My Awesome Page
 */

Now you can create a new page on the right side you should be able to select "My Awesome Page" from the page template list

So if I understand correctly, you want to make a onepager out of twentythirteen?

 

After you make the page template as above you will want something along the lines of:

<section>
<?php query_posts('page_id=1'); 
while ( have_posts() ) : the_post(); ?>
<div>?php the_title(); ?></div>
<div>?php the_content(); ?></div>
<?php endwhile; ?>

</section>

<section>
<?php query_posts('page_id=2'); 
while ( have_posts() ) : the_post(); ?>
<div>?php the_title(); ?></div>
<div>?php the_content(); ?></div>
<?php endwhile; ?>
</section>

<section>
<?php query_posts('page_id=3'); 
while ( have_posts() ) : the_post(); ?>
<div>?php the_title(); ?></div>
<div>?php the_content(); ?></div>
<?php endwhile; ?>
</section>

Of course you would use the correct page id of the pages you want and you could use other information besides the title and the content. You may have to play with this a bit but if you take my example and use query_posts don't forget to add

wp_reset_query();

at the bottom of the page.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.