An array (in PHP) is actually an ordered map. A map is a type that associates values to keys. This type is optimized for several different uses; it can be treated as an array, list (vector), hash table (an implementation of a map), dictionary, collection, stack, queue, and probably more. As array ...

learn more… | top users | synonyms

0
votes
1answer
85 views

Shortcodes and a list of IDs?

I'm creating a simple shortcode function and need to specify a list of IDs as a variable. I've checked the Codex but I'm not sure how this is handled. The shortcode is: [video_vote ...
0
votes
1answer
77 views

posting twice from an array?

I dynamically create iterations of a form field with jquery, but they all carry the name extrakosten[] for the first variable and the other variable vergoeding[]. The php: $postTitle = ''; // save ...
0
votes
1answer
53 views

Adding Category Argument into an Array for WordPress Query

I'm new to customizing WordPress and am looking to query an array of posts within a certain category. I have a display that's showing an array of all posts from the site: $arguments = array( ...
1
vote
2answers
1k views

shortcode to create dynamic dropdown box form shortcode attributes

I am trying to make a shortcode that will create a dynamic dropdown list of downloadable file links, that once selected, html will show a download link below the dropdown. Here is the end result of ...
0
votes
1answer
215 views

Insert dynamic content into posts

I'm currently using this plugin http://wordpress.org/extend/plugins/automatic-featured-image-posts/ which creates batches of posts from uploaded images I'm also using this code here to generate the ...
0
votes
2answers
190 views

create functions based on array values

I am working on a function set that will add a piece to each custom post type on a site. Since I won't know what CPTs are registered, I wrote a function to get them all (simple). However, I now need ...
2
votes
1answer
917 views

Problem with wp_update_post

I'm trying to write a plugin that creates a page if a box is checked (value 1) and if the post id doesn't already exist. If the post id does already exist, then I want to update the post with whatever ...
-1
votes
1answer
105 views

Use php array outside his function

any ideas why my function print_r $arr with lot of elements, but only retain cat and dog when it comes to print_r $stack? I need to have $arr used outside the function, function ...
1
vote
1answer
204 views

Save an array from drop-down in custom meta box

I have successfully pulled a custom post type through into a drop-down that is in a custom meta box. However, when displaying it on the front end I would like to also provide a link to the actual ...
1
vote
2answers
397 views

Limit the post for differents custom post type in the same wp_query

I have three custom post type: books magazine videos Now i want to limit the number of post for custom post type, for example: books => 3 post magazine => 2 post videos => 1 post I used a ...
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
88 views

Ways of dealing with nested arrays within option

I stumbled upon one problem regarding too complicated(at least in my point of view) data structures stored in option field. Right now I have an array of collections and within each other there is ...
-1
votes
1answer
58 views

Marketpress php warning on server, no problem on localhost [closed]

I have this in my functions.php that creates a shopping cart widget with the plugin Marketpress. <?php function marketpress_get_cart_subtotal($format_currency=true) { global $mp; ...
0
votes
1answer
262 views

Using multiple variables to assign categories to an array

I have php set up in a template file to check a form and see if 1 or more of 5 categories is selected. Based on which one is selected, I want the custom query I'm using to change in that the array for ...
1
vote
1answer
84 views

How do I get link URLs from the Wordpress links backend into an array?

I'm currently running a blogroll on a site I'm working on by defining a variable with an array that has all the rss feed urls I want to pull from. Like this for example: <?php // Get RSS Feed(s) ...
0
votes
1answer
122 views

Retrieve post thumbnail as array

How can I retrieve the post thumbnail (featured image) as an array? Using get_post_thumbnail() I noticed in the WP documentation that there is a third parameter from, which I understand, one would be ...
2
votes
1answer
3k views

Fetch array with $wpdb

I am trying to convert this code to use the $wpdb. $data = array(); $query = "SELECT * FROM videos"; $query_exec = mysql_query($query) or die(); while($row = mysql_fetch_array($query_exec)) { ...
2
votes
1answer
118 views

How to use bloginfo( 'template_directory' ) in array

I want to pass bloginfo( 'template_directory' ) in an array I tried this but not working. How to write it correctly? <?php get_the_image( array( 'size' => 'full', ...
0
votes
1answer
72 views

Iteratively add sub shortcodes to php array

I have this shortcode structure: [component] [type1]some content[/type1] [type2]some more content[/type2] ... [typeN]some other content[/typeN] [/component] I would like to have the ...
0
votes
1answer
96 views

Exclude posts based on an array

I'm using a custom meta box to output a list of post IDs within a particular post type ("Publications" in this example). Is there a way I can output this array into a custom loop to only show posts ...
2
votes
1answer
250 views

WP doesn't show Array Custom Fields?

I'm wondering why WordPress doesn't list PHP array() and any serialized data in Custom Fields in Admin Panel (for Pages, Posts etc.)? Only Custom Fields containing strings and numbers show up and can ...
0
votes
1answer
260 views

Run a check for multiple meta key values

I am having a heck of a time getting wordpress to display all values of a certain meta key correctly. I wonder if I am going about this the wrong way? My end goal is to run a check to see if there ...
0
votes
1answer
358 views

Custom field to array?

I have a posts query that queries posts by ID but want to select those posts by enetering a custom field. Here is the query and where I want to put the custom field: $query_args = ...
1
vote
0answers
17 views

Change Widgets Order In Plugin - Get Array Of Sidebar Widgets [duplicate]

Possible Duplicate: Programmatically add widgets to sidebars i create front-site drag and drop layout manager. I need to change widget order, when user drag widget A over widget B, but how ...
0
votes
1answer
116 views

Add formatting to Array

This displays authors by date of their latest post. I'd like to: add formatting around each author list additional properties (avatar, latest post title and excerpt) <-- I have the bits for this, ...
2
votes
1answer
3k views

Can I query custom meta data through WP_Query

Ok, my question is a bit complex so I will try and give a general explanation and then go into details afterward. I am running WordPress 3.4.2 and I am using WCK Post Type Creator and WCK Custom ...
0
votes
3answers
251 views

Adding custom field to an array

How can I add a custom field to an array? To complicate matters, custom field is on the Author's page, not on a regular post. It's added via Advanced Custom Fields. Typically, that field value would ...
0
votes
1answer
1k views

meta_query with array as value

I am writing some PHP which allows users of my site to submit a form and query posts by their post_meta. Everything works fine except for one thing, I used Advanced Custom Fields to create the ...
0
votes
1answer
374 views

Meta query: get posts with value in a multidimensional array

I have a custom post type, Album, which has a custom field called 'tracklist'. Tracklist is a multidimensional array which contains a track title and track link, like so: $tracklist = array( [0] ...
1
vote
1answer
112 views

Custom order for Mysql array

I have a Page of Posts, each post has a Custom Field "expired" which contains a date in the format YYYY-MM-DD which is used to order the posts. This date is used for a script that tells the visitor if ...
0
votes
1answer
48 views

How do I get a array, with the right order of the nested comments?

array (size=10) 'comment 0' => array (size=2) 'comment_id' => string '22' (length=2) 'parent_of' => string '0' (length=1) 'comment 1' => array (size=2) 'comment_id' => ...
1
vote
4answers
370 views

Updating wp_options with an array on save_post results in duplicated entries

I'm not entirely sure this is Wordpress' fault, but I figure I'd ask anyway and see if anyone else has experienced any problems like this before. I'm trying to save an array to a wp_options table ...
2
votes
2answers
314 views

wp_nav_menu show 1 item only

I was reading Wordpress documentation and also trying to find some clear example of how to do this but I couldn't, sorry if this is posted elsewhere but I did my best trying to find an answer before ...
0
votes
1answer
172 views

Custom Post Types — $args vs. labels array

I registered a new post type, and I was wondering what the difference was between the $args and labels array. Read more about it in the codex (can't have more than two links, sorry). For example, ...
0
votes
2answers
381 views

settings api store multiple array

If I am not mistaken, the settings api only storing one single data array in wp_options table. You can only change the field data in the array. What if I want to add multiple array in the same table ...
0
votes
2answers
88 views

Saving array keep adding length of array

I'm using wp all import to load in datafeeds but when i set a custom field (thats needed for the theme) it keeps modding it before it stores it when I put this in the field : a:7:{test} it saves it ...
0
votes
1answer
946 views

Removing duplicate values between two wordpress queries

I'm addressing a well known issue in Wordpress, in which I want to display "featured" posts, and under it the rest of the posts. I have a $query1 which holds 2 featured posts, and my query_posts which ...
0
votes
3answers
6k views

Printing out JSON array returned [closed]

I have the following JSON array: [{"occurences":"1","post_title":"Test 1","ID":"16"}, {"occurences":"1","post_title":"Test 2","ID":"19"}, ...
0
votes
1answer
1k views

how to store wordpress loop in array?

I am working on a site. This site has a built in layout organize that uses a switch statement to organize data on a page. I want to use that to organize the homepage posts. Right now, there are 4 ...
0
votes
1answer
98 views

Showing all post from all post type in admin backstage

I try to create an admin page where to display all posts from all custom post type. It is something like in edit.php, but instead of displaying single post type,I would like to display all posts in ...
0
votes
1answer
112 views

meta_query returning excluded result

I have a series of day slots per location, in a multicheckbox custom field. I have a search page where the user can select location, weekday desired, and activity type. Right now I just have 2 ...
-1
votes
1answer
379 views

SQL query add only posts with custom field to array

I have this SQL query which is building an array of wordpress posts... $query = "select $wpdb->posts.* from $wpdb->posts,$wpdb->terms,$wpdb->term_taxonomy,$wpdb->term_relationships ...
0
votes
1answer
143 views

How to use array in function to get only value I want

I am trying to work this function in wordpress theme the way where I can get value only what I want and not all to gather. I am not much familiar with using array in function so I need you expert help ...
0
votes
1answer
364 views

array_pop() expects array, boolean given for $event_type_term ->slug

I have the following function I wrote … add_filter('post_type_link', 'events_permalink_structure', 10, 4); function events_permalink_structure($post_link, $post, $leavename, $sample) { if ( ...
-2
votes
1answer
86 views

how to separate array with commas? [closed]

Let's say that i have this array: Array ( [0] => 13 [1] => 7 ) And this array is for example "print by <?php print_r($_categories); ?> but now, how to make a array implode to this format: ...
1
vote
0answers
86 views

Using shortcode to display array in array

I am using a widget, U more recent posts. Seems to work with custom taxonomies when you input the correct data into it in a widget form, but the suggested shortcode doesn't work (and I am trying to ...
2
votes
3answers
2k views

Add post title as alt tag for featured image

How do I add post title as alt tag in a post? I tried using array(title => '.the_title.') but it didnt work. I think I am not suppose to use the_title. I tired using get_the_title as well. Thanks
0
votes
1answer
213 views

Show array of meta_value in Edit Post Coloum

what I'm trying to do is add a new coloumn to Edit post page (done) and in that coloumn show data taken from a set of custom fields (partially done). This is my code (I use it as a plugin so it ...
0
votes
2answers
288 views

WP Query Returning All Posts

I have a custom WP query that is returning every post, instead of just the ones being specified by the query. I can't seem to find anything wrong with the code, so I must be missing something: ...
0
votes
1answer
43 views

WordPress Query Returning Every Post

I have a custom WP query that searches a single custom field, using an array. The custom field is for the country of origin of a post. The array I'm using are the names of the various countries in a ...