Hi There, Hope, you all are doing well. WEBSITE: https://www.directsupplyservices.com I want to display my 5 categories pages in the footer under "Categories". How can I do that? Kindly advise. For your reference: https://screenshots.firefox.com/fG5S8onH95Ne652m/www.directsupplyservices.com Thanks & Regards, Rashida H.
This code gives you posts from a category, notice category ids in the arrugments. $getposts = get_posts( array( 'category__in' => '1, 2', 'numberposts' => 5 ) ); if( $getposts ){ $display = ''; $display .= '<ul>'; foreach( $getposts as $post ) { setup_postdata($post); $display .= "<li><a href=\"" . get_permalink() . "\>" . get_the_title() . "</a></li>"; } $display .= '</ul>'; wp_reset_postdata(); echo $display; }// Code (markup):
Hi there, Thanks for the quick reply. Quick point though; I don't have "posts" in categories. I have made categories in pages. And I just want to show my 5 main categories in the footer. So, how can I display those with this code? Also, quick question: where do I place this code? which file? Kindly advise. Thanks!
My bad! Actually, I made pages only. But since in my website layout, I have named those pages as my categories - so I ended up saying the same here. I apologize. Yes. So technically there are 5 pages that I want to mention in the footer under "Categories". I went into "Appearance" - "Menu" and add these 5 pages in "footer menu" under categories there as well .. but it doesn't display on the website. I hope, am not confusing you. Let me know, please!
Best way create a menu for those category page and display that in the menu in the footer through widget.
Hi @salmanshafiq: Thanks for your guidance. I have created the menu for the category pages and displayed the menu in the footer as well. But, the way I want to display is: after categories - the 5 pages (Gas Detection etc) needs to align little right so the user see these pages as part of the categories. For your reference: WEBSITE URL: https://www.directsupplyservices.com/ Kindly advise, how can I do this. Thanks & Regards, Rashida H.
"Category" Free plugin is available - you can manage category with Image also , then at footer.php- using the custom query- you can call the category