Custom Widget in Sidebar using a post from a specific category
-
using this code to pull the Categories Post, but the issue is it doesnt show on every page of the Site, only the home page and the blog and category pages. Not user created pages.
Any help?
Code:
-ul-
-?php $recent = new WP_Query(“cat=12&showposts=2”); while($recent–have_posts()) : $recent–the_post();?-
-li–a href=”-?php the_permalink() ?-” rel=”bookmark”-
-?php the_title(); ?-
-/a-
-br /-
-?php the_content_rss(”, TRUE, ”, 25); ?–br /-
-a href=”-?php the_permalink() ?-” title=”-?php the_title() ?-“-Read More…-/a-
-/li-
-?php endwhile; ?-
-/ul-(the – are < )
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for WordPress.com hosted blogs only. If you have a self-hosted WordPress blog you need to seek help at the WordPress.org forums, not here.
If you don’t understand the difference, you may find this information helpful.
- The topic ‘Custom Widget in Sidebar using a post from a specific category’ is closed to new replies.