• Hey, on my website, https://www.thecaninedirectory.com, you will see how on the main page, there is a cool list of recent blog posts that shows up under that yellow box.

    What I want to do, is have a page on the site, https://www.thecaninedirectory.com/training, that features something similar. But on that page, instead of having recent blog posts show up, I want to have a list of pages (on how to train a dog).

    Does anyone know how I can do that? The /index.php code is as follows.

    <?php get_header(); ?>
    
    <div id="cap">
    <?php include (TEMPLATEPATH . '/cap.php'); ?>
    
    </div>
    <div id="content">
    
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="single" id="post-<?php the_ID(); ?>">
    <?php $preview = get_post_meta($post->ID, 'preview', $single = true); ?>
    <img class="custim" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $preview; ?>&h=150&w=200&zc=1" alt=""/>
    <div class="title">
    
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="date">Posted by <?php the_author(); ?> under <?php the_category(', '); ?> </div>	
    
    </div>
    
    <div class="cover">
    <div class="entry">
    
    <?php if(function_exists('the_content_limit')) { ?>
    <?php the_content_limit(350);  ?>
    <?php } else { ?>
    <p> Activate the limitpost plugin to see the post contents ! </p>
    <?php } ?> 
    
    <div class="clear"></div>
    </div>
    
    </div>
    
    <div class="singleinfo">
    
    </div>
    
    </div>
    		<?php endwhile; ?>
     <div id="navigation">
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    </div>
    
    	<?php else : ?>
    
    		<h1 class="title">Not Found</h1>
    		<p>Sorry, but you are looking for something that isn't here.</p>
    
    	<?php endif; ?>
    
    </div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Please help if possible,
    Thanks!
    -Luke

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lukafer2

    (@lukafer2)

    let me know if you need more information to figure this out

    Normally, I would recommend the Page Links To plugin. However, the current version, 2.2, has a bug. It is easy to fix, so if you want to try it, here are instructions.

    First, install the plugin and activate it. Then go to Admin->Plugins->Editor.

    On the right, where it says ‘Select plugin to edit’, select ‘Page Links To’ from the dropdown and click ‘Select’.

    Click on any line of code in the text window. Then press CTRL-F to find the right line to correct.

    In the ‘Find’ box at the top, type ‘preg’. It should highlight two of them in ‘preg_replace’. At the start of the line of the SECOND one, put in two slashes, so the line is like this: //$pages = preg_replace( ….

    Scroll the screen down and click ‘Update File’

    Create a category for training and assign it to all the posts you want to show on the Training page. Note the category id.

    Now, edit the Training page. Scroll to the bottom to the ‘Page Links To’ section and the line that says ‘Point to this URL:’. In the box, enter:

    https://www.thecaninedirectory.com/?cat=4

    where 4 is the category id you got for training. Make sure that there is only one ‘https://&#8217;.

    Update the page and you are done.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating a page similar to homepage’ is closed to new replies.