SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Mar 2013
    Location
    Philippines
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Display post by category

    I'm trying to figure out on how to display post by category in page.php. I have been searching and trying out different kinds codes but no luck. I'm still new to PHP and wordpress and just starting to code my first wordpress theme from scratch.

    Here is the website i'm developing in wordpress. It's just simple and something i can practice on.

    http://zigzagadvertising.com.ph/chris/

  2. #2
    SitePoint Addict
    Join Date
    Oct 2008
    Location
    Virtual World is my location
    Posts
    316
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Long back I had one such requirement and had bookmarked a link. Hope this helps you

    www . riotstories . co . uk / wordpress / group-posts-by-category /
    FreelanceNext.com - Freelance Projects / Jobs & more...
    BargainNext.com - coupons / deals / bargains / offers & more...

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2013
    Location
    Philippines
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jaagare View Post
    Long back I had one such requirement and had bookmarked a link. Hope this helps you
    Thanks but i found the solution a few hours ago and now i have another problem.

    I have created a custom page that will display posts only from a specific category and i have also set wordpress to show only 4 number of post. Now the problem is the "WP-PageNavi" is not working properly. Here is the code.

    <div class="sixteen columns latest_post">

    <?php query_posts('cat=3', 'posts_per_page=-1=-'); if(have_posts()) : while(have_posts()) :the_post(); ?>
    <div class="sixteen columns alpha omega outer_box">
    <div class="inner_box articles">

    <!--TITLE OF THE POST -->
    <h3 class="post-title">" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h3>

    <ul class="data">
    <?php the_author_posts_link() ?> /
    <?php the_category(', ') ?> /
    <?php the_time('F jS, Y') ?> /
    <?php comments_number() ?>

    <hr>

    <!--THUMBNAIL -->
    <div class="align_thumbnail_right">
    <?php if ( has_post_thumbnail()) the_post_thumbnail('home-thumb'); ?>

    </div>

    <div class="content">
    <!--TEXT -->
    <?php the_excerpt(); ?>

    "><span>Read More</span>
    </div>

    </div>

    </div>

    <?php endwhile; endif; >

    <div class="pagination">
    <?php wp_pagenavi(); ?>
    </div>

    </div>

    I applied the plugin on the index and it seems to be working fine. But when i tried it on a custom page it doesn't work. Really hope that someone can help me here since i'm not really good at PHP


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •