Tag Info

New answers tagged

1

You're getting Array because that's exactly what wp_get_post_tags returns; an array (and when you try and echo one in PHP it'll simply output Array). As @Chip Bennet suggested, use the_tags() instead, which outputs an HTML string.


1

If I follow you correctly you want an array of arrays. $get_ref = $_SERVER['HTTP_REFERER']; $ref = get_post_meta($post->ID, 'page_ref', true ); $ref[] = array($get_ref); //or $ref[][] = 'xyz' ...if you prefer update_post_meta($post->ID,'page_ref', $ref);


1

WP_Query itself can't do that logic internally but you can easily create the query dynamically. $args = array( 'meta_key' => 'name', 'orderby' => 'meta_value', 'order' => 'ASC', 'posts_per_page' => '-1' ); if ($post->ID == 1) { $args['category_name'] = 'first'; } elseif ($post->ID == 2) { $args['category_name'] = 'second'; ...


0

I suspect this is mostly happening because down towards the bottom, you've got an input that's not using $this->get_field_name() (the first of the two checkbox inputs). Try using $this->get_field_name() as you did in the "then" clause of that section of code and it should be OK. Not much else wrong that I can see.



Top 50 recent answers are included