Linked Questions

2
votes
3answers
99 views

Explanation of WP_Query

Why am I able to use WP_Query methods without using an object of this class? Sometimes I see examples that are using the object: // The Query $the_query = new WP_Query( $args ); // The Loop ...
2
votes
3answers
367 views

What are the differences between “Latest Posts” and “Static Page”?

WordPress has an option to pick "Latest Posts" and "Static Page" under "Settings" in Admin Panel. My questions: What page template is getting loaded in each of those modes? Why paged stops working ...
2
votes
3answers
888 views

Adding “latest from the blog” to the homepage

I have a big problem and no clue how to solve it :) I want to add a "module" to my homepage (static homepage, not blog posts) that will display the 2 latest blog posts in a very particular way and ...
1
vote
3answers
150 views

Single page theme

I am trying to create single page theme. What i have trouble with is understanding this whole wordpress query logic. There is query object and supposedly i get all published posts like this: ...
1
vote
3answers
160 views

Force index.php have_posts() loop to exit if no sticky posts found

I'm currently using the code below to list sticky posts on my index.php. However, when no sticky posts are present, its loading the latest posts (up to the number specified in "settings > reading > ...
1
vote
3answers
104 views

wordpress loop for specific category

i have this snippet for specific category it works perfect but i want little modification to show posts by Ascending order. <?php // The Query query_posts( array ( 'category_name' => 'A', ...
0
votes
3answers
142 views

How to show a popular post in wordpress in last 24 hours?

I have the query_post on my codes. This will display the popular post of all time. But I want to dispaly the popular post in past 24 hours. How do I do that? <?php ...
0
votes
3answers
53 views

content and excerpt not displaying

I am using get_the_title(453) and while the title displays, i am unable to display the content and the excerpt for the page with the id of 453. The following is my code get_the_title(453); ...
0
votes
3answers
37 views

Include one page/post into query which is already returning posts

I have my news query which is on my index file. I want to include a post into this query which is infact a page. Is there anyway to do this? <?php query_posts(array( 'posts_per_page' => ...
0
votes
3answers
442 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
1k 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
262 views

shortcode for recent custom type post

I'm not a coder so I may have done some "coding" crimes, apologies. I've bought a theme who has shortcodes for last posts but not for last "custom post type". So I tried to create last "custom post ...
0
votes
3answers
43 views

Is there a way to make this kind of loop shorter and nicer?

Here is my loop code, i want to call different page templates for different pages. Please notice that this is a one-page-layout. <?php $args = array( 'post_type' => 'page' );?> <!-- get ...
0
votes
3answers
227 views

how to “not” display new posts with a specific category on the main page?

I've read this and this but I'm just a basic user. I have a "technical" blog that more and more people visit. I'm a freelance, and now, when someone hears about me, he/she wants to search for me, ...
0
votes
3answers
590 views

Split wordpress loop to multiple layouts

OK so I've searched a lot and couldn't find a straight forward answer to my question. I am simply trying to use one category loop that will display posts in a category page in a wordpress site. lets ...

15 30 50 per page