SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2013
    Location
    Maine
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Word Press Question

    This is my first post. I will apologize up front if I get terminology wrong. My web hosting company and I decided a month or so back that an upgrade to our site was needed and that if I was going to do some of the heavy lifting on the new site, I should go with Word Press. The old site was in both Joomla and Word Press. We chose a template, purchased it and they migrated over 548 categorizes (many we multiply duplicated in the process/split) and over 6500 posts.

    I want to organize the categories (and their respected posts) in the new site under five - seven pages located under the header. Any help here would be great and a work though / work around would be grateful.

    Thanks, Schwarzw

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Welcome to Sitepoint, Schwarzw.

    It's hard to be certain if anything happened to your organizational sys during your migration. Also, if your post are not organized under five to seven categories they cant be displayed under 5 to sever categories. The obvious having been said .. have you tried wp_list_categories( $args )?

    By default it should give you a list of your existing categories ( so if you have 5-7 as desired, then you are set!) ..there are actually WAY too many ways of doing this to list.
    but for a layman.. i could suggest setting echo=0 ( that means it wont output, but instead return the data), from which yu could extract the catID , list the category, use the catID to get all of the post under that category, and echo those.

    ACTUALLY... if you already KNOW the ID of the cats you want to use, you could just make an array and then loop through. something like :


    Code:
    <?php
    $cats=array(1,2,3,4,5); // your  chosen categories
       global $post;
    foreach ($cats as $catID){  
    $cat=get_category($catID);
    $myposts = get_posts('category='.$catID. '&order=DESC');
    ?>
    <h3><?php echo $cat->name ?></h3>
    <ul>
    <?php foreach($myposts as $post) :?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
    <?php endforeach; ?>
    my tablet is acting up so I may have typos in that code ... but that's the gist of it. hope it helps.

  3. #3
    SitePoint Member
    Join Date
    Apr 2013
    Location
    Maine
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you dresden_phoenix. It quite obvious I may not be up to this. I no that I would need to cut and past that code into the editor some place, but don't know where. I have been search for pluggins that may help, but I am doomed at this point. I know that answer is out there, but I can find it yet. I have a giant about of posts and in the position to post about 5000 times a year, so I have a bunch of catagoies to organize under. I just need right plugins for the Menu and for the website to make it work.


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
  •