[resolved] some1 help with my syntax? $posts= (4 posts)

  1. Cathy Tibbles
    Posted 8 years ago #

    This is the first string I've needed in my category template - i want to alphabetize posts IF in category 7 or 3. This (my guess) is obviously not viable! Can anyone help me with this?

    if (is_category('7'))
    {   $posts = query_posts($query_string .
    }   else
        $posts = query_posts($query_string .
        if (have_posts()) : while (have_posts()) : the_post(); ?>
  2. moshu
    Posted 8 years ago #

    Probably a missing { after else... then somewhere closing it...

    But why don't you just make a category-7.php and a category-3.php template file - so you don't have to struggle with conditionals?

  3. Cathy Tibbles
    Posted 8 years ago #

    ummmmm, cause I didn't think of it! I will do exactly that. I know your approach is to stay away from coding, I just have a hard time seeing the wordpress logic. Whereas, computer logic is intuitive, and it's a matter of syntax. (which I guess is quite a BIG matter!)

    :) thanks a ton, I'm going to make category templates now. :)

  4. moshu
    Posted 8 years ago #

    When it comes about template... the "logic" is outlined here:

Topic Closed

This topic has been closed to new replies.

About this Topic