title: Child parent relationship inside WP DB

text: i am a .net user so i am unfamiliar with not using a foreign key inside of the database. On my WP application, user's are able to create videos on the application, the videos are stored on a different server, and I am just using a simple UI to gather video information such as src value and title of movie, ect... I am adding a custom table to the WP DB, "user_video" it will hold the user's video data. How does Wordpress create a child-parent relationship between tables? (E.g. user & usermeta) I am just wondering how I can create a child table to hold video data for that specific user?


title: qTranslate conflicts with SEO-plugins

text: I have an issue with a clients site. I installed the Yoast SEO-plugin (which i find to be great), but when i activate it i get lot's of error messages (See below).               /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 54 Notice: Undefined index: language in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 55 Notice: Undefined index: language in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 61 Notice: Undefined index: in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 61 Notice: Undefined index: language in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 111 Notice: Undefined index: language in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 111      This error message appears with every SEO-plugin i've tried What causes this, and how can i solve it?


title: Email from my theme's contact form doesn't get the reply-to address right

text: I'm using a theme that has a built in contact form, which has some options (like where the form is sent) set through the OptionTree plugin. What's happening is, the email gets sent, but the reply-to is a made-up server address at the webhost, rather than what the visitor's self-stated email is. This is really weird. When I look at the code, it all seems sound:               //If there is no error, send the email     if(!isset($hasError)) {         $emailTo = get_option_tree( 'contact_page_email' );  /*Put your own email address here*/          $body = "Name: $name \n\nEmail: $email \n\nSubject: $subject \n\nComments:\n $comments";         $headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;              mail($emailTo, $subject, $body, $headers);         $emailSent = true;     }      It looks like the code is supposed to set reply-to to be the person's stated email address. But our mail server, for some reason, wants to set the reply for all form responses to a server-generated address. The reply-to address ends up being clientaccount@s4-vancouver.accountservergroup.com. Does anyone have any ideas why this might be happening? The code looks sound to me -- I just can't figure out why when we receive mail from the server from the contact form, it appears to come from an address that isn't the client's email. Thanks! Rob


title: How to add a custom page template selector to a custom taxonomy?

text: I am trying to add the custom page template selector that can be found in the "edit page" screen for pages to a custom taxonomy. The custom taxonomy is product_cat created by WooCommerce. I am using the Tax-meta-class created by Ohad Raz of en.bainternet.info. This allows me to add a meta box to the the "edit product categories" screens. Ohad Raz has also authored a plugin that adds a custom page template selector menu to the "edit category" screens. However it does not show for the custom taxonomy. I can get the selector menu to out put the templates by adding:               <?php page_template_dropdown($template); ?>      to the Tax-meta-class.php. It out puts the proper values that i can use later in a template redirect but it won't save. The built in way to add a drop down selector has you choose the options values and names by adding them to an array like so:               array('selectkey1'=>'Select Value1','selectkey2'=>'Select Value2')      Which outputs this:               <option value='selectkey1'>Select Value1</option>     <option value='selectkey2'>Select Value2</option>      if I use the code:               $templates = get_page_templates();     foreach ( $templates as $template_name => $template_filename ) {        echo $template_name . ' ' . $template_filename . ' ';     }      I can get it to output:               Contact Page contact-page.php EVENT Pageevent-page.php Product     Icon product-icon.php Product SubFeature product-subfeature.php     Lockable Dowel template-lockable-dowel.php      I was hoping there would be a way to store these values in an array that can be used in place of:               array('selectkey1'=>'Select Value1','selectkey2'=>'Select Value2')      This way it will be using the Tax-meta-class how it should be and everything should work fine. I am fairly new and all self taught so please excuse me if I have not asked in the proper way. Thank you for taking the time to rean my question. Sincerely, Leon


title: Add the custom post term to the custom post title

text: what I need is this: add a term from a custom post to the post's title. Like this: Custom Post title - term Right now I have:               $terms_of_post = strip_tags (get_the_term_list( $post->ID, 'my-custom-term', '','', '', '' ));          elseif ( is_single() ) { single_post_title(); {echo ' ('; echo $terms_of_post;  echo ')';} ; }             I don't know why it doesn't work, but it seems it should. I have found Copy a Taxonomy Term into the Post Title for a certain Custom Post Type, which could be 90% of the answer, but instead of replacing the post title with the taxonomy title, I need to add it to the title. Thanks a lot!


title: Subcategory is displayed before Parent Category

text: I'm current using the following code to echo the categories of my post :               <?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>       So, for example, I have post with a parent category HOBBIES and a sub category MUSIC. When this code is used, it is displayed as               MUSIC HOBBIES      While I want to display it as,               HOBBIES MUSIC      How can i achieve this? BTW, the cat id for hobbies is 7 and cat id for jazz is 8.


title: How to sort by most watched in X days/months

text: So I managed to loop my posts in a page template, ordering the posts by most viewed. The query posts string looks like this               $wplover_home = new WP_Query('posts_per_page=18&v_sortby=views&v_orderby=desc&paged=' . $paged);          while ($wplover_home->have_posts()) : $wplover_home->the_post(); ?>      Now to my question. If I wanted to sort the posts by most viewed in X days or months, how should the string look like then? The documentation for the plugin (wp-postviews) doesn't have anything on this. Thanks in advance :-)


title: Limit of char count in WP custom fields

text: does anyone of you know what is the limit of chars count which can be stored in to database via WP custom fields? Let's say that I would want to add to custom field 20 000 chars. Would it be problem?


title: Filter a pluggable function

text: The following function is pluggable as it contains a filter :               // Make function pluggable/overwritable     if ( ! function_exists( 'wpsight_layout_images' ) ) {              function wpsight_layout_images() {                  $layout_images = array(                 'show_on_single'         => true,                 'size_archive'           => 'post-thumbnail',                 'align_archive'          => 'left',                 'size_single'            => 'post-thumbnail',                 'align_single'           => 'left',                 'size_widget'            => 'post-thumbnail',                 'align_widget'           => 'left',                 'size_archive_listings'  => 'post-thumbnail',                 'align_archive_listings' => 'right',             );                  return apply_filters( 'wpsight_layout_images', $layout_images );              }          }      My question is the following. Lets say I need to change the value of the two last variables `size_archive_listings` and `align_archive_listings` using the filter. Do I have to copy over the whole function or can some variables be changed independently ? What is the proper of using `add_filter` from a child theme functions file in this situation ?


title: Protect Uploads in Multisite

text: I am using WordPress multisite (3.3.1) and am trying to protect uploads from certain blogs from being hotlinked and directly accessed. This is loosely related to How to Protect Uploads, if User is not Logged In?, but I only want the uploads to be accessible through scripts running on the server (IE. the server alone can display/serve uploads), so the content can be protected by WordPress user-rights. For example, I have a filed called _40c.jpg_ located at _localhost/files/2011/07/40c.jpg_ ; I want the file to show up **only** when called by HTML on the local domain (here: _localhost_ ). So **not** on any other site on the WordPress Network, any other domain or when accessed directly (IE. visiting _localhost/files/2011/07/40c.jpg_ ). Preferably, this would be done by using WP_Rewrite within functions.php of the theme for this site; as that would easily limit the impact to just that site. But using the .htaccess in WordPress root also is a viable option, though I assume that would mean that the domain itself would have to be specified there (IE. _localhost_ ). Any suggestions on how to accomplish this? I've had very little luck through searching StackExchange, WordPress.org and Google.


title: Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error

text: I refer to this question previously asked and not suitably answered: Wordpress overriding actual subdirectories and also Non "Wordpress" pages/code getting 404 error. I have the same problem and I have tried nearly everything I found on the net. It's definitely related to having permalinks turned on in the wordpress. However, I have put a new .htaccess file in the subdirectory with: RewriteEngine off and the problem still exists. Even if I completely delete the wordpress .htaccess file the problem still exists. I have also tried some other suggested solutions such as ErrorDocument 401 "Unauthorized access" and ErrorDocument 404 "Unauthorized access" and Redirect 301 /mysubdirectory http://www.mydomain.com/mysubdirectory/index.html in various locations all to no avail. Can someone please offer another solution? The only way I can fix it is to turn permalinks off but we need them to be on. Thanks, Nicole


title: How to deal with the confliction between PHP-Markdown and MathJax?

text: I use PHP-Markdown plugin in WordPress. In order to show the formula beautifully, I add some code to use MathJax. Like this:               <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>     <script type="text/x-mathjax-config">     MathJax.Hub.Config({         extensions: ["tex2jax.js"],         jax: ["input/TeX", "output/HTML-CSS"],         tex2jax: {         inlineMath: [ ['$','$'], ["\\(","\\)"] ],         displayMath: [ ['$$','$$'], ["\\[","\\]"] ],         processEscapes: true         },         "HTML-CSS": { availableFonts: ["TeX"] }     });     </script>      But something wrong happens. Once my formula contains at least two underlines, the MathJax doesn't work. Such as `$$P_1, P_2$$`, and the words between the two underlines will be transformed to italic. The formula will be transformed by PHP-Markdown first, and it can't be transformed by MathJax again. Could you help me?


title: Set Post Thumbnails in Percents

text: I've built this responsive site on WordPress and got a little curious as to how I can set the post thumbnails in percentages. Any help would be much appreciated.


title: Where does the 404 redirection happen?

text: Can someone please tell me where the 404 redirection occurs? I am wanting to redirect to a custom template.php instead of the 404 page. Is this possible to do? If it is can some one provide me with a solution. Thanks Ravi


title: How to add media from front-end to an existing post and edit file title

text: with the code from this question: run ok, but I need add one input line to write the title of the file attach and save this title in media when upload this file.


title: Problem getting current post tags to show in a widget

text: I have tried tons of examples and suggestion on this topic but I can not get them to work. What I am trying to do is display the tags associated with the current post in a widget. I have built the widget and the widget works fine but I can not write the code to query the posts tags and display them. I understand the basics that needs to be done to get post meta from outside the loop but I can not pull the exact code together. Can someone start me off by showing me a piece of code to get the current post tags and display them from outside the loop? I can handle making the output look fine.


title: What server settings are required to import WordPress XML file

text: I am trying to import my site using the WordPress import XML page. My XML file is 7mb so when I try to import it I receive a "500 Internal Server Error" page. I read some other posts and tried using the "WordPress WXR File splitter" and tried to split the files into files only 300kb each. Tried to import again and still receive the 500 error page. I am on a VPS server so can change settings if required. Where would I find the error log to view what is going on and do I need to change any server settings to get WordPress to import my XML file. Thanks.


title: Page template that uses lightbox to display post images

text: I have created a page template that displays the featured image for all posts of a certain custom post type. It uses a normal loop that is querying that specific custom post type. The thumbnails are being displayed using `<?php the_post_thumbnail('project- thumb'); ?>` I now want to use a lightbox to display the rest of the images in the post. I believe that I need to use `<?php wp_get_attachment_image_src(); ?>` For some reason I can't quite get my head around it. Can anyone point me in the right direction? Thanks in advance!


title: Can I start to build a site before choosing/registering its domain?

text: I am a photographer and want to build a site for a specific part of the photography market. I have not yet decided on the domain name, but would like to start building the site (as I know what content I want on it). Can I build a site before deciding on a domain name for that site? And if so, where can store this site, if not on the net at its (yet unchosen) domain. I realise that ideally I would just choose a domain and get building, but choosing the right domain is taking some time so I want to start building so I can be ready to go once I have settled on the domain. I have a web host who has Fantastico WP installer. Thanks, Cormac


title: Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)

text: How do I add a minimum word count to the Excerpt field before the post can be sent for pending review? I want to require content in the Excerpt field. And also, how do I add the Excerpt field as a condition to the WyPiekacz plugin? WyPiekacz is a plugin that checks if posts that are submitted for review satisfies a set of rules.


title: Add custom data (field) to sidebar widgets for later display

text: I am building a theme that allows widgets to be dragged & dropped, essentially turning WP into a desktop-like environment where the admin controls what "apps" are available via the widget panel. This is going reasonably well, except that it would be nice is if there were a way for the admin to store starting locations for all of the widgets (and presumably, more meta-data later) In practical terms, this means I want 2 custom fields to appear on each widget in the admin panel, and then for there to be a hook to spit that data out when the widgets are printed on the page (in my case as some inline style values). I am building this "desktop" using home.php I am not sure if wordpress is actually built to do this, but it seems vaguely plausible. Any thoughts? Thanks!


title: How to pass a search $_GET parameter to a new custom search page?

text: So far in my wordpress installation I have a complete wordpress search page that I can call by going to: `/?s=mysearchstring` And this searches through wordpress pages containing the "`mysearchstring`" string. So I have created a new page "Custom Search" (`/custom-search/`) and assigned a template file `custom-search.php` (same code as `search.php`). How can I add a keyword parameter to this? `/custom-search?s=mysearchstring` doesn't quite work, it only shows 404 Page Not Found, while `/custom-search/` displays a search page as an only result. `custom-search.php` **code** :               <?php     /*     Template Name: Custom Search     */     //Post ID         global $wp_query;         $content_array = $wp_query->get_queried_object();         if(isset($content_array->ID)){             $post_id = $content_array->ID;         }         else $post_id=0;          $template_uri = get_template_directory_uri();          //Search         $allsearch = &new WP_Query("s=$s&showposts=-1");         $count = $allsearch->post_count;         wp_reset_query();         $hits = $count == 1 ? $count." ".__("hit for","goodweb") : $count." ".__("hits for","goodweb");          get_header();      ?>      along with the html listout. What can I do to pass the parameter search query to this page?


title: Timthumb script being compromised - What precautions to take?

text: Read an article about Timthumb script being compromised making WP installations vulnerable. Source here Taking a look at timthumb.php, There is the following function, which I presume is the culprit.               function checkExternal ($src) {              $allowedSites = array(             'flickr.com',             'picasa.com',             'blogger.com',             'wordpress.com',             'img.youtube.com',         );      Since my site is highly customized (therefore is complicated to update timthumb), would it suffice to delete those external domains as all the images are hosted on my server and hence doesn't require any of the 3rd party domains?


title: What does making sure "that your theme is Wordpress header and footer tag enabled" mean?

text: I am trying to get this plugin to work (http://wordpress.org/plugins/prettyphoto/), and there is a reference to: > Make sure that your theme is WordPress header and footer tag enabled > otherwise this plugin won't work. I don't understand what is meant by 'header and footer tag enabled'.


title: Force WP to use a certain search template

text: Any way to do this? I'd like for all the search results to be run through wp advanced search ( https://github.com/growthspark/wp-advanced-search ) so they appear on the wp advanced search page template instead of the default way provided by my theme.


title: Best way to save horoscope data

text: I'm workin on a website that's goin to have two horoscope sections:   1. The normal zodiac - Updated weekly   2. The chinese horoscope - Updated yearly ### The Normal Zodiac This section will have pages for each sign of the zodiac with informations like **current week forecast** , color, gem, best month day and etc. ### The Chinese Horoscope This section will have pages for each sign of the zodiac with informations that will be updated once a year and will have informations like color, gem and etc. as well # The question Should I create a **custom post-type** for each type of zodiac and create single posts for every sign or maybe I can fit all this information inside a good **Pages** structure? And what about some **custom taxonomies** to hold the color, gem, and extra info of each sign? I don't think it's a good idea because there's no search form, filter or something like that to use these informations as taxonomies. What do you guys think it's a good way to store this data without abusing of the system and - yet - keeping it easly maintanble for the site owner?


title: Newer/Older posts links display same posts on every page

text:
I am using a plugin called "Types" to generate custom post types for drink/food recipes. I want to show booth drink and food recipes on the same page. The posts are displaying fine, but for some reason, when you click "newer posts" or "older posts" it will bring you to a new page, but the new page will have the same posts as page 1. Anyone have any ideas? Thanks in advance! Here's my loop:

             <?php query_posts( array('post_type' => array( 'recipe', 'drink-recipe' ), 'cat' => array('12','8'), 'showposts' => 5 )); ?>             <?php if( have_posts() ): ?>             <?php while( have_posts() ): the_post(); ?>             <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" style="background-image:url('<?php echo $image[0]; ?>')">

<?php the_title(); ?>

<?php the_time('F j, Y') ?>
                         <?php echo the_excerpt(); ?>                         <div href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="button">Read more

             <?php endwhile; ?>

         <?php previous_posts_link(__('Newer Posts »','blog')) ?>         <?php next_posts_link(__('« Older Posts','blog')) ?>
             <?php else: ?>

<?php _e('None found.','404'); ?>

          <?php endif; wp_reset_query(); ?>          <?php get_footer(); ?>


title: How to set an upload directory for each media type?

text: Is there a way I can set a custom upload folder for each media type? for example: .PNGs should be saved in uploads/png, .GIFs in upload/gifs


title: Using a plugin class inside a template

text: I am writing a plugin to send an invitation to a friend which opens up a form when a link is clicked. I encapsulated all the functions in class by following the code given in the Report Broken Video plugin by @toscho. The relevant code is below:               /*     Plugin Name: Send Invitation     Plugin URI: http://w3boutique.net     Description: Emails a the link of the current page to a friend     Author: Nandakumar Chandrasekhar     Version: 0.1     Author URI: http://w3boutique.net/about-nanda.html     License: GPL2     */          // include() or require() any necessary files here          // Settings and/or Configuration Details go here     define('SEND_INVITATION_MIN_WORDPRESS_VERSION', '3.1.1');          define('SEND_INVITATION_PLUGIN_URL', plugins_url('', __FILE__));          add_action( 'init', array( 'SendInvitation', 'nc_sendinvitation_init' ) );          class SendInvitation {              protected $nonce_name = 'nc_sendinvitation';         protected $post_url = '';              public static function nc_sendinvitation_init() {             new self;         }              public function __construct() {             add_action( 'init', array(&$this, 'nc_sendinvitation_head' ));             add_action( 'init', array(&$this,  'nc_sendinvitation_check_wordpress_version' ));            add_action( 'init', array(&$this, 'nc_sendinvitation_form_action' ));            //$this->post_url = $this->nc_sendinvitation_get_post_url();        }             public function nc_sendinvitation_head() {            wp_enqueue_script( 'jquery' );            wp_enqueue_script( 'send_invitation_js',             plugins_url( 'js/send-invitation.js', __FILE__ ),             array( 'jquery' ) );                 wp_enqueue_style( 'send_invitation_css',             plugins_url( 'css/send-invitation.css', __FILE__ ) );        }             public function nc_sendinvitation_check_wordpress_version() {            global $wp_version;                 $exit_msg = 'Send Invitation requires version '         . SEND_INVITATION_MIN_WORDPRESS_VERSION         . 'or newer Please     update!';                 if ( version_compare( $wp_version, SEND_INVITATION_MIN_WORDPRESS_VERSION, '<') )            {                 exit( $exit_msg );            }        }             public function nc_sendinvitation_form_action() {                  $action = '';             if ( $_SERVER['REQUEST_METHOD'] != 'POST' )             {                  $action = $this->nc_sendinvitation_get_form();             }             else if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {                 $action = $this->nc_sendinvitation_handle_submit();             }             return $action;        }             public function nc_sendinvitation_get_form() {            // Start the output buffer, prevents content being output directly into            // script, instead it is stored in a buffer which can then be flushed            // to allow the include file to be stored in a variable            // See http://www.codingforums.com/showthread.php?t=124537            ob_start();            include('send-invitation-form.php');            $send_invitation_link = ob_get_clean();                 return $send_invitation_link;        }             public function nc_sendinvitation_handle_submit() {              if ( isset( $_POST['form_type'] ) && ( $_POST['form_type'] == 'nc_sendinvitation' ) ) {                 $to = 'navanitachora@gamil.com';                 $subject = 'Invitation to SwanLotus';                 $message = 'Navanitachora invites you to take a look at this link';                 wp_mail($to, $subject, $message);                 $result = 'Email was sent successfully';         }         else {             $result = $this->nc_sendinvitation_get_form();         }         return $result;     }          public function nc_sendinvitation_get_post_url() {         global $post;         $blog_id = get_option('page_for_posts');         $post_id = '';         if (is_home($blog_id)) {             $post_id = $blog_id;         } else {             $post_id = $post->ID;         }              return get_permalink($post_id);     }     }     /* End of File */     ?>      I am at a loss as to how to use this class in my template so that I can display the form. I know that I need to instantiate the class but I am not sure where to put the code and how to access the object so that I can use it in my template. I have knowledge of OOP but have not used it in this context before and require a little bit of step by step instruction. Many Thanks.


title: Display Gallery Images from Custom Post Type

text: I want to display all the images added as gallery in a post with prettyphoto class. I am using this code.                   <?php             /* The loop */             while ( have_posts() ) : the_post();                 if ( get_post_gallery() ) :                     $gallery = get_post_gallery( get_the_ID(), false );                       /* Loop through all the image and output them one by one */                     foreach( $gallery['src'] AS $src )                     {                         ?>                           <a href="<?php echo $src; ?>" rel="prettyPhoto[pp_gal]"><img src="<?php echo $src; ?>"  alt="Gallery image"  />                          <?php                     }                 endif;                 endwhile;         ?>      Its is displaying the photos but it is showing only thumbnail as src. I want to display Full Image. How can i display full image instead of thumbnail ?


title: Disable / Deregister all JS from all plugins

text: How can i disable all js files from plugins and load one single js file which i have combined and compressed ? Is there any way ?


title: import (migration) user database to wp-users

text: I am having hard time for importing to user-meta and post-meta from my non-wp- tables. I am trying to do db migration from user table and post table to WordPress tables. So it might be   * user table to wp-users and wp-usermeta   * post table to wp-posts and wp-postmeta I have been trying to find good plugins but it's all limited. (only basic information) My old user table has all of users information on **only 1 row (1 line)** such as `phone number, mobile, DOB..` etc. These have to be on user-meta table. Old user tables and wp-users are on same database now. How can I insert user information from old user table to wp-user(for basic information) and wp-usermeta (for extra information)? Is it possible to make it with PHP coding? (because it's on same database) I am trying to figure it out how to do with php coding or something else. If anyone knows can you advise me a sample coding? or anybody knows any good plugins? all of them I found are not enough to put all of user information.


title: Display the first post's comments of category in comments.php template

text: I want the display the comments from first post of the category only. Example; Category   - Post 1 (2 comments)   - Post 2 (1 comments)   - Post 3 (5 comments)  If I am reading the **Post 2** or **Post 3** , I should see **2 comments** of the first post. How can I code this from template files? Thanks for your helps.


title: WooCommerce Order Status Displays Twice on Order Page

text:
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.


title: Admin toolbar shows up when not logged in

text: 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)


title: How can I implement jQuery plugin correctly with my CPT?

text:
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 :)


title: Differentiate Featured Image from Post Images upon Upload

text: 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).


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

text: 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.


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

text: 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?


title: Exclude a 'portfolio' custom category?

text: 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']                          )                      );             }


title: Display and hide content using checkbox in Options Framework Theme

text:
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.


title: Remove [...] from RSS feed?

text: 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?


title: Exclude Specific Term from Search

text: 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


title: Fetching ten ten records from JSON API in word press

text: 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


title: Custom post type permalink structure to include the taxonomy

text: 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?


title: Multiselect value in wp_query

text: 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.


title: Please suggest me some plugins in WordPress networking

text: 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.


title: Blank screen at login/logout - tried everything!

text: 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


title: Wordpress Next & Previous post outside the loop

text:
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.


title: BBpress error wp-init

text: 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


title: Custom post type won't take my custom fields

text:
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?


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

text:
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.


title: remove child post from custom post type archive

text:
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++;                     }                 }


title: Manually trigger a wp_schedule_event item?

text: 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?


title: Adding Custom fields to woocommerce edit order page

text: 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.


title: Child navigation within a menu

text: 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?


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

text: 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?


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

text: 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.


title: Change the way wordpress outputs images or image galleries

text: 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!


title: Placing generated list into drop-down on custom menu

text: 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


title: SQL query to extract only the "current" wp_posts?

text: 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.


title: Problem with multiple menus in theme

text: 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.


title: Display Notification Bar on Header on Certain Post Count

text: 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.


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

text:
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..


title: Showing up my custom post type in primary navigation

text: 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?


title: How to show only child categories using the_category();

text: 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();**?


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

text:
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.)


title: 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?

text: 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


title: Can't query by meta_key

text: 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);


title: How to find the exact widget details

text: 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


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

text:
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     ?>


title: Manage Columns : order by post_parent's title

text: 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,


title: Exclude Tags from get_the_tags

text: 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.


title: WordPress Post Voting - Vote once per IP on entire site

text: 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);     }


title: Add ID to target navigation link

text: 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


title: Setting up staging area

text: 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.


title: Theme Customiser Image Control

text: 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?


title: Conditional Custom field with foreach

text: 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) ;     ?>


title: Wordpress Ecommerce handling multiple option groups & prices

text: 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.