Linked Questions

0
votes
3answers
3k views

How do I use wp_get_recent_posts?

I'm trying to display the title and excerpt of the most recent 8 posts on the sidebar. I'm getting a list where: All items link to the oldest post All titles are "id number of a post that should be ...
0
votes
3answers
3k views

current-menu-item not added on page showing custom post type (rendered with archive template)

I have setup a custom post type called 'expertizeom' I have setup a page called "expertize" and added to my custom menu (site main nav). The page is rendered with an archive called ...
0
votes
1answer
3k views

How to create a category and sub-category sorted blogroll with all posts?

I would like some help to post all the posts of my website into a blogroll sorted by categories and subcategories. The end-result HTML I would like to see displayed would be something like this: ...
0
votes
3answers
1k views

how to get a different html for odd/even posts?

query posts if posts exist then begin the loop if post is even: <h1>title</h1><p>content</p> if post is odd: <div>its ...
0
votes
3answers
2k views

Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact ...
0
votes
2answers
1k views

Multiple Category Query

Is it possible to display a wordpress category page but have it pull posts from mulitple categories? For example, let's say I need to pass in params for cat_id in this fashion ...
0
votes
1answer
2k views

When to use Wordpress loop or Foreach loop?

Under what circumstances would you, (should you?) use a foreach loop, instead of the wordpress loop. I have no real coding need, but I'm curious. What's good practice here? Should I: ...
0
votes
1answer
3k views

Sub-loop / nested loops Best Practices

I'm trying sort through the morass that is WP documentation, and just need someone to clear up the use of the term "The Loop" and how it relates to subloops. My understanding of "The Loop" is that ...
0
votes
2answers
3k views

Show posts from category specified using a custom field

I have a post that shows the titles and excerpts from a specific category underneath the content. Currently this is coded into a specific template like this: <?php ...
2
votes
1answer
2k views

how to get posts by custom post type then display Custom fields?

I have custom posts types for Recipes, and within that I have set up Advanced Custom Fields (from the plugin.) Within, that custom post type, I have several categories. Two questions: 1.) How do I ...
1
vote
1answer
3k views

query_posts() vs get_posts() multiple loops [duplicate]

I have a template which initially had one single loop and it was using query_posts, I added 2 more loops using the same method, However after reading allot about these it was concluded that I shall ...
0
votes
5answers
2k views

Is there any way of changing the post order via user click?

Is there any way of changing the post order, posts number, etc via user click? The same way you can choose displaying questions by time and vote here at StackExchange. How to accomplish that?
1
vote
2answers
1k views

Custom posts per page does not work with pagination

I have one page in my template where I would like to set a custom posts_per_page. Here is the code I have used: <?php global $query_string; query_posts($query_string . '&posts_per_page=4'); ...
1
vote
1answer
835 views

Exclude custom taxonomy tag from loop

I have the following code at the beginning of a loop: <?php query_posts('showposts=3&cat=84'); ?> <?php $posts = get_posts('category=84&numberposts=3&offset=0'); foreach ($posts ...
2
votes
3answers
646 views

Exclude category on blog list page

I've got a site with a News page (archive for category 'news') and a separate Blog page. When I make a post for the News page I select the category 'news'. So, on the news page you only see the posts ...

15 30 50 per page