The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
40 views

Show list of authors with latest post NOT older than a month

I found two bits of code. One gets me posts NOT older than a month the other bit gets me a list of authors and their custom fields, names, etc. Can someone please help me integrate the two. One runs ...
1
vote
3answers
31 views

get_*_meta doesn't always return an array

I find it annoying that functions like get_user_meta or get_post_meta will return an array if the meta key exists or false if it doesn't. This means I need to do a check like so: $meta = ...
2
votes
1answer
22 views

foreach error on false boolean from get_terms

I'm grabbing an array of page ids that were created in another function which I use regularly- that's all good. The issue I have is in the below function. Some pages have not been assigned an ...
0
votes
2answers
35 views

post__in - Placing content from a foreach loop inside of an array

I know this code is incorrect, but it's a basis of what I am trying to achieve. I am parsing an xml feed via PHP and running a foreach loop to get a value from a specific key. Here is the snippet I ...
0
votes
2answers
59 views

How to use Wordpress Conditional Tags in get_posts foreach loop

I have a page which has a jquery tab function to output the list of pages that are the children of this page (Bio, Archives, Contact). However I am trying to make a conditional in the foreach loop ...
0
votes
1answer
21 views

Store Foreach in user profile

I use a foreach to get visits / visitors per month with Analytics API. I need to store the results in the user profile the way it is displayed with an echo. I tried this but I don't get the right ...
0
votes
1answer
56 views

How can i show pagenavi in my author.php?

With this query in author.php i show all posts from a specific author_id/name/slug. But the problem is when i set the minimum of posts to show in the page. I have tried with posts_per_page= but if i ...
0
votes
0answers
27 views

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 : ) Also, I looked at this post and I did not find it helpful in my case, so I am making a stab at it here. (Meta Box ...
0
votes
0answers
36 views

JQuery is only applying to first post in loop

I have a JQuery script that creates 'arrows' that allow for my textbox to be scrollable, the problem is JQuery is only apply it to the first post (you can see none of the other posts have the arrows). ...
0
votes
2answers
50 views

Displaying values from related field - if empty shows current post type's link and title

I'm working with custom post types. In the post type awards I have a relationship field that links each award to a post from the post type project. I'm using the following code to return the values ...
0
votes
3answers
62 views

Conditionally set post_content in wp_insert_post

Is it possible to conditionally set the post_content in wp_insert_post? Im using a foreach to add multiple pages at once: foreach ($create_pages as $new_page) { $add_pages = array( ...
2
votes
2answers
81 views

How can i get the last post from wp multisite?

I have to get the last post from my Multisite network on WordPress. For now I use this code for display the last updated post after a cycle on each blog_id: <?php $blogs = get_last_updated(' ', ...
0
votes
0answers
125 views

Attaching Images to Multiple Rows within Foreach Loop

I'm trying to modify the Product Add-Ons plugin for WooCommerce. I need to be able to add an image for each add-on item. So each add-on item row would look like: Name Price Image Each row is ...
0
votes
2answers
45 views

Create menu locations for each category in wordpress

I need display a special menu in each category page in wordpress, for example I have 3 category: horse,dog,cat So I must have 3 menu in Menu Settings locations with name: horse,dog,cat with this ...
0
votes
0answers
30 views

Get_post_meta returns Array instead of actual value [duplicate]

With the PODS plugin in Wordpress, I've created a custom post type called project. Within project I've created a few custom fields. One of those is project_thumb. The thing is; When I want to display ...
0
votes
1answer
38 views

List all pages including archive

I'm creating a custom options page on my site. One of the options is controlling a box on the homepage and i'm trying to set the link for the item to any page on the site via a select menu. as of now ...
0
votes
0answers
27 views

Get parent taxonomy's name of custom post?

I have a foreach-loop that looks like this foreach($selected_courses as $postid) { $course = new WP_Post($postid); } where $selected_courses is an array of ids based on a form submit. ...
0
votes
0answers
18 views

WP supersize not displaying when different languages flags are selected

I've got a very strange problem with this website. The background slides appear when your English flag but when its switched to The Spanish flag or Other flag the backgrounds don't appear. Link to ...
0
votes
2answers
37 views

Order by custom field attribute

I'm try to get the output of this post type to order by the staff name alphabetically and I can't seem to figure out if needs to be within the beginning array() or if I been do something within the ...
0
votes
1answer
81 views

Woocommerce Attributes pulling in wrong data

My Problem is very strange - I don't fully understand all the aspects of woocommerce just yet and am still fiddling with things to understand it. I'm trying to pull in the size attributes for each ...
0
votes
1answer
64 views

Second level subcategory

I'm trying to get anoter level subcategory to show in my select option. I've managed to get one... how can i get the other? <?php $taxonomies = array(CUSTOM_CAT_TYPE); $args = ...
0
votes
1answer
87 views

foreach pagination

I am looking for help in how to paginate my foreach output. I've looked at other questions and answers and cannot find a solution that works for me or that I can figure out on my own. Right now my ...
0
votes
2answers
99 views

Display Random Thumbnail from Category

I have a feeling that I'm on the right track, I just don't have enough solid PHP knowledge to get much further than where I'm currently at. I'm currently using the following code to return a list of ...
0
votes
1answer
35 views

Wordpress multi-query not returning as expected

I am trying to perform a merged query to get at most 6 posts from either the post post type and my events custom post type. The post query is based off of whether or not the Featured Image is set, and ...
0
votes
0answers
78 views

Trying to combine multiple Wordpress queries

I am trying to query multiple post types and meta values in Wordpress... the query is trying to fetch event post types with a featured meta key, as well as post post types with the featured image set. ...
0
votes
0answers
128 views

Advanced Custom Fields Repeater sorting by category

Basically in my ACF repeater I have a select field and I want to display the content in sections that relate to the value of the select field..? Example: In the select field I have four options.. - ...
0
votes
0answers
59 views

Foreach Columns & Pagination

I am using the plugin "Categories Images" and using a foreach statement that I am trying to adapt for display of 11 items in three rows for a yearly magazine archive. The 11 items are custom category ...
2
votes
1answer
65 views

Listing all capabilities in dropdown is returning boolean

Trying to put a list of all possible caps in a dropdown. I can only get it to return 1s (boolean true). If I use var_dump($user->allcaps); it does produce the actual cap names, but when I plug this ...
0
votes
0answers
42 views

Pagination on Custom Gallery Template : get_children() and foreach loop [duplicate]

With the help of this WordPress.org Support Thread, I made a Page Template for a custom designed photo gallery of 4 columns with the following codes in a TwentyThirteen theme: <?php /* Template ...
2
votes
1answer
224 views

Endless loop with wp_insert_post and wp_update_post

I have an array $unqiues which contains URL's, I loop over the array with the code below to get the URL titles, insert a new post, update the post meta. Then I change the the posts title and name to ...
1
vote
0answers
198 views

Set default value for radio button in WP Alchemy custom meta box?

I'm using the WP Alchemy Metabox PHP class (www.farinspace.com/wpalchemy-metabox/) to add a custom meta box with a radio select to a custom post type. The code below shows the code I'm using for the ...
0
votes
1answer
28 views

If no author posts, echo out some text

I have this piece of code to show the author posts of the author of the current post, but I want to make an if statement, if no posts then echo out some text. I have now this but it do not work (above ...
0
votes
1answer
43 views

Display only the latest post

There seems to be something wrong with the logic of what I'm doing. I just want to display the latest post in a custom term. But instead I'm displaying every post for that term, even though I am ...
0
votes
1answer
63 views

Show message if statement is false - foreach

I got this PHP script from http://tutorialzine.com/2010/02/php-mysql-download-counter/ and integrate it to my wordpress successfully. It works but the "No Download File" message appears even the value ...
0
votes
1answer
275 views

Display post thumbnail in foreach loop

I am trying to display a thumbnail in a foreach loop. The thumbnail is a new image size I have added called "plant-thumb". I have all the desired elements displaying properly except for the thumbnail. ...
0
votes
1answer
72 views

Getting “Invalid argument supplied for foreach()” Warning

I am on the last step in a tutorial that I followed here , called "Using the data". I tried using// $album_repeatable = unserialize($post_meta_data['album_repeatable'][0]); echo '[ul ...
0
votes
1answer
290 views

Add number in increment of one to DIV ID

I'm using a shortcode to display a custom post type. The shortcode contains an attribute to display only posts of a specific category within the custom post type e.g. [faq category="travel"] For each ...
0
votes
1answer
64 views

How to remove certain words from url slug

Trying to create a SEO plugin, that will remove stop words from slugs. This is how to explode the $slug into a list, and explode the variable containing the stop words : add_filter ('sanitize ...
-1
votes
1answer
736 views

Eliminate duplicates in a foreach loop [closed]

I've created a filter for my search results that allows people to filter user searches based on their State from their profile. The problem I am having is that there are duplicate states showing in ...
0
votes
1answer
780 views

Custom widget using get_categories select menu dropdown

I have created a custom widget that is supposed to display a select menu with all the categories the blog has. I have used get_categories to compile the list. This works fine and all categories appear ...
0
votes
0answers
134 views

How to exclude child terms from tax query foreach loop

I have this query which is working fine but I can not get it to exclude child terms and include only parent terms. This is what I have so far -- <?php $custom_terms = get_terms('videoscategory'); ...
0
votes
1answer
107 views

Paginating a list of all posts collected by category titles

I'd be really grateful if anyone has any ideas about what might be wrong with this code or, alternatively, could suggest an entirely different way of achieving the same aims. I have a site (staged, ...
0
votes
1answer
562 views

Pagination for multiple queries merging into one Loop

I have an events site where I want to display upcoming events that can be booked in ascending date order and then events that are closed for registration in descending order. I'm using get_posts for ...
0
votes
1answer
340 views

update_post_meta only updating on last loop of foreach

I'm building a way to upload multiple files for an announcement custom post type on the front end. My function here uploads any number of files succesfully so I can see them under "Media" in ...
1
vote
0answers
18 views

How to write an efficient metabox with repetitive fields [duplicate]

Possible Duplicate: Create more Meta Boxes as needed I’m having a hard time to write an efficient code for the below Metabox. Since I do not want to use any third-party class, I’m trying to ...
0
votes
1answer
519 views

How to get the next and previous image title from attachment or gallery?

I'm trying to build a slider exactly like this in wordpress. I have managed to make the slider work except the next/prev button. I need to get the next image title and the previous image title for the ...
0
votes
1answer
149 views

Insert new post for each user infinite loop error

I wrote this little function to automatically create a post for every user of the blog but it creates an infinite loop (I disabled it to stop it creating new posts). I'm not very skilled in php, I ...
0
votes
1answer
128 views

How to reduce three query to one in multiple output template?

I would like to publish 7 posts from the same category but embedded in different DIV or UL. How could I simplify this code? <?php $query01 = array( 'numberposts' => 1, 'offset'=> 0, ...
3
votes
2answers
701 views

Display data from a non wordpress database on a page template

I am using a sql query to access information to display on a wordpress page by adding the below code to a page template. I know the query works as I've tested it in phpmyadmin. $rows = ...
0
votes
1answer
259 views

foreach repeat html structure after every nth for attachment [closed]

I am trying to achieve result with below structure in foreach loop where after every two images it will repeat entire structure. I have some basic knowledge for something I can use eg. counter++; and ...