How to add all categories in PHP code?
-
Hi,
I’ve got these parts of the code for my index page which shows posts of a certain category. The problem is that I want the index to show all posts of EVERY category. My knowledge of PHP is not thát good so I figured I’d ask here. How can I adjust these parts of the code to make it work like that? 🙂
<?php global $post; $myposts = get_posts('numberposts=3&category_name=Fashion'); $x=0; foreach($myposts as $post) : setup_postdata($post); ?>
$args = array( 'category_name' => 'Fashion', 'post_type' => 'post', 'posts_per_page' => 6, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1), );
Thanks a lot!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to add all categories in PHP code?’ is closed to new replies.