WooCommerce Order Status Displays Twice on Order Page

I modified the woocommerce_custom_order_columns function to make some changes to the WooCommerce Admin Order page. Everything works great, except that Order Status shows up twice (but only for the latest (top) order). I've attached an image and the code that could be causing this. I have no idea what would make this happen. ![enter image description here](http://i.stack.imgur.com/H6heO.png) My Code:               add_action('manage_shop_order_posts_custom_column', 'match_order_woocommerce_custom_order_columns', 2);          function match_order_woocommerce_custom_order_columns( $column ) {          remove_action('manage_shop_order_posts_custom_column', 'woocommerce_custom_order_columns', 2);          global $post, $woocommerce;     $order = new WC_Order( $post->ID );          switch ($column) {         case "order_status" :                  printf( '%s', sanitize_title($order->status), __($order->status, 'woocommerce') );              break;         case "order_title" :                  if ($order->user_id) $user_info = get_userdata($order->user_id);                  if (isset($user_info) && $user_info) :                      $user = 'ID ) . '">';                      if ($user_info->first_name || $user_info->last_name) $user .= $user_info->first_name.' '.$user_info->last_name;                 else $user .= esc_html( $user_info->display_name );                      $user .= '';                  else :                 $user = __('Guest', 'woocommerce');             endif;                  echo 'ID.'&action=edit').'">'.sprintf( __('Order %s', 'woocommerce'), $order->get_order_number() ).' ' . __('made by', 'woocommerce') . ' ' . $user;                  if ($order->billing_email) :                 echo ''.__('Email:', 'woocommerce') . ' ' . 'billing_email ).'">'.esc_html( $order->billing_email ).'';             endif;             if ($order->billing_phone) :                 echo ''.__('Tel:', 'woocommerce') . ' ' . esc_html( $order->billing_phone ) . '';             endif;              break;         case "billing_address" :             if ($order->get_formatted_billing_address()) :                      echo 'get_billing_address() ).'&z=16' ) . '">'. preg_replace('#
#i', ', ', $order->get_formatted_billing_address()) .'';             else :                 echo '–';             endif;                  if ($order->payment_method_title) :                 echo '' . __('Via', 'woocommerce') . ' ' . esc_html( $order->payment_method_title ) . '';             endif;              break;         case "shipping_address" :             if ($order->get_formatted_shipping_address()) :                      echo 'get_shipping_address() ).'&z=16' ) .'">'. preg_replace('#
#i', ', ', $order->get_formatted_shipping_address()) .'';             else :                 echo '–';             endif;                  if ($order->shipping_method_title) :                 echo '' . __('Via', 'woocommerce') . ' ' . esc_html( $order->shipping_method_title ) . '';             endif;         break;         case "total_cost" :             echo $order->get_formatted_order_total();         break;         case "order_date" :                  if ( '0000-00-00 00:00:00' == $post->post_date ) :                 $t_time = $h_time = __( 'Unpublished', 'woocommerce' );             else :                 $t_time = get_the_time( __( 'Y/m/d g:i:s A', 'woocommerce' ), $post );                      $gmt_time = strtotime($post->post_date_gmt);                 $time_diff = current_time('timestamp', 1) - $gmt_time;                      if ( $time_diff > 0 && $time_diff < 24*60*60 )                     $h_time = sprintf( __( '%s ago', 'woocommerce' ), human_time_diff( $gmt_time, current_time('timestamp', 1) ) );                 else                     $h_time = get_the_time( __( 'Y/m/d', 'woocommerce' ), $post );             endif;                  echo '' . apply_filters( 'post_date_column_time', $h_time, $post ) . '';              break;         case "order_actions" :                  ?>
                 <?php                     do_action( 'woocommerce_admin_order_actions_start', $order );                          $actions = array();                          if ( in_array( $order->status, array( 'pending', 'on-hold' ) ) )                         $actions[] = array(                             'url'       => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-processing&order_id=' . $post->ID ), 'woocommerce-mark-order-processing' ),                             'name'      => __( 'Processing', 'woocommerce' ),                             'action'    => "processing"                         );                          if ( in_array( $order->status, array( 'pending', 'on-hold', 'processing' ) ) )                         $actions[] = array(                             'url'       => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-complete&order_id=' . $post->ID ), 'woocommerce-mark-order-complete' ),                             'name'      => __( 'Complete', 'woocommerce' ),                             'action'    => "complete"                         );                          $actions[] = array(                             'url'       => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),                             'name'      => __( 'View', 'woocommerce' ),                             'action'    => "view"                         );                          $actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $order );                          foreach ( $actions as $action )                         printf( '', $action['url'], $action['name'], $woocommerce->plugin_url() . '/assets/images/icons/' . $action['action'] . '.png', $action['name'] );                          do_action( 'woocommerce_admin_order_actions_end', $order );                 ?>
<?php              break;         case "note" :             if ( get_post_meta( $post->ID , 'match_order' , TRUE) == 1 ) {                 echo '';             }             else if ($order->customer_note) {                 echo 'plugin_url().'/assets/images/note.png" alt="yes" class="tips" data-tip="'. __('Yes', 'woocommerce') .'" width="14" height="14" />';             }             else {                 echo 'plugin_url().'/assets/images/note-off.png" alt="no" class="tips" data-tip="'. __('No', 'woocommerce') .'" width="14" height="14" />';             }         break;         case "order_comments" :                  echo '
                 ID.'&action=edit') .'" class="post-com-count">'. $post->comment_count .'
';         break;     }     }      The WooCommerce Code:               function woocommerce_custom_order_columns( $column ) {          global $post, $woocommerce;     $order = new WC_Order( $post->ID );          switch ($column) {         case "order_status" :                  printf( '%s', sanitize_title($order->status), __($order->status, 'woocommerce') );              break;         case "order_title" :                  if ($order->user_id) $user_info = get_userdata($order->user_id);                  if (isset($user_info) && $user_info) :                      $user = 'ID ) . '">';                      if ($user_info->first_name || $user_info->last_name) $user .= $user_info->first_name.' '.$user_info->last_name;                 else $user .= esc_html( $user_info->display_name );                      $user .= '';                  else :                 $user = __('Guest', 'woocommerce');             endif;                  echo 'ID.'&action=edit').'">'.sprintf( __('Order %s', 'woocommerce'), $order->get_order_number() ).' ' . __('made by', 'woocommerce') . ' ' . $user;                  if ($order->billing_email) :                 echo ''.__('Email:', 'woocommerce') . ' ' . 'billing_email ).'">'.esc_html( $order->billing_email ).'';             endif;             if ($order->billing_phone) :                 echo ''.__('Tel:', 'woocommerce') . ' ' . esc_html( $order->billing_phone ) . '';             endif;              break;         case "billing_address" :             if ($order->get_formatted_billing_address()) :                      echo 'get_billing_address() ).'&z=16' ) . '">'. preg_replace('#
#i', ', ', $order->get_formatted_billing_address()) .'';             else :                 echo '–';             endif;                  if ($order->payment_method_title) :                 echo '' . __('Via', 'woocommerce') . ' ' . esc_html( $order->payment_method_title ) . '';             endif;              break;         case "shipping_address" :             if ($order->get_formatted_shipping_address()) :                      echo 'get_shipping_address() ).'&z=16' ) .'">'. preg_replace('#
#i', ', ', $order->get_formatted_shipping_address()) .'';             else :                 echo '–';             endif;                  if ($order->shipping_method_title) :                 echo '' . __('Via', 'woocommerce') . ' ' . esc_html( $order->shipping_method_title ) . '';             endif;         break;         case "total_cost" :             echo $order->get_formatted_order_total();         break;         case "order_date" :                  if ( '0000-00-00 00:00:00' == $post->post_date ) :                 $t_time = $h_time = __( 'Unpublished', 'woocommerce' );             else :                 $t_time = get_the_time( __( 'Y/m/d g:i:s A', 'woocommerce' ), $post );                      $gmt_time = strtotime($post->post_date_gmt);                 $time_diff = current_time('timestamp', 1) - $gmt_time;                      if ( $time_diff > 0 && $time_diff < 24*60*60 )                     $h_time = sprintf( __( '%s ago', 'woocommerce' ), human_time_diff( $gmt_time, current_time('timestamp', 1) ) );                 else                     $h_time = get_the_time( __( 'Y/m/d', 'woocommerce' ), $post );             endif;                  echo '' . apply_filters( 'post_date_column_time', $h_time, $post ) . '';              break;         case "order_actions" :                  ?>
                 <?php                     do_action( 'woocommerce_admin_order_actions_start', $order );                          $actions = array();                          if ( in_array( $order->status, array( 'pending', 'on-hold' ) ) )                         $actions[] = array(                             'url'       => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-processing&order_id=' . $post->ID ), 'woocommerce-mark-order-processing' ),                             'name'      => __( 'Processing', 'woocommerce' ),                             'action'    => "processing"                         );                          if ( in_array( $order->status, array( 'pending', 'on-hold', 'processing' ) ) )                         $actions[] = array(                             'url'       => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce-mark-order-complete&order_id=' . $post->ID ), 'woocommerce-mark-order-complete' ),                             'name'      => __( 'Complete', 'woocommerce' ),                             'action'    => "complete"                         );                          $actions[] = array(                             'url'       => admin_url( 'post.php?post=' . $post->ID . '&action=edit' ),                             'name'      => __( 'View', 'woocommerce' ),                             'action'    => "view"                         );                          $actions = apply_filters( 'woocommerce_admin_order_actions', $actions, $order );                          foreach ( $actions as $action )                         printf( '', $action['url'], $action['name'], $woocommerce->plugin_url() . '/assets/images/icons/' . $action['action'] . '.png', $action['name'] );                          do_action( 'woocommerce_admin_order_actions_end', $order );                 ?>
<?php              break;         case "note" :             if ($order->customer_note)                 echo 'plugin_url().'/assets/images/note.png" alt="yes" class="tips" data-tip="'. __('Yes', 'woocommerce') .'" width="14" height="14" />';             else                 echo 'plugin_url().'/assets/images/note-off.png" alt="no" class="tips" data-tip="'. __('No', 'woocommerce') .'" width="14" height="14" />';              break;         case "order_comments" :                  echo '
                 ID.'&action=edit') .'" class="post-com-count">'. $post->comment_count .'
';         break;     }     }          add_action('manage_shop_order_posts_custom_column', 'woocommerce_custom_order_columns', 2);      As you can see, the only thing I've done here is remove the default `woocommerce_custom_order_columns` function and replaced it with the `match_order_woocommerce_custom_order_columns` function. Everything else is the same.


Admin toolbar shows up when not logged in

I'm running into a Major trouble. Today I found out that when visiting a specific URL on my website, the admin toolbar shows up. Also for people who are not logged in. It appears that the visitor is logged in, but that's not true. All the links in the toolbar go to a 404 page. However, important information is being shown, like how many plugins need an update and even my login name. Is anyone familiar with this? Since it is a corporate website, I need a fix as soon as possible. (due to security reasons I won't post the exact url in public)


How can I implement jQuery plugin correctly with my CPT?

I've tried making an area for client testimonials on my site but I'm having troubles with the jQuery plugin Unslider, which I've implemented. Here is the live site. - The slider is located in the third section, under "HVA KUNDENE SIER". First I'll write up what I've done, and my actual problems is at the bottom of this question. So here's what I've done: I've created a custom post type for the testimonials where the markup is set up in accordance with the guidelines of the plugin:

                  <?php                 $args = array(                     'post_type' => 'referanse'                 );                 $referanser = new WP_Query( $args );                 if( $referanser->have_posts() ) {                     while( $referanser->have_posts() ) {                         $referanser->the_post();                         ?>

                                         <?php the_content(); ?>

- <?php the_title() ?>

                         <?php                     }                 }                 else {                     echo 'Oh ohm no referanser!';                 }             ?>

      I've included jQuery as well, and I copied the minified script into a js file which I called in my functions.php file:               function my_scripts() {     wp_enqueue_script( 'unslider', get_bloginfo('template_directory') . '/../canvas-flex/js/unslider.min.js', array('jquery') );     }     add_action('template_redirect', 'my_scripts');      Lastly I've added this script in my header.php file:                     Currently I have two main issues that I'm having trouble with: 1: Only the first slide displays, none of the next slides appear. 2: The navigation dots are displayed in the markup, but won't appear on the site. Appreciate any help given. If I'm missing some information, feel free to tell me and I'll add it as quickly as possible :)


Differentiate Featured Image from Post Images upon Upload

I want to differentiate the featured image from post images. The plan is to give the Featured Image multiple sizes, but the images inside / connected to the post only needs the default sizes. I know I can use `intermediate_image_sizes` to filter what Custom Post Types get assigned to what image sizes, like so:               /** Don't Make Extra Sizes **/     function post_type_sizes( $image_sizes ){         $post_type_size_array = array('icon', 'med-thumb', 'large', 'full');         $post_image_sizes = array('thumbnail', 'medium', 'large', 'full');              if( isset($_REQUEST['post_id']) && 'cpt_test' === get_post_type($_REQUEST['post_id']) )             return $post_type_size_array;         else             return $post_image_sizes;              return $image_sizes;     }     add_filter('intermediate_image_sizes', 'post_type_sizes', 999 );       But I want to only give the Featured Image multiple custom sizes, and leave any post that gets uploaded into the TinyMCE Default Sizes (thumbnail, medium, large, full).


Is there a way to upload an external folder in Wordpress?

I have a set of custom html pages that are not made with Wordpress in folder DIR In the wordpress blog I have a web page called SPECIAL that only some users can access (after being authenticated). I would like to know if there is a way to allow those users to open the web pages in DIR (in a comfortable way) For now i am using a very non-pratical solution: I make a zip archive of that folder, upload it from the Admin interface of Wordpress, using WP-Filebase, and put a link to the DIR.zip in the web page SPECIAL. Yes I agree that my solution is ridiculous. Please help me find a better one. Thanks in advance.


force user to re-login after 4 hours - how?

Does anyone know of a way to force a logged in user to re-login after say 4 hours? or at a particular time to day? For example, if they logged in at 9am, can we force them to re-login at 1pm?


Exclude a 'portfolio' custom category?

I have a custom post type called 'portcat' and I want to exclude one portcat category ('weather' - ID='5') from the page. I've tried **'category__not_in' => array( 5 )** but apparently this doesn't work with custom post types. What can I add to the below code to exclude it?               <?php     $temp = $wp_query;     $wp_query = null;     $wp_query = new WP_Query();                  $args = array(                  'post_type' => 'port',                  'paged' => $paged,                  'posts_per_page' => get_theme_option("portfolio_work_count"),                             );          if (isset($_GET['slug'])) {      $args['tax_query']=array(                          array(                             'taxonomy' => 'portcat',                           'field' => 'slug',                           'terms' => $_GET['slug']                          )                      );             }


Display and hide content using checkbox in Options Framework Theme

I am currently using Options Framework Theme for making WordPress options panel. I created a checkbox in admin panel by this code in `options.php`               $options[] = array(     'name' => __('Input Checkbox Name', 'options_framework_theme'),     'desc' => __('Check to display.'),     'id' => 'example_checkbox_2',     'std' => 'true',     'type' => 'checkbox');      I want to display different content when the checkbox is checked or unchecked. So, I inserted this code in file template (`footer.php`)               <?php if ( of_get_option('example_checkbox2') != 'true') { ?>
checked
         <?php } else { ?>
unchecked
     <?php } ?>      My problem is: When I checked or uncheck the checkbox, "`checked`" is displayed in my footer. Could anybody help how to retrieve and display content from checkbox correctly? Any respond are highly appreciated. Thank you.


Remove [...] from RSS feed?

I would like to remove the [...] from the RSS feed widget. I have tried adding the following to functions:               function replace_ellipsis($text) {          $return = str_replace('[...]', '-', $text);      return $return;     }     add_filter('get_the_excerpt', 'replace_ellipsis');      However, this does not affect the widget. Any help?


Exclude Specific Term from Search

It is possible to search for posts with a specific term by appending the URL with:               ?&term=abc      Is it possible to do the opposite and search excluding a specific term? Something like:               ?&term=NOTabc


Fetching ten ten records from JSON API in word press

I am using `JSON API` for getting web services.. I have 80 records in my `wp_posts` table . I need to display 10 , 10 records so that my mobile app will be faster. I used the following method in this               http://mysite.com/api/?json=get_category_posts&slug=mediapr&count=84      here i get 84 records, if i specify my count to 10 , only ten records will be displayed but later on i need to fetch next ten records. I searched json api documentation but dint find solution What method should i use to do so.. please help


Custom post type permalink structure to include the taxonomy

I have a blog and I want to make a modification to my custom post type to include the taxonomy term in the permalink. For example I have a custom post type named "my_services" and I have a custom post type to called "my_service_cats".               register_post_type( 'my_services', $args);     register_taxonomy( 'my_service_cats', 'my_services', $args);      In the custom post type I currently have the following items: Hotel 1 / Hotel 2 / Hotel 3 The custom taxonomy contains the following terms: Hotels / Rooms / Houses Currently the url is www.domain.com/services/hotel-1 and what I want it to be is www.domain.com/hotels/hotel-1 I have been messing with the custom post type permalinks but the only thing I have managed to do is to create more problems with the posts categories that I already have. Can you please help on how should I go about creating this structure?


Multiselect value in wp_query

i have been trying to display the post that contain specific tag. what i am trying is: if user search for post related to tagss for example: if user selects the tag **Don** after submition the query will fetch post that contains **don** tag. for that i have created one multiselect form. user will select multiple tags. for exapmle mama and don. after form submit getting array of multiple selected values like:                    array([0]=>11,[1]=>18)           $options = $_post['options'];      i am passing this values to new WP_Query( array( 'tag__in' => array( $options ) ) );                   <form method="post" action="" multiple="multiple">             <select name="options[]" multiple="multiple">            <option value="15">mama</option>            <option value="16">chacha</option>            <option value="17">Bhatija</option>            <option value="18">Don</option>        </select>            <input type="submit" value="submit" name="submit"/>        </form>                <?php                       if(isset($_POST['submit'])):             $options = $_POST['options'];             $query = new WP_Query( array( 'tag__in' => array( $options ) ) );        //print_r($query);            while ($query->have_posts()) : $query->the_post();               echo get_the_tile($post->ID);             endwhile;      unfortunately it is not working. need help to get the list of post by selected tag.


Please suggest me some plugins in WordPress networking

Hey guys i'm creating a site network using WordPress. Lets say my site name is blahblah.com and lets say i have 10 subdomains like site1.blahblah.com,site2.blahblah.com Now i want something like this. There will be no articles in my main domain. But i want list all subdomain's articles in my main domain. When they click read more button users have to redirected to original article. I also want multisite access facility with single registration. That is if a user signed up in my main domain, then he should able to access all my sub domain using the same login credentials. Some says use the same database for all domains. But i dont think thats a good idea. Is there any premium or free plugin available for this feature?.   Thanks.


Blank screen at login/logout - tried everything!

I am working on some customized themes and when they are activated I cant log out, it goes blank. If I get rid of all cookies (being logged out) I cant log back in. The login.php shows, but when I've filled out the login form and hit the login button it's just a blank page showing. As you probably figured I've tried everything I could come up with, that including googeling for days and trying all solutions I've found. There are no empty lines or spaces anywhere, I've disabled all plugins, I've even tried to rewrite one of the themes using twentyeleven as base. I'm out of ideas where to look. My theme is not an ordinary blog theme but suppose to become a website. All other themes I've tried is working, including some free themes and twentyeleven. I can log in/out when they are enabled. The strangest thing is that everything worked just fine yesterday and today it doesn't, I thought rewriting it solved the problem, but no. Any ideas where to go from here? Hoping for answers before I go bald, Bellisia


Wordpress Next & Previous post outside the loop

As a (front) designer I'm looking for the following: How can I get the following code working for next/previous posts OUTSIDE the loop?               <img src="<?php get_featured_image ?>" />
<?php post_title(); ?>

<?php echo the_date(); ?>

<?php echo excerpt (); ?>
<a href="<?php get_permalink(); ?>"> FULL link
      I know code works for the featured image, but I want to make it easier with more HTML markup because my lag of PHP knowledge.


BBpress error wp-init

I installed bbpress with the latest wordpress version 3.8 and I receive an error:               Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /public_html/wp-includes/functions.php on line 3049      What does mean? Thanks


Custom post type won't take my custom fields

I have written the following plugin:                   <?php          /* Set up the post types */     add_action( 'init', 'mdg_kjdz_register_post_types' );          /* Register the post types */     function mdg_kjdz_register_post_types() {              /* Set up the arguments for the kjdz_adress post type */         $adress_args = array(                 'public' => true,                 'query_var' => 'kjdz_adress',                 'rewrite' => array(                         'slug' => 'adres',                         'with_front' => false,                 ),                 'supports' => array(                         'title',                         'thumbnail',                         'editor'                 ),                 'labels' => array(                         'name' => 'Locaties',                         'singular' => 'Locatie',                         'add_new' => 'Voeg locatie toe',                         'add_new_item' => 'Voeg locatie toe',                         'edit_item' => 'Locatie aanpassen',                         'new_item' => 'Nieuwe locatie',                         'view_item' => 'Bekijk locatie',                         'search_items' => 'Doorzoek locaties',                         'not_found' => 'Geen locaties gevonden',                         'not_found_in_trash' => 'Geen locaties in prullenbak'                 ),         );              /* Set up custom meta box kjdz_adress post type */         $kjdz_adress_meta_box = array(                 'id' => 'adress-meta-box',                 'title' => 'Gegevens locatie',                 'page' => 'kjdz_adress',                 'context' => 'normal',                 'priority' => 'high',                 'fields'=> array(                         array(                                 'name' => 'Adres',                                 'desc' => 'Adres locatie',                                 'id' => 'adress',                                 'type' => 'text',                                 'std' => 'Voer straatnaam en huisnummer in.'                         ),                         array(                                 'name' => 'Plaatsnaam',                                 'desc' => 'Plaatsnaam locatie',                                 'id' => 'town',                                 'type' => 'text',                                 'std' => 'Voer de plaatsnaam in.'                         ),                         array(                                 'name' => 'Soort locatie',                                 'id' => 'location_type',                                 'type' => 'radio',                                 'options' => array(                                         array('name' => 'hoofdvestiging', 'value' => 'Hoofdvestiging'),                                         array('name' => 'nevenvestiging', 'value' => 'Nevenvestiging')                                 )                         ),                         array(                                 'name' => 'Openingstijden',                                 'id' => 'opening_days1',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days2',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days3',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days4',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days5',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days6',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'id' => 'opening_days7',                                 'type' => 'select',                                 'options' => array('Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag', 'Zondag')                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours1_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours1_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours2_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours2_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours3_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours3_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours4_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours4_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours5_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours5_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours6_1',                                 'type' => 'text',                                 'std' => '09:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours6_2',                                 'type' => 'text',                                 'std' => '18:00'                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de openingstijd in (vb. 09:00)',                                 'id' => 'opening_hours7_1',                                 'type' => 'text',                                 'std' => ''                         ),                         array(                                 'name' => '',                                 'desc' => 'Voer de sluitingstijd in (vb. 18:00)',                                 'id' => 'opening_hours7_2',                                 'type' => 'text',                                 'std' => ''                         )                     )                 );                      /* Register the post types */                 register_post_type( 'kjdz_adress', $adress_args );     }          add_action('admin_menu', 'kjdz_adress_add_box');          /* Add meta box */     function kjdz_adress_add_box() {             global $kjdz_adress_meta_box;                  add_meta_box($kjdz_adress_meta_box['id'], $kjdz_adress_meta_box['title'], 'kjdz_adress_show_box', $kjdz_adress_meta_box['page'], $kjdz_adress_meta_box['content'], $kjdz_adress_meta_box['priority']);     }          /* Callback function to show fields in meta box */     function kjdz_adress_show_box() {         global $kjdz_adress_meta_box, $post;              /* Use nonce for verification */         echo '<input type="hidden" name="kjdz_adress_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)) ,'" />';              echo '
';              foreach ($kjdz_adress_meta_box['fields'] as $field) {                 /* Get current post meta data   */                 $meta = get_post_meta($post->ID, $field['id'], true);                      echo '
',                                 '', $field['name'], '	',                                 '';                 switch ($field['type']) {                         case 'text':                                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width: 97%" />', '
', $field['desc'];                                 break;                         case 'textarea':                                 echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width: 97%">', $meta ? $meta : $field['std'], '</textarea>', '
', $field['desc'];                                 break;                         case 'select':                                 echo '<select name="', $field['id'], '" id="', $field['id'], '">';                                 foreach ($field['options'] as $option) {                                         echo '<option ', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';                                 }                                 echo '</select>';                                 break;                         case 'radio':                                 foreach ($field['options'] as $option) {                                         echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', '/>', $option['name'];                                 }                                 break;                         case 'checkbox':                                 echo '<input type="checkbox" name="', $field['id'], '"', $meta ? ' checked="checked"' : '', '/>';                                 break;                 }                 echo        '	',                             '
';         }              echo '
';     }                         ?>      Which shows up as the custom post type "kjdz_adress" or Locatie in the admin menu. But my custom fields don't show up. What am I missing?


how to access the $query variable inside taxonomy-xxx.php template file?

In my custom template files, I create query in the following way:               <?php $query = new WP_Query(array('post_type' => 'aya-bi-aya','author' => $current_user->ID,'paged' => $paged, 'post_status' => array('publish') ) ); ?>      And to perform pagination, I call pagination function after loop like:               <?php my_pagination($query->max_num_pages);?>      But in my `taxonomy-xxx.php`, when I call pagination the same way, I get the warning:               Notice: Undefined variable: query in C:\xampp\htdocs\balagha-to-alquran\production\wp-content\themes\twentyten\taxonomy-dawahir-balaghia.php on line 186          Notice: Trying to get property of non-object in C:\xampp\htdocs\balagha-to-alquran\production\wp-content\themes\twentyten\taxonomy-dawahir-balaghia.php on line 186      Can you please help me resolve this issue? your help is appreciated. **Edit and solution:** My pagination function:               function my_pagination($pages = '', $range = 2)     {            $showitems = ($range * 2)+1;                 global $paged;          if(empty($paged)) $paged = 1;               if($pages == '')          {              global $wp_query;              $pages = $wp_query->max_num_pages;              if(!$pages)              {                  $pages = 1;              }          }                  if(1 != $pages)          {              echo "
";                   if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "«";              if($paged > 1 && $showitems < $pages) echo "‹";                   for ($i=1; $i <= $pages; $i++)              {                  if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))                  {                      echo ($paged == $i)? "".$i."":"".$i."";                  }              }                   if ($paged < $pages && $showitems < $pages) echo "›";                if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "»";              echo "
\n";          }     }      I resolved the issue by removing the argument from the function call(`$query->max-num-pages`) in my `taxonomy-xx.php` since the argument is not mandatory. As you can see, there is an if statement inside the function that deals with the absence of argument by calling the global `$wp_query`. Thank you.


remove child post from custom post type archive

I have a custom post type and a page like this for displaying the posts inside : **archive-(myCPT).php** I've created 2 posts, and one of them is the child. How can I display just the parent page inside my **archive-(myCPT).php** Here is a snippet from **archive-(myCPT).php** :               <?php                   if( have_posts() ){                  // normal blog layout                     $x = 1;                     while ( have_posts() ){                         the_post();                          get_template_part( 'inc/post-format/content-debate');                         // advertising between posts                         if($ad_posts_mode != 'none'){                             // take into account ad frequency                             if (($x % $ad_posts_frequency) == 0){                                      switch ($ad_posts_mode) {                                     case 'image':                                         echo '

';                                     break;                                     case 'html':                                         echo '
'.apply_filters('shortcode_filter',do_shortcode(of_get_option('ad_posts_code'))).'
';                                     break;                                 }                             }                         }                         $x++;                     }                 }


Manually trigger a wp_schedule_event item?

I have successfully added an event via `wp_schedule_event` and I'd like to trigger it manually without disrupting the existing schedule. Is there a way to tell WP to execute an event immediately without the cha-cha where I have to swap values in-and-out to get the event to fire _and_ save/restore the existing (pre-manual call) timing on the event?


Adding Custom fields to woocommerce edit order page

I have a woo commerce shop selling dated courses... as the courses vary in content slightly (even if they are similar in content) and because we need to have courses listed in date order, (we have say five making Sausage Courses and 6 Beer Brewing Courses all with different dates, rather than entering the dates as conventional attributes) which are entered as Custom fields, and because I need them to sort via date) as a woo commerce attribute (but not user selected) also which does require the date to be input twice (clumsy I know) When a customer books the date is not showing on the Edit Order page which I need to to. I assume I have to create a new function but have tried various things and failed total! I hope that makes sense! Shop is here at TideswellSchoolofFood.co.uk.


Child navigation within a menu

I've managed to create a dynamic menu. However, I need to place an inner menu within that, like so:   * List Item      1. List Item     2. List Item     3. List Item   * List Item   * List Item   * List Item And I currently have:               function register_my_menu() {       register_nav_menu('nav-menu',__( 'Navigation Menu' ));     }     add_action( 'init', 'register_my_menu' );      And:                   <?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>      However, I am unsure how to create this without any plugins. Does anyone know how?


How would I load wp_editor someehere else other than the admin area?

I would like to use the wp_editor in my article page for live blogging, but the tiny mce does not show up. Can someone guide me through this?


How to keep WP from using https to get to wordpress.org?

See question In 3.7.1 why is themes.php timing out? Turning off SSL on the server is not something we can do since we use the server to serve content on other SSL binding servers. What can I do in WP to make the WP core just use http? I want all of our admin stuff going to http://api.wordpress.org. There is an SSL variable - $ssl - that is being read. How do I set that to FALSE everywhere so that WP doesn't try to use it. I have no security needs since I am behind proxy/firewall.


Change the way wordpress outputs images or image galleries

The title is the short version of the question. Here's what I need in more details... If the answer is not so simple, I would be glad if you can point me to the right direction with a tutorial or to the codex and where I can ready more about this. Inside the WP loop, and "maybe" before using "the_content();", how can I tell wordpress to go to the database, loop/query through each one of the images inserted on that post/page, in such a way that I'll have full control of how those images will be displayed. I need something that will be easy and intuitive for the client to update (with new images), and I consider easy and intuitive when you only have to click the "add media" button, upload some images and add them to the post/page. At the same time, I need more control on how those images will be displayed to show all them like so:                                    And each anchor link will also have a `rel="shadowbox[page-title]"`. I've done this before, and something even more complex than this, but it's far from being easy to maintain (at least for clients). I'm thinking about creating a custom-post-type with some different taxonomies. Then I create a new post, linked to a given taxonomy, use it as a bucket for all the images for that taxonomy, and than import it all inside another page- template, but I still don't know how to control how the images will be displayed. Hope the question and description is clear enough. Thanks!


Placing generated list into drop-down on custom menu

I'm trying to add categories and authors automatically into the custom menu as they are created (avoiding having to do it manually for each one). I've modified Alex Mill's code and got to display a list of elements with the categories on the menu, buuut the problem is that the list of elements is **_outside_ the ul of the menu** in itself. You can see what I mean here. And here's my version of the code:               // Front end only, don't hack on the settings page     if ( ! is_admin() ) {     // Hook in early to modify the menu     // This is before the CSS "selected" classes are calculated     add_filter( 'wp_get_nav_menu_items', 'replace_placeholder_nav_menu_item_with_latest_post', 10, 3 );     }          // Replaces a custom URL placeholder with the URL to the latest post     function replace_placeholder_nav_menu_item_with_latest_post( $items, $menu, $args ) {          // Loop through the menu items looking for placeholder(s)     foreach ( $items as $item ) {          // Is this the placeholder we're looking for?     if ( '#latestpost' != $item->url )     continue;          // Get the categories     $latestpost = wp_list_categories( array(     'orderby' => name,     'show_count' => 0,     'exclude' => 3,     'title_li' => "",     ) );          if ( empty( $latestpost ) )     continue;          // Replace the placeholder with the real URL     $item->url = get_permalink( $latestpost[0]->ID );     }          // Return the modified (or maybe unmodified) menu items array     return $items;     }      Any idea on how to place this generated list of elements inside the proper dropdown (in this case, TEST)? Thanks! Eric


SQL query to extract only the "current" wp_posts?

The wp_posts table seems to retain all revisions of the same, ok very similar but presumably different, posts/pages/whatever. I'm somewhat conversant with SQL but not WordPress. I need to extract just those records which would appear on the public facing site; so just the most recent revision, and not all the superceded rows. Not sure how to filter the fields. Obviously something more complicated than:               select *     from wp_posts     where post_status in ('publish','revision')     order by post_modified desc      which has 'duplicates' and seems to miss some stuff.


Problem with multiple menus in theme

I am having trouble trying to get my new theme working. I have all 4 menus working on my test server but when I move the theme to the live server and set up all but one (main-menu) will not show up. Here is my code for the menus:               register_nav_menus( array(     'main-menu' => __( 'Main Menu', 'Bootstrap WP Primary' ),     'second-menu' => __( 'Second Menu' ),     'footer-menu' => __( 'Footer Menu' ),     'mobile-menu' => __( 'Mobile Menu', 'Mobile Menu' )     ));      Here is the code from the current template:               register_nav_menus(     array(       'main-nav' => __( 'Main Nav' ),      ));      Is it a conflict with the main menu items? ![white Menu is Second Menu, Purple is Main](http://i.stack.imgur.com/1CX8k.png) ![white Menu is Second Menu, Purple is Main and isn't showing up on live site](http://i.stack.imgur.com/0rnsT.png) Also upon inspection of the code the menu isn't even being populated on to the page.


Display Notification Bar on Header on Certain Post Count

I want to display notification bar on header in my Wordpress theme when user submit certain number of post. I want to notify my author once they are submit amount of post. e.g. if (authorpost === 50){ // congratulations! you have submitted total 50 posts bla bla. } else if (authorpost === 100) { // congratulations! you have submitted total 100 posts bla bla. } else { // nothing will display } I want this into header.php and will place my div right after tag. Also I want to display only when they submit certain number of post as I mention above as soon as they cross that number it won't display anything.


use a page to render 1 post and include comments FOR THE POST

wordpress 3.3.2 hi. so i have this custom post type and i use a page to show just one post. url.td/page/ the page renders the post but now i want to include comments. if i allow comments for the page, the comments get assigned to the page, but i want it to get assigned to the post, for example url.td/page/my-post if i disallow comments, the comments form is hidden. this is my page               get_header(); ?>

             <?php                 $args = array( 'post_type' => 'charts', 'posts_per_page' => 1 );                 $loop = new WP_Query( $args );                 while ( $loop->have_posts() ) : $loop->the_post();                     get_template_part( 'content', 'charts' );                 endwhile;             ?>

     <?php get_footer(); ?>      and here comes my content-charts.php               <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>          lots of stuff here...          <?php          wp_reset_query();         comments_template( '', true );     ?>
      so i thought, if the comments form is inside the post, it will be related to it, but it aint..


Showing up my custom post type in primary navigation

I have 4 custom post types set up in my blog and video is one of them. I want the video archives page (archives-video.php) to shop up in my primary navigation. how do I do this without writing a custom function?


How to show only child categories using the_category();

I'm using **the_category();** on my category.php template to show the category's name — the problem is that it attaches the category's parent category. Is there any way to show only child categories using **the_category();**?


Custom Post Type 'Event': Chronological list of recurring events from meta_values in array

i have a custom post type 'events'. Each event (post) can have multiple dates. The dates (date, time, location) are stored as array. I need a **query that creates a chronological list of all events** from the meta data (events can occur multiple times). The custom-meta-box looks like this: ![Add Dates](http://i.stack.imgur.com/h5zCd.png) The resulting database entry in wp_postmeta has the `meta_key` '_events_termine' with the following `meta_value` (using WPAlchemy):               a:1:{s:12:"termin_group";a:2:{i:0;a:3:{s:11:"termin_date";s:10:"2011/03/14";s:11:"termin_time";s:5:"19.30";s:15:"termin_location";s:15:"Max-Reger-Halle";}i:1;a:3:{s:11:"termin_date";s:10:"2011/03/15";s:11:"termin_time";s:5:"20.00";s:15:"termin_location";s:15:"Max-Reger-Halle";}}}      I display the dates for a single event with the following code:
         <?php global $events_meta_termine;         $meta = get_post_meta(get_the_ID(), $events_meta_termine->get_the_id(), TRUE);         foreach ($meta['termin_group'] as $termin)         { ?>
           <?php echo mysql2date('D', $termin['termin_date'], true); ?>	           <?php echo mysql2date('j. F Y', $termin['termin_date'], true); ?>	           <?php echo $termin['termin_time']; ?> Uhr	           <?php echo $termin['termin_location']; ?>
         <?php } ?>
      The output looks like this: ![Output](http://i.stack.imgur.com/xlVCe.png) So everything works fine except i have no idea how to create a page that lists all events (title, date, location) in chronological order where a single event can occur several times. Any help is highly appreciated! (i'm sorry i asked a similar question before, but i came to a dead end and had to start over.)


I need to generate the CSS for my plugin from a function, how do i map a request to a function in the front-end?

I'm generating my CSS dinamically in a function using a link like this               <link id="www-core-css" rel="stylesheet" href="http://wordpress/myplugin/theme-css-loader.php?v=1" />       and i was wondering what approach to take. I could either point the href to a file like `http://wordpress/myplugin/theme-css-loader.php?v=1` or i could try to map a request to a function `http://mysite.com/wordpress/?requested_page=myplugin_theme_css_loader&v=1` but i don't know how to that in the frontend ( in the backend i would add a page with add_menu_page and then remove the page with remove_menu_page and the url would still be callable. Do you know how i could map the url request to a function and does it make sense? Requiring the file seems to have far less overhead to me


Can't query by meta_key

For some reason. I do not have the ability to query by meta_key when I run a loop. What could cause this and what can I do to the diagnose the problem? I am using wordpress 3.4.1.               $args = array( 'meta_key' => 'slideshow_image');          $query = new WP_Query($args);


How to find the exact widget details

I imported the blog to my self-hosted WP. I also found the theme I was using, downloaded and installed it. I don't see all the widgets that are available in my Wordpress.com dashboard. I can search for widgets e.g. Twitter but it gives me like 1000 results. I want exactly the one I have on my curren wordpress.com blog. Any ideas? Thanks


How to use filter hook 'post_updated_messages' in coherence with action hook 'save_post'

I am trying to send out e-mail, SMS and IM notifications to group members of this WordPress website, whenever a WordPress page in their user group has been published/updated. I figured using the action hook `'save_post'` would be the best solution. However, I ran into some annoying factors along the way, and believe I have found a fix for them. One of the annoying factors was every time the page was updated, it would perform the action twice. So I used the fix proposed here and it seems to have corrected the double saving issue. If you have a better solution to the double saving issue, I would be glad to read about it. Now, the issue I am facing is I don't know exactly how to properly use the filter hook `'post_updated_messages'` in coherence with action hook `'save_post'`. When I place the reference to `add_filter('post_updated_messages', array(&$this, 'message'));` in the class constructor, it displays the updated message when I have only just arrived on the edit screen and haven't even clicked the update button yet. After talking to @rarst in chat, he informed me that the `'post_updated_messages'` filter was referenced as _'place'_ and not as _'event'_ which gave me the idea of moving the reference to `add_filter('post_updated_messages', array(&$this, 'message'));` to `$this->save_post();`. After moving the filter to `$this->save_post();`, now I don't see the custom updated message displayed at all. I just see the typical post updated message. However, the group notification method still fires. Where is the best place to make the filter reference. Or if this situation does not require this particular hook, what hook should be used, and where should it be placed? I tagged this as related to plugin development, even though it's just a class file included by the **functions.php** file of this particular active WordPress theme. Here is a rough idea of what I have:               <?php     if(!class_exists('tester_class')){         class tester_class{             /**              * Initiate!              *              * @return void              **/             public function __construct() {                 add_action('save_post', array(&$this, 'save_post'));             }                  /**              * Display update message              *               * Outputs a message using post_updated_messages, after the WP save_post action              *              * @return void              **/             public function message(){                 _e('

Post updated & Notified all group members!

');             }                  /**              * Hooks the WP save_post action              *               * Perform class call after post is saved.              *              * @return void              **/             public function save_post(){                 global $flag;                 if($flag == 0){                     $this->send_group_notifications();                     add_filter('post_updated_messages', array(&$this, 'message'));                 }                 $flag = 1;             }                  /**              * Notifies group members              *               * Sends email, SMS, and IM notifications to all group members.              *              * @return void              **/             public function send_group_notifications(){                 // example...             }                 }// EoF tester_class class              // Initiate tester_class class         $tester_class = new tester_class();          }// EoF tester_class class_exists     ?>


Manage Columns : order by post_parent's title

I have 2 custom post types : "industry" (page + hierarchical) and "product" (post + hierarchical). This allows me to use Industry for Product's post_parent. On the Product manage screen, I have a custom column that displays the title of the product's post_parent, an industry. I would like to make that column sortable.               function column_orderby ( $vars )     {         $output = array();              switch ( $vars['orderby'] )         {             case 'industry':     /*                 NOT SURE WHAT TO DO HERE                      orderby post_parent's title     */                 break;                  case 'product': // Custom column that just displays post_title differently                 $output = array(                     'orderby' => 'title'                 );                 break;         }              return array_merge($vars, $output);     }     add_filter('request', 'column_orderby');      I don't think I can merge any useful parameters. It has crossed my mind to use the `posts_join` and/or `posts_where` filters, but I'm not sure if this would work. My question is, should I experiment with the hooks mentioned above or is there another way I'm not thinking of? Cheers,


Exclude Tags from get_the_tags

While following this article to get tags by date, I was wondering if I could exclude certain tags from what gets returned. The point is to have trending tags but some tags will always be there and I don't want to include those ones. **Here is the code:**                   <?php         $how_many_posts = 50;         $args = array(             'posts_per_page' => $how_many_posts,             'orderby' => 'date',             'order' => 'DESC',         );         // get the last $how_many_posts, which we will loop over         // and gather the tags of         query_posts($args);         //         $temp_ids = array();         while (have_posts()) : the_post();              // get tags for each post             $posttags = get_the_tags();             if ($posttags) {                 foreach($posttags as $tag) {                     // store each tag id value                     $temp_ids[] = $tag->term_id;                 }             }         endwhile;         // we're done with that loop, so we need to reset the query now         wp_reset_query();         $id_string = implode(',', array_unique($temp_ids));         // These are the params I use, you'll want to adjust the args         // to suit the look you want             $args = array(             'smallest'  => 15,              'largest'   => 15,             'unit'      => 'px',              'number'    => 10,               'format'    => 'flat',             'separator' => "\n•\n",             'orderby'   => 'count',              'order'     => 'DESC',             'include'   => $id_string,  // only include stored ids             'link'      => 'view',              'echo'      => true,              );         wp_tag_cloud( $args );         ?>      **UPDATE:** I am wondering since doing passing an 'exclude' object in the args for wp_tag_cloud didn't work as one answer suggested, if doing an unset before the wp_tag_cloud runs is how to make this work? The problem is is that I don't know much about php or Wordpress so I'm not sure how to work that in to the above code.                               foreach( $tags as $tag_key => $tag_object ) {                     if ( 'tag1' == $tag_object->slug || 'tag2' == $tag_object->slug ) {                             unset( $tags[$tag_key] );                             }                         }      Thanks for your help! **UPDATE 2:** @artlung answer worked perfectly.


WordPress Post Voting - Vote once per IP on entire site

I've been researching this for a few days now and found many voting plugins - unfortunately none of them do exactly what I need, so I am trying to hack some functions/scripts that I've found by searching online. I'm working with this script, now: http://bavotasan.com/2011/a-better-voting- system-for-wordpress/ I'm trying to figure out a way to only allow the IP to vote once on the website. Essentially, if they vote on one post - they cannot vote on another. This post is similar to this thread, Wordpress Vote Plugin - Vote Once and Track User               add_action("wp_ajax_add_votes_options", "add_votes_options");     add_action("wp_ajax_nopriv_add_votes_options", "add_votes_options");     function add_votes_options() {     if (!wp_verify_nonce($_POST['nonce'], 'voting_nonce'))         return;          $postid = $_POST['postid'];     $ip = $_POST['ip'];          //$voter_ips = get_post_meta($postid, "voter_ips", true);          // use an option instead          $voter_ips = get_option( "wpse_59080_voter_ips", true );          if(!empty($voter_ips) && in_array($ip, $voter_ips)) {         echo "null";         die(0);     } else {         $voter_ips[] = $ip;         // update_post_meta($postid, "voter_ips", $voter_ips);         update_option( "wpse_59080_voter_ips", $voter_ips );          }             //$current_votes = get_post_meta($postid, "votes", true);     $current_votes = get_option( "wpse_59080_voter_ips", true );          $new_votes = intval($current_votes) + 1;          // update_post_meta($postid, "votes", $new_votes);          // use an option instead          update_option( "wpse_59080_voter_ips", $voter_ips );          $return = $new_votes>1 ? $new_votes." votes" : $new_votes." vote";     echo $return;     die(0);     }


Add ID to target navigation link

I am using the following code for a navigation bar on a WordPress website:               <?php wp_list_pages("title_li="); ?>      Which currently spits out some links that look like:               News      What I'd like to do is have the ability to add an id to a link so that it looks like:               News      Does anyone know how to do this? It's ok if just this page or every page has an id...whatever is easiest, I just need an ID so that I can target a specific link. Thanks,   Josh


Setting up staging area

I typically work on live sites, no matter the scope. What is the best way to set up a staging/dev area for live wp sites? I know MAMP is the way to go, but how would this work? Would I have to download a database everytime and then export? Seems cumbersome.


Theme Customiser Image Control

I'm aware that one can add a control to the theme customiser to add an image. This control returns an image URL however, and I need its attachment ID, not the image URL. Where can I intercept or steal the attachment ID of this image in order to do this? Is there a save hook I can intercept? Or a javascript based method?


Conditional Custom field with foreach

i use use this code to set slider in header with CF, how i can disable when CF is empty or set another CF key to exclude it?               <?php       $custom_fields = get_post_custom($post_id);//Current post id       $my_custom_field = $custom_fields['slider_id'];//key name       foreach ( $my_custom_field as $key => $value )       echo get_new_royalslider($value) ;     ?>


Wordpress Ecommerce handling multiple option groups & prices

I've been searching for a couple of hours for a way to have WordPress ecommerce handle products with multiple option groups but am yet to find anything that fits the bill. Basically, a product should have a base price and you should be able to specify multiple different attributes with associated prices. ie:               Garden Shed - base price £100             Wood types           beech +0.00           pine  +40.00             Roof Type           Canvas + 0.00           Tile + 50.00             Front Porch           No + 0.00           Yes + 45.00      etc etc Does anyone know anything that will fit this bill? I've looked at thecartpress's dynamic options plugin and this only seems to allow combinations of options. ie beech + canvas + front porch = +45 or pine + tile + no porch = 90 etc.


"Allow Comments" box cannot be checked

I've registered a custom post type, ensured that 'supports' has 'comments', and comments are allowed on new posts under settings -> discussion. I do see the check boxes for allow comments and allow trackbacks/pings. If I check 'allow comments', then update/publish post, **it automatically gets unchecked**. I have no clue why. The only solution I've found is through a SQL query. I can add an action to run a query after save, but I'd like to know what is the problem.               register_post_type( 'ott_products',         array(             'labels' => array(                 'name' => __( 'OhTheThings Products' ),                 'singular_name' => __( 'OhTheThings Product' ),                 'add_new' => __( 'Add New' ),                 'add_new_item' => __( 'Add New Product Listing' ),                 'edit' => __( 'Edit' ),                 'edit_item' => __( 'Edit Product Listing' ),                 'new_item' => __( 'New Product Listing' ),                 'view' => __( 'View Product' ),                 'view_item' => __( 'View Product' ),                 'search_items' => __( 'Search Products' ),                 'not_found' => __( 'No product found' ),                 'not_found_in_trash' => __( 'No product found in Trash' ),                 'parent' => __( 'Parent Product' )             ),                  'public' => true, // Can be seen/edited by public.             'menu_position' => 5, //Position, in this case, just after post.             'supports' => array( 'comments', 'title', 'editor', 'thumbnail' ),             'taxonomies' => array( 'category' ),             'rewrite' => array( 'slug' => 'product' ),         )     );      Here's the code for my post type, but I don't really think it's relevant. EDIT: Code which is making and saving custom fields...               function display_product_info_meta_box($post) {                   wp_nonce_field( plugin_basename( __FILE__ ), 'ott_checknonce' );                    $price = get_post_meta($post->ID, 'price', true);               $viaTitle = get_post_meta($post->ID, 'viaTitle', true);              $viaLink = get_post_meta($post->ID, 'viaLink', true);               $learnmore = get_post_meta($post->ID, 'learnmore', true);               $description = get_post_meta($post->ID, 'description', true);               $userreview = get_post_meta($post->ID, 'userreview', true);                $colorscheme = get_post_meta($post->ID, 'colorscheme', true);                     echo '

                      Color Scheme	                                               <input type="text" name="colorscheme" id="colorscheme" value="'.$colorscheme.'" size="30" />
Accepted values: green, red, blue, corresponding to geeky, home life, and oh wow respectively.
Default value is green, ie, geeky.

                      Price (USD)	                                               <input type="text" name="price" id="price" value="'.$price.'" size="30" />
The price, in USD

                      Via (Title)	                                               <input type="text" name="viaTitle" id="viaTitle" value="'.$viaTitle.'" size="30" />
Example: \'Amazon\' will output \'Via Amazon\'

                      Via (Link)	                                               <input type="text" name="viaLink" id="viaLink" value="'.$viaLink.'" size="30" />
The link to go in the \'via\'

                      Learn More URL	                                               <input type="text" name="learnmore" id="learnmore" value="'.$learnmore.'" size="30" />
The url the \'Learn More\' button should lead to.

                      Poem/Description	                                               <textarea name="description" id="description" cols="60" rows="15">'.$description.'</textarea>
The poem/description. Try and keep it short :)

                      Featured User Review/Product Features	                                               <textarea name="userreview" id="userreview" cols="60" rows="15">'.$userreview.'</textarea>
The \'Featured User Review/Product features\' field. Please prepend with \'<h1>Featured User Review</h1>: \' if it\'s a user review

'; // end table           };                      function ottycb_save_postdata($post_id) {         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )          return;               if ( !wp_verify_nonce( $_POST['ott_checknonce'], plugin_basename( __FILE__ ) ) )             return;                  update_post_meta($post_id, "price", $_POST["price"]);         update_post_meta($post_id, "viaTitle", $_POST["viaTitle"]);         update_post_meta($post_id, "viaLink", $_POST["viaLink"]);         update_post_meta($post_id, "learnmore", $_POST["learnmore"]);         update_post_meta($post_id, "description", $_POST["description"]);         update_post_meta($post_id, "userreview", $_POST["userreview"]);         update_post_meta($post_id, "colorscheme", $_POST["colorscheme"]);     };


What specific database privileges does WordPress need?

I want to create a new database user for my WordPress installation. Usually on localhost, i can just use root, but it is good practice to use a user with as little rights as possible. What are those rights? I was wondering if WordPress needed to have installed plugins etc. It may require `CREATE` & `DROP` privileges as well. ![alt text](http://i.stack.imgur.com/XB7wW.jpg)


Taxonomy list names with lowercase

I try to make custom taxonomies names to display with lowercase, but for some reason it doesnt work and show all taxonomy titles with big capital. Here is the code that i use:                   $genre = strtolower( strip_tags( get_the_term_list( $wp_query->post->ID, 'genre', '', ', ', '' ) ) );     if ( is_singular( array( 'dvd','vhs' ) )) {     echo '<meta name="description" content="'. get_the_title() .' is '. $genre .'." />';     }      Thank you all in advance :) **UPDATE** This is my whole code that I put in functions.php                   function test_seo() {                   $terms = get_the_terms( $post->ID, 'genre' );         // var_dump($terms);         $tnames = array();         if (!is_wp_error($terms) && !empty($terms)) {           foreach ($terms as $t) {             $tnames[] = strtolower($t->name);           }           $genre = implode(', ',$tnames);         }         // var_dump($terms);                   if ( is_home() || is_front_page() || is_search() || is_tag() || is_tax() || is_page() ) {             echo '<meta name="description" content="Test description" />';         }              elseif ( is_singular( array( 'dvd', 'vhs' ) )) {             echo '<meta name="description" content="'. get_the_title() .' is '. $genre .'." />';         }          }     add_action ( 'wp_head', 'test_seo');


Widget Javascript code (ajax)

I have a widget like this:               class test_widget extends WP_Widget{            function test_widget(){         $widget_ops = array('description' => 'test widget');         $this->WP_Widget(false, 'Test', $widget_ops);              add_action('init', array(&$this, 'ajax'), 99);              // include in jQuery(document).ready()         add_action('jquery_init', array(&$this, 'js'));       }            function js(){         // get settings from all widget instances         $widget_settings = get_option($this->option_name);              // identify this instance         foreach($widget_settings as $instance => $options):                $id = $this->id_base.'-'.$instance;           $block_id = 'instance-'.$id;                if (is_active_widget(false, $id, $this->id_base)): ?>                $("#<?php echo $block_id; ?> .button").click(function(){                  $.ajax({               type: "GET",               url: "<?php echo get_bloginfo('url'); ?>",               data: { id: "<?php echo $block_id; ?>",                       some_data: "<?php echo $options['some_widget_option']; ?>",                       my_widget_ajax: 1 },               success: function(response){                  alert(response);                  // yey               }             });             return false;                });                <?php endif;         endforeach;       }            function ajax(){         if(isset($_GET['my_widget_ajax'])):                $some_data = esc_attr($_GET['some_data']);                echo $some_data;           exit();         endif;       }            function widget($args, $instance){         // the widget front-end            }            function update($new_instance, $old_instance){         // update form         return $instance;       }            function form($instance){         // the form       }     }      Basically there's a button in it which triggers a ajax request that retrieves some info... As you can see the only way I could add the ajax function was by hooking it to the init tag, and the js to a theme function that handles the javascript. The problem is that this only works when the widget is present in a sidebar. And I also need it to work when I call this widget with the_widget() function, for eg. inside a page. I don't know how could I retrieve the widget options to pass them in the javascript code... Any ideas?


How do I install two versions of WordPress on 1 server?

I am installing on a local machine using `localhost`. I have a "learning" version of WordPress @ `http://localhost/wordpress` and I want to create another version of WordPress (@ `http://localhost/jiewmeng`) I want to test and maybe move to a real server later. I found that when I extracted a fresh copy of WordPress into `localhost/jiewmeng`, it probably detects the WordPress database and uses that? All the data I get is from the "learning" version of WordPress. How do i set this up so that the 2 installations of WordPress are separate?


Can I have both front-page.php and index.php?

I've made a custom front-page.php which includes "the loop" and it works great. I would also like to have a separate page which is the regular old posts page you get from index.php. How do I make a page refer to index.php? I've tried going to Appearance -> Customize and setting a static front page, but then "the loop" on my main page stops working, so that's not the solution.


Drop down menu location select widget

This code select menu by names but i want to do it selecting registered menu location.below is my exact code.                 class MyWidget extends WP_Widget {              function __construct() {             $widget_ops = array( 'description' => __('Use this widget to add one of your custom menu as a link list widget.') );             parent::__construct( 'custom_menu_widget-1', __('My name'), $widget_ops );         }              function widget($args, $instance) {             // Get menu             $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false;                  if ( !$nav_menu )                 return;                  $instance['title'] = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );                            echo $args['before_widget'];                  if ( !empty($instance['title']) )                 echo $args['before_title'] . $instance['title'] . $args['after_title'];                  wp_nav_menu( array( 'menu' => $nav_menu) );                  echo $args['after_widget'];              }              function update( $new_instance, $old_instance ) {             $instance['title'] = strip_tags( stripslashes($new_instance['title']) );             $instance['nav_menu'] = (int) $new_instance['nav_menu'];             return $instance;         }              function form( $instance ) {             $title = isset( $instance['title'] ) ? $instance['title'] : '';             $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';                  // Get menus             $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) );                  // If no menus exists, direct the user to go and create some.             if ( !$menus ) {                 echo '
'. sprintf( __('No menus have been created yet. Create some.'), admin_url('nav-menus.php') ) .'
';                 return;             }             ?>
                 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?>                 <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" />

                 <label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?>                 <select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">             <?php                 foreach ( $menus as $menu ) {                     $selected = $nav_menu == $menu->term_id ? ' selected="selected"' : '';                     echo '<option'. $selected .' value="'. $menu->term_id .'">'. $menu->name .'</option>';                 }             ?>                 </select>
             <?php         }     }          add_action( 'widgets_init', 'myplugin_register_widgets' );          function myplugin_register_widgets() {                register_widget( 'MyWidget' );          }


Wordpress excerpt with formatting and allowing selected tags

I went through your answer in post Issue with enabling formatting in excerpts in Wordpress. It works fine and closes tags so that a tag does not spill over to other posts. But I need to disable images from showing in the excerpts. How do I do that?


Permalink, links a page to the homepage

So I'm using the 'post-name' pretty permalink structure. I have a page called The Trust, the slug of this page is the-trust. But when i go onto www.mydomain.com/the-trust, it shows the the homepage. The URL stays the same, but it displays the index.php page. It used to show me the archive.php page, but I removed that from my theme files so now it shows me the index page. How can I fix this?   * If i change the slug to the-trusts, it displays the page fine, however I want the slug to stay as the-trust.   * I used to have a php file in my theme folder called thetrust.php (i've removed that now), the template file that is assigned to The Trust page is called trust-articles.php Thanks in advance. EDIT: The page does work with Ugly permalinks so www.domain.com/?page_id=174


get_footer not working boilerplate theme

I am very new to WordPress. The footer will not show up in a boilerplate theme I have. I've looked online for hours. Here is my footer.php file:               <?php     /**      * The template for displaying the footer.      *      * Contains the closing of the id=main div and all content      * after.  Calls sidebar-footer.php for bottom widgets.      *      * @package WordPress      * @subpackage Boilerplate      * @since Boilerplate 1.0      */     ?>
                                        <a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?>                 Proudly powered by WordPress                   <?php         /* Always have wp_footer() just before the closing           * tag of your theme, or you will break many plugins, which          * generally use this hook to reference JavaScript files.          */         wp_footer("new");     ?>                              here is my loop.php file (not sure if you'll need this):               <?php     /**      * The loop that displays posts.      *      * The loop displays the posts and the post content.  See      * http://codex.wordpress.org/The_Loop to understand it and      * http://codex.wordpress.org/Template_Tags to understand      * the tags used in it.      *      * This can be overridden in child themes with loop.php or      * loop-template.php, where 'template' is the loop context      * requested by a template. For example, loop-index.php would      * be used if it exists and we ask for the loop with:      * get_template_part( 'loop', 'index' );      *      * @package WordPress      * @subpackage Boilerplate      * @since Boilerplate 1.0      */     ?>          <?php /* Display navigation to next/previous pages when applicable */ ?>     <?php if ( $wp_query->max_num_pages > 1 ) : ?>
<?php next_posts_link( __( '← Older posts', 'boilerplate' ) ); ?>

<?php previous_posts_link( __( 'Newer posts →', 'boilerplate' ) ); ?>
              <?php endif; ?>          <?php /* If there are no posts to display, such as an empty archive page */ ?>     <?php if ( ! have_posts() ) : ?>

<?php _e( 'Not Found', 'boilerplate' ); ?>

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'boilerplate' ); ?>
                 <?php get_search_form(); ?>

     <?php endif; ?>          <?php          /* Start the Loop.      *      * In Twenty Ten we use the same loop in multiple contexts.      * It is broken into three main parts: when we're displaying      * posts that are in the gallery category, when we're displaying      * posts in the asides category, and finally all other posts.      *      * Additionally, we sometimes check for whether we are on an      * archive page, a search page, etc., allowing for small differences      * in the loop on each template without actually duplicating      * the rest of the loop that is shared.      *      * Without further ado, the loop:      */ ?>     <?php while ( have_posts() ) : the_post(); ?>          <?php /* How to display posts in the Gallery category. */ ?>              <?php if ( in_category( _x('gallery', 'gallery category slug', 'boilerplate') ) ) : ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'boilerplate' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

                     <?php boilerplate_posted_on(); ?>

     <?php if ( post_password_required() ) : ?>                     <?php the_content(); ?>     <?php else : ?>                     <?php                         $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );                         if ( $images ) :                             $total_images = count( $images );                             $image = array_shift( $images );                             $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );                     ?>
                                 <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?>

<?php printf( __( 'This gallery contains %2$s photos.', 'boilerplate' ),                                     'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'boilerplate' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',                                     $total_images                                 ); ?>
                     <?php endif; ?>                             <?php the_excerpt(); ?>     <?php endif; ?>
                                           <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'boilerplate'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'boilerplate' ); ?>"><?php _e( 'More Galleries', 'boilerplate' ); ?>                     |                     <?php comments_popup_link( __( 'Leave a comment', 'boilerplate' ), __( '1 Comment', 'boilerplate' ), __( '% Comments', 'boilerplate' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'boilerplate' ), '|', '' ); ?>
          <?php /* How to display posts in the asides category */ ?>              <?php elseif ( in_category( _x('asides', 'asides category slug', 'boilerplate') ) ) : ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                  <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
                     <?php the_excerpt(); ?>
             <?php else : ?>
                     <?php the_content( __( 'Continue reading →', 'boilerplate' ) ); ?>
             <?php endif; ?>                                           <?php boilerplate_posted_on(); ?>                     |                     <?php comments_popup_link( __( 'Leave a comment', 'boilerplate' ), __( '1 Comment', 'boilerplate' ), __( '% Comments', 'boilerplate' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'boilerplate' ), '| ', '' ); ?>
          <?php /* How to display all other posts. */ ?>              <?php else : ?>             <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'boilerplate' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

                                              <?php boilerplate_name(); ?>                                          ·                                              <?php boilerplate_posted_on(); ?>

<?php the_subtitle(); ?>

              <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
                     <?php # the_excerpt(); ?>
         <?php else : ?>
                     <?php #the_content( __( 'Continue reading →', 'boilerplate' ) ); ?>                     <?php #wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'boilerplate' ), 'after' => '
' ) ); ?>
         <?php endif; ?>
                  <?php comments_template( '', true ); ?>              <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>          <?php endwhile; // End the loop. Whew. ?>          <?php /* Display navigation to next/previous pages when applicable */ ?>     <?php if (  $wp_query->max_num_pages > 1 ) : ?>                      <?php next_posts_link( __( '← Older posts', 'boilerplate' ) ); ?>             <?php previous_posts_link( __( 'Newer posts →', 'boilerplate' ) ); ?>              <?php endif; ?>      here is my page.php file (again, not sure if you need this):               <?php     /**      * The template for displaying all pages.      *      * This is the template that displays all pages by default.      * Please note that this is the wordpress construct of pages      * and that other 'pages' on your wordpress site will use a      * different template.      *      * @package WordPress      * @subpackage Boilerplate      * @since Boilerplate 1.0      */          get_header(); ?>     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                     <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                     <?php if ( is_front_page() ) { ?>
<?php the_title(); ?>
                          <?php } else { ?>
<?php the_title(); ?>
                          <?php } ?>
                             <?php the_content(); ?>                             <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'boilerplate' ), 'after' => '' ) ); ?>                             <?php edit_post_link( __( 'Edit', 'boilerplate' ), '', '' ); ?>

                     <?php comments_template( '', true ); ?>          <?php endwhile; ?>          <?php get_sidebar(); ?>     <?php get_footer(); ?>


Custom Comment Form Error Messages

When submitting a comment with invalid data, an error page is displayed which doesn't conform to the website theme template. I've been trying to change this by attempting to display the errors in the same page. I'm very curious to know if I can do this by not using JQuery nor JS for error checking. I want to try do this through using Globals or Sessions. I tried using globals to no success (till now I still don't know what I'm doing wrong) Has anyone tried to do this before. Any suggestions or solutions are most appreciated.


Using WP meta query to show custom post types by a start and finish date

I have a custom post type called 'events', I have a page which displays events by each month. Each event has a start_date and finish_date custom field (using advanced custom fields plugin) which stores the date as yymmdd. If an event spans over two different months it is only appearing in the month of the start date. I'm stuck on how to show it in the month of the finish date as well. For example, if I have an event with a start date of 19/03/2014 and a finish date of 19/04/2013 it should appear in both the month of March and April. I am using the below:               // Get chosen month to display from URL     $events_month = sanitize_text_field($_GET["month"]);     $events_year = sanitize_text_field($_GET["year"]);          // Convert chosen month to display to a timestamp     $ts = strtotime("$events_month $events_year");          // Create chosen month start end end dates to use for query     $month_start_date = date('Ym01', $ts);     $month_end_date = date('Ymt', $ts);          $args = array(         'post_type' => 'events',         'posts_per_page' => 50,         'order' => 'ASC',         'orderby' => 'meta_value_num',         'meta_key' => 'start_date',         'meta_query'        => array(             array(                 'key' => 'start_date',                 'value' => array($month_start_date, $month_end_date),                 'type' => 'numeric',                 'compare' => 'BETWEEN'             )         )     );          $events = new WP_Query($args);


How to import media from folder as opposed from old site?

I don't have access to my old blog any more. However, I do have all the files (wordpress export and uploads folder). Now... I'm trying to import all that stuff in my new blog and unfortunately I can't upload my media files. There is an option to "import and download" but it tries to download files from my old server (not available any more). Is there a way I can redirect "importer" to get files from my local computer as opposed to old web site? Please help!


Most efficient way to have 1 template for parent, 1 template for child categories?

This is the setup I want: For category-15.php:                Child Category A (list of all posts inside)          Post A from Child Category A          Post B from Child Category A          Post C from Child Category A      Child Category B (list of all posts inside)          Post A from Child Category B          Post B from Child Category B      And for ALL child categories under category-15, I want them to display:               Child Category Title (paginated with 2 posts each)          Post A          Post B      As I understand, WordPress does not have something like: category-15.php (for parent) category-15-child.php (for children) Right now, I have a query in my category-15 that checks if the category has children (if yes, display the code for the parent; if no, display code for children). Is there a cleaner and faster way to do this?


Extract a .zip by uploading using file in wordpress

I am uploading a ZIP folder that is saving as zip, but I want to save it by extracting it. Where can I edit the file for it? ![enter image description here](http://i.stack.imgur.com/HlpXD.png)


Wordpress Footer Widget Processing

I made a sidebar in wordpress and have widgets in it, I want to process them one by one so that I can set their locations in theme according to me. **Example:** If I have a 3 widget in my footer sidebar, they come in one row and if fourth came it goes to next row but in the centre. Secondly if there is only one widget in sidebar it comes in the centre of first row. I am using bootstrap with LESS, How can I get the done.


Child-theme suddenly stopped working

I have been working on a website using the twenty twelve theme. I was modifying the footer.php and when I refreshed my website, I noticed all the extra css I had add in my child theme was not working. I reverted the changes I had made in the footer.php, but nothing in my child theme css is being applied to my website. Any suggestions will be appreciated **Edit:** Here is the code -- I do not have what I wrote originally as it was a small edit only, and I just wrote over the top of it. Also I cleared the cache to ensure that I wasn't seeing an old version.               <?php     /**      * The template for displaying the footer      *      * Contains footer content and the closing of the #main and #page div elements.      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */     ?>

                 <?php do_action( 'twentytwelve_credits' ); ?>                 <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?>

          <?php wp_footer(); ?>


How to publish a post with empty title and empty content?

Why I'm doing this you might ask? I'm developing a website for a business with a portfolio where the gallery items are posts. These posts are populated through custom fields and category selections, nothing else. For each item, there could be a title/content or not, it depends on the item in question and that's entirely up to the client. They are the ones populating their portfolio and not me. I'm just building the system for them to easily publish whatever they want. I realize that WordPress might have some issues with posts without a title, that's why I implemented (in `functions.php`) a function to auto set a title for the post if none was attributed. This post auto title will never be shown on the website cause I look for it and omit it if it's there, otherwise, show the attributed title to the post. The function for that is:               add_action('publish_post', 'insert_automatic_post_title', 10, 2);          function insert_automatic_post_title($postID, $post) {         if($post->post_title === '') {             $post->post_title = '['.get_the_date('d/m/Y @ H:i:s').']';                  if($post->post_name == $postID) {                 $post->post_name = sanitize_title($post->post_title);             }                  $result = wp_update_post($post);         }     }      The only problem is that if title is empty and the content is also empty (with some custom fields already defined) that function above will never be called and the post won't be published, it will remain in draft status. The only solution I could think of was to create some shortcode like `[empty_post]` and ask the client to set that on the post content when he does not wish to attribute a title/content to the post. That shortcode could print something like `<!-- EMPTY POST -->` or even nothing at all. The fact that there's something in the post content, the function above is called, an automatic title is set and the post is published. But I'm looking for a way where the client doesn't need to have more trouble (i.e: inserting a shortcode into the post content) than what's needed, I want it to be as simple as possible. Without messing with WordPress source code of course. Can anyone think of another way with actions/filters?