The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
475 views

Shortcode, Concatenating & Parse error: syntax error, unexpected T_FOREACH

I'm learning how to write a shortcode. I'm getting this error: Parse error: syntax error, unexpected T_FOREACH . I'm having problems with concatenating it properly. <?php /* Plugin Name: My ...
1
vote
2answers
534 views

Make Selected Mutiselect Items “selected”

I'm developing a theme settings panel for a new wordpress theme that have an option to exclude categories from being shown in the loop. I managed to get the main functionality to work, using a ...
1
vote
2answers
4k views

In a foreach loop, how do I target the last item in the loop?

I have the following code to do a foreach loop, I want to target the last item in the loop (e.g if it's looped over 3 events I want to target the 3rd event) to do something slightly different with the ...
1
vote
1answer
1k views

Limit get_pages to only show 5 items

How can I limit the get_pages to only show 5 items? I thought adding 'number' => 5 to the array would limit it to 5 but it doesn't show anything. Here's my code: <?php $pages = ...
0
votes
1answer
653 views

Wordpress: paginating array using a foreach

I currently grab an array of user data from a query. I then use a foreach to loop through them and apply styles and divs to output them to the page. This all works great but i would like to paginate ...
1
vote
2answers
2k views

mysql query two database tables, users and usermeta and sort by custom meta int value

I am trying to get an array of site users sorted by a custom meta value (an int). I can query the users just fine and get them back to use in a foreach. I currently have the query results come back ...
0
votes
2answers
1k views

WordPress MS wp-admin/includes/post.php error with shortcode generator

I'm having a serious issue with Wordpress 3.1 with Multi Site enabled and my themes custom shortcode generator. For some reason, I'm getting the following error whenever I create a new ...
2
votes
3answers
1k views

Using a loop to display terms associated with a post

I'm using a custom post type and custom taxonomies, and using the following to display the terms of the taxonomies on the post page: the_terms( $post->ID, 'taxname', 'beforetext', ', '); Is ...
0
votes
3answers
106 views

How can this crude function be improved?

In the first function below, inside the foreach, I'm calling out to the 2nd function in order to test for the occurence of matching category ids that I want to remove from the category listing. ...