Advanced Taxonomy query, with 3 post types
to make this work all I did was add ‘terms’ => array(‘home’), to each term like this above ‘terms => ‘home’
to make this work all I did was add ‘terms’ => array(‘home’), to each term like this above ‘terms => ‘home’
get_post_meta no longer working
syntax error unexpected ‘}’ at 364 line
Add: $first_attachment = reset($attachments); $first_attachment_id = $first_attachment->ID; $first_attachment_title = $first_attachment->post_title; Below: $nbImg = count($attachments); Now you are able to return the link with: echo wp_get_attachment_link( $first_attachment_id, ” , true, false, $first_attachment_title ); If you need a sort of custom link markup, you can have a look at the related functions: http://codex.wordpress.org/Function_Reference/wp_get_attachment_link Edit: There is no … Read more
If you want to put the custom fields inside the shortcode…you actually should put the custom fields inside the shortcode. Be sure that your fields content does not get echoed, according to ACFs resources you have to use get_field($field_name) within the loop. Try: <?php echo print_wp_cart_button_for_product(get_field(‘product_name’), get_field(‘product_price’)); ?>
Apparently this is a new WordPress bug (I’m using version 3.5.2). Just set wp_debug to false and it works perfectly again. Hopefully they’ll fix this soon. define(‘WP_DEBUG’, false);
You are offered to use: get_post_meta($post_id, $key, $single); instead of: get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,’Pageimage’); and then process this meta value.
I am not sure this a WordPress question. It is really more just bad PHP but since that is a filter, in the spirit of fostering good will… Your function is returning a variable-name function that doesn’t exist, and none of your operations are saved at all. You are processing the string but you aren’t … Read more
Clearly this is because the ID you are passing to get_category is wrong (false or 0). i don’t know how you configured the taxonomy add on but do a vaR_dump and double check what data the get_field function is returning, maybe it’s an array with a single value in it : get_category(array_pop(get_field(‘category_test’)));
I think all you need is this: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> if (get_field(‘channel’) == ‘Youtube’) { echo get_field(‘youtube_video_id’); } elseif (get_field(‘channel’) == ‘Vimeo’) { echo get_field(‘vimeo_video_id’); } elseif ( has_post_thumbnail()) { the_post_thumbnail(); } That should use a Youtube video, then a Vimeo video, then the thumbnail, … Read more