Set up The Loop with query parameters. This will override the current WordPress Loop and shouldn’t be used more than once. This must not be used within the WordPress Loop.

learn more… | top users | synonyms

0
votes
1answer
115 views

do more action after I publish a post

I am using wordpress3.5, I need to write post information to a file after I publish a post successfully. What I am not know is When I click Publish button, what function wordpress invoke to save ...
0
votes
0answers
50 views

how to prevent words inside image tags from being update in a sql query via php

I need to update certain words inside wp_posts table (1032 posts in a specific time range) but I would like to exclude some words when they are inside tags like so: <img ...
0
votes
1answer
44 views

how to get the top 10 popular blogs

Our wordpress sites have many many users, each of them have an blog account, they can write posts,comments and so on. Now I want to find out the top 10 popular blogs, according to or order by ...
0
votes
1answer
780 views

post-per-page and offset not working

This is my code, why cant i get post per page and offset result ?. <?php $myquery['tax_query'] = array( 'relation' => 'OR', 'posts_per_page' => 3, 'offset' => ...
0
votes
2answers
264 views

how could I get the pagination as I want to when query posts using get_posts function

I am using WP3.5, and I have a post_list.php which will show all the posts order by post date DESC. Everything is ok except pagination. I have 15 posts, for test purpose, I want to every page show 2 ...
0
votes
1answer
207 views

Wordpress Query based on random taxonomy

I am banging my head to get this solved, would appreciate if any one can help The scenario is, I have a WordPress site related to books. I have a custom taxonomy named "History Books" sluged as ...
1
vote
1answer
3k views

Using OR conditions in meta_query for query_posts argument

I have searched high and low for this but I cant seem to locate anything. I am trying to filter some results and when I make an args array like this and pass it to query_posts I noticed that the ...
0
votes
1answer
54 views

why the same code got different results when using query_posts in functions.php and index.php

I am using WordPress 3.5, and my blog sites have many registered users. After they log in, I want them to see just their own posts, not others. So I added this to my functions.php, but I get a blank ...
0
votes
1answer
220 views

Retrieve only posts from a specific user in wp-admin/edit.php

I create a role and set capabilities for a group of user. $userdata = array( //something ); $uid = wp_insert_user($userdata); if(!empty($uid)){ $blogger = new WP_User($uid); //add role ...
0
votes
1answer
289 views

get_next_posts_link() stops displaying at page 4

Please start by taking a look at this quick video: http://www.screenr.com/8vSH The problem: get_next_posts_link() disappears on page 4. That is, the "go to older posts" link disappears once I am in ...
1
vote
1answer
181 views

Show Posts From Same Category OR Same Tag

Assume a post is categorized in "Fruit" and tagged with "Apple". The following code shows posts with category "Fruit" AND tag "Apple" $args = array( 'tag__in' => $tag_in, ...
0
votes
1answer
99 views

get_the_title outputs title until spacing; it does not get full length of title

If I have a post with a spacing in it (like: Hello World), than get_the_title shows me only "Hello" as a link and not the whole permalink. I already tried using a substring to get it done, but it did ...
0
votes
1answer
153 views

How to get all post titles starting with numbers and symbols?

I want to get all posts which are starting with a number (0-9) or symbols, in a list. I managed to get it work for letters, but this one is harder for me. Can someone help me out please? I tried ...
0
votes
2answers
333 views

Paginate pages with dynamic query

I have a wordpress page that has a series of listings and a searchbox at the top. The search allows the user to filter posts by creating a custom WP_Query object based on what they selected. I am ...
0
votes
1answer
352 views

Displaying and Querying Posts with Featured image

I have added Featured image support for my posts by adding the following in the functions.php add_theme_support('post-thumbnails'); I created 3 posts with Featured Image and i want to display them ...
0
votes
1answer
60 views

How to inject a post within a loop

I'm trying to inject a post while the loop is running. This post will be injected on a condition, so if(x == j){ //inject post here } I see this would seem easy to do, but i have a posts_per_page ...
0
votes
1answer
270 views

WP-Snap too slow (caused by WP_Query?)

I have a website with 10.000 posts... WP Snap alphabetizes the posts and puts it out with WP_Query, but it is slow as hell, which is very frustrating. My question would be: what can I do about it? ...
0
votes
0answers
76 views

WP Build-In Post selector for CPT

I'm quite sure to remember any WP build-in function that generates post selector based on several args (post_type, etc.) like on the nav-menus admin page, here a screenshot: Is there something like ...
0
votes
1answer
1k views

WP_query parameters for date range

I'm using the events manager plugin to create custom posts for events. I do not have a need for a blog, so I modified my theme's index.php file (using a child theme) for its query to retrieve the ...
0
votes
0answers
213 views

Advanced Custom Fields Post Object

I am looking to create a custom proposal system with WP and ACF. I created 3 custom post types. Proposal Objectives Proposal Items Proposals I created some custom fields in ACF to include in ...
1
vote
2answers
62 views

Integrating post archive wtih another source and preserving date ordering

I'm pulling posts from Instagram into the WP basic archive view; but I want things to display in order of date, and not screw up paging (too much). The outcome should look like this: BLOG POST JUNE ...
0
votes
2answers
29 views

wordpress taxonomy query posts

I have categories and sub -categories with same name.. but I want to show only the categories which is on the top level and not in the sub categories $qry=query_posts( array( 'post_status' ...
0
votes
1answer
128 views

Passing a varible from jQuery to PHP

I have a a bunch of li's that are a blog but i want to show them enlarged in a colorbox. Therefore I need to know which li I clicked so I can get that ID and use that in my query to get all the date ...
0
votes
1answer
59 views

Pagination linking to first page

I have created a query which work correctly and displays the pagination correctly. However when clicking the links /products/category/application-range/page/2 the page will load and go back to ...
0
votes
0answers
484 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
2
votes
1answer
301 views

How to implement time filter to show random post 1 month for one category and 3 months for other categories

I started to work on one website after another developer and there is problem with his "popular widget" which is basically showing 3 random posts from category. There is some Switch statement which is ...
0
votes
1answer
192 views

How can I change the publish date based on a custom field?

How can I change the publish date based on a custom field? Author uses a date picker to choose the date for journal entry. The date is used to make a list of all the users journal entries. I can ...
-1
votes
1answer
38 views

query posts in wordpress

I want to filter my query results just before the_loop starts in word press. I only want the results having term_id or term_taxonomy_id equal to 1. ...
0
votes
1answer
133 views

Control content before and after custom post type loop

I am trying to create a left nav menu that contains a couple of different taxonomy lists of a custom post type. For example, the left menu might look like this... <h2>New Stuff</h2> ...
0
votes
1answer
44 views

Display Posts with template on a Page

OK, I'm sure some WP pros here will think this is a dumb question, and I'll probably get some flak, but I have actually read plenty of documentation, and I just don't think I'm even going in the right ...
0
votes
1answer
194 views

How to get alphabetic listing x other posts, based on first letter post?

Let's say I have a post called "Hello World" and I am on that page... Let's say I have different posts like "Haaaa" and "Hoooo".... What I want to do is showing Haaa and Hooo in a different place (let ...
1
vote
2answers
1k views

Display posts of the last 7 days

I'm trying to display the 5 best rated posts of the last week (7 days) on my website, however I can't seem to figure out how to display them. Here's what I've achieved so far but it doesn't seem to ...
2
votes
1answer
309 views

Can't show comments count per post outside loop

How can I show the amount of a comment per post outside the loop? I tried this in a function already: ' . get_comments_number . ' , but that outputted the text "array" on the screen... What do I have ...
5
votes
1answer
5k views

Get posts from sites in Multisite?

I'm trying to pull multiple sites posts. For example, I can pull out a single site posts by a category and total posts 10. But I'm trying to pull out both posts from two separate Multisite blogs 1 ...
0
votes
2answers
155 views

query_post and wpdb returning different results

I am trying to get the woocommerce products by category.. When I query using the wpdb it gets the product correctly which exists in the backend products list. But when I query using the query_posts it ...
2
votes
1answer
548 views

Perform query with meta_value date

I am trying to perform a query on a custom-type post using the value of a custom field. This field contains a string date: dd.mm.yyyy. The post type name is 'event' The custom field name is ...
1
vote
1answer
149 views

Change order of posts

I made a post recently that did not explained myself right! Come again, but with better explanations. I need the "Select Option" change the order of query_posts. My current code is: <select> ...
9
votes
4answers
265 views

Is there a way to exclude the content from the post variable to save on RAM usage?

So, I've run into what looks like a WP RAM usage problem and am looking for a solution. The only place I'm really having this problem on my site is with a Site Map page that I'm trying to populate, ...
0
votes
1answer
174 views

Restrict query_posts by Date?

To display the most popular posts based on page views I am using this code (source): <?php query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC'); if ...
1
vote
2answers
132 views

Trying to find a way to query post like normal search would do. within search.php page

I have a costume search in a site i am making. When a user search a certain term, i want to display category list with a count of how many posts are found with in that category. I thought of a way ...
0
votes
1answer
321 views

Transfer taxonomy to custom field

I have a blog with movie critics and I'm using many taxonomies to add some informations about the movies, like director, actors or it's year. Using taxonomies is really useful to display all movies ...
0
votes
1answer
199 views

Replace query_posts with pre_get_posts

I have a static front page that checks if the user is logged in, and if he/she is a number of x posts from a specific category is displayed. For that I was using this code: ...
0
votes
1answer
145 views

Multiple post queries -category,posts per page,orderby

I originally had this query on a posts category page: <?php $page_query = new WP_Query('post_type=post&cat=145'); ?> Which worked, but it only displayed the first 4 posts. So I ...
0
votes
1answer
603 views

Copy posts from one blog to another in multisite environment

I am creating a plugin for post.php page where user can select (one or more) blogs and copy the post content,title,author,categories everything in selected blogs. The copied post would be the child of ...
1
vote
1answer
713 views

Using loop pagination on single.php

I want the main front-page loop to show in a section on both index.php AND single.php templates, with pagination. Pagination works fine on the homepage, but not on single posts. This is the code ...
0
votes
1answer
91 views

Exclude current sticky post

I have the following query, trying to fetch the latest sticky posts but exclude the current one: $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice($sticky, 0, 3); ...
1
vote
2answers
472 views

Next/Prev posts on same page

Hello WordPress Users, I'm stuck with a problem building my wordpress website and I can't figure out what to do about it. Currently I'm showing 2 posts form the category 'News' at the page 'News'. ...
0
votes
1answer
49 views

Different layout based on post amount?

Is it possible to change the layout of the query posts depending on how many there are? So simple query page listing posts... Up to 4 posts show them in a list. If there are 4 posts and over show ...
0
votes
1answer
247 views

How to break up php code to avoid echo

I have this php code I am using to list all post (titles) with the taxonomy categories names, and its working fine however I will like to break it up and avoid using echo within the php code so that I ...
0
votes
1answer
55 views

PHP dynamical conditional post display

I'm trying to get the WordPress loop to display only the post has an ID that reflects whatever $category_name is equal to, as shown in the line of code below. It ends up showing everything and not the ...