Articles of array

Only load certain artists on this page

I have a wordpress page which loads all the artists in two columns… here is what I believe to be the relevant bit of code <?php global $paged; if ( is_front_page() ) { $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; } else { $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; } query_posts(array( ‘post_type’ => ‘artists’, […]

How can you query posts by advance custom field when the value is a serialized array?

Bottom for resolution Im going crazy I think. I cannot figure this out for the life of me. I have an advanced custom field that is a select box. The select box has multiple values and allows for multi-selections. I made 1 post and multi-selected 3 values in this drop down. I now need to […]

Getting custom post types to properly display alphabetically

I’m trying to get the sub loop of custom post types to display in alphabetical order, but having no luck. I’ve tried applying ksort and asort to the $posts array, but it just reorders the ID display and isn’t doing it for the title. // alphabetical menu: // get all totems $args = array( […]

Getting Category Children

i have a problem understanding the get_terms function All i want is getting all the children of specific category so that it can be listed. But i don’t really know how the $args works. So with this get_terms(category, $args); I tried to use the child_of $args = array( ‘child_of’ => 0, ‘childless’ => false, ); […]

query_posts with meta_value

I have category ‘news’ http://localhost/foldername/news, for each ‘news’ posts I have custom field called ‘years’ and is set up as a Text Field. I have 2 values assigned n different posts ‘2013’ and ‘2014’. What I’m trying to do first to show only 2014 posts in ‘news’ category http://localhost/foldername/news and second to pass url parameter […]

Query using string from custom field as array value

Firstly, what I am trying to do is display posts from Category x on posts from Category y where text from a custom field on post from Cat y matches text from one of 2 custom fields on cat x. I am using Advanced Custom Fields and have a custom text field on each post […]

Can't add classes using jQuery from a JSON string with get_body_class()

In order to refresh the classes on the <body>element after an AJAX call, I am writing at the top of my AJAX response the following in JSON: $o[ ‘classes’ ] = get_body_class(‘project’); I can then see in the JSON response the following: “classes”:[“single”,”single-project” ,”postid-1793″,”logged-in”,”project”,”default”] What I am trying to do is to put all those […]

Related Posts Excluding Certain Categories

I’m using a related posts PHP WordPress query, but having trouble excluding categories. I’ve tried excluding via cat and category__not_in as well as both as and not as an array. What am I setting up incorrectly? <?php $orig_post = $post; global $post; $categories = get_the_category($post->ID); if ($categories) { $category_ids = array(); foreach($categories as $individual_category) $category_ids[] […]

Need to echo category id in multi-dimensional array

I have custom post types and categories created with the Types plugin. I have category images allowed/created with the Categories Images plugin. I have a loop that displays the posts of a category in <li>s. Each <li> has a background style property that needs to get the image assigned to that category. This is my […]

Adding option values as an array using a multi selectable select box

I have a plugin I’m developing. As part of its functionality I need to set up an option group and specify an option var for that group: function swcs_settings() { register_setting( ‘swcs-settings-group’, ‘swcs_postpage_id’ ); } add_action( ‘admin_init’, ‘swcs_settings’ ); Where swcs_postpage_idis the name of my variable. I am using this variable in a <select> box […]