title: Uploading DB to server from local is not matching the post dates

text: I just created a custom WP CMS and am having trouble with the custom post maintaining the correct order on the front-end. In the back end the date order is correct but is not being reflected on the front-end in the same order. When I download the DB to my local machine, the order is right but once on the server, it shows up differently?


title: Change admin language based on user (in single-site)

text: I'm trying to make a small plugin to install in some sites of a german client. I can make my way around WordPress in german, but would be easier if it was in english. There's a plugin that manages this (WP Native Dashboard) and albeit it does it wonderfully, it's too heavy weight to what I need. The client don't need this, I do.   Tried to emulate it to no avail... It stores a database option to check for swapping instead of `$current_user`. But I didn't get the logic for this to work. So, I'm trying to adapt this solution given by toscho, but looks like I'm not making the hooks in the correct points of WordPress process. The question is: what bit is missing _(or I'm messing)_ in the following code?               <?php     /*     Plugin Name: Set User Locale     Plugin URI: http://wordpress.stackexchange.com/q/53326/12615     Description: changes the admin language according to user_login     Version: 1.0     Author: wordpress-stackexchange     */          class Wpse53326_ChangeLocaleOnDemand     {              public function __construct()         {                    add_action('admin_init', array(&$this, 'on_init'));             add_filter( 'locale', array(&$this, 'on_change_language') );         }              public function on_init()         {         }              public function on_change_language( $locale )         {             global $current_user;                         // this prints the current user_login without problems              // global $firephp;              // $firephp->log($current_user->data->user_login,'user_login');                  //  the following works for backend/frontend             // but if I try this conditional, it don't: if (is_admin() && 'the_user_login' == $current_user->data->user_login)             if( is_admin() )             {                 return 'en_US';                      }             return $locale;         }     }          $wpse53326_ChangeLocaleOnDemand_instance = new Wpse53326_ChangeLocaleOnDemand();


title: WP Cron job every 1st and 15th of the month

text: Trying to set up custom schedules for WP Cron, knowing that they use an interval is it even possible to set up a cron job for every first of the month? As well as every fifteenth. This is what I have so far:               private function cron_schedules( $schedules ) {              $midnight = strtotime( "midnight", current_time( 'timestamp' ) );         $first = strtotime( 'first day of this month', $midnight );         $fifteenth = $first + (7 * 24 * 60 * 60) * 2;              $schedules['1st'] = array(             'interval'  => $first,             'display'   => __('1st of every month'),         );              $schedules['15th'] = array(             'interval'  => $fifteenth,             'display'   => __('15th of every month'),         );              $schedules['weekly'] = array(             'interval'  => ( 7 * 24 * 60 * 60 ),             'display'   => __('Weekly'),         );              $schedules['biweekly'] = array(             'interval'  => ( 7 * 24 * 60 * 60 ) * 2,             'display'   => __('Biweekly'),         );              return $schedules;          }


title: Create posts on user registration

text: How can I create let say 3 posts after the user finish the registration ? The ideal outcome would be to create 3 posts using the user as the author of the posts and with some pre-defined values. (post title and slug) The post title and slug would be created from info that the user will provide on the registration form. An example: User registers and provide Name, Surname, Email (all fields are mandatory) Three posts are created and the user will be the author of each post. Each post will have in the title and slug info from the registration form   * 1- Jon Doe Bio | jon-doe-bio   * 2- Jon Doe Portfolio | Jon-doe-portfolio   * 3- Jon Doe Contact | jon-doe-contact *In the example above it seems unnecessary to have the ability to edit the slug but there will be posts with words like: in, is, at, and, that will be removed otherwise. Also note that the "pre-defined values would be: Bio, Portfolio and Contact. It would be close to the "welcome" posts created by wordpress after install. Any idea of how to ? I know I need to use `wp_insert_post( $my_post );` and probably `add_action('user_register', 'some_function');` but I don't know how to create 3 posts in one shot using `wp_insert_post( $my_post );` and how to trigger that after the user finish the registration process. Any idea how to accomplish this ? Thanks in advance.


title: Target all images that are not the first attachment

text: I'm querying image attachments on a template I'm writing.   For a layout purpose, I'd like to apply a css class to all the images that are not the first.   Here is the code I'm currently working on, I'm stuck with the last if statement. But my php knowledge is very shallow, hope someone can help me writing this.               <?php $args = array( 'post_type' => 'attachment',                 'numberposts' => -1,                 'post_status' => null,                 'post_parent' => $post->ID );              $attachments = get_posts($args);             if ($attachments) {                     foreach ( $attachments as $attachment ) {                             echo the_attachment_link( $attachment->ID , 'full' );                             echo $img_count > 1 ? 'rel="'.$post->ID.'"' : '';                             // OK all my post attached images are visible.                      }             }                         //if image is not the first one then add class="fantome"                         if ( $attachments != $first_attachment ) {                             echo '<a class="fantome">';                              }             ?>


title: Adding a navigation page state to individual blog and portfolio pages

text: I'm using a Woo Themes template (Simplicity) for a client's web site. I'm using the portfolio page as the profile pages (Our Trainers). Also have a blog category in the main nav. How do I get the individual "portfolio" and blog pages to set the nav current page (.current_page_item)?


title: Not able to put link on featured image

text: I have one front slider and I am just showing featured image within front slider, but not able to put link of post on featured image in WordPress.               <img src="<?php echo $thumb_small;?>" alt="<?php the_title();?>">      this is code by which featured image is showing in front slider and I tried this code for put link on image..               <a href="<?php the_permalink(); ?>"><img src="<?php echo $thumb_small;?>" alt="<?php the_title();?>"> not working..      please help me...


title: Custom Field box history

text: I entered a test value ("hhhhhhhhhhhhhhhhhhhh") in my custom field box at some point, and now it always appears in the drop down when I am trying to select a value. Is there some way to get rid of this? ![enter image description here](http://i.stack.imgur.com/Cxycp.png)


title: How to add custom css file in theme?

text: Some themes ask you not to edit the style.css file, instead use custom.css file. If you write code on custom.css, it will overwrite the same element style in style.css. I think this is done in order to prevent the loss of user styles on theme update, is it so? **How this works?** Do they already include custom.css file in their theme? But how this file is included in the theme so that he theme look for style in custom.css first? Thanks.


title: /wp-admin/install.php redirecting to 123-reg

text: This is my first time installing wordpress via FTP, and the first time to an existing host and domain (I normally use EvoHosting, since it's automatic) I've gotten to the stage where I'm heading to /wp-admin/install.php, but it's redirecting to the host - 123-reg.co.uk I'm trying to figure out where I went wrong. I've installed MySQL, but not made any tables (the admin panel I've been given requires a number fields, and cell types to be specified) I'm not entirely sure if I've got the config file correct either though. I was never given a password or db name when I installed it with the admin panel, so I've just been using the password I had to access that.               // Actual username/password removed!     define('DB_NAME', 'example.com');         define('DB_USER', 'user');          define('DB_PASSWORD', 'pass');     define('DB_HOST', 'localhost');      Any help would be really useful here - I'm sorry that I'm so noobish at this, but you have to start somewhere ^^"


title: Do not show on homepage functions.php code needed

text: I'm using a plugin called Float Left Right Advertising however I don't want to work on the homepage. I tried adding this code into the functions.php but it doesn't work:               add_action( 'float_left_right_advertising' );           function float_left_right_advertising() {        if ( is_home() ) {          wp_deregister_script( 'float-left-right-advertising' );       }      Can someone please help me with this?


title: I have a table I created, how do I make a form for a user to filter the data?

text: I have created a table, I now need to filter the data from that table when someone selects options from a form. Whats a good way to do that?


title: What can cause JavaScript and CSS files to be minified?

text: On one of my client's site, I see that my plugin's JS and CSS files are minified. Trying to identify what causes the files to minify, I tried to deactivate all plugins (except mine), and changing the theme to TwentyEleven. However, the files were still minified. What else could cause the files to be minified?


title: One of my pages uses the archive.php template only. Why?

text: I created a page and experimented with Custom Templates. Suddenly I noticed that this page started using the archive.php template and no matter which Custom Template I assigned to it, it continues using the archive template. What could be the reason for this? ## Edit I noticed something interesting. I have a Custom Post Template that has the exact same slug as the page described above. I made another CPT and a page with the same slug and got the same effect. If I change the page slug it starts using the assigned Custom Template. This behaviour seems kind of convenient but why is WP behaving like this? Is it documented anywhere? I'd would be very interesting to read.


title: the_content returns blank when adding SEO details

text: I am using the Thesis theme and wanted a custom style for my pages. So I created a custom template while using thesis hooks and functions where applicable. I am doing this with a solution similar to the method described here so other contributors can use the themes in their pages as well. I am getting the post's content by using the function the_content(). While this works normally and returns the contents of the pages, if I specify the SEO details (meta title, keywords, description etc), the_content() returns a blank. Why should adding meta details to a page affect the_content like this? Would appreciate if someone can help me out with this. Thanks.


title: Change wp_mail SMTP settings for each E-Mail

text: I want to send mails using `wp_mail` function. I have multiple SMTP accounts login details. I want to send some mail using Account A and some using Account B. How can I send mails with different accounts? I saw `phpmailer_init` but it cannot be changed once set.


title: WordPress 302 Redirect to Holding Page

text: Once again struggling with htaccess. I've successfully redirected the home page to my holding page with the following rule but it's not applying to child pages for some reason (mydomain.com/child-page).               # MAINTENANCE-PAGE REDIRECT     <IfModule mod_rewrite.c>      RewriteEngine on      RewriteCond %{REQUEST_URI} !/holding [NC]      RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|eot|svg|ttf|woff|css) [NC]      RewriteRule ^(.*)$ /holding [R=302,L]     </IfModule>      What am I doing wrong? I know it must be to do with the '^(.*)$' bit but I can;t seem to find the correct syntax.


title: Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?

text: Before asking question here I want to tell that I have already asked the question in stackoverflow and wordpress forum but have not got any answer. So finally I came here. I have installed the woocommerce plugin in my wordpress 3.5.2. Everything is fine with woocommerce. I have made a folder called woocommerce and have pasted all the files inside the woocommerce template files inside my template folder. But there is something that I am totally stuck on. In the woocommerce checkout page I want to show cart totals in sidebar. But it is not showing there. In other pages it is working fine. So can someone kindly tell me what wrong here? Any help and suggestions will be really appreciated. Thanks Update Here is the screenshot for the woocommerce cart widget in sidebar which can be shown in all pages except the checkout page. ![enter image description here](http://i.stack.imgur.com/M7VI0.png) Edit:   Additional, how to make this change secure from updates?


title: How to add more custom fields in user meta table simultaneously

text: I am working on a task in which i have to submit some records to user_meta table at form submitting. Actually it is related to employee data and i just want to add records in user meta table. I am doing with this code.               if(isset($_POST['submit']))     {         if($_POST['user_login'])         {                     $user['user_login']=$_POST['user_login'];                     $user['user_pass']=md5($_POST['user_login']);                     $user['user_pass']=md5($_POST['user_login']);         }         if($_POST['email']){    $user['user_email']=$wpdb->escape($_POST['email']); }         if($_POST['url']){  $user['user_url'] = $_POST['url'];  }         if ($mes == '')         {             $flag = 1;             if ($flag == 1 && $message == '')             {                 if ($wpdb->insert("wp_users", $user))                 {                         if($_POST['status'] == 'inactive')                         {                                     $member_type = 'pending';                                     $capabilities = 'a:1:{s:7:"'.$member_type.'";b:1;}';                                     $meta_user['capabilities'] = $capabilities;                               }                         elseif($_POST['status'] == 'active')                         {                                 $member_type = 'employee';                                 $capabilities = 'a:1:{s:8:"'.$member_type.'";b:1;}';                                 $meta_user['capabilities'] = $capabilities;                          }                          $customer['company_id']=$company_id;                     $customer['user_id']=mysql_insert_id();                     $customer['owner']='N';                          $metauser1['user_id'] = mysql_insert_id();                     $metauser1['meta_key'] = 'member_type';                     $metauser1['meta_value'] = 'employee';                          $metauser2['user_id'] = mysql_insert_id();                     $metauser2['meta_key'] = 'nickname';                     $metauser2['meta_value'] = $user['user_login'];                          $metauser3['user_id'] = mysql_insert_id();                     $metauser3['meta_key'] = 'capabilities';                     $metauser3['meta_value'] = $meta_user['capabilities'];                          if( $wpdb->insert("wp_company_user", $customer)   && $wpdb->insert("wp_usermeta", $metauser1) && $wpdb->insert("wp_usermeta", $metauser2)&& $wpdb->insert("wp_usermeta", $metauser3))                     {                         $_SESSION['mes']="Record has been inserted successfully.";                          exit;                     }                 }                    else                 {                     $message="Record could not be inserted.";                 }             }                 }         else         {             $message = $mes;         }     }      I know this is not an efficient way to do this, there should be another way to insert custom meta key and meta values in user meta table. How can i make my code efficient please tell me. Please let me know if any code is broken.


title: Display unused categories in dropdown

text: I have created a front end post with a form and I would like to have several categories for the user to choose between. But the problem is that the dropdown category only show those categories that are in use. I need it to show all categories even if they are not in use. The code I'm using is following:               wp_dropdown_categories(   'show_option_none=Kategori&tab_index=4&taxo. nomy=register_vote_category' );


title: wp_handle_upload Image sizes

text: What's the simplest way of getting `wp_handle_upload` To either change the size of the image it is uploading, or to get WordPress to generate the 3 sized images like it does in "crunching" when adding new image in the media library? I've seen some very complex solutions and really I want something much leaner! The best solution would be to get WordPress to automatically generate the thumbnail etc..


title: How to let users sort list of categories?

text: In my homepage, I have listed all of categories, under which their posts, are listed like this:               Category 1           post 1           post 2           post 3     Category 2           post 4           post 5           post 6     Category 3           post 7           post 8           post 9      I want to let registered users, sort the categories as they want, for example like this:               Category 2           post 4           post 5           post 6     Category 1           post 1           post 2           post 3     Category 3           post 7           post 8           post 9      And want it to be:   1. **per registered user** , not one setting for all usaers the same   2. **on a widget** on the sidebar   3. **Drag and Drop** sortable list What do I have?   1. I think the 2 and 3 are not so hard. I can search for How to Write Simple Wordpress Widgets for the 2 and implement jQuery Sortable library for the 3. I just dont know how to implement the 1?  Any suggestions, ideas?


title: Order posts (across the whole site) by metadata date

text: My custom 'Home' page is set to sort my custom posts via the custom date field with this (updated to be custom named) code in functions.php:               // sort order for home page     add_action('wp', 'wwgo_check_page');     function wwgo_check_page () {     if (is_page()) {         add_filter('get_previous_post_sort', 'sort_it');         add_filter('get_next_post_sort', 'sort_it');         add_filter('posts_orderby', 'sort_it' );         add_filter('posts_join', 'join_it' );         add_filter('posts_where', 'where_it' );              function sort_it () {             global $wpdb;                  return " $wpdb->postmeta.meta_value ASC ";         }              function join_it( $join ) {             global $wpdb;                  $join .= " LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id) ";                return $join;         }              function where_it( $where ) {             global $wpdb;             $where .= "AND $wpdb->postmeta.meta_key = 'deadline' ";                return $where;         }     }                    }      Which is dandy and simple. Now. I want this to work across the whole site. I want posts on archive pages, categories etc to be sorted first by the custom date field. Any ideas? I have tried changing the '`if`' to `is_archive()` but that had no effect. I tried `<! is_single()>` too. _I'm sure it should be something simple. But I'm new to php and thus clueless._ Here is the site, where you can see the home page is nicely sorted, but if you click 'poetry' (the only one with a few posts), sorting doesn't work. Any suggestions will be met with much joy. Thank You Kindly.


title: Good website screenshot plugin

text: I'm looking for a good plugin I can integrate in my template to show screenshots. Today I am using Wordpress Simple Website Screenshot, but it's too unstable. I post a lot of posts per day and my problem is that it doesn't load all the screenshots. You have to reload several times before it shows. This is not acceptable for me. One solution could be to store the screenshots locally to make it more stable. Do you have any suggestions how to make this as stable as possible? Link to example post: http://bit.ly/jjO4z1 (with bit.ly because of google searches on the site)


title: Choose options via url

text: I wonder if it's possible to preselect options when creating new post via url. My goal is to bookmark links when i want to create post with specific options such as category and not to have to select them each time. Thanks


title: Best Practise on embedding code on Wordpress?

text: I have two blog sites. One hosted with Wordpress.com, one self-hosted with Wordpress.org We are a technical company, and a number of our blog posts will be about HTML, Javascript, .NET, etc. and we would like to embed code snippets within our posts. We have about 20 authors on each blog, and from experience, I need to make inserting code snippets as easy and user friendly as possible. * * * **Wordpress.org**   I saw, for Wordpress.org, this article.   From what I understand, when writing with the HTML editor, if you apply the tags `<code> some code</code>` then this preserves the formatting.   - Its ok. But the major downfall, is ease of use. For example, compare it to stack exchange text editor - there is no need to switch to HTML view and write tags, you use the 'Code Sample' button. I know there are a heap of plugins out there.   Is there a general consensus on the best way to embed code in wordpress.org posts? > My requirements are for it to be as easy as it is with Stack Exchange. * * * **Wordpress.com**   It appears I can also use the code tags with wp.com.   I guess the advanatage of telling my users to use this approach, would mean there would not be any confusion with authors who contribute to both blogs. I was currently using the 'preformatted' text format from the extended toolbar (kitchen sink).   I assume there are no other options?


title: List child terms and posts in the current term

text:
With this code parent term page lists all the child terms and the child term page lists all of the posts in current term, and the single page lists a big flat list of terms(hierarchical). Now, The parent term page is fine. When it's child term page, i want to list all child terms( not showing with this code ) + the posts in current term( showing ). And when it's single post, i want to list the same as child term page.                       $term = get_queried_object();             $tax = 'ntp_package_type';             $parents = $term->parent;             $term_id = $term->term_id;                  if($parents == 0){                 wp_list_categories( array (                                 'taxonomy'  => 'ntp_package_type',                                 'pad_counts'=> 0,                                 'title_li'  => '',                                 'child_of'  => $term_id,                                 )                 );             }             elseif (is_tax($tax, $term->name)){                      $args = array(                         'post_type' => 'ntp_package',                         $tax => $term->name,                 );                 $wp_query = new WP_Query($args);                 if( $wp_query->have_posts() ):                 while ( $wp_query->have_posts() ) : $wp_query->the_post();                 echo "
".$post->post_title."
";                 endwhile;                 endif;                  }             elseif (is_single()){                  }      It is for a sidebar sub nav. is it a right way to do? I'd really appreciate any help.


title: jQuery Validate wp_editor

text:
I have a form, and in the form, I use               <?php wp_editor('', 'user_submitted_progress', $settings = array('textarea_name' => 'user_submitted_progress')); ?>      to generate a TinyMCE, rather than a simple `textarea`. The problem is that I can't get the wp_editor to be validated by jQuery Validation. Here is my code for jQuery Validation               $(document).ready(function() {         $("#user_submitted_post").validate({                  errorPlacement: function(error, element) {},                  debug: false,             rules: {                 user_submitted_title: {required: true},                 user_submitted_progress: {required: true},                 user_submitted_goals: {required: true},                 user_submitted_categories: {required: true},                 user_submitted_tags: {required: true},             },                  invalidHandler: function(form, validator) {                 var errors = validator.numberOfInvalids();                 if (errors) {                     $("#error-message").show().text("Please make sure that all required fields have been filled out.");                 } else {                     $("#error-message").hide();                 }             },                  submitHandler: function(form) {                 tinyMCE.triggerSave();                 var serialized = $(form).serialize();                 console.log(serialized);                 $(form).ajaxSubmit();             }              })     })      Here is my form:               <?php if (is_user_logged_in()) { ?>

              <form id="user_submitted_post" action="" method="POST" enctype="multipart/form-data">
Title
             <input type="text" id="user_submitted_title" name="user_submitted_title" value="">
Please provide detailed information about the long-term goals of your project, as well as your current project progress. Feel free to format your text using boldness, italics, lists, and block quotes. Simply click on the formatting option you'd like to use and start typing. When you no longer need the format you have selected, hit enter to go to the next line, and click on the active format button to end formatting.

Project Progress
             <?php wp_editor('', 'user_submitted_progress', $settings = array('textarea_name' => 'user_submitted_progress', 'media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 15, 'editor_css' => '', 'tinymce' => add_filter("mce_buttons", "base_extended_editor_mce_buttons", 0), add_filter("mce_buttons_2", "base_extended_editor_mce_buttons_2", 0)) ); ?>
Project Goals
             <?php wp_editor('', 'user_submitted_goals', $settings = array('textarea_name' => 'user_submitted_goals', 'media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 15, 'tinymce' => add_filter("mce_buttons", "base_extended_editor_mce_buttons", 0), add_filter("mce_buttons_2", "base_extended_editor_mce_buttons_2", 0)) ); ?>
Category
             <?php wp_dropdown_categories($args = array('selected' => Uncategorized, 'orderby' => 'name', 'hide_empty' => 0, 'hierarchical' => 1, 'id' => 'user_submitted_categories', 'name' => 'user_submitted_categories')); ?>
Tags

Separate tags with commas.
             <input type="text" id="user_submitted_tags" name="user_submitted_tags" value="">
Video

Copy and paste links from Youtube and Vimeo in the field below
             <textarea id="user_submitted_video" name="user_submitted_video"></textarea>
Audio

Copy and paste links from Soundcloud in the field below
             <textarea id="user_submitted_audio" name="user_submitted_audio"></textarea>
Images
             <input type="file" name="upload_attachment[]" multiple="multiple">                  <?php wp_nonce_field('post_nonce', 'post_nonce_field'); ?>                  <button type="submit" name="submitbutton" id="submitbutton">Submit</button>              </form>          <?php } else { ?>              <?php echo 'Sorry, but you need to be logged in to see that. You can          <?php echo wp_login_url( get_permalink() ); ?>         <?php echo '" title="Login">login here'; ?>          <?php } ?>      How do I get `.validate` to validate the text that the user types in the wp_editor? Don't mind the crazy long array for the wp_editor. I just put all of the css in that array, because I'm still just testing all of this in the Twenty Twelve theme. Any help is appreciated.


title: Show image exactly defined to a width

text: I have a photoblog displaying posts as image galleries having width 500px and some posts as single image of width 900px. For posts with 900px width images, I made `category HQ`. Posts with 500px width image galleries display fine. But those posts having single image doesn't display image of width 900px width instead 584px. E.g. Post content for 900px width image:               <img class="alignnone size-full wp-image-15735" alt="Camping in the Rocky Mountains " src="http://abc.com/wp-content/uploads/2013/05/Camping-in-the-Rocky-Mountains.jpg" width="900" height="700" />      Getting image info in browser shows 584px width. On further inspection, I came to know that there is a `$content_width variable` in `functions.php` set to 584px. I can't change it as I read it is for oEmbeds. How to get this 900px width image to show as 900px width?


title: Display external RSS feed on pages

text: i'm working on a website that is built on WordPress & the Genesis Framework. I'm looking to display an RSS feed From Feedstich within WordPress pages in the middle of the content. What is my best bet of doing this, is there a plugin that can use shortcodes or is there a way I can use php in pages to display them?


title: Displaying a widget only on long posts (over X characters)

text: I'm looking to display a standard wordpress widget only on posts that are over X amount of characters in length (or another method that can roughly calculate the height of of a post.) I am looking to include some additional advertising in the sidebar of my sites posts that are very long and thus have empty sidebar space. On shorter posts this is not necessary to display this large additional advert as then otherwise the sidebar would be longer than the main content body and cause issues with layout. Does anybody know the best solution to achieve this? I understand it may not be a common thing to ask, but if it's a simple enough solution it could be worth while to implement on the site. Thanks to anyone who can offer some assistance.


title: Custom booking form field not saving

text: I am trying to follow this debugging tutorial on adding custom booking form fields - Link My intention is to add a field, which is required, that is saved amongst the other user data when they register to an event. So, should they book an event again in future, the custom field will already be filled in, like the forename, surname etc... So far I have added my custom field to this file - event/wp- content/plugins/events-manager/templates/forms/bookingform/booking-fields.php               <p>     <label for='user_practice'><?php _e('Practice','dbem') ?></label>     <input type="text" name="user_practice" id="user_practice" class="input" value="<?php if(!empty($_REQUEST['user_practice'])) echo esc_attr($_REQUEST['user_practice']); ?>"  />     </p>      Which is outside the if statement that includes the name, phone and email:               <?php if( !is_user_logged_in() && apply_filters('em_booking_form_show_register_form',true) ): ?>          <?php endif; ?>      Half way down the support page (link above), Marcus, the plugin's author says to use the 'em_booking_validate' function. The only issue is, I'm not sure how or where to use it! I added this to the bottom of my bookings-field page, but I've tried submitted the form and the custom data hasn't followed:               <?php if( ! empty( $_REQUEST['user_practice'] ) ){             $EM_Booking->booking_meta['registration']['user_practice'] = wp_kses( $_REQUEST['user_practice'], array() );         } ?>      Any guidance / support would be appreciated.


title: Converting static website to wordpress

text: I have a static website http://www.powersolutionindia.com/ which i want to add blog functionality. There are approximate 10 static html pages in this website, just i want to add seamless blog to this website in wordpress. I want to convert design in wordpress, then create all pages in wordpress or if wordpress allows static content. Then i want navigation is populated by wordpress so when i add few more page i have to just click pages->add page and it will show in navigation. There is a javascript image scroller which i want to serve if possible by some post type or any other means, so that if i post 10 images in this image scroller, and turn off 5 of them, i can do that. Is all this possible in wordpress, dose it affect seo? I get befitted by converting to wordpress as this website is getting top ranking in google for few keyword? I have knowledge of wordpress, php html css, i can convert html css to wordpress blog layout theme, just i can't figure out how i serve these static pages.


title: automatically add new post type to its menu list

text: In case of menus that contain items other than pages, such as custom post types, posts, posts of a certain category, etc. How can I make wordpress to automatically (programatically) add a new item to the menu when that new item is just created? I don't want users to manually add this new item in Appearance -> Menus ... Should I use the fallback_cb of wp_nav_menu()? I need to use that for a custom post type and for posts of category:restaurant for example. I am also interested in being able to highlight the current visited item. Thanks in advance.


title: wp_insert_user not creating account correctly when ID is manually set

text: So, I'm trying to create a new user account with `wp_insert_user` based on credentials I receive from a Facebook user profile. I want the new user account ID to equal the Facebook account ID (ex: 1352348133). If I set the `ID` parameter as per the Wordpress wp_insert_user reference page the user account is not created in `wp_users` as I would expect, however all the relevant meta data IS inserted in the `wp_usermeta` table. If I remove the `ID` parameter from the array I pass to `wp_insert_user` it creates the new record in `wp_users` as it would normally. I was expecting to get a return error but it actually returns the newly created user ID on success. Here is an example of the code I'm passing:               $insert_user = wp_insert_user(array(         'ID'              => 1352348133,         'user_login'      => 'jdizzle',         'user_nicename'   => 'jdizzle',         'user_url'        => 'https://www.facebook.com/jdizzle',         'first_name'      => 'Jared',         'last_name'       => 'Eitnier',         'display_name'    => 'Jared Eitnier',         'nickname'        => 'jdizzle',         'user_registered' => date('Y-m-d H:i:s'),         'role'            => 'customer'     ));      and the return value of               1352348133      I thought maybe the `auto_increment` on the `ID` field in `wp_users` might affect something but disabling that had no effect. Typecasting as an `int` had no effect. Length of the int isn't an issue.


title: Listing subpages title and content and styling the first iteration differently

text:
So for now, every iteration looks the same and it's been a while since I dealt with php so could you help me?                  <?php     $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');     $count = 0;     foreach($pages as $page)     {         $content = $page->post_content;         if(!$content)             continue;         if($count >= 2)             break;         $count++;         $content = apply_filters('the_content', $content);     ?>         <div id="<?php echo $page->post_title ?>">
<?php echo $page->post_title ?>
         <?php echo $content ?>
     <?php     }       ?>      I've look there and there and found that I coud Use something like this               <?php foreach ($pages as $page) : start_wp(); ?>         <?php if ($i == 1) : ?>      //first iteration        <?php else : ?>     //the rest


title: Create custom page from custom rewrite

text: I want to know how to create a custom page with a custom URL route, but I only found how to define a custom URL and custom route (rewrite URL) to any post- type. The problem is that I don't want a custom page for a post type. I only want to create a page that is rendered when the URL is entered. Something like this:               http://mydomain.com/services      What I did on a plugin I'm creating is this:               function geofarma_add_rewrite_rule($rewrite){         $rewrite->rules['services/'] = 'index.php?services=yes';     }          function geofarma_register_query_vars($vars){         $vars[] = 'services';         return $vars;     }          function geofarma_url_rewrites_template(){         if(get_query_var('services')){             add_filter('template_include', function(){                 return get_template_directory() . '/geofarma-rest-services.php';             });         }     }          add_action('generate_rewrite_rules','geofarma_add_rewrite_rule');     add_filter('query_vars', 'geofarma_register_query_vars');     add_action('template_redirect', 'geofarma_json_template_redirects');      But when I go to the URL,I get the **not found page**. Is something wrong with my code?


title: Ajax Contact form plugin

text:
I am facing strange problem .I am building ajax contact form plugin.My problem When I add jquery script in theme footer there is no problem at all everything works fine. But if I add same script from plugin directory it does not work any more.My coding to add script .Please note that if ace.js is added in footer in script tag it works Here is the source https://www.dropbox.com/s/8m64xzueohppuxd/ajax_contactform.zip               add_action( 'wp_enqueue_scripts','webangon_ajax_contact');      function webangon_ajax_contact() {     wp_enqueue_script('ajcontact', plugins_url("/inc/ace.js", __FILE__),array(jquery));}      The form section                   <form method="post" id="mailinglist" action="">

     <input type="text" name="mailinglistname" id="mailinglistname" placeholder="John Doe" />
     <input type="text" name="mailinglistemail" id="mailinglistemail" placeholder="johndoe@hotmail.com" />
     <textarea name="mailinglistcomment" id="mailinglistcomment" cols="58" rows="5" tabindex="4" placeholder="Do you develope websites for FREE?"></textarea>
     <input type="submit" name="submit" class="read-more" id="mailinglistsubmit" value="Send" /><img src="<?php bloginfo('template_directory'); ?>/image/89.gif" alt="" class="ajaxsave" style="display: none;" />     </form>      The jquery part ace.js               jQuery(document).ready(function(){     jQuery("#mailinglist").submit(function()    {         if(jQuery("#mailinglistname").val()=="") {             jQuery("#mailinglist #message").text("Please enter your name.");             return false;         }                if(jQuery("#mailinglistemail").val()=="") {             jQuery("#mailinglist #message").text("Please enter your email address.");             return false;         } else {             var email = jQuery('#mailinglistemail').val();             var name = jQuery('#mailinglistname').val();             var comment = jQuery('#mailinglistcomment').val();             if(email.indexOf("@") == -1 || email.indexOf(".") == -1) {                 jQuery("#mailinglist #message").text("Please enter a valid email address.");                 return false;             } else {                 var data = {                     action: 'join_mailinglist',                     email: email,                     name:name,                     comment:comment,                 };                 jQuery("#mailinglistsubmit").hide();                 jQuery(".ajaxsave").show();                 jQuery.post("<?php echo admin_url('admin-ajax.php'); ?>", data,                 function(response){                     jQuery(".ajaxsave").hide();                     jQuery("#mailinglistsubmit").show();                     jQuery("#mailinglist #message").html(response);                 });                      return false;             }         }           });      }); Finally ajax admin part               add_action('wp_ajax_join_mailinglist', 'join_mailinglist_callback');     add_action('wp_ajax_nopriv_join_mailinglist', 'join_mailinglist_callback');     function join_mailinglist_callback() {     $email = $_POST['email'];     $name = $_POST['name'];     $comment = $_POST['comment'];     $emailTo = "raisulangon@hotmail.com";     $body = "Name: $name Email: $email Comment: $comment";     if(wp_mail($emailTo, $name,$body)){     echo "
Enquiry has been sent successfully
";     }     else     {     echo "
Please Try Again
";     }     die();     }


title: Override default password nag in Wordpress

text:
For some reason my default password nag is playing up on a big multi-user site I've setup. Pretty sure it's got to do with the New User Approve and Gravity Forms User Rego combo that I'm using. Anyway, problem is I need to hack the core WP code every time I upgrade. The wp-admin/includes/user.php file has the 'default password nag' function... so I just change this to the wording I want. But of course it doesn't stick and needs to be done every upgrade! Big hassle.               add_action('admin_notices', 'default_password_nag');     function default_password_nag() {     global $pagenow;     if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') )          return;          echo '
';     echo '
';     echo '' . __('Notice:') . ' ';     _e('You’re using the auto-generated password for your account. Would you like to change it to something easier to remember?');     echo '

';     printf( '' . __('Yes, take me to my profile page') . ' | ', get_edit_profile_url( get_current_user_id() ) . '#password' );     printf( '' . __('No thanks, do not remind me again') . '', '?default_password_nag=0' );     echo '

';     }      Each time I change it to this, which works a treat:               add_action('admin_notices', 'default_password_nag');          function default_password_nag() {     global $pagenow;     if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') )          return;          echo '
';     echo '
Visit your ';     printf( '' . __('profile page') . ' to update your password any time. ', admin_url('profile.php') . '#password' );     echo '

';        }      But I want a permanent fix. Any advice will be appreciated :)


title: Trying to code a simple plugin, infinite loop?

text:
I am at a standstill. I have checked over my code so many times. The code just shows up about 4 or 5 times on the Settings --> Plugin page and then breaks the browser. I am just trying to make a text box that can be modified as needed and echoed out on the font-page.php. I am including this functions.php file from my main plugin file:               <?php          // Add admin page to WP Settings menu     function grizzly_quotes_add_options() {         add_options_page( 'Site Quotes', 'Site Quotes', 'manage_options', 'site_quotes', 'site_quotes_output_settings' );     }          // Add Javascript     function add_grizzly_scripts() {          wp_enqueue_script( 'responsiveslidesjs',  plugins_url( 'assets/js/responsiveslides.min.js' , __FILE__ ) );         wp_enqueue_script( 'themejs',  plugins_url( 'assets/js/theme.js' , __FILE__ ) );     }          // Add stylesheets     function add_grizzly_stylesheets() {         wp_enqueue_style( 'responsiveslidescss', plugins_url( 'assets/css/responsiveslides.css' , __FILE__ ) );     }               // Add section for settings section to admin panel plugin page     function site_quotes_api_init() {         // Add settings section to WP admin plugin page         add_settings_section(             'site_quotes_settings_section',             'Main Settings',             'site_quotes_main_create_description',             'site_quotes_plugin'         );         add_settings_field(             'sometext',             'Some text!',             'site_quotes_output_settings',             'site_quotes_plugin',             'site_quotes_settings_section'         );         register_setting( 'settings-group', 'site_quotes_plugin_settings_arraykey', 'site_quotes_validate' );     }          // Sanitize and validate data     function site_quotes_validate($input) {         $options = get_option('site_quotes_plugin_settings_arraykey');         $options['sometext'] = trim($input['sometext']);         return $options;     }          // Output section description     function site_quotes_main_create_description() {          echo '
This is where you add your quote!
';     }               // Output the actual form     function site_quotes_output_settings() {         ?>
         <form method="post" action="options.php">             <?php             // Makes the $options_group             settings_fields( 'settings-group' );             // Make the $page             do_settings_sections( 'site_quotes_plugin' );             ?>             <?php submit_button('Save Changes'); ?>         </form>
         <?php     }          function site_quotes_main_create_input() {         $options = get_option('site_quotes_plugin_settings_arraykey');         ?><input type="text" name="site_quotes_plugin_settings_arraykey[sometext]" value="<?php echo $options['sometext']; ?>" /><?php     }          //           // Add to hook     add_action( 'admin_menu', 'grizzly_quotes_add_options' );     add_action( 'admin_init', 'site_quotes_api_init' );     add_action( 'init', 'add_grizzly_scripts' );     add_action( 'init', 'add_grizzly_stylesheets' );


title: Custom Search not working

text: Can any Wordpress Guru figure out why my custom search form just reloads the page when submitted? I'm trying to create a custom search that uses two dropdowns only (no text input). The first dropdown lists custom post types, the second lists the "location" taxonomy. This is my code so far (submitted on POC for easier reading: http://paste.ofcode.org/WSyw4ZdeLweEicQQFj9aPG Any help will be GREATLY appreciated!! Thanks :)


title: Why is the generated POT file from WordPress.org not adding my plugin description to the POT file?

text: So I ran into this issue before and was able to get it fixed by using the get POT from the admin side of WordPress.org. However, with this plugin when I make the POT file it doesn't have the plugin description inside it. Any ideas why this would be happening? The code for the plugin can be found here: https://github.com/pderksen/WP- Stripe-Checkout You can see I added the Text Domain and Domain Path plugin headers as well. Thanks for any help!


title: AJAX Pagination not working

text:
I have integrated an AJAX Pagination in my site sidebar, where I'm showing custom post type. Here is my code:               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $new_query = new WP_Query();     $new_query->query('post_type=listing&showposts=5'.'&paged='.$paged);     ?>
     <?php if ($new_query->have_posts()) : while ($new_query->have_posts()) : $new_query->the_post(); ?>          <?php  if(has_post_thumbnail()){     $c_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'scroller-thumb');             }                  ?>             <?php             $kstoreStreet=get_post_meta($post->ID,'street',true);             $kstoreCity=get_post_meta($post->ID,'city',true);             // $map_bubble=get_the_title($post->ID);             $desc=get_post_meta($post->ID,'description',true);             ?>

                         <img src="<?php echo $c_image[0];?>" alt="<?php the_title();?>">

                         <a href="<?php the_permalink();?>" title="<?php the_title();?>"/><?php the_title();?>
                         Address: <?php echo $kstoreStreet;?> | <?php echo $kstoreCity;?>
                         <?php if( ( $et_rating = et_get_rating() ) && 0 != $et_rating ) : ?>                         <span style="<?php printf( 'width: %dpx;', esc_attr( $et_rating * 17 ) ); ?>">                         <?php endif; ?>

                      <?php endwhile; //endwhile                                       wp_reset_query(); ?>

     <?php next_posts_link('« Older Entries', $new_query->max_num_pages) ?>
     <?php previous_posts_link('Newer Entries »') ?>

      The query works perfectly and I can see 4 posts in the side bar with a navigation to Previous Posts. I want to make this Previous ad Next link an AJAX link so that the `<ul>` element shows 4 new posts without whole page refresh ( I'm writing above code in sidebar) My javascript is as follows:                     When I click the Previous/Next Links I can see a fadeout , but the same old posts load. What I mean is posts on initial page. Can someone guide me in pointing out, what am I doing wrong here?


title: Form Plugin for Api Requests which is used via Shortcode

text:
I've a little PHP Script with a input Form which is used to register for a newsletter. This Form accepts only an email address and then makes an api call using curl. Now I wan't to build this form as a plugin for wordpress. It should be easy usable on different pages with a shortcode. I have already build this plugin. I have a Form and I can display this form with the Shortcode. But I don't know how build the functions from my original php file in wordpress. I don't know how to send the form to itself and work with the values. Also I need to work with get parameters which are used to confirm a user. Here is my original script, I think it's much easier to understand what I wan't to do: index.php:                   <?php              require_once('functions.php');              // task subscribe                  if(isset($_POST['task'])){                 $task = $_POST['task'];                 if ($task == "subscribe"){                     if(!empty($_POST['email'])){                         $email      = $_POST['email'];                         $group      = basic;                              $data = array(                             "group"       => $group,                             "email"       => $email                         );                         $response = doCurlRequest($task, $data);                     }                 }             }              // task = confirm                  if(isset($_GET['task']) && isset($_GET['hash'])){                 $task = $_GET['task'];                 $hash = $_GET['hash'];                      $data = array("hash" => $hash);                        $response = doCurlRequest($task, $data);             }              // send mail with confirm link                  if(isset($response['subscriptions']['0'])){                      $to = $response['email'];                 $title = "confirm your address";                 $from = "From: Newslettersystem <newsletter@domain.tld>";                 $text = "                     Please confirm your address: http://domain.tld/index.php?task=confirm&hash=".$response['subscriptions']['0']['hash']."                 ";                      mail($to, $title, $text);                  }          ?>          <!DOCTYPE html>                     <meta charset="utf-8">             <title>Newsletter Form Test</title>
Newsletter Form
             <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>" name="newsletterForm">                 <input type="hidden" name="task" value="subscribe">
                     E-Mail Adresse *                     <input type="text" name="email" id="email" size="30">

                     <input type="submit" value="absenden">
             </form>                    functions.php:               function doCurlRequest($task, $data){              $data_string = json_encode($data);              // Get cURL resources         $curl = curl_init();              // Set some options - we are passing in a useragent too here         curl_setopt_array($curl, array(             CURLOPT_RETURNTRANSFER => 1,             CURLOPT_URL => 'http://domain.tld/api/emailing/v0.1/'.$task,             CURLOPT_USERAGENT => 'Wordpress Form cURL Request',             CURLOPT_POST => 1,             CURLOPT_POSTFIELDS => $data_string,             CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Content-Length:' . strlen($data_string))                                                                                ));              // Send the request & save response to $resp         $resp = json_decode(curl_exec($curl), true);              // Close request to clear up some resources         curl_close($curl);              return $resp;          }      Okay, that's the original script which is working. And here is my starting point for wordpress:               <?php          /**      * Plugin Name: NewsletterFormConnector      * Description: Newsletter Form to connect to Newsletter Api      * Author: emjay      * Version: 1.0      */              function addCustomQueryVars( $vars ){             $vars[] = "task";             $vars[] = "hash";             return $vars;         }              add_filter( 'query_vars', 'addCustomQueryVars' );              function createForm(){                  $task = get_query_var( 'task' );             $hash = get_query_var( 'hash' );                  $form  ="";                  $form .= '<form>';             $form .= 'E-Mail: <input type="text" name="email">';             $form .= '</form>';                  return $form;              }              add_shortcode('newsletterForm', 'createForm');          ?>      I hope someone could give me some hints, how I can do this with a shortcode plugin. The shortcode should work on every page and the form is send to itself to make the api calls. But also I need that the page with a Form is responding to GET Parameters from the url so that a user can confirm it's address. Thanks for your help, emjay


title: Subpages return 404 server error

text: I just moved a site to another production environment and I have an issue with accessing subpages. The home page and the /wp-admin section works as expected and there are no path issues with images or other files. My permalinks are set to /%category%/%postname%/, but neither that or using a default url such as http://site.com/?p=123 works for the subpages ("The requested URL /sample-page/ was not found on this server."). I've searched and replaced all absolute paths to point to the local environment. Htaccess set to               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>      Running on Apache with Polylang (set to not show prefix at default language) and ACF plugins. Edit: Solved! AllowOverride was turned off for my /www directory in the Apache main config.


title: Add description to categories menu in admin

text: I'm trying to create a simple paragraph above the categories menu, on the post editor page. Most of the tutorials I see are adding input meta values, and not in relation to the categories. What's the best way to add a paragraph of content into the post-editor page (above the categories menu)?


title: Processing a login/register form before shortcodes are rendered?

text:
I am building a custom login and register form in the theme of my client's website, and I need to process any error messages into a variable that can be displayed on the page within the form. I am using shortcodes for the forms themselves, so using the 'after_setup_theme' action executes after the shortcodes are rendered, meaning any variables I set can't be used in the shortcode itself. This also means that on a successful login, is_user_logged_in() was already checked beforehand, so it still thinks the user is not actually logged in. Is there another action that takes place BEFORE 'after_setup_theme' that I can use to process the login and store any error variables? EDIT: Here is the custom function for processing the login and the action hook. For the moment, I have the error printing on the page and moving it into the form with jQuery, but I'd rather find a solution that allows me to print it where it belongs, so I don't have to manipulate the DOM elements on load.                   function custom_login() {             if(!is_admin() && !preg_match('*wp-login.php*', $_SERVER['REQUEST_URI'])) {                 $username = isset($_POST['log']) && strlen($_POST['log']) ? $_POST['log'] : '';                 $password = isset($_POST['pwd']) && strlen($_POST['pwd']) ? $_POST['pwd'] : '';                 if(strlen($username)) {                     $creds = array();                     $creds['user_login'] = $username;                     $creds['user_password'] = $password;                     $creds['remember'] = true;                     $user = wp_signon($creds, false);                     if (is_wp_error($user)) {                         $login_error = '
'.$user->get_error_message().'
';                         echo $login_error;                     } else {                         if(isset($_POST['redirect_to']) && strlen($_POST['redirect_to']) > 3) {                             wp_redirect($_POST['redirect_to']);                         } else {                             wp_redirect(home_url().'/login/');                         }                     }                 }             }         }         // run it before the headers and cookies are sent         if(isset($_POST['frontend_login'])) {             add_action('after_setup_theme', 'custom_login');         }


title: How can I get the open graph thumbnail url?

text: I use WP SEO plugin to set the Open graph image meta, because my template does not support featured image thumbnails. Now I want to use the YARPP related posts plugin which uses featured image thumbnails. So I want to alter the YARPP plugin code to use the open graph image in each of my posts, but I don't know how to get it. I tried to get the image url as follows:               $post_thumbnail_html = get_post_meta( get_the_ID(), 'open_graph_image', true );      but that does not seem to work. Any ideas?


title: WP_Query get posts where post_name is empty

text: I want to get all the posts for which the post_name(slug) is not set/empty as well as a meta_key does not exist.               $args = array (         'post_type'              => 'books',         'name'                   => '',         'post_status'            => array('publish, draft'),         'posts_per_page'         => -1,         'meta_query'             => array(             array(                 'key'       => 'book_isbn_id',                 'value'     => 'dummy',                 'compare'   => 'NOT EXISTS',                 'type'      => 'NUMERIC',             ),         ),     );     $query = new WP_Query( $args );     echo $query->request;      It seems that `'name' = ''` or `'name' = ' '` is completely ignored from what I see from `echo $query->request`. Am I doing anything wrong?


title: Show all terms of a custom taxonomy?

text:
I made a few custom taxonomies and I need to show ALL the terms from it, what I achieved so far is showing the taxonomies that are selected/chosen in a custom post type but I need all of them to show, wether it's selected or not. So that later I can make a filter that filters according to which terms a custom post type value contains.               <?php      $args=array(       'public'   => true,       '_builtin' => false     );     $output = 'names'; // or objects     $operator = 'and';     $taxonomies=get_taxonomies($args,$output,$operator);      if  ($taxonomies) {       foreach ($taxonomies  as $taxonomy ) {         $terms = get_terms($taxonomy);             foreach ( $terms as $term) {     ?>

<input type="checkbox" name="profile[]" value=""><?php echo $term->name; ?>

            <?php                      }                   }                 }                   ?>      What I have so far. Thanks in advance!


title: How can I allow editors to leave comments on posts that have not yet been published?

text: On my NFL football blog all users are allowed to make blog posts. New registrants are given contributor status. When users make a post it is reviewed by an editor, then the editor schedules the post to publish at a time fitting our blog schedule. Multiple editors have asked me if they could make a comment on the article right after they edit the post and schedule it to be published, but before it is actually published. By comments, I mean comments on the article content, not comments to the contributor about their writing style, grammar, spelling, etc. or comments that other editors can see in the backend. I use Peter's Post Notes and Peter's Collaboration E-mails to handle communication with contributors about these issues/situations. What I need, example: A contributor writes an article about Peyton Manning signing with the Denver Broncos. The editor is notified at 10pm that the post has been submitted for review. He/she goes in to check the post for grammar, spelling, tags, proper category, etc. The editor makes all the necessary corrections and schedules the post to publish at 9am tomorrow. Now, the editor wants to leave his thoughts about Peyton Manning's contract with the Broncos for the world to see. The problem, the post publishes at 9am tomorrow, but he is reading the post at 10pm today... and does not want to come back 11 hours later to leave a comment on a post he is reading right now. This makes sense to allow the editor to comment before the post publishes, since the editor has already read the post, so I would like to make it easier for editors if possible, rather than the editor needing to come back once the post has published to make their comments. I really have no preference as to whether the timestamp on the comment is the same as the post publish time or the time the comment was actually made, even if it was before the post was scheduled to publish. I found a forum post that is two years old ( http://core.trac.wordpress.org/ticket/11810 ) discussing a vulnerability in WordPress that used to allow comments on unpublished posts, but I simply cannot find a way to allow Editors to leave comments on unpublished posts in WordPress 3.


title: What is the RSS feed link for the newest WordPress plugins?

text: Is there an RSS feed for the page that displays the newest WordPress plugins from the official plugins repository? I know of the following link, but I'm looking for an RSS feed that I can add to my reader. http://wordpress.org/plugins/browse/new/


title: How to exclude/filter a tag from get_the_tag_list()

text: Does anyone know how to exclude/filter a tag from the HTML string generated by get_the_tag_list()? http://codex.wordpress.org/Function_Reference/get_the_tag_list Any help much appreciated.


title: Can't edit thumbnails

text:
I am having two related problems: In the Media Library, when I click on edit image, I don't see the image load on the left part that allows to crop etc. Similarly, I can't edit nggallery thumbnails, the image with cropper aren't loaded. This bug only occurs when using my theme. It works well when I switch back to say Twenty Eleven. However, I have no idea what could be causing this from my theme. Any suggestion? ![enter image description here](http://i.stack.imgur.com/G9OsN.png) EDIT: I followed toscho's comment, I noticed that the following pieces of code are causing the problem described here. One of those functions is enough to cause the issue. 1) This code to include jquery from cdn               <?php       /************* INCLUDE JQUERY 1.10.0 FROM CDN *****************/     if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);     function my_jquery_enqueue() {        wp_deregister_script('jquery');        wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://code.jquery.com/jquery-latest.min.js", false, null);        wp_enqueue_script('jquery');     }     ?>      The following functions that I coded myself...                   <?php         /*          * this is a helper function to get wordpress metadata          * for an attachment (wordpress media file)          *           */         function custom_wp_get_attachment( $attachment_id ) {                  $attachment = get_post( $attachment_id );                  $path_parts = pathinfo($attachment->guid);                  return array(                 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),                 'caption' => $attachment->post_excerpt,                 'description' => $attachment->post_content,                 'href' => get_permalink( $attachment->ID ),                 'dirname' => $path_parts['dirname'],                 'basename' => $path_parts['basename'],                 'extension' => $path_parts['extension'],                 'filename' => $path_parts['filename'],                 'title' => $attachment->post_title             );         }         ?>      .                   <?php         /************* REPLACE TAGS TO EMBED YOUKU VIDEOS *****************/         // [youku vid="video id" width="width" height="height"]         function youku_func( $atts ) {             $atts =  shortcode_atts( array(                 'vid' => '',             ), $atts );                  return "";         }         add_shortcode( 'youku', 'youku_func' );              ?>      .                   <?php         /************* REPLACE TAGS TO EMBED LOCAL VIDEOS *****************/         // [local video=""VideoName width="width" height="height"]         function localvideo_func( $atts ) {                  $atts =  shortcode_atts( array(                     'name' => '',                     'width' => "400",                     'height' => "200",                  ), $atts );                  $contentUrl = content_url();                  return "<video width='" . $atts['width'] ."' height='" . $atts['height'] . "' controls>                                  <source src='$contentUrl/wp-content/uploads/" . $atts['name'] . ".mp4' type='video/mp4' />                                  <source src='$contentUrl/uploads/" . $atts['name'] . ".ogg' />                                  <object width='" . $atts['width'] . "' height='" . $atts['height'] . "' type='application/x-shockwave-flash' data='http://localhost/dangsters/wp-content/uploads/" . $atts['name'] . ".swf'>                                         <param name='movie' value='$contentUrl/uploads/" . $atts['name'] . "'.swf' />                                         <param name='flashvars' value='controlbar=over&image=http://localhost/dangsters/wp-content/uploads/" . $atts['name'] . ".jpg&file=http://localhost/dangsters/wp-content/uploads/" . $atts['name'] . "'.mp4' />                                                                              </object>                             </video>
 Download Video:                                 Closed Format:  MP4                                 Open Format:    OGG
";                   }         add_shortcode( 'localvideo', 'localvideo_func' );              ?>      What's the matter with those functions?


title: Change the output for [gallery] shortcode

text: I'm sorry if this question was answered here, but I couldn't find it. Is possible to change the HTML output of [gallery] shortcode (without plugins)? I would like to show the thumbnails as another appearance. Is this possible? Thanks!


title: Average Account Age

text: I'm trying to see if there is a way to find an average age of user accounts which came through my wordpress site not including the age of the administrator account. When I say age I don't mean their actual birth age but the tenure of their account. Is there a simple way to determine this?


title: Overriding Attributes values in Shortcode Plugins

text: I have made some shortcode plugins according to my need. But this time I am getting a strange problem. My attributes in the shortcode are not getting the values written in the shortcode while executing them, instead I am just getting the default set values only. Please Help me.               add_shortcode('wi_form' , 'wi_form_func');          function wi_form_func($input) {         extract(shortcode_atts( array(             'productName'  => 'Java',             'productPrice' => 1000         ), $input));         return $productName . esc_attr($productPrice);     }


title: Multisite redirect loop for a single www domain

text: I have been using WordPress multisite for several years without a problem. At some point in the last few days one of my many multisite domains is stuck in a redirection loop. The domain is http://www.drandrewhall.com and as of this writing is stuck in a redirection loop. This worked fine until a couple days ago. I have removed it from the domain mapping plugin and added it back in. I can remove the www domain and add in just the drandrewhall.com as the primary and it works fine. I've looked at the database tables and everything seems to work. I've changed the theme, removed all the plugins, made sure everything is up to date, but the problem remains. All the other multisite sites are working correctly and this one was until 3 days ago.


title: Query Posts by Custom Field 'Price'

text: I'd like to display all posts within a given price range. For example: When a user inputs 100 and 1000 (in two separate form fields) - my site will display all posts that have a custom field called price that has a numeric value between 100 and 1000. Found this under the documentation for WP Query; however, I'm unsure as to how I create a query based on input from a form on my WordPress site.               $args = array(     'post_type' => 'product',     'meta_query' => array(         array(             'key' => 'color',             'value' => 'blue',             'compare' => 'NOT LIKE'         ),         array(             'key' => 'price',             'value' => array( 20, 100 ),             'type' => 'numeric',             'compare' => 'BETWEEN'         )     )     );     $query = new WP_Query( $args );      Thank you for your time.


title: Loop that displays the first post of every available custom post type?

text: Is it possible to create a loop that goes through all the available custom post types without statically defining what those custom post types are, and then displaying the featured image of the first post for each of those custom post types?


title: Prerequisites Skills to learn WordPress

text: I'm new to WordPress and I was going through skills sets on some of the projects that are to be built in WordPress. The prerequisties that were mentioned are listed as below:   * HTML (obvious)   * CSS (that too is obvious!!!)   * PHP - Is this required to learn WordPress? Moreover, Is there any other skill set that is required to learn WordPress (apart from WordPress...:-) )? Thanks!


title: Filepath to Chosen for "Home Page" option - Which function?

text: Someone using my plugin/theme surprised me by making their site address different than their install address with the _"Enter the address here if you want your site homepage to be different from the directory you installed WordPress."_ option. Example: They've installed at: **www . thesite . com / blog /** And their actual wordpress site shows up at **www . thesite . com** Which function properly delivers the _filepath_ (not URL) leading to **www . thesite . com** ? I have a unique case where this is needed. Considering random cases, it would have to work if a user chooses **www . thesite . com / random / location /** * * * **CLARIFICATION:** If the site as a whole was installed at **www . thesite . com / blog** virtually every URL and *file*path is relative to that location. BUT if they modify their settings so that the blog is shown at a different spot OTHER than the install director ( such as **www . thesite .com** OR **www . thesite . com / somerandom / chosen / url** ) what I need is the FILE PATH to that location. REASON: I have a network of sites running, and the plugin installs certain network oriented files at their "home" location.


title: Custom widgets in theme option page

text:
I'm trying to create a simple theme options page that uses widgets to change the layout of content on the front page. I started off by using meta boxes not realizing that the position is based on the user. Any nudge in the right direction would be awesome. **EDIT TO ADD MORE DETAIL:** I'm trying to duplicate the functionality of widgets. What I would like is to have an options page that has a set number of items that can be rearranged (sorted) in any order. These items represent content like a text block or an ad. I then want to take the order of the items and display their content on the front page of the site. I want this to be a global setting so if any user changes the order it shows the same order for anyone looking at the site. **PROGRESS:** I've created an array and put my initial order of things and used update_option to store the data. I can sort the items but I don't know how to save this order.               if(get_option('content_boxes') == false) {         $content_boxes = array(             array('title' => 'Downloads', 'id' => 'k2-settings-downloads', 'content' => 'k2_settings_downloads', 'order' => '1'),             array('title' => 'Sites', 'id' => 'k2-settings-sites', 'content' => 'k2_settings_sites', 'order' => '2'),             array('title' => 'Tips', 'id' => 'k2-settings-tips', 'content' => 'k2_settings_tips', 'order' => '3'),             array('title' => 'Live', 'id' => 'k2-settings-live', 'content' => 'k2_settings_live', 'order' => '4'),             array('title' => 'Ad - 728x90', 'id' => 'k2-settings-ad-one', 'content' => 'k2_settings_ad_one', 'order' => '5'),             array('title' => 'Ad - 728x90', 'id' => 'k2-settings-ad-two', 'content' => 'k2_settings_ad_two', 'order' => '6')         );         update_option('content_boxes', $content_boxes);     }          $content_boxes = get_option('content_boxes');     if(!is_array($content_boxes)) {         $content_boxes = array();     }          foreach ($content_boxes as $boxes) {         $order[] = $boxes['order'];      }     array_multisort($order, SORT_NUMERIC, $content_boxes);      Loop:               <form method="post" action="">             <?php settings_fields('content_boxes_group'); ?>

                     <?php foreach($content_boxes as $boxes) {?>                         <div id="<?php echo $boxes['id']; ?>" class="postbox closed">

<?php echo $boxes['title']; ?>

                                 <?php echo $boxes['content']; ?>

                     <?php } ?>

                 <input type="submit" class="button-primary" value="Save Order">
        </form>


title: Is WordPress MultiSite secure & how much can it scale?

text: Great info on How to Scale Wordpress and more info on Wordpress Web Hosting. Still, I am left with questions. Creating a project that for the sake of argument we will call a blog network. A user signs up for an account and then the blog network company creates a subdomain install for the user. For example, userdomain.blognetwork.com. We have lots of experience with wordpress and zero experience with multisite.   1) By creating admins for each subdomain, what security concerns should we have and how to we address them? Thank you for all the help. **EDIT: Removed sub questions for better focus**


title: Disable CSS for IE 8 and earlier.

text: I am trying to find a way to disable the twenty twelve stylesheet for anything in IE 8 or less. Is there a conditional code that I can put in my functions php file that will enable the default twentytwelve style sheet (and it's child themes child sheet) to be ignored in these particular browsers? I want to start my IE only style sheet from a blank slate, and have only very very minimals styles applied. Thanks in advance


title: Insert image doesn't pickup right size

text: I have a very annoying problem. I have created some custom sizes in my media gallery using "simple image size" plugin, but the issue is not related to it as it happens also with wp native media sizes. Basically, when I upload an image and I then go and select a size, the size i select doesn't reflect the actual size... well, an image can explain it better. ![Check it out](http://i.stack.imgur.com/zkWoM.png). So, as you can see I have created a number of image sizes, and in my case both "ninesixty" and "grande" are 960px wide, but I am seeing only 625... why is that? This is driving me crazy, any help is most welcome!!


title: Horizontal scroller with post_thumbnail's

text: Attempting to create a horizontal scroller using post_thumbnail's. I've made a filterable portfolio section using this tutorial: http://www.wearepixel8.com/blog/filterable-portfolio but my attempts to make it a horizontal scroller have failed, i've tried several different jQuery image scroller plugins to attempt it but none have worked. Can anyone give advice on how to achieve what i'm looking to do? Thanks!


title: How to group by custom posts by child taxonomy term

text: I have registered a custom post types named "property" , a custom taxonomy "city" is associated with that post type . I have couple of city like               Ontario           Toronto         street 1         street 2      Here "street 1" and "street 2" are child terms . I can fetch all the posts under any city . But the problem is I want to group it by child term . Here is what I have done               $args1 = array(         'post_type' => 'property',         'city' => $city,         'meta_query' => array(             array(                 'key' => $meta_key,                 'value' => 0,                 'compare' => '>'             ),         ),     );     $query1 = new WP_Query($args1);          if ($query1->have_posts()) {         while ($query1->have_posts()) {                  $query1->the_post();             $property_list[] = get_the_ID();              }     }     wp_reset_postdata();      With this I can fetch all the post under a city . Like for Toronto all post are showing like this                1. Property 1       2. Property 2      3. Property 3       But I want to show like that way               street 1            Property 1     street 2            Property 2           Property 3       Thanks in advance


title: Passing a location-dependent array via wp_localize_script within a shortcode

text: I have created a shortcode that is intended to be inserted into custom field of a music custom post type. The shortcode is coverted into an audio playlist using the jplayer jquery plugin (and it's playlist addon), with the tracklist passed to jplayer via the wp_localize_script function. The shortcode needs to work on both the single_music page, and also in a custom widget. The problem I am having is that the tracklist for the single_music post is being overridden by the widget tracklist, due to wp_localize_script being declared twice with the same settings. Here is the shortcode that goes into a custom field:               [musicplayer ids="45,56,87,56"]      Here is the shortcode function:               add_shortcode('musicplayer','gs_musicplayer_shortcode');          function gs_musicplayer_shortcode($atts) {            wp_enqueue_script('jplayer-setup');            $ids = explode(',', $atts['ids']);            $tracks = array();            foreach ($ids as $key=>$id) {         $meta = wp_get_attachment_metadata( (int)$id, true );         $url = wp_get_attachment_url( (int)$id );         if ($url){           $tracks[] = array(             'title' => $meta['title'],             'mp3' => $url           );         }       }            $playlist = array( 'tracks' => $tracks );            wp_localize_script( 'jplayer-setup', 'playlist', $playlist );            $output = "<!-- HTML CODE FOR JPLAYER -->"           return $output;          }      And the jquery file that sets up the jplayer playlist:               var primaryPlaylist = new jPlayerPlaylist({       jPlayer: "#primary-music-player .jp-jplayer",       cssSelectorAncestor: "#primary-music-player .jp-container"     }, playlist.tracks, {       swfPath: "http://localhost/wp/wp-content/themes/gs/js/jplayer/Jplayer.swf",       supplied: "mp3"     });          var widgetPlaylist = new jPlayerPlaylist({       jPlayer: "#widget-music-player .jp-jplayer",       cssSelectorAncestor: "#widget-music-player .jp-container"     }, playlist.tracks, {       swfPath: "http://localhost/wp/wp-content/themes/gs/js/jplayer/Jplayer.swf",       supplied: "mp3"     });      Is there a way of passing seperate arrays through wp_localize_script, depending on whether the shortcode was inserted via a widget or in (for example) the #primary content area? Something like this perhaps...               if ( shortcode was called from #primary ) {       $playlist = array( 'tracks-primary' => $tracks );     }     else ( shortcode was called from widget ) {       $playlist = array( 'tracks-widget' => $tracks );     }          wp_localize_script( 'jplayer-setup', 'playlist', $playlist );      Any help much appreciated!!!


title: pre_comment_content filter not working using IntenseDebate Enhanced moderation

text: I wrote a plugin that modifies the contents of some comments. It uses the pre_comment_content filter. It seems to work OK using the standard WP moderation, however, it doesn't when I turn on the IntenseDebate Enhanced Moderation. Here's some code:               function my_plugin($orig_comment){            $orig_comment = some_func($orig_comment);           return $orig_comment;     }      Edit: Basically the plugin just applies some formatting, let's say lowercase all letters. In the first case it works perfectly, when using IntenseDebate it seems as if my function never gets called. Any workarounds for this?


title: What process do you use for WordPress development?

text: I'm interested in how other people develop themes and plugins for WordPress. To me, the in-browser editor in the admin panel just doesn't cut it. Currently, I'm just using an IDE with a PHP plugin (NetBeans), pulling down my development web directory from my server, editing in there, pushing up to test, and then migrating over to live. I'm looking for how other people use their tools of choice to manage workflows for developing, testing, and deploying themes, plugins, and testing the latest versions of WordPress against these before going live. I've made this a community wiki so that other people can share there development process. I'm not expecting to find a singular right answer here - your process is your own, and I wouldn't expect what you do to just work for myself or anyone else. I'm just interested in improving my ability to develop plugins and themes by seeing what works or doesn't work for other people. Another question here discusses specific software tools to support WordPress development. Here, I'm looking for more process and methodology that can be applied independently of tools, with the exception of certain tasks that might only be accomplished in a certain family of tools.


title: A simple script/plugin to display specific page upon hierarchy of selections

text: I am building up a shop in wordpress using mayashop theme. What i need is a page where i can display two categories - Men and Women. Upon selecting one, it should open up a list of sub categories. There is one more level deep sub categories and on final selection it should redirect to a page based on the 3 selection. I got several different pages so its not like i need to send parameters or something. The basic solution would be to create a hell lot of pages, which i don't want to do. So is there any plugin or some script which i can put on a page that can display the hierarchy in a decent manner?? I tried making something like this but it couldn't go beyond 2 levels and it doesn't look nice.


title: Customize register form page with add_action or apply_filter

text: I am studying "action and filter" and confused. I have a theme and I need to add "phone number1, phone number2" on register form page. I have been trying to file apply filter or add action on the register form page, but I can't really find them. Then do I need to modify the php file as child theme?   I mean do I need to create a register form page and add apply filter or add action? if I want to add some more input fields, do I need to add each of filters or actions? Let's say the original form is like this.               input type='text' name='usersname'     input type='text' name='email'     input type='password' name='password1'     input type='password' name='password2'      Now, I need to add 3 more fileds which are "address" between username and email and "phone number1, phone number2" between email and password1 then do I need to add filters on each exact lines               input type='text' name='usersname'     apply_filter('custome_address');   <===== added filter     input type='text' name='email'     apply_filter('custome_phone1');   <===== added filter     apply_filter('custome_phone2');   <===== added filter     input type='password' name='password1'     input type='password' name='password2'      Am I doing right? or something wrong? It could be a too easy question but I just want to make sure. One more short question: after this form, how can I handler register processing page? it should be added for saving database.


title: shortcode using multiple WP_Query's with multiple category names not fully functional

text: we're working on a bilingual site, Larry A. Downs all the posts are categorized into two categories, english or spanish, along with other categories. so every post has multiple categories, i've coded out a shortcode that sets up a tabbed widget in the sidebar, based on the language category, using multiple WP_Query's and looping thru them, but if you look on the english category page: /category/english some the queries are returning posts from the spanish category, i've checked the posts and they're in the right categories, i think i'm not setting up my query $args properly, and could use the wisdom of higher lever wordpressers than i. thanks again stack. here's the sidebartabs shortcode: SidebarTabs Shortcode


title: is there a way to have duplicate category slugs?

text: Wordpress sometimes is plain limiting, and some of its logics I just don't get... For example if I have two parent directories:   * parent1   * parent2 with subcategories:   * parent1      * sub   * parent2      * sub I cannot have sub sub as slug or name... WordPress automatically appends what it thinks is best like `sub-1` or `sub-parent2`. This is not very beautiful. And I consider this nothing short of a bug.


title: Wordpress URL Rewrite not working

text: I'm trying to create a custom url rewrite for my wordpress plugin.               function insert_plugin_rewrite_rule($rules) {         global $wp, $wp_rewrite;         $wp->add_query_var('update_slug');         $ret = $wp_rewrite->add_rule('updates/plugins/([^/]+)/', 'index.php?update_slug=$matches[1]', 'top');              // Remove when debugging is done.         $wp_rewrite->flush_rules(false);     }          add_filter('init', 'insert_plugin_rewrite_rule');      And to try and intercept it:               function blah() {         global $wp;         echo "<pre>";print_r($GLOBALS['wp']->query_vars['update_slug']);echo "</pre>";     }     add_filter('init', 'blah');      When I'm in the 'blah' function, it shows that my update_slug query var has been registered, and that my url has been registered too. But when I go to /updates/plugins/123/ it doesn't show any query_vars have been set. Am I doing this right, or is there some subtle thing I'm missing?


title: Permalinks and pagination are not working in WordPress with WP e-Commerce plugin

text: I am running WordPress 3.2.1. and WP e-Commerce 3.8.7.2. The problems I am having are:   1. If the permalinks are set to default (`example.com/?p=123`) the e-Commerce plugin works ok except when I turn on pagination and enter 16 as the number of products to show per page, I can’t reach page 2 in the pagination links – it just brings me back to page 1 with the URI `example.com/?page_id=54&paged=2`. Same thing with the “Next” and “Last” links. How do I fix this?   2. If I go with better permalinks ( `/%category%/%postname%/` ) the store doesn’t work, the URI `example.com/category` leads to an empty page and none of the products work. Is there any way I could get the permalinks structure above and get the pagination to work?


title: enable permalinks in window hosting

text: I had been developing wordpress sites from last one year but never used window hosting but one of my client have window hosting. Apache module mod_rewrite in collaboration with .htaccess used to serve my purpose of Permalinks But in the window server I donot have any idea at all. I tried copying few xml in web.config but donot know where I am Wrong. I am on a sshared server with no access to Shell I want equivalent action of linux hosting in window hosting 1) Enable module_rewrite 2) Write .htaccess


title: How do I create a Meta box that can be repeated? (with an image section and text area)

text: What I need to do is have a meta box that you can select an Image (via the built in media uploader), and then add a caption to it using a text box with the TinyMCE bar - and once this is done, another one can then be added below if needed. I found a similar question, with an answer, here: Create more Meta Boxes as needed but I am not sure how to adapt it to my needs. I know this kind of functionality is possible with Advanced Custom Fields, but I would prefer to be able to learn to build this functionality myself. I hope this makes sense!


title: Menu that shows months and filters posts to show only posts from that month and shows posts as sub items

text: I've created a custom post type called news. On the page that shows all of my news posts i need to have a menu on the left side (sidebar) which shows months, i.e. October 2011, September 2011 and so on. When I click on one of these months i want it to be able to show the posts from that month as sub items in the menu as well as filter the posts that are shown on the page to only show posts from that month. It would also need to auto update the months, i.e. when we go in to November, November 2011 will be added to the menu automatically. I plan on using a plugin called Jquery Accordion Menu but that's not necessary if the menu displays the sub items. The plugin is just a widget that takes a menu created in wordpress and gives it an jquery accordion style to expand menu items and show sub items. Any ideas how this can be achieved. Thanks


title: Get thumbnail URL :)

text: I try to get thumbnail URL correctly... In my functions.php, I have theses lines:               <?php     add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 'emphasis', 132, 82, true );     ?>     <?php     function w_thumbnail_src() {         if (has_post_thumbnail()) {             $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'emphasis');            echo $thumb[0]; // thumbnail url         }     }     ?>      The thing is, I don't get the correct size in my template :( I have this:               <?php w_thumbnail_src(); ?>      That returns the big image, not the thumbnail :( Where am I wrong? Regards, Alex


title: Archiving custom post content?

text: Last year, I built a movie festival website using "movie" as a custom post type. Now that the festival is over and we're getting ready for next year, how would I archive that content so that I can start adding movies for the coming festival? Thanks!


title: Where is Featured Image code stored in WP?

text: Well, I'm looking for source code of these two small containers (PHP backend, HTML frontend & JS used to attach the image): ![Featured Image](http://i.stack.imgur.com/d2hmB.jpg) I want to build a theme option based on Featured Image code, but I'm not able to find it. I'm pretty sure it is somewhere in wp-admin directory, but I've spent loong time there and found nothing. Any clues?


title: Page view: Sorted by categories

text: I think this might be a really simple problem, but I just don't know exactly what and where to enter the specific code and before I mess up, I thought it's better to ask for help here. I was able to create multiple columns to display the latest posts. For that I created a category.php and tried it out there as I didn't want to mess up my index.php. Now I quite like it and would like to use the same style for my actual category view as well. However, the current php code is meant to be for the normal Wordpress loop, so naturally only the latest posts are displayed, but they are not sorted by category, even if I click on the category link, e.g. category/uncategorized. It's probably done with some kind of "if" command, but I'd really appreciate if somebody could help me. My category.php looks like this right now: http://pastebin.com/69VXxytK My website: zoomingjapan.com Also, I'd like to have something like this for my front page: here I think I already know how to do it except for where to put the command which category should be shown.


title: wp_redirect not working in header, exit is breaking page

text: Sorry to ask such a basic question, I've looked at other questions and not found an answer. I've customized some public pages with their own header- public.php, and I'm doing a basic login check for all other pages right at the beginning of the page (line 1 in header.php). The intent is to redirect unlogged users to a reception page where they can get help, log in, etc. It's just that a) it doesn't redirect, and b) adding the 'exit;' as recommended breaks the rest of the page too. I tried abstracting this into a function in functions.php and that broke functions.php, so now Idunnowhatsgoingon. Here's the code:               if (is_user_logged_in())     {     echo 'loggedin';     }     else     {     echo network_home_url( '/receptionist' );     wp_redirect( network_home_url( '/receptionist' ) );     exit;     }      The sanity checks work, and echoing the 'network_home_url' works too - I can copy and paste the url in and it brings the page up fine. Would anyone have any advice about this? Sure looks to me like it should be working :\ Edit: per Hansy's answer and my response, here's the current code. The exit is commented since it breaks the page, I'll uncomment it when the redirect is working.               if (is_user_logged_in()){     die(); // edit - don't do this per Hansy's response, I misread what it does. My bad.     }     else {     wp_redirect( network_home_url( '/receptionist' ) );      /* exit; */     }      I've also tried: if (!is_user_logged_in()){ wp_redirect( network_home_url( '/receptionist' ) ); /* exit; */ } since that eliminates as much before the redirect as possible. I'm starting to think there's something wonky with the theme, since This Should Work. Edit 2: My server has a security package and PHP Safe Mode is On. Is there anything in PHP config that would affect this functionality? Edit 3: It was the theme. I switched back to 2011 and redid the setup and it Works Perfectly. What in the name of Charles Babbage could the theme dev have done to break a core template tag? Do they not teach separation of presentation, logic and data in school anymore? Jeez. Here's the code that worked, for reference. I'll try Hansy's much upgraded solution too.               if (!is_user_logged_in() )     {     wp_redirect( network_home_url( '/receptionist' ) );     exit;     }


title: Custom Taxonomy Images with Advanced Custom Fields

text: I've created a custom Taxonomy for a Custom Post Type, and created five or so terms within the taxonomy. I've created a single image upload and assigned it to the custom taxonomy, and uploaded images for each term. I can't for the life of me figure out how to get the image to display. I've var_dumped the term but there's nothing in there about the image? Any help much appreciated! WP version: 3.4.2 ACF version: 3.5.3.1


title: How to check the array values, what WP_Query has brought to me?

text: I have two questions in a row:   * How to check the array values, what `WP_Query` has brought to me?   * If I get 10 posts in cat=3, then I want to get only 5 from them, and then want to echo them individually wherever I want them to print. It may be like:               -------------------     | 1  |  2         |     -------------------     | 3 | 4 |     -------------------     | 5 |     -------------------      But I don't have any idea on both of the problems.


title: How do I use pagination in WordPress?

text: I'm using the index.php file and editing this so that it displays two articles at a time. I'm using `query_posts( $query_string . '&posts_per_page=2' );` before the main loop and it's displaying what I want correctly. How can I have a page navigation at the bottom?