Andrew Hall

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Blog only showing specific Categories #1887
    Andrew HallAndrew Hall
    Member
    • Topics: 2
    • Replies: 2
    • Total: 4
    Member since: September 19, 2014

    I figured it out.

    I needed an <?php endif; ?> at the end.

    in reply to: Blog only showing specific Categories #1886
    Andrew HallAndrew Hall
    Member
    • Topics: 2
    • Replies: 2
    • Total: 4
    Member since: September 19, 2014

    I did what you said, but I am getting the below error:

    Parse error: syntax error, unexpected ‘=’ in C:\xampp\htdocs\www.d-dub.com\wp-content\themes\skt_full_width_pro\page-bonetown.php on line 5

    To make sure I am doing it right, let me tell you what I did. I replaced <?php if( (is_home() && get_option(‘page_for_posts’)) || is_front_page() ) { ?> with the code <?php query_posts(‘category_name=CATEGORYNAME&showposts=5′); (adding a ?> at the end, which you didn’t have, but I assume should be there).

    Next I replaced CATEROYNAME with my category slug name.

    Under this code I added <?php if( have_posts() ) : ?>

    Finally, I deleted <?php } else { ?>

    Right now I am only working on a localhost, so there is no ftp to upload to.

    Here is the code:

    <?php
    /* Template Name: About Game Page */
    get_header(); ?>

    <?php query_posts(‘category_name = aboutgame & showposts=5′); ?>

    <?php if( have_posts() ) : ?>

    <div id=”primary” class=”content-area”>
    <div id=”content” class=”site-content container”>
    <main id=”main” class=”site-main” role=”main”>
    <header class=”page”><h1 class=”entry-title”>Blog</h1></header>
    <div class=”blog-post”>
    <?php if( have_posts() ) : ?>
    <?php while( have_posts() ) : the_post(); ?>
    <?php get_template_part( ‘content’, get_post_format() ); ?>
    <?php endwhile; ?>
    <?php skt_full_width_pagination(); ?>
    <?php else : ?>
    <?php get_template_part( ‘no-results’, ‘index’ ); ?>
    <?php endif; ?>
    </div><!– blog-post –>
    <?php get_sidebar(); ?>
    <div class=”clear”></div>
    </main><!– main –>
    <?php get_footer(); ?>

    </div>
    </div>
    </body>
    </html>

    <?php } ?>

Viewing 2 posts - 1 through 2 (of 2 total)