Is it possible to start the loop from a certain post ID? I would like to get all the post…
Exclude subcategory from wp_query
I’ve got a simple loop, that goes through the category street-style: $street_style_tags = array( ‘category_name’ => ‘street-style’, ‘posts_per_page’ => 25,…
Latest Post Styled Different Than other Posts
I’m just completely mixed-up with this. I need the 1st post of the loop looks differently, as a kind of…
How to output data from meta box with cloned fields?
Just to let you know, i am at a beginner level with PHP, so please bear with me : )…
Equivallent to the_author_posts_link()
As you know, in the loop, the_title() function displays (echos) the post title to the screen, and get_the_title() returns it…
Saving return value from the_author_posts_link()
As you know, in the loop, the_title() function displays (echos) the post title to the screen, and get_the_title() returns it…
Building a plugin: use offset values, save to database, call values on frontpage in loop
I first posted this on StackOverflow, but now I realise that this is probably more suited for this site. Updated…
One page loop – All pages in landing
I’m trying to create a one loop page ( where EVERY page is showed at the beginning of the site,…
Order by multiple meta keys on wordpress
After multiple research I didn’t find the correct answer to my question. I just need to order my custom post…
Use get_posts() to get an array of images (from each post)
I’m trying to access each post’s attached images (even those without an attached image, I want a string if no images.).
I’ve got the following code, which is a foreach loop, and for every post it should post the title and attachment link.
However, it posts the same title twice (because there’s two posts in the database).
$args = array( );
$get_info = get_posts( $args );
foreach ( $get_info as $x ) {
echo the_title();
echo the_attachment_link();
}
Would anyone know why there’s not an attachment link and that it’s posting the same title, twice?
Running the Loop outside of WordPress
I have a static website and WordPress installed at mywebsite.com/blog. I have a page on my external static website which…
Get the ID of the current post’s child category
A client of mine wants to create a simple “related posts” loop that shows 6 of the most recent posts…
How to exclude categories from recent posts, recent comments & category widgets?
I use the bellow function (thanks to @helgatheviking!) to exclude categories from the wordpress loop. It works very well –…
Style first 3 posts differently with WP_Query [duplicate]
This question already has an answer here: How to mark every 3rd post 5 answers I’ve got the following code,…
Pulling current post/page data into header.php
I want to pull some post/page specific data (author name, post ID, publish time, etc) into header.php to be used in meta tags. I am having trouble figuring out the most efficient way to do this. It is my understanding that I will need to create a loop within header.php to pull this data. How can I go about creating a loop for the current page/post if I don’t yet know the ID?