I want to reorder stuff in a custom post. I got the meta box and editor working together, but currently the editor is above the meta box and I need it to be the other way around.   This is the code for my meta box:  // adding the meta boxes add_action("admin_init", "tl_admin_init"); function tl_admin_init(){   add_meta_box("testimonial_description-meta", __('Testimonial Description', 'sagive'), "testimonial_description", "testimonial", "normal", "core"); }   // getting, setting and displaying PROJECT DESCRIPTION meta box function testimonial_description() {     global $post; // this is a must!     $custom = get_post_custom($post-&gt;ID); // this is a must!     $testimonial_description = $custom["testimonial_description"][0];     ?&gt;     &lt;textarea name="testimonial_description" style="width: 98%; height: 10em; " /&gt;&lt;?php echo $testimonial_description; ?&gt;&lt;/textarea&gt;     &lt;label&gt;&lt;?php _e('Write a Simple 2 Line Description of your client testimonial without html for clean design.', 'sagive'); ?&gt;&lt;/label&gt;     &lt;?php }   I tried removing the editor and re-instating after this function but I guess that`s an over simplistic solution since it doesn't work.  I've removed the editor using this:  /* This will help me get rid of the editor */ function tl_remove_pages_editor(){     remove_post_type_support( 'testimonial', 'editor' ); }    add_action( 'init', 'tl_remove_pages_editor' );   Then added it again using add_post_type_supports.    Any suggestions anyone ?
121591
I have a custom meta box for a custom post type that my client wants placed between the title/permalink section and the post editor in the admin panel.  Is this possible and if so is there a hook/filter/etc that I would need to use?
52375
Here's what happened to me just now:   (It took me an embarrassingly long time looking for an edit option on my meta profile to get to this step though)  So, I realize that it makes sense that we don't have separate profile information for site Meta accounts. And it also makes sense that we do have separate settings options for Meta (there are meta-only tags, people might be less interested in the questions and not want to receive email updates, etc.) But, instead of having the functionality change based on which site you're on, perhaps we could just make it so that you can edit your main-site profile from Meta? Or maybe keep them different, but make it a smaller difference: after clicking the &quot;Edit profile and settings&quot; horizontal tab on Meta, the vertical tab that you start out on is &quot;Preferences&quot; rather than &quot;Edit Profile&quot; by default, and if you click on &quot;Edit Profile&quot; you're automatically taken back to the main site page for that.
55881
I want a description under the user name input field in the Wordpress registration form like in the next example. How can I do this?  //create an extra field in login page for invitation code add_action( 'register_form', 'add_invitation_code_field' );  function add_invitation_code_field() {    ?&gt;       &lt;p&gt;          &lt;label for="invitation_code"&gt;             Invitation code             &lt;input id="invitation_code" class="input" type="text" size="20" value="" name="invitation_code"/&gt;             &lt;span class="description"&gt;&lt;?php _e("Description text"); ?&gt;&lt;/span&gt;          &lt;/label&gt;       &lt;/p&gt;    &lt;?php }
103142
Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode itself:  if(has_shortcode(get_the_content(), 'gallery')){     $pattern = get_shortcode_regex();      preg_match("/$pattern/s", get_the_content(), $matches);     echo do_shortcode($matches[0]); }   But this doesn't work if the gallery short code isn't the first instance. Is there a way to split my content and gallery up completely?    Edit: I have a semi-solution but it seems like a long winded way to go about it. It first grabs the first shortcode in the post (which needs to be fixed since I only want the "Gallery" shortcode) then removes all shortcodes from the content (again, not really what I want to do.  &lt;?php if(has_shortcode(get_the_content(), 'gallery')) : ?&gt;     &lt;?php          $pattern = get_shortcode_regex();          preg_match("/$pattern/s", get_the_content(), $matches);     ?&gt;     &lt;div id="content"&gt;         &lt;?php echo strip_shortcodes(get_the_content()); ?&gt;     &lt;/div&gt;     &lt;div id="gallery"&gt;         &lt;?php echo do_shortcode($matches[0]); ?&gt;     &lt;/div&gt; &lt;?php endif; ?&gt;     Edit #2 - Ok, I've been able to only get gallery shortcodes in the post. I've also added a filter to remove the gallery shortcode form the_content() - the problem is that its not necessarily removing the shortcode since it does post it, but its not allowing me to run "do_shortcode()"  Functions.php  function remove_gallery($content) {     global $post;      if($post-&gt;post_type == 'artcpt')         remove_shortcode('gallery', $content);      return $content; } add_filter( 'the_content', 'remove_gallery', 6);    The Loop  &lt;?php preg_match('/\[gallery ids=[^\]]+\]/', get_the_content(), $matches); ?&gt; &lt;div id="content"&gt;     &lt;?php the_content(); ?&gt; &lt;/div&gt; &lt;div id="gallery"&gt;     &lt;?php echo do_shortcode($matches[0]); ?&gt; &lt;/div&gt;   in The Loop it will return my short code Twice (i'm on a single page, should be looped twice - so its not running do_shortcode()). Not sure why.
111653
That's a freaking bad practice I must say. Spent last two hours finding a solution to remove actions and filters added via Anonymous functions.    This is the code used on a Parent Theme, and I need to remove it.  /**  * Add custom columns to admin comments grid  *  * Rate that user set.  */ add_filter( 'manage_edit-comments_columns', function( $default ) {     $columns['smr_comment_rate']  = __( 'Rate', 'txtdmn' );      return array_slice( $default, 0, 3, true ) + $columns + array_slice( $default, 2, NULL, true ); });   Got , played with it heavily, but no help. So, is there any other alternative that will remove actions/filters added via anonymous functions?  Thanks
62694
When writing a long post, if you want to check the output as you go along, you have to keep scrolling down and then back up to see the preview of the output.  Which gets annoying after a post gets long enough.  I imagine on Math or other sites where there is a lot of rendered output this is an even bigger annoyance.  Is it possible to give the preview box a standard size, which could be elongated at the bottom, and able to be scrolled, just like the box I'm typing in right now?  That way, I could position my window so that the editing box and the preview box are both in full view at the position that I am currently working on.
111494
I want to add Metabox for the posts of category=18 and i am using the following code but unable to do so . So please help me out->   add_action('admin_init','my_meta_init');  function my_meta_init() {     $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;      // checks for post/page ID     if ($post_id-&gt;post_category[0] == 18)     {         add_meta_box('team_meta', 'My Custom Meta Box 1', 'team_meta_1', 'post', 'normal', 'high');       function team_meta_1(){     global $post;     // Noncename needed to verify where the data originated     echo '&lt;input type="hidden" name="eventmeta_noncename" id="eventmeta_noncename" value="' .      wp_create_nonce( plugin_basename(__FILE__) ) . '" /&gt;';      // Get the location data if its already been entered     $designation = get_post_meta($post-&gt;ID, '_designation', true);      // Echo out the field     // echo '&lt;input type="text" name="_description" value="' . $description  . '" /&gt;';     echo '&lt;textarea name=_designation rows="6" cols="100"&gt;'.$designation.'&lt;/textarea&gt;';      }      function my_meta_save($post_id, $post) {      // verify this came from the our screen and with proper authorization,     // because save_post can be triggered at other times     if ( !wp_verify_nonce( $_POST['eventmeta_noncename'], plugin_basename(__FILE__) )) {     return $post-&gt;ID;     }      // Is the user allowed to edit the post or page?     if ( !current_user_can( 'edit_post', $post-&gt;ID ))         return $post-&gt;ID;      // OK, we're authenticated: we need to find and save the data     // We'll put it into an array to make it easier to loop though.      $events_meta['_designation'] = $_POST['_designation'];       // Add values of $events_meta as custom fields      foreach ($events_meta as $key =&gt; $value) { // Cycle through the $events_meta array!         if( $post-&gt;post_type == 'revision' ) return; // Don't store custom data twice         $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)         if(get_post_meta($post-&gt;ID, $key, FALSE)) { // If the custom field already has a value             update_post_meta($post-&gt;ID, $key, $value);         } else { // If the custom field doesn't have a value             add_post_meta($post-&gt;ID, $key, $value);         }         if(!$value) delete_post_meta($post-&gt;ID, $key); // Delete if blank     }  }   add_action('save_post','my_meta_save'); }   }
1690
I have been using this site alot for solving my problems, but this time I did not succeed in finding and answer for my problem.  I get and infinite loop when using wp_update_post inside a function that is called on save_post. I know that this is a common issue, but I can't figure out how to avoid it.  I want to save the order of my posts (which is of the post-type 'section'). So I have made a custom meta box which contain some sortable html-elements. In each element there is an hidden input tag with name='sectionorder[]'. So when I click the standard WordPress 'Update' buttom, an array containing all the ID's of the posts (in order) are send via POST. So here is the code where I retrieve the array, and wants to save the order:      // Update section sort order $sectionorder = $_POST['sectionorder']; if (isset($sectionorder)) { // Avoid error if there is no sections added yet     foreach( $sectionorder as $no =&gt; $sectionID ) {         $post_update = array();         $post_update['ID'] = $sectionID;         $post_update['menu_order'] = $no;         wp_update_post( $post_update );     } }   But the problem is that it starts an infinite loop. How do I avoid that? Maybe I can do it in a completely different way?  Appriciate your help!
55524
So I finally got my invitation (yay! It's awesome! Thanks!) and I'd like this first feature request to be typed from here.   I propose the ability to change the "favorite" sites, and also include meta sites in there.   Right now, I presume it's reading the list of sites ordered by reputation.  I propose the following:    If I am a moderator on any site, those sites and their metas should come first. After that, ordered by reputation.  The above is only the default order, and can be altered freely by the user.
72757
Which file (or files, if more than one) do I need to edit to re-arrange the Product Page?  I want to make some basic layout changes to the default Woocommerce product page. Specifically, I want to put the Order stuff just below the Price, and push the description down.  In other words, swap the Short Description with the Order Stuff (Attributes, Add to Cart, SKU, etc.)  Here is a screenshot of what I want to do:
1321
I edit a lot of posts every day. I often run across posts with 'Hi' and 'Thanks' on the top and the bottom of the post respectively. I also run across things like:     --User   Should these items be removed during the editing of the post by an editor?
64217
I have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an "Upload" button that points to the WordPress media uploader and sets the url of the selected uploaded file to the text field that caused that associates the upload button.  I am not looking for code on creating the actual meta tag option, but for a way to actually add a Wordpress media upload button properly.
9736
I've posted a lot to StackOverflow, and I've noticed something kind of irritating with the formatting in writing questions and comments. If I need to put something inside a &lt; and a >, without spaces in the middle (like right there), it will think it's code and not show up, like this   (obviously it won't come up what I wrote there, or else this wouldn't be an issue, but if you open up the question to edit you can see what's written there.)  If I want it to show up, right now I have to add an extra set of brackets inside of the originals with a junk variable, like right &lt;here> (again, open in edit window to see).  This is really annoying when trying to show variables like lists that require those brackets, and I feel like the junk variables could confuse people looking at the edits. Is there a way to get around this formatting? Thanks!
80030
I'm working on a project in which I'm creating a custom post type and custom data entered via meta boxes associated with my custom post type. For whatever reason I decided to code the meta boxes in such a way that the inputs in each metabox are part of an array. For instance, I'm storing longitude and latitude:  &lt;p&gt;      &lt;label for="latitude"&gt;Latitude:&lt;/label&gt;&lt;br /&gt;      &lt;input type="text" id="latitude" name="coordinates[latitude]" class="full-width" value="" /&gt;  &lt;/p&gt;  &lt;p&gt;          &lt;label for="longitude"&gt;Longitude:&lt;/label&gt;&lt;br /&gt;      &lt;input type="text" id="longitude" name="coordinates[longitude]" class="full-width" value="" /&gt;  &lt;/p&gt;   For whatever reason, I liked the idea of having a singular postmeta entry for each metabox. On the save_post hook, I save the data like so:  update_post_meta($post_id, '_coordinates', $_POST['coordinates']);   I did this because I have three metaboxes and I like just having 3 postmeta values for each post; however, I've now realized a potential issue with this. I may want to use WP_Query to only pull out certain posts based these meta values. For instance, I may want to get all posts that have latitude values above 50. If I had this data in the database individually, perhaps using the key latitude, I would do something like:  $args = array(     'post_type' =&gt; 'my-post-type',     'meta_query' =&gt; array(         array(             'key' =&gt; 'latitude',             'value' =&gt; '50',             'compare' =&gt; '&gt;'         )     )  ); $query = new WP_Query( $args );   Since I have the latitude as part of the _coordinates postmeta, this would not work.  So, my question is, is there a way to utilize meta_query to query a serialized array like I have in this scenario?
88018
I manage a wordpress site and have created a template part that I usually paste below the content.      &lt;div class="posts-group"&gt;          &lt;h2&gt;Featured store products&lt;/h2&gt;          &lt;?php $catquery = new WP_Query( 'post_type=product&amp;posts_per_page=4&amp;orderby=rand' );         while($catquery-&gt;have_posts()) : $catquery-&gt;the_post();         ?&gt;         &lt;a href="&lt;?php echo get_post_meta($post-&gt;ID,'PRODUCT-url', true);?&gt;"&gt;             &lt;article class="post home-post homeproduct"&gt;                     &lt;div class="post-thumbnail-img"&gt;                         &lt;?php the_post_thumbnail('small-thumbnail'); ?&gt;                     &lt;/div&gt;                     &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;                                   &lt;p&gt;&lt;/p&gt;             &lt;/article&gt;         &lt;/a&gt;          &lt;?php endwhile; ?&gt;  &lt;/div&gt;   Now I'm trying to put this IN BETWEEN the content, so I thought of using a shortcode  function get_products($atts) { get_template_part('block-products-inline'); } add_shortcode('products', 'get_products');   Now every time I post [products], I expect the products to go there. However when I try the code above, the products template_part goes all the way to the top of the page, right underneath the title and right before the actual content.  But when I edit the shortcode to simply return some text, then the text DOES appear in the middle of the content.  Does anyone understand what's going on? Because I don't..
78286
I got a loop from internet (I forgot the site) for two column post view. It has a nice CSS for it too. But skipping that for the question now.  &lt;?php $counter = 1; ?&gt;                  &lt;?php query_posts( 'cat=3&amp;showposts=6' ); //Find whether the catID is 3 ?&gt;             &lt;?php while ( have_posts() ) : the_post() ?&gt;                   &lt;?php /* Two Column Support get class */ ?&gt;              &lt;?php $class = ( $counter % 2  ? ' one' : '' ) ?&gt;                  &lt;?php /* Two Column output open the div class */ ?&gt;              &lt;div class="column&lt;?php echo $class;// echo $first; ?&gt;"&gt;              &lt;?php news_format(); ?&gt;             &lt;/div&gt; &lt;!-- End Two Column Support close div class --&gt; &lt;?php $counter++; //Update counter ?&gt;   It printed my posts into 2 columns like:  ========= | 1 | 2 | --------- | 3 | 4 | --------- | 5 | 6 | =========  It's fine. But I want to print it like this:  ========= |   1   | --------- | 2 | 3 | --------- | 4 | 5 | --------- | 6 | 7 | =========  What the modification I need to do? I can't pass any custom limit into the WordPress' custom loop &lt;?php while ( have_posts() ) : the_post() ?&gt;. It's for a custom theme. I did it, but the problem is, it's showing like:  ========= |   1   | --------- | 1 | 2 | --------- | 3 | 4 | --------- | 5 | 6 | =========   is my whole bunch of code.
79091
In the Admin area when you edit a post, I'd like to add a custom item to the Publish panel in the top right corner.  Is it possible to access this through the Wordpress API? If so, what functions do I need to look at? Any examples would be much appreciated.