Nav / get_categories data pulling
-
i have been trying to fix this all day..
i just started with wordpress and was reading on some sites
here is what i end up having<?php $args=array( 'orderby' => 'name', 'order' => 'ASC' ); $categories=get_categories($args); foreach($categories as $category) { echo '<li><a href="' . get_category_link( $category->term_id ) . '" class="title" title="' . $category->name . '" >' . $category->name . '</a> <ul>'; query_posts('category_name='); while (have_posts()) : the_post(); echo '<li><a href="' . the_permalink() . '" title="' . the_title_attribute() .'" >' . the_title_attribute() . '</a></li>'; endwhile; echo '</ul> </li>'; } ?>the result i get was ALMOST what i wanted
excluding the fact that the info that i pulled did not get placed
within these tagsan example of the outcome
<li><a href="" title=""></a></li>http://www.icc575.com/qweng/cny/?p=118White collar theftWhite collar theft<li><a href="" title="">all the data that got pulled end up not inside the ” “
i thought it was because i echoed everything (from a noobie point of view)so i switched it to this
and totally broke the page : (<?php $args=array( 'orderby' => 'name', 'order' => 'ASC' ); $categories=get_categories($args); foreach($categories as $category) { ?> <li><a href="<?php get_category_link( $category->term_id );?> " class="title" title="<?php $category->name;?>" ><?php$category->name;?></a><ul> <?php query_posts(); ?> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title_attribute(); ?></a></li> <?php endwhile;?> </ul></li> <?php } ?>some pointers on how to solve this would be great : )
The topic ‘Nav / get_categories data pulling’ is closed to new replies.