title: Using page template as Static Front Page

text: I've created a page named "homepage", set the page as front page from `Reading > Static Page > Front page` and it's nearly working fine. The issue I'm having the blog posts aren't included into the page. It comes with the blank page and I need to change order as "menu_order", not working. In other words, I need to get the pages in order as same as the navigation.               <?php     /**      * The main template file.      *      * Template Name: One      */          get_header();          $pages = get_posts(array(         'posts_per_page' => -1,         'post_type' => 'page',         'order' => 'ASC'     ));          foreach($pages as $_post) {         $content = apply_filters('the_content', $_post->post_content);         $title = $_post->post_title;         $slug = $_post->post_name;         ?>          -div class content-          <?php     }     get_footer(); ?>


title: How to make Plupload zones that will survive changes in core?

text: I had recently implemented custom Plupload form in a plugin (located in admin area and working with SVG files). Plupload has half a ton of settings, provided _for WP's own_ upload zone by `wp_plupload_default_settings()`, from which I had to copy settings out and customize. Now in upcoming 3.9 core release those settings are getting changed (see Plupload 2.x in WordPress 3.9), which would likely blow my custom upload up, at least partially. How do I implemented Plupoad in a way that won't fall apart every time core changes related bits and won't interfere with arbitrary upload zones in core or other plugins/themes? This is settings I ended up with so far (they might not be perfect, but they got it done):               public function get_uploader_settings() {              return array(             'runtimes'            => 'html5,silverlight,flash,html4',             'browse_button'       => 'cdd-plupload-browse-button',             'container'           => 'cdd-plupload-upload-ui',             'drop_element'        => 'cdd-drag-drop-area',             'file_data_name'      => 'async-upload',             'multiple_queues'     => true,             'max_file_size'       => wp_max_upload_size() . 'b',             'url'                 => admin_url( 'admin-ajax.php' ),             'flash_swf_url'       => includes_url( 'js/plupload/plupload.flash.swf' ),             'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),             'filters'             => array( array( 'title' => __( 'Allowed Files' ), 'extensions' => 'svg' ) ),             'multipart'           => true,             'urlstream_upload'    => true,             'multi_selection'     => false,             'multipart_params'    => array(                 '_ajax_nonce' => wp_create_nonce( 'media-form' ),                 'action'      => 'upload-attachment',                 'post_id'     => get_the_ID(),                 'cdd-upload'  => true,             ),         );     }


title: wp_query to display custom taxonomy terms

text:
I have a custom post type named 'tours' and custom taxonomy named 'tourtypes' so i can categorize it into terms like 'cultural tour', 'sports tour' etc. I'm not the original author of this theme and don not know much about dealing with taxonomy. But I want to extend it so that instead of outputting all 'tours' post, user can also choose which tour category they want. in the theme template taxonomy-tourtypes.php this is part of the code to display the term title which work:               <?php $terms = get_the_terms($post->ID, 'tourtypes'); foreach ($terms as $term){ ;?>
<?php echo $term->name; ?> Category
<?php } ;?>      But when it comes to the part where i want to query the specified term it didnt work.               <?php     $paged = get_query_string_paged();     $counter = 1;     $termg = wp_get_post_terms($post->ID, 'tourtypes', array("fields" => "all"));          $posts_per_page = get_option('theme_show_portfolio_items');        if($posts_per_page == "") {         $posts_per_page = get_option('posts_per_page');     }          <?php       $paged = get_query_string_paged();       $counter = 1;       $termg = wp_get_post_terms($post->ID, 'tourtypes', array("fields" => "all"));            $posts_per_page = get_option('theme_show_portfolio_items');     if($posts_per_page == "") {         $posts_per_page = get_option('posts_per_page');     }            $my_query = new WP_Query(array('post_type' => 'tours', 'tourtypes' =>'$termg'    ,'paged' => $paged, 'posts_per_page' => $posts_per_page));       ...      I manage to get it to work if i type in the term slug eg.               $my_query = new WP_Query(array('post_type' => 'tours', 'tourtypes' =>'cultural' ...      I'm sure i just need a little change on the wp_query. Anyone care to point to the right code..i almost give up with this


title: Get category id when SEO URL is turned on

text: <?php     /*     Plugin Name: Members     */             function myFilter2($query)          {                  if ($query->is_category)             {                 $currently_listing_categories = $query->query_vars['category__in'];                              print_r($currently_listing_categories);             }              }              add_filter('pre_get_posts','myFilter2');     ?>      This plugin display the category ids when the url is not SEO friendly > http://domain.com/wplab/wpla4/?cat=4 . but when I turn on SEO > http://domain.com/wplab/wpla4/category/members/ the array is empty how can I get the category id with SEO friendly urls


title: How do we check if the user is logging in or registering?

text:
I am changing the text on the login page using this filter:               function filter_register_text() {         return "
Registering for this site will give you access to the admin panel to add new products with images and useful files for others to download and choose open product licenses.
";     }          add_filter('login_message', 'filter_register_text');      I just want to show the text if the user **signs up** on the website, not for users who just want to **log in**. Thanks.


title: Frontend Simple Local Avatar upload

text:
I'm using Simple Local Avatars for uploading custom user avatars. How can I create a frontend page with the avatar upload function? Below please find the code from Simple Local Avatars plugin:                   <?php         /**          * add field to user profiles          */          class simple_local_avatars {             function simple_local_avatars() {                 add_filter('get_avatar', array($this, 'get_avatar'), 10, 5);                 add_action('admin_init', array($this, 'admin_init'));                 add_action('show_user_profile', array($this, 'edit_user_profile'));                 add_action('edit_user_profile', array($this, 'edit_user_profile'));                 add_action('personal_options_update', array($this, 'edit_user_profile_update'));                 add_action('edit_user_profile_update', array($this, 'edit_user_profile_update'));                 add_filter('avatar_defaults', array($this, 'avatar_defaults'));             }         function get_avatar($avatar = '', $id_or_email, $size = '80', $default = '', $alt = false) {             if (is_numeric($id_or_email))                 $user_id = (int) $id_or_email;             elseif (is_string($id_or_email)) {                 if ($user = get_user_by_email($id_or_email))                     $user_id = $user->ID;             } elseif (is_object($id_or_email) && !empty($id_or_email->user_id))                 $user_id = (int) $id_or_email->user_id;             if (!empty($user_id))                 $local_avatars = get_user_meta($user_id, 'simple_local_avatar', true);             if (!isset($local_avatars) || empty($local_avatars) || !isset($local_avatars['full'])) {                 if (!empty($avatar))                     return "";                 remove_filter('get_avatar', 'get_simple_local_avatar');                 $avatar = get_avatar($id_or_email, $size, $default);                 add_filter('get_avatar', 'get_simple_local_avatar', 10, 5);                 return $avatar;             }             if (!is_numeric($size))                 $size = '80';             if (empty($alt))                 $alt = get_the_author_meta('display_name', $user_id);             if (empty($local_avatars[$size])) {                 $upload_path = wp_upload_dir();                 $avatar_full_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full']);                 $image_sized = image_resize($avatar_full_path, $size, $size, true);                 if (is_wp_error($image_sized))                     $local_avatars[$size] = $local_avatars['full'];                 else                     $local_avatars[$size] = str_replace($upload_path['basedir'], $upload_path['baseurl'], $image_sized);                 update_user_meta($user_id, 'simple_local_avatar', $local_avatars);             } elseif (substr($local_avatars[$size], 0, 4) != 'http')                 $local_avatars[$size] = site_url($local_avatars[$size]);             $author_class = is_author($user_id) ? ' current-author' : '';             $avatar = "";             return $avatar;         }              function admin_init() {             load_plugin_textdomain('simple-local-avatars', false, dirname(plugin_basename(__FILE__)) . '/languages/');             register_setting('discussion', 'simple_local_avatars_caps', array($this, 'sanitize_options'));             add_settings_field('simple-local-avatars-caps', __('Local Avatar Permissions', 'simple-local-avatars'), array($this, 'avatar_settings_field'), 'discussion', 'avatars');         }              function sanitize_options($input) {             $new_input['simple_local_avatars_caps'] = empty($input['simple_local_avatars_caps']) ? 0 : 1;             return $new_input;         }              function avatar_settings_field($args) {             $options = get_option('simple_local_avatars_caps');             echo '                 <input type="checkbox" name="simple_local_avatars_caps" id="simple_local_avatars_caps" value="1" ' . @checked($options['simple_local_avatars_caps'], 1, false) . ' />                 ' . __('Only allow users with file upload capabilities to upload local avatars (Authors and above)', 'simple-local-avatars') . '             ';         }              function edit_user_profile($profileuser) {             ?>
<?php _e('Avatar', 'simple-local-avatars'); ?>

                     <?php _e('Upload Avatar', 'simple-local-avatars'); ?>	                                              <?php echo get_avatar($profileuser->ID); ?>                     	                                              <?php                         $options = get_option('simple_local_avatars_caps');                         if (empty($options['simple_local_avatars_caps']) || current_user_can('upload_files')) {                             do_action('simple_local_avatar_notices');                             wp_nonce_field('simple_local_avatar_nonce', '_simple_local_avatar_nonce', false);                         ?>                         <input type="file" name="simple-local-avatar" id="simple-local-avatar" />
                         <?php                         if (empty($profileuser->simple_local_avatar))                             echo '' . __('No local avatar is set. Use the upload field to add a local avatar.', 'simple-local-avatars') . '';                         else                             echo '<input type="checkbox" name="simple-local-avatar-erase" value="1" /> ' . __('Delete local avatar', 'simple-local-avatars') . '
                                 ' . __('Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option.', 'simple-local-avatars') . '';                         } else {                             if (empty($profileuser->simple_local_avatar))                                 echo '' . __('No local avatar is set. Set up your avatar at Gravatar.com.', 'simple-local-avatars') . '';                             else                                 echo '' . __('You do not have media management permissions. To change your local avatar, contact the blog administrator.', 'simple-local-avatars') . '';                         }                         ?>

                          <?php         }              function edit_user_profile_update($user_id) {             if (!wp_verify_nonce($_POST['_simple_local_avatar_nonce'], 'simple_local_avatar_nonce'))                 return;             if (!empty($_FILES['simple-local-avatar']['name'])) {                 $mimes = array(                     'jpg|jpeg|jpe' => 'image/jpeg',                     'gif' => 'image/gif',                     'png' => 'image/png',                     'bmp' => 'image/bmp',                     'tif|tiff' => 'image/tiff'                 );                 $avatar = wp_handle_upload($_FILES['simple-local-avatar'], array('mimes' => $mimes, 'test_form' => false));                 if (empty($avatar['file'])) {                     switch ($avatar['error']) {                         case 'File type does not meet security guidelines. Try another.':                             add_action('user_profile_update_errors', create_function('$a', '$a->add("avatar_error",__("Please upload a valid image file for the avatar.","simple-local-avatars"));'));                             break;                         default:                             add_action('user_profile_update_errors', create_function('$a', '$a->add("avatar_error","".__("There was an error uploading the avatar:","simple-local-avatars")." ' . esc_attr($avatar['error']) . '");'));                     }                     return;                 }                 $this->avatar_delete($user_id);                 update_user_meta($user_id, 'simple_local_avatar', array('full' => $avatar['url']));             } elseif (isset($_POST['simple-local-avatar-erase']) && $_POST['simple-local-avatar-erase'] == 1)                 $this->avatar_delete($user_id);         }              function avatar_defaults($avatar_defaults) {             remove_action('get_avatar', array($this, 'get_avatar'));             return $avatar_defaults;         }              function avatar_delete($user_id) {             $old_avatars = get_user_meta($user_id, 'simple_local_avatar', true);             $upload_path = wp_upload_dir();             if (is_array($old_avatars)) {                 foreach ($old_avatars as $old_avatar) {                     $old_avatar_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $old_avatar);                     @unlink($old_avatar_path);                 }             }             delete_user_meta($user_id, 'simple_local_avatar');         }     }     $simple_local_avatars = new simple_local_avatars;          if (!function_exists('get_simple_local_avatar')):         function get_simple_local_avatar($id_or_email, $size = '80', $default = '', $alt = false) {             global $simple_local_avatars;             return $simple_local_avatars->get_avatar('', $id_or_email, $size, $default, $alt);         }     endif;          register_uninstall_hook(__FILE__, 'simple_local_avatars_uninstall');          function simple_local_avatars_uninstall() {         $simple_local_avatars = new simple_local_avatars;         $users = get_users_of_blog();         foreach ($users as $user)             $simple_local_avatars->avatar_delete($user->user_id);         delete_option('simple_local_avatars_caps');     }      I have tried many variants but all of them failed. Could you please give a hint, what pieces of code I shall copy to my custom frontend template file? Thank you very much.


title: custom rss templete

text: The objective is to fetch fields associated with a specific post id to create a custom rss feed. It is required to use functions like `the_content_feed('rss2')` , `the_excerpt_rss()` etc outside the loop to fill the rss template. How to accomplish this (use such functions outside the loop)?


title: wp_localize_script with mce_external_plugins in wordpress

text: I am not sure if it is possible or not. Can i use `wp_localize_script` with `mce_external_plugins` filter? I want to send a variable to the tinymce plugin script. For Example:               add_filter( "mce_external_plugins", array( &$this, 'add_test_plugin' ) );     .......          public function add_test_plugin( $plugin_array ){              global $pagenow;              if( is_admin() && $pagenow == "post.php" || $pagenow == "post-new.php" ){             $plugin_array['mytest'] = plugin_dir_url(__FILE__) . '/js/testing.js';             return $plugin_array;         }          }      I have to send a variable to `testing.js`? How do i achieve this? ## Update: this is the link that help me to resolve my problem Using post ID in custom tinyMCE button


title: Is it possible to sign in with user_email in Wordpress?

text: is it possible to sign in with **user_email** instead of **user_login** , please ? Thanks.


title: Change the next thumbnail to text

text:
Hey i am using this theme called starblog and on the single gallery page it shows this cpde below

<?php next_image_link() ?>

<?php previous_image_link() ?>

      It shows the thumbnails of the next and previous image but instead i want it show text "Next Image" "Previous Image" how do i change this


title: Programmatically add posts add and assign postmeta and assign terms

text: I have thousands of WooCommerce products that need to be inserted into the database. For some reasons I can't use the csv import plugin or any other 3rd party solution and this has to be done manually through php code into database. Here is what my question is: > To what table do the product categories go ? I guess the products have to be added to `wp_posts` and then the description/price etc is added to the `wp_postmeta`. How to assign the products to a particular taxonomy. In which table do they go? Don't need the code just guidelines regarding tables.


title: Custom post type category page not working

text: I have a custom post type called 'emp_case-studies'. Archive and Hierarchical are set to true. My archive-emp_case-studies.php and single-emp_case-studies.php are performing as expected. However, when on the archive page, if I click a category link that the post has been given, it goes to e.g. /category/case- studies/engineering/ But I get "Sorry! There are no posts to show at the moment. Please come back later."


title: Wordpress 3.8.1 update error

text: Presently running Wordpress 3.8.1 French but Wordpress is asking me to update to a new version. When doing the update, I get the following error:                Warning: copy(/home/XXXXXX/domains/XXXXXX.com/public_html/wp-admin/includes/update-core.php)       [function.copy]: failed to open stream: Permission denied in      /home/XXXXXX/domains/XXXXXX.com/public_html/wp-admin/includes/class-wp-filesystem-direct.php      on line 217      > La mise à jour ne peut pas être installée parce que nous n’allons pas > pouvoir copier certains fichiers. Ce problème est généralement dû à des > incohérences dans les permissions de fichiers.: `wp-admin/includes/update- > core.php` > > Échec de l’installation _Translation for above:_ > The update cannot be performed because we will not be able to copy certain > files. This problem is usually associated with inconsistencies in the files > permission: `wp-admin/includes/update-core.php` > > Installation failed. We need to know what type of files inconsistencies this is related to and what would be the procedure the fix it.


title: Admin-area broken through weird issues

text: Sorry for my bad English - it is not my mother language. Just installed wordpress 3.9. The admin area looks a bit broken all though I have fixed some things with switching the magic quotes to off But the admin area that allows customizing looks a bit funny. See the refering image **update:** besides the parts that can be seen on the image - i can see nothing - the whole screen is emtpy - and i cannot click anything. Nothing happens Btw; if you want to ave a look a the backend I would be happy. Just send me a mail - to get the consent (and passwd ) to the admin-area.


title: How to migrate from Mark Jaquith's Subscribe to Comments plugin to Gurken's new version?

text: Mark Jaquith's Subscribe to Comments plugin has been a staple of my WordPress site since shortly after I launched it. However, it's not really maintained any more (last updated end of 2007) and it lacks some options (email verification, etc.). infogurke extended Mark's plugin and released a different version with enhancements: >   * All of the original Subscribe to Comments >   * Registration with Double-Opt-In >   * Multi-Language (English and German included) >   * You can define an own css file for the manager interface >   * Fixed many bugs that are still in the original plugin > Is it possible to migrate to infogurke's version and maintain the subscriptions in the database? (Found the new plugin via this question.)


title: List taxonomy terms as links

text: How can I make a list of links of all the taxonomy terms I'm using? For example, I have a taxonomy of Manufacturers with terms of Honda, Ford, etc. I want to list out those terms as links.


title: Custom URL rewrites for templates

text: I need to rewrite some URLs to custom templates. For example, I have a page at domain.com/page, and when a user clicks 'remove' on an element, it goes to domain.com/page/?remove=54. I'd like it to rewrite to domain.com/page/remove/54. Help is appreciated, thank you in advance!


title: New post email alert

text: I'd like to display a checkbox with the option to subscribe to the site by email I have seen a wordpress blog with the following label next to the said checkbox Subscribe by email to this site The problem is that i cannot see to find the plugin that displays it: i've tried Subscribe2 and Post Notification and Gurken for comment subscriptions. Would you perhaps know what plugin i need to install?


title: Blog in multiple languages on WordPress.com?

text: Does wordpress.com support multiple languages at the same time? I know it does support changing the main language, but I can't find anything about how one would go about setting up multiple languages at the same time. Thanks.


title: show custom post types for a month

text: I have a custom post type called "cpt_docs": add_action( 'init', 'create_post_type' );               function create_post_type() {         register_post_type( 'cpt_docs',             array(                 'labels' => array(                     'name' => __( 'Docs' ),                     'singular_name' => __( 'Doc' )                 ),             'public' => true,             'has_archive' => true,             )         );     }      I have tabs with months and i want to show the "docs" for that month. I need to show the custom post types in the home page, bu i dont how can i do that. Should i use a hard coded sql query or there is another way? thk all.


title: Problem with custom post types, taxonomy and permalinks

text: I am experiencing problems with custom post types, taxonomies, permalinks and rewrites. I created a custom "recipes" post type and taxonomy using this code:               add_action('init', 'recipes_register');     function recipes_register() {     $labels = array(      'name' => __('Recipes', 'framework'),      'singular_name' => __('Recipe', 'framework'),      'add_new' => __('Add Recipe', 'framework'),      'add_new_item' => __('Add New Recipe', 'framework'),      'edit_item' => __('Edit Recipe', 'framework'),      'new_item' => __('New Recipe', 'framework'),      'view_item' => __('View Recipe', 'framework'),      'search_items' => __('Search Recipe', 'framework'),      'not_found' =>  __('Nothing found', 'framework'),      'not_found_in_trash' => __('Nothing found in Trash', 'framework'),      'parent_item_colon' => ''     );     $args = array(      'labels' => $labels,      'public' => true,      'publicly_queryable' => true,      'show_ui' => true,      'query_var' => true,      'menu_icon' => get_stylesheet_directory_uri() . '/img/admin-recipes.png',      'rewrite' => true,      'capability_type' => 'post',      'hierarchical' => true,      'menu_position' => null,      'supports' => array('title','editor','thumbnail','comments'),       );      register_post_type( 'recipes' , $args );     }          register_taxonomy('recipe_type', array('recipes'), array('hierarchical' => true, 'label' => __('Recipe Type', 'framework'), 'rewrite' => array('hierarchical' => true, 'slug'=>'recipes')));      The problem occurs when I want to access to custom type post with this type of URL, it throws a 404 error :               http://my-website/recipes/name-of-the-recipe/      I think the problem is caused because I want to use the same slug for the taxonomy "recipe_type" and the "recipe" custom post type. I am a bit stuck on this and I would be grateful if you could help me with this. Thanks


title: Displaying child taxonomies

text: Imagine this: I have a custom post type called 'Animals' and I have registered a taxonomy for this post type called 'Types of Animal'. 'Types of Animal' would be 'dog', 'cat' and 'mouse' and so on. So that's straightforward. But say I want to introduce child taxonomies based on the value of the Types of Animal taxonomy. I can use the fact that the taxonomy is hierarchical but if Types of Animal contained 100 terms with 50 possible sub-terms, that makes for a big mess when I'm editing. So what I'd like to do is display a child taxonomy, say 'Breeds', when the editor selects 'dog' in the 'Types of Animal' taxonomy. I could use tags but I'm afraid of the margin of error inputting tags. I would rather that editors had to check a box. Is it possible to display a child/secondary taxonomy dynamically in this way?


title: TinyMCE with custom buttons on a meta box

text:
Firstly please allow me to apologise - my fourth question in the week that I've been here! You've all been very helpful though, which is why I keep coming back.. I'm trying to put together a custom post type which doesn't utilise the 'editor'. There is a lot of input fields on the page and most of them will need a custom TinyMCE editor. I have meta boxes with textareas. I've tried the following code:                     with...                   if (function_exists('wp_tiny_mce')) {                  add_filter('teeny_mce_before_init', create_function('$a', '                 $a["theme"] = "advanced";                 $a["skin"] = "wp_theme";                 $a["height"] = "75";                 $a["theme_advanced_buttons1"] = "bold, italic, pastetext, pasteword,                     bullist, numlist, link, unlink, outdent, indent, charmap, removeformat, spellchecker, fullscreen";                      return $a;'));                  wp_tiny_mce(true);         }      They don't seem to work together. The TinyMCE editor appears on the right element but it's just the default WP editor, not the settings I've tried to implement. So, my three questions are... **Question 1** When using meta boxes for custom post types, what's the best (by best I probably mean most flexible and integrated and least "hacky") way to add a custom TinyMCE editor to multiple elements? **Question 2** A follow on from Question 1... How do I go about adding custom buttons to such a setup? **Question 3** Is it possible to change the minimum height of the TinyMCE editor? It seems to be force-capped at 100px. My research and attempts at making this work appear to indicate that WordPress' built in TinyMCE functions won't do the job. Might it be best for me to make this completely bespoke, i.e. deregister the existing tinyMCE scripts and register my own? If so, is it possible to only do this on my custom post type pages? Thanks in advance, apologies for the essay! * * * **MAJOR EDIT - QUESTIONS 1 & 2 RESOLVED** OK, courtesy of Martin's post (and Mike's code!) I've managed to set up multiple textareas with custom buttons:               function meta_genus_species() {         global $post;              $genus = get_post_custom_values( 'genus', $post->ID );         $species = get_post_custom_values( 'species', $post->ID );         $etymology = get_post_custom_values( 'etymology', $post->ID );         $family = get_post_custom_values( 'family', $post->ID );         $common_names = get_post_custom_values( 'common_names', $post->ID );              if (!isset($id)) { $id = "etymology"; }         if (!isset($temp_min)) { $temp_min = plugins_url('images/temp_max.png' , __FILE__); }         if (!isset($temp_max)) { $temp_max = plugins_url('images/temp_min.png' , __FILE__); }         if (!isset($pH_min)) { $pH_min = plugins_url('images/pH_max.png' , __FILE__); }         if (!isset($pH_max)) { $pH_max = plugins_url('images/pH_max.png' , __FILE__); }          $tinyMCE = <<<EOT              EOT;         echo $tinyMCE;              ?>

Description of taxonomy.

             Genus
                 <input name="genus" class="text" value="<?php if(isset($genus[0])) { echo esc_attr( $genus[0] ); } ?>" />                 Testing...

             Species
                 <input name="species" class="text"  value="<?php if(isset($species[0])) { echo esc_attr( $species[0] ); } ?>" />                 Testing...

             Etymology             <textarea cols="50" rows="5" name="etymology" id="etymology"><?php if(isset($etymology[0])) { echo esc_attr( $etymology[0] ); } ?></textarea>             Description

             Family             <input name="family" class="text"  value="<?php if(isset($family[0])) { echo esc_attr( $family[0] ); } ?>" />             Description

             Common Names             <input name="common_names" class="text"  value="<?php if(isset($common_names[0])) { echo esc_attr( $common_names[0] ); } ?>" />             Description

         <?php          }          function meta_authored() {         global $post;              $species_author = get_post_custom_values( 'species_author', $post->ID );         $year_described = get_post_custom_values( 'year_described', $post->ID );              ?>
         Species Author
             <input name="species_author" class="text" value="<?php if(isset($species_author[0])) { echo esc_attr( $species_author[0] ); } ?>" />
         Year Described
             <input name="year_described" class="text" value="<?php if(isset($year_described[0])) { echo esc_attr( $year_described[0] ); } ?>" />

         <?php     }      I am absolutely over the moon! I've been working SO hard to find that information. Thank you ever so much Martin :) **Just Question 3 to answer now!**


title: Load ajax if is_home()

text: I want to show some simple things on homepage with ajax. The problem is I want to load everything when is_home() is true. Php, js, everything. **In funtions.php:**               add_action('init', 'pint_functions_separation_test');     function pint_functions_separation_test(){          if ( is_home() ) {               require_once('functions_hometest.php');          }     }      **functions_hometest.php:**               <?php     if (file_exists("./wp-load.php") && file_exists("./wp-blog-header.php")){         define('WP_USE_THEMES', false);         require_once("./wp-load.php");         require_once("./wp-blog-header.php");     }          add_action( 'wp_ajax_nopriv_ajaxtest', 'ajaxajaxtest_handle_request' );     add_action( 'wp_ajax_ajaxtest', 'ajaxajaxtest_handle_request' );          function ajaxajaxtest_handle_request() {            echo json_encode("evo me");            die();          }     ?>      **JS:**               <script>     jQuery(document).ready(function () {         jQuery.ajax({             url: '<?php echo admin_url( 'admin-ajax.php'); ?>',             data: ({                 'action': 'ajaxtest',             }),             type: 'POST',             dataType: 'json',             success: function (data) {                 jQuery("#test_div_id").html(data);             }         });     });     </script>      Wordpress on homepage loads functions_hometest.php but **ajax returns 0.** And if I call php file just with                require_once('functions_hometest.php');      everything works great, but I wan't to keep loading of functions on bare minimum. Does that make any sense? PS. I tried to call with               add_action('get_header', 'pint_functions_separation_login');      but i get the same results. Thank you


title: Author Nickname URL Friendly

text: Using the below code to chnage the author page url to use the "nickname". Works ok but when the nickname is more than one word it doesnt make it url friendly. Any way to do this?               add_filter( 'request', 'wpse5742_request' );     function wpse5742_request( $query_vars ) {       if ( array_key_exists( 'author_name', $query_vars ) ) {         global $wpdb;         $author_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta}    WHERE meta_key='nickname' AND meta_value = %s", $query_vars['author_name'] ) );         if ( $author_id ) {             $query_vars['author'] = $author_id;             unset( $query_vars['author_name'] );             }       }        return $query_vars;      }          add_filter( 'author_link', 'wpse5742_author_link', 10, 3 );     function wpse5742_author_link( $link, $author_id, $author_nicename )  {       $author_nickname = get_user_meta( $author_id, 'nickname', true );       if ( $author_nickname ) {         $link = str_replace( $author_nicename, $author_nickname, $link );       }       return $link;      }          add_action( 'user_profile_update_errors', 'wpse5742_set_user_nicename_to_nickname', 10, 3 );     function wpse5742_set_user_nicename_to_nickname( &$errors, $update, &$user ){       if ( ! empty( $user->nickname ) ) {         $user->user_nicename = sanitize_title( $user->nickname, $user->display_name );       }     }


title: Error instead of search results

text: I am making a blog (wordpress) and I hope to have a search engine in it. I put the "search" as my widget but when I input something into box, an error page is shown. How can I make a search engine so that it will search the posts in my blog? Thanks so much.


title: Add screen options to custom admin pages

text: I want to add screen options to my plugin settings page, like the ones that are available in the Dashboard. ![enter image description here](http://i.stack.imgur.com/GoD60.png) I tried using the `add_option` method of the `WP_Screen` object and found that it supports only two options. `per_page` and `layout_columns`. Does anyone know what screen option to use to get options like the one in Dashboard page? **Edit** : Let me explain what I am trying to a little bit. I have different sections in my Bulk Delete Plugin and each section let's people delete posts based on some criteria (like category, tags, custom taxonomy etc). I want to let users choose which sections they want to use and which sections that they want to hide, similar to the Dashboard page, where users can choose which dashboard widgets they want to see and which ones to hide. Now, to implement this, I want to show a list of checkboxes (one for each section) and let user choose which one to show. To show the list of checkboxes, I had to call the `add_option` method of the `WP_Screen` object. When I was doing that, I figured out that currently `add_option` function only supports these two types and the others are just ignored.   * per_page   * layout_columns But, only in the dashboard page checkboxes are shown. I want to know how to replicate a similar thing in the screen options section of my custom admin page as well.


title: Is a *.wordpress.com blog easy to migrate?

text: As a student software developer who is about to graduate, I find it is time to start my own blog. I've been told it is important to make a name for yourself, to stand out from the rest. Therefore I decided to make a Wordpress website. Since I live in Belgium, I would like a `.be` domain. But, I'm new to Wordpress and I want to go full-on with my own theme from the start. However, I would like to avoid the cost of my domain during the development phase of my website, so I'm planning to create it on the free `*.wordpress.com` domain first. ## My question: If I do this, will I have an easy time migrating everything to my own domain? Which features of my web hoster (server, database, disk space, etc) should I look for specifically, to make the process go smoothly?


title: register_sidebar() will not wrap an element properly

text:
I am trying to add a widget for for some reason I cant wrap an element around the widget. Here's the html in the index.php:

                         <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Intro')) : ?>                                                      <?php endif; ?>

      And here's function.php code:               if (function_exists('register_sidebar')) {         register_sidebar(array(             'name'=> 'Footer',             'id' => 'footer',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));         register_sidebar(array(             'name'=> 'Intro',             'id' => 'intro',             'before_widget' => '',             'after_widget' => '',             'before_title' => '
',             'after_title' => '
',         ));     }      First sidebar wraps the div as expected the second opens and closes the `<p>` (with some whitespace) before contents of the widget. Issue is the same if I add the p tag in the before_widget/after_widget properties. Here's the output:

test

Studio phi is all about architecture, design aesthetics and helping people to put their great ideas on paper and eventually on the ground or maybe even on the water... as far as our imaginations go.

      What is my mistake? Edit: It seems that div wraps as expected but p won't, no idea why this would make a difference.


title: Theme options: Display ID of page options

text: I am building a theme options page and everything is great. There is a function to display the list of page options.               $all_pages = get_pages();     $page_options = array();     $page_list = array();     $page_list_footer = array();     $checked_options = array();          foreach ($all_pages as $page){         $page_list[] = "acera_nav_header_".$page->ID;         $page_list_footer[] = "acera_nav_footer_".$page->ID;         $page_title = get_page($page->ID);         $page_options[] = $page_title->post_title;         $checked_options[] = "not";     }      This is the option:               array(      "under_section" => "Pages",     "name" => "Pages",     "desc" => "",     "id" => "anything",     "type" => "select",     "options" => $page_options,     "tip" => ""),      This is the front end code to display the selected page.               <?php echo stripslashes(get_option('anything'))  ?>      Everything is working just fine, but the problem is that I want to display the name of the page in the admin back end, and to display the ID of the selected page in front end. This way , it displays the name of the page in front end. How can I display the ID instead. Please if there is any solution or tweaks I can do for this, help me, I would be so thankful. Thanks


title: Move jetpacks Googleplus Author from bottom of post?

text:
i am trying to make jetpack play nicely with my theme. i have moved the sharedaddy Likes and Sharing with great success and would like to target the Google+ author output in the same way. here is the code i am using to remove the sharedaddy likes and sharing                   remove_filter( 'the_content', 'sharing_display',19 );         remove_filter( 'the_excerpt', 'sharing_display',19 );         if ( class_exists( 'Jetpack_Likes' ) ) {                 remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );         }      and i add it back where i need it with this...                   $get_jet =  '';         if ( function_exists( 'sharing_display' ) ) {                 $get_je = sharing_display();         }              if ( class_exists( 'Jetpack_Likes' ) ) {                 $custom_likes = new Jetpack_Likes;                 $get_je .= $custom_likes->post_likes( '' );         }         if($get_je){             echo '
';             echo    $get_je;             echo '
';         }      How can i target the Google+ author in the same way?


title: How to get vim to autocomplete WordPress API functions?

text: I guess built-in omnicomplete is a start, but perhaps we're talking some neocomplcache plugin module or something themsuch? Googling "vim wordpress autocomplete" doesn't really give much.


title: How to Increment ID value within ACF Repeater Field Loop

text:
The code below is meant to display an Advanced Custom Fields Repeater field. I need to have unique values for the "for" attribute of the Label tag, and for the ID value of the trailing checkbox input field. Also, in order for the field label to work correctly, I need the "for" value to match the ID value of the input field, and each value needs to be unique for each time the field is repeated or displayed on the front end. See how this displays currently on the front end in the source: Imgur The ID and "for" value are blank, but need to be matching values for each row of fields, but also needs to be unique per row.               <?php     if ( get_field('ingredients-list') )     {         echo '
';         while ( has_sub_field('ingredients-list') )         {         echo '
  <input type="checkbox" class="check" id=""> ';                 if ( get_sub_field('quantity') ) echo '' . get_sub_field('quantity') . ' ';                 if ( get_sub_field('measurement') ) echo '' . get_sub_field('measurement') . ' ';                 if ( get_sub_field('ingredient_name') ) echo ''. get_sub_field('ingredient_name') .'';                 if ( get_sub_field('measurement') ) echo '' . get_sub_field('notes')  . ' ';             echo '';         echo '
';     }     echo '
';      } ?>


title: Menu's breaking, now showing all page links on site

text: There's something quite odd happening on a site I'm working on I can't figure out why at all. I have a custom post type set up for `news` and categories so the user can select what type of news it is (e.g. specials, offers etc).   On the news archive I have a sub-menu set up linking to all the categories so the user can filter the news items by category.      I have a `category.php` file set up and a function in the functions file that filters the news items on the fly:               function set_post_type_for_category_archive_wpse_101930($qry) {       if (is_main_query() && is_category()) {         $qry->set('post_type', 'news');       }     }     add_action('pre_get_posts','set_post_type_for_category_archive_wpse_101930');      But for some reason when you're on a category archive page, e.g. `www.website.com/news/category/offers` the sub-menu breaks, and instead of being the categories list, it's now displaying a list of all page links on the site, e.g. Home, About, Gallery, Contact etc and I can't figure out at all why this is happening, is there a solution to this? Any suggestions would be greatly appreciated!


title: How we add tabs in plugin page

text: I want to add tabs in my test-plugin. I have add a folder '3 test plugin' with file '3 test-plugin.php'. I have activate plugin and add in the setting admin menu. Please give the details of adding tabs in my plugin file. thanks in advance. file code is follow: ## Hello World Options Enter Text " /> (ex. Hello World) " />


title: How to use radio buttons in WordPress plugin options using register settings?

text:
How do I get this to save the radio buttons? It saves the checkboxes but I've tried a lot of methods and can't get it to save the radial buttons. Any help will be appreciated. Working Plugin Example just drop into wp-content/plugins/myplug folder.               <?php     /*     Plugin Name: myplug     Version: 0.1     Plugin URI: http://myplug.org     Author: ME     Description: Stupid plugin     */          add_action('admin_init', 'myplug_register_options');  // register options for the form     add_action('admin_menu', 'myplug_admin_links');  // register admin menu hyperlinks          /** Function to register form fields **/     function myplug_register_options(){         register_setting('myplug_options_group', 'myplug_settings', 'myplug_validate');     }          /** Function to add hyperlinks to the admin menus using hooks and filters. **/     function myplug_admin_links() {       add_options_page('myplug Setup', 'myplug', 'manage_options', 'myplug', 'myplug_admin_page' );  // add link to settings page       add_filter( 'plugin_action_links', 'myplug_settings_link', 10, 2 );  // add link to plugin page     }          /** Function to create link for plugin_action_links filter **/     function myplug_settings_link($links, $file){         if ( $file == plugin_basename( dirname(__FILE__). '/myplug.php')){                 $settings_link = '' .__('Settings') . '';                 array_unshift( $links, $settings_link ); // place before other links         }     return $links;     }          /** Validate User Input **/     function myplug_validate($input) {         $input['value1'] = wp_filter_nohtml_kses($input['value1']);         $input['value2'] = wp_filter_nohtml_kses($input['value2']);         $input['select_display'] = wp_filter_nohtml_kses($input['select_display']);     return($input);     }          /** Draw the Settings Page **/     function myplug_admin_page(){     ?>

Options
       <form method="post" action="options.php">       <?php settings_fields('myplug_options_group'); ?>       <?php $myplug_options = get_option('myplug_settings'); ?>             <input type="checkbox" name="myplug_settings[select_value1]" value="1" <?php checked('1', $myplug_options['select_value1']); ?> />             value1:             <input style="display:inline-block;width:300px;" type="text" name="myplug_settings[value1]" value="<?php echo $myplug_options['value1']; ?>" />
             <input type="checkbox" name="myplug_settings[select_value2]" value="1" <?php checked('1', $myplug_options['select_value2']); ?> />             value2:             <input style="display:inline-block;width:300px;" type="text" name="myplug_settings[value2]" value="<?php echo $myplug_options['value2']; ?>" />
             <?php echo 'display:  ' . $myplug_options['select_display'] . '
'; ?>             <input type="radio" name="select_display" id="item1" value="item1"     <?php if($myplug_options['select_display'] == 'item1') echo 'checked="checked"'; ?> />             <input type="radio" name="select_display" id="item2" value="item2"     <?php if($myplug_options['select_display'] == 'item2') echo 'checked="checked"'; ?> />       <?php submit_button(); ?>       </form>
     <?php     }     ?>


title: Shortcode are not working in Option tree textarea

text: I am using option tree. In textarea, i place shortcode               [layerslider id="1"]      its not working, i also found same post replied by plugin author allow shortcodes in textarea in option tree applied the               do_shortcode('[layerslider]');      still no solution


title: get_usermeta() deprecated in favor of get_user_meta(). But why doesn't it make use of it?

text: While coding WP I just wondered about this simple fact: `get_usermeta()` is deprecated since version 3.0. The warning suggests me to use `get_user_meta()`. Even the parameters are pretty similar, I wonder why the deprecated function is not making use of the new function as well. Isn't that a sign that the new function does not really does what the deprecated did? I'm wondering because I need to replace deprecated calls and wonder a bit. What makes me even wondering more is the simple fact that `get_user_meta()` is quite an alias of the 2.9 function `get_metadata()` with only a constant value'ed parameter 'user' given. Help ;) _**Edit:_** A counter-example is `clean_url()` - it's deprecated, the error message shows what this is about and the deprecated function aliases the new one: `esc_url()`, so it's clear what to do.


title: Random Featured Image Based on Category

text: I am looking to extend the below code to select a random featured image based on a specific category. The below works but uses an overall list of images to pull from vs a list of images based on specific categories. In the below, any image starting wtih "UF-" is selected at random to be used as the featured image. Can someone help point me in the right direction? Ideally, looking to have several images for each category that are used at random.               function autoset_featured() {          global $post;          $already_has_thumb = has_post_thumbnail($post->ID);          if (!$already_has_thumb)  {              $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );              if ($attached_image) {                   foreach ($attached_image as $attachment_id => $attachment) {                        set_post_thumbnail($post->ID, $attachment_id);                   }              } else {                   set_post_thumbnail($post->ID, get_image());              }          }     }          function get_image(){          $list = array();          $data = array();               $media_query = new WP_Query(                         array(  'post_status' => 'inherit',                                 'post_parent' => 0,                                 'post_type' => 'attachment',                                 'post_mime_type' => 'image/jpeg'                   ));               foreach ($media_query->posts as $post) {               $fullpath = wp_get_attachment_url($post->ID);           $list     = (explode("/", $fullpath));           $string   = $post->ID.'|'.$list[sizeof($list)-1];                    if (substr($list[sizeof($list)-1],0,3) == 'UF-') {                 array_push($data,(explode("|", $string)));                     $idx      = mt_rand(0, count($data)-1);             $img_id   = $data[$idx][0];               }          }               return $img_id;     }          add_action('the_post', 'autoset_featured');     add_action('save_post', 'autoset_featured');     add_action('draft_to_publish', 'autoset_featured');     add_action('new_to_publish', 'autoset_featured');     add_action('pending_to_publish', 'autoset_featured');     add_action('future_to_publish', 'autoset_featured');


title: Is there ANYTHING about this query that's incompatible with WordPress 2.9.2?

text: I've been puzzling over this one for two days. Still can't figure it out. I'm testing a theme release in multiple versions of WordPress using xampplite on localhost on a PC. I'm having a problem on WP 2.9.2 that does not occur on any other newer installations of WP. Take a look at the query below. As long as I leave the commented line in place, it works fine. However, when I uncomment the line, it crashes my xampplite Apache server. WTF?               $the_query = new WP_Query(array(       'posts_per_page' => 5,       'offset' => 0,        'order' => 'ASC',       'post__not_in' => get_option("sticky_posts"),     //  'cat' => get_cat_ID('top-menu'),       ));     print "<p>header.php";exit;      I've even tried to hard code the cat attribute to a static number:               'cat' => 3      It still crashes! Is this a problem with the code, wordpress 2.9.2 or with my Xamplite setup? Seems odd that it works in all newer other versions of WP I've got set up on this same box.


title: Does wordpress.com appears in the URL if I buy custom domain service from WP.com

text: Let's say I buy a custom domain myblog.com and I host at wordpress... if I access the dashboard page on my blog, will it have wordpress.com in the URL? I want to be able to manage my blog behind school firewall.. thanks


title: Do multiple jobs on date change without WordPress cron job

text: I m trying to randomize several posts on my client's site which are on different pages , everyday. So I wrote a function which returns true on date change, and if does, I randomize the post ids and save them into the database and use the same values throughout the day, So here is what I m doing,               function comi_date_change(){          date_default_timezone_set('Asia/Kolkata');         $current_date = date('j F Y');         $comi_current_date = get_option('comi_current_date');         if($current_date == $comi_current_date){              return FALSE;         }else{             update_option('comi_current_date', $current_date );               return TRUE;         }     }      When I check the condition mocomi_date_chage() to be true or false, it works but only once, because, the moment this function executes, it saves the current date into the database and it returns false for the rest? I don't want to use WordPress cron job function `wp_schedule_event()`, is there any alternative? Thanks


title: Only Show an Advanced Custom Fields custom field on a specific template

text: I am building a site that will rely on Advanced Custom Fields to control the information displayed on a page template. Is there a way I can programmatically show a field (or fieldgroup) only when that template is selected?


title: Prev and Next link for splitting single post into multiple pages

text: I have pagination on my site like this: > Pages 1 2 3 4 … and so on. I am doing this by adding `<\--nextpage-->` where i want to split my long pages into multiple pages. I want to add previous and next links to the page numbers that looks like this: > Prev 1 2 3 4 5 6 7 Next


title: Taxonomy search filters

text: I have developed an educational courses database of several countries using several taxonomies. Country, institute, study level and some other are taxonomies. If user click on some country, all courses in that country will appear. How the result can be filtered (institute, study level etc) while remaining in the same country. I would like to put it on archive page so each search could be further filtered.


title: How to override my plugin's php classes with duplicates that are in my child theme folder

text: I have a child theme in wordpress and one of the plugins I am using is called jigoshop. I made a copy of a few php classes from the plugin and placed them in my child theme folder. I want these clases to override the ones from the plugin folder. How would I go about doing that? Thanks!!


title: Using the Settings API, how should I add multiple values to an option?

text: I'm trying to add/ update additional values to an option created with the Settings API. I'm trying to do this with my validation callback function, but I'm not getting very far. Here is my code:               function tccl_settings_option_validate( $input ) {         add_option( 'tccl_settings_option', $input );     }      This is causing a pretty big error. How should I be doing this? What I would like to do is use the validation callback to add values to the option array without overwriting it.


title: Custom Post Type Archive Page not showing

text: I have a category on my website called 'profiles' I am in the process of moving this category to a custom post type called 'profiles'. My problem is I cannot get the archive page to show for this custom post type. When I go to the url `mywebsite.com/profiles` it takes me to a single post page for a post in the profiles category. I have included `has_archive = true;` in my `functions.php` I didn't have a problem creating an archive page for another custom post type I did on the same website so Im really lost as to why this is not working this time. Any advice would be most appreciated?               add_action( 'init', 'profile_custom_init' );          /* Here's how to create your customized labels */     function profile_custom_init() {     $labels = array(         'name' => _x( 'Profiles', 'post type general name' ), // Tip: _x('') is used for localization         'singular_name' => _x( 'Profile', 'post type singular name' ),         'add_new' => _x( 'Add New', 'Profile' ),         'add_new_item' => __( 'Add Profile' ),         'edit_item' => __( 'Edit Profile' ),         'new_item' => __( 'New Profile' ),         'view_item' => __( 'View Profile' ),         'search_items' => __( 'Search Profile' ),         'not_found' =>  __( 'No Profile found' ),         'not_found_in_trash' => __( 'No Profile found in Trash' ),         'parent_item_colon' => ''     );          // Create an array for the $args     $args = array( 'labels' => $labels, /* NOTICE: the $labels variable is used here... */         'public' => true,         'publicly_queryable' => true,         'has_archive' => true,         'show_ui' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'post',         'hierarchical' => false,         'menu_position' => 10,         'supports' => array( 'title', 'editor','thumbnail', 'excerpt', 'custom-fields' ),             'taxonomies' => array('category')         );               register_post_type( 'profile', $args ); /* Register it and move on */     }


title: Loading wp-load.php in an external PHP file throws unknown error

text: I'm loading wp-load.php in order to access WP functions inside of a PHP file that I'm using to process form submissions. Everything works perfectly fine on localhost and every server I've tested (except one). It does not, however, work on one particular server (which is running on rackspace). I'm loading it like this:               $oldURL = dirname(__FILE__);     $newURL = str_replace(DIRECTORY_SEPARATOR . 'wp-content' . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'cgc-post-image-gallery' . DIRECTORY_SEPARATOR . 'includes', '', $oldURL);     include($newURL . DIRECTORY_SEPARATOR . 'wp-load.php');      This is in a file called process-submission.php that is called when the form is submitted. The error is thrown after the form is submitted. Unfortunately, the server is configured such that it does not display what the actual error is, only that an error has occurred. The really weird thing is that I have another plugin running (that I wrote) on the exact same server and site that is loading wp-load.php in the exact same manner, except it works perfectly fine! Through some testing I have been able to determine that the error is thrown the moment the include() function is reached. I thought perhaps this file loading wp-load.php and the other plugin (the one that is working) loading the file might be causing a conflict, but the other one still works perfectly fine. Also, neither of the files are ever actually loaded in WP (only accessed from the form on the front end), so there is no redeclaring of anything. Any ideas why including wp-load.php would throw an error in this instance, but not the other? The problem also occurs if I try to load wp-blog-header.php


title: Automatically install wordpress plugin at theme activation

text: I'm looking into using http://tgmpluginactivation.com/ to activate required plugins for my custom theme during the theme activation step. From what I can tell, this class only Activates plugins automatically, but it doesn't automatically Install plugins I have bundled with my theme. Does anyone know if it's possible to automatically Install plugins upon theme activation? Preferably, in a way that can still make use of TGM?


title: Testing for a shortcode using a function. 404 page throwing PHP Notice

text: I'm using the following function (can't remember where I found it, but I think it was written by pippin so thanks to him) to test for a shortcode.               function has_shortcode($shortcode = '') {             $post_to_check = get_post( get_the_ID() );             // false because we have to search through the post content first        $found = false;             // if no short code was provided, return false        if ( !$shortcode ) {           return $found;        }             if (  stripos( $post_to_check->post_content, '[' . $shortcode ) !== false ) {           // we have found the short code           $found = true;        }             // return our final results        return $found;     }      The problem is, on a page such as a 404 page I get the following errors:               Notice: Trying to get property of non-object in /wp-includes/post-template.php on line 30     Notice: Trying to get property of non-object in theme-functions.php on line 49      On theme-functions in line 49 is this line from the above function               if (  stripos( $post_to_check->post_content, '[' . $shortcode ) !== false ) {      If I remove the function call **if( has_shortcode('gallery') )** ... from another file, the two errors go away. I believe the two are related and if I fix the function it will clear them both. I can "kind of" understand why this is happening... my understanding is that on the 404 page there is no $post variable set so somehow I need to modify the function to test first. Am I right?


title: How to export bbPress (forums, topics, replies) and all users?

text: I've searched a little and I could not find a straight working answer. I want to export all users and their bbPress(2.1.2) forums, topics and replies to another fresh WordPress installation? If anyone has a suggestion. Thanks


title: get_the_excerpt() not returning anything when post has no excerpt

text: When trying to call `get_the_excerpt()` the page does not return anything on posts that have no excerpt. I thought WordPress usually 'fake' it and create one using the first x characters from `the_content()`. Or have things changed?


title: How to modify post content before writing to database?

text: Hi~ I'm back again and I'm trying to add another function to the script I was working on a plugin that notify my friends of new post that mentions(@) them. Now I want to change the plain text of my friends' names that I mentioned into links to their own wordpress blog address (if they have) once I hit publish. So @David will become David. I search this question many times but all results are like following:               add_filter('the_content', 'replace_custom_word');      which doesn't really modify the database, right? Edit: I don't know, maybe I'm wrong. Below is the code I'll use to get David's blog address.                       $friend_url = $wpdb->get_var( $wpdb->prepare( "                                                                 SELECT comment_author_url                                                            FROM $wpdb->comments                                                            WHERE comment_author                                                            LIKE %s ",                                                            $friendCorrectName                                                            )) ;      So please tell me what's the best way of doing this. Thanks a lot in advance! The complete code for this script is pasted below too, please feel free to comment on what I have now too. :） You can check out my last post if you see something weird, or you can just ask me.               function email_friend()  {              // get post object         $post = get_post($id);         // get post content         $content = $post->post_content;         // get how many people is mentioned in this post         $mentionCount = preg_match_all('/(@[^\s]+)/', $content, $matches);                   // if there is at least one @ with a name after it         if (0 !== $mentionCount) {                  $friendList = array();//for storing correct names                  for ($mentionIndex=0; $mentionIndex < $mentionCount; $mentionIndex++) {                      $mentionName = $matches[0][$mentionIndex];                   $mentionName = str_replace('_',' ',$mentionName); //change _ back to space                 $mentionName = substr($mentionName, 1); //get rid of @                 //for security and add wildcard                 $friend_display_name_like = '%' . like_escape($mentionName) . '%';                       global $wpdb;                      // get correct name first                 $friendCorrectName = $wpdb->get_var( $wpdb->prepare( "                                                                     SELECT comment_author                                                                FROM $wpdb->comments                                                                WHERE comment_author                                                                LIKE %s ",                                                                $friend_display_name_like                                                                )) ;                      // get friend email by comment author name                 $friend_email = $wpdb->get_var( $wpdb->prepare( "                                                                     SELECT comment_author_email                                                                FROM $wpdb->comments                                                                WHERE comment_author                                                                LIKE %s ",                                                                $friendCorrectName                                                                )) ;                      // get friend's blog address                 $friend_url = $wpdb->get_var( $wpdb->prepare( "                                                                 SELECT comment_author_url                                                            FROM $wpdb->comments                                                            WHERE comment_author                                                            LIKE %s ",                                                            $friendCorrectName                                                            )) ;                      //if we have David's blog address in database                 if ($friend_url) {                               //this is where I need help with.                      //I need to modify post content before writing it into database now                     //I need to change the plain text name after @ to a link to his blog                                                                   }                      if($friend_email) {// if found email address then email                          $postTitle = get_the_title($id);                     $post_permalink = get_permalink( $id );                     $to =   $friend_email;                     $subject =   'Arch!tect mentioned you in his new post 《'.$postTitle .                      '》';                     $from = "noreplay@swotong.com";                     $headers = "From:" . $from;                     $message = "Arch!tect mentioned you in his new post《".$postTitle .                      "》 check it out？\n\n"  ."Post link：".$post_permalink                     ."\n\n\nPlease don't reply this email.\r\n";                          if(mail($to, $subject, $message, $headers)) {                         //if send successfully put his/her name in my list                         array_push($friendList, $friendCorrectName);                     }                      }                   }              $comma_separated_list = implode(",", $friendList); //friend list array to string                   // now send an email to myself about the result             $postTitle = get_the_title($id);             $post_permalink = get_permalink( $id );             $to =    'myOwn@email.com';             $subject =   "Your new post《".$postTitle .              "》has notified ".count($friendList)."friends successfully";             $from = "noreplay@email.com";             $headers = "From:" . $from;             //list all friends that received my email             $message = "Your new post《".$postTitle .              "》has notified ".count($friendList)."friends successfully:\n\n".             $comma_separated_list;             mail($to, $subject, $message, $headers);         }          }//end of email_friend function          add_action ( 'publish_post', 'email_friend' );      **EDIT2: to be more specific, the code above where I comment " //this is where I need help with. " is the place I need help with.**


title: Add Bootstrap Classes to Recent Posts Widget

text:
I am building a site that is based on an existing theme, lawyers. I am tasked to make the recent posts widget look like the practice areas section, I would need to add some structural divs (bootstrap "rows") and classes on the list items so the widget output would look like this:

Recent Posts Widget Title

Recent Post

Recent Post

Recent Post

Recent Post

      I'm assuming this can be done relatively easily with filters, i'm just not too sure how.


title: Add extra field when admin create user

text: I have created extra field that user can edit on their 'Your Profile' page. The extra field also available on WordPress register page. What I want to ask is, how to add the field to User > Add new page ? So, when admin creates a user, admin also input the user's extra field


title: Syntax Highlighting Plugins and 3.2.1

text: I was looking for some decent syntax highlighting plugins to display php code on posts. But most of the plugins in the wordpress repository are not updated for years. I found wp-syntax causing issues with the theme. So is there any good plugin with less bugs and better syntax highlighting that works fine with wordpress 3.2.1 ?


title: Licensing: Can I include SWFs without source in a plugin released on wordpress.org?

text: Suppose I create a WP plugin that includes a couple of SWFs that I create (not third-party SWFs). According to http://wordpress.org/extend/plugins/about/ , if I want to publish that plugin on wordpress.org I have to release it as GPLv2 or compatible. The first question is more theoretical:   * Do I have to release the source code for the SWFs for GPLv2 compliance? Doing a little research, it appears this question has been argued before: http://smackdown.blogsblogsblogs.com/2011/02/18/as-it-turns-out-wordpress-itself-is-not-100-gpl-compliant-after-all-and-they-violate-the-mit-license-as-well/ . The second question is more practical:   * If I tried to release a plugin that includes SWF "binaries" without source code on wordpress.org:     * Would I be blocked from publishing the plugin on wordpress.org?     * Would I be permitted to publish it, but publicly excoriated?     * Would nothing happen? Thanks for your thoughts, JP


title: Showpost and last

text:
I need your help. I would like to bring up the last (number) from my template classified ads. Here's the code:               <?php      $the_query = new WP_Query( array(                 'showposts' => 10,                 'post_type' => 'ad',                 'tax_query' => array(                                     array(                                     'taxonomy' => 'ad_category',                                     'field' => 'id',                                     'terms' => array('8')                                     )                                 )         ));     if($the_query->have_posts()):     ?>

Category

         <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                 <?php colabs_image('width=150&height=150&play=true');?>                 <a href="<?php the_permalink();?>"><?php the_title();?>
         <?php endwhile; ?>

     <?php endif;?>      I tried with showpost, but nothing appears in one ad ... this is not even the last announcement.


title: Multiple Custom Headers

text: I am trying to add this function:               add_theme_support( 'custom-header' );      I would like this to somehow combine with multiple headers. I saw some code that was PHP that checked which template was loaded then add the image (header) that was defined in the code. This is not totally optional since I want my theme to allow the user of the theme to change the header for his "buyers" template, the "sellers" template, so forth. Is there any way to make the 'custom header' page allow several custom headers that are called on different templates?


title: Inserting a Download Link in the Quick Edit Actions of the Media Library?

text: What's the best way of doing this: On The 'Media Library' page, I would like a link next to 'View' (the 'View' that appears when you hover over a Media item) for 'Download'. The 'Download' hyperlink would link directly to the file, unlike the 'View' link which links to a template-based page with either the embedded image or a link to the non- image file. I have a lot of PDF's in my media library that I look up regularly, having to click on 'View' and then click on the hyper-linked file name just to get to the file is a little cumbersome.


title: Add all typography options with options tree

text: I'm new to WordPress theme development, and I had to create a theme with options tree. I have successfully add some options with options tree plugin in my Wordpress theme. But I am really stand when I go to add typography option. I have complete section an settings on theme option with `'type' => 'typography'`, after that I see I have find some options on dashboards theme options like `'font-family'`, `'font-size'`, `'line-height'`, `'font-style'` etc. Now I want to query all methods, but I do not know how can I do this?


title: Create a blank test.php

text: Sometimes it's necessary to figure out CSS errors or whatever and then it's great if you have a minimal test page where you just insert the specific code you want to test. How can I create such an empty test.php? All I could find was this. However, doing so will only create a page that will have the same styling as the page.php one, no? I suppose I need to put something into my function.php to tell Wordpress that it should create a new template for test.php? How would I do that? Thanks a lot in advance! :)


title: How do I load my site without the side bars? This is for an app

text: My site has a left side bar where I display categories and ads and what not. We are creating a basic android app for it and we are trying to figure out how to load the site on the app without sidebars. I know that I can disable the side bars in the options of WP but I don't want to disable them because I want people to be able to see the sidebar when they visit the site. Is there a trick to just loading the site without including the side bar? I just want to target the middle frame of the site. Any help would be appreciated. site: tablified.com


title: XML-RPC and post_date

text: I'm trying to set the post_date via XML-RPC and keep getting an error saying the XML isn't formatted properly. The code goes something like:               $post = get_post( $post_id );          $response = $client->query(          'wp.editPost',         array(              0,              $user,              $pw,              array(                  'post_date' => $post->post_date              )          )      );      I'm hitting the same issue with `wp.newPost`. I know the date should be formatted ISO8601 but I'm just having no luck getting it formatted right.


title: How to link avatar and nickname to profile

text: On the single post page I want to link the avatar function to the author profile, but I tried               <a href="<?php the_author_posts_link(); ?>">     <img src="<?php echo get_avatar($post->post_author, '64', $avatar); ?>">           but that doesn't work. Also, how can I display the nickname (display name) and still link to the profile the following code gives a strange link and 404s               <a href="<?php echo get_author_posts_url(); ?>"><?php the_author_nickname(); ?>      some help would be greatly appreciated. Thanks


title: Search result permalink

text: how to make permalink available for search result page /?s=one+two+ok to /search/one-two-ok/ thank


title: How to auto update to latest WP version in IIS localhost?

text: I have WordPress installs in my IIS localhost server on Win7 desktop done manually and with WebPI install.Both installs are under IIS default website. Either asks for FTP credentials when I try to auto update to the latest WP version. I have FTP server enabled on IIS (users IUSR and Richard). I have checked that read write permissions are enabled on the wordpress root & wp-content folders.   I try putting in the credential values but keep getting no response or > ERROR: There was an error connecting to the server, Please verify the > settings are correct. Credentials asked for are Hostname/FTP user/FTP password and I have tried all manner of credentials I think might be correct but obviously are not. (eg `ftp://localhost`- IUSR -site password etc etc). I am most unsure about the FTP password. I have asked for help with this on WordPress forum, WordPress codex, IIS7 forum, googled & tweeted for help to fix this and found no answer! There are several threads about the issue but most say the fix is to enable read write folder permissions and there is something about using `web.config` file and also editing `wp-config.php`. I do not really want to edit `wp-config.php`. What I really want is to enter the correct ftp credentials for WordPress on IIS and have it work and autoupdate to the latest version. Does anyone know what ftp credentials I have to use to get this done please? Has any WordPress IIS localhost user experienced this and dealt successfully with this ftp autoupdate? Edit 10/10/12 >> Hi mauri- many thanks for your very helpful reply. I followed your instruction on my WordPress blog that MS WebPlatformInstaller(WPI) installed for me and (ta da!) it worked as you said-ie it autoupdated to the latest WP version without asking for the ftp credentials. My only issue is I'm not sure what this is or what I really did apart from following your instruction! I would like to understand all this 'jiggery-pokery'! I add Authenticated users & gave them full permission. I would also really like to fully understand my localhost IIS server...I would also like to know how to set my IIS up so when asked for the ftp credentials I can put in the info & have it work that way too! However very many thanks for your very helpful reply


title: displaying the categories post

text:
I have this php code below for displaying the post from the specific categories.
     <?php query_posts('category_name=slideshow&showposts=10');     while (have_posts()) : the_post();     echo "
".the_content()."
";     endwhile;?>
      as you can see, it display those post in the category slideshow and the structure of that should be this.

the post 1

the post 2

the post 3

      but the output that is generated is this.

three

two

one

      and the generated structure should not look like that and it looks nasty at all, so im having a problem on this on how to display it properly like to display into this structure.

the post 1

the post 2

the post 3

      So Im wondering if there's someone who could tell me how to fix this. Im open into any suggestions, recommendations and suggestions. Thank you.


title: Remove a plugin meta box from the dashboard

text: I'm trying to remove the meta box that the Download Manager plugin creates, as it uses a hardcoded http iframe, caused a mixed content error in ssl. Here is the code that generates the meta box:               wp_add_dashboard_widget('wpdm_dashboard_widget', 'WordPress Download Manager', 'wpdm_dashboard_widget_function');      and here is the code I'm using in my theme's functions.php file:               function remove_dashboard_widgets(){         remove_meta_box('wpdm_dashboard_widget', 'dashboard', 'normal');     }     add_action('wp_dashboard_setup', 'remove_dashboard_widgets');      I also tried 'dashboard-network' as the 2nd parameter, as I'm running a multisite setup. Neither worked for me. Where am I going wrong?


title: Change the behaviour of archive cpt category and single cpt by plugin, not by theme

text: I need to know: I have wrote at 60% one plugin, it works well in backend (some settings, some cpt, some custom fields... nothing special). It uses custom post type with custom fields. For now I need to change default archive category behaviour as well as change behaviour of single posts of this CPT _doesn't_touching_ templates (because this plugin will be used not only in the 1 site and there will be many templates). Just programmatically, by filters/actions - change it as I like.. for example, I will need to show up this custom fields in this single custom post type. Does somebody knows about how to do it by plugin?


title: Force display name as full name

text: Is there a way I can force all users display names to be `Firstname Lastname` or alternatively change this to be the default?


title: Custom Post Types in the WordPress Navigation Menu

text: Hello can someone help me out by pointing me in the right direction as to where I can find out how to add a drop down menu to a theme with my custom post types stored within in, have been looking/searching google for "custom post types in wp_nav_menu", "custom post types in wp_list_pages", "custom post types in wordpress themes", "custom post types in wordpress theme", and have drawn a blank so far, I have managed to find out how to get my posts in the custom post types to appear in with the normal blog posts, but as I will have several posts in the custom post types more than what would be in the normal blog, would make this diluted and I would therefore like to have them in a drop down box in the menu. The menu on this website here http://justintadlock.com/ the "Writing" part on the menu I presume that these are custom post types, but I wish to have the menu on my site like this menu, if anyone can point me in the right direction as to how to achieve this, be is something on the codex, a blog post or something like this I would very much appreciate anything anyone would be able to tell me.


title: If/Else child list for Custom Post Type single template within loop?

text:
I'm trying to add a feature to my 'Services' custom post type single template that displays one thing if the post type has one or more child post types and another thing if it doesn't. So far I've come up with this, however it doesn't seem to work as expected:               <?php     if($post->post_parent)     $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else     $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); ?>     <?php if ($children): ?>

     <?php echo $children; ?>

          <article class="four-column spacer align-left <?php post_class(); ?>"id="post-<?php the_ID(); ?>" role="article">          <?php the_content(); ?>
          <?php else : ?>          <article class="six-column spacer align-left" id="post-<?php the_ID(); ?>" role="article">          <?php the_content(); ?>
           <?php endif; ?>      Can anyone help me and point me in the right direction please? I have set up the Services post type to hierarchical => true and capability_type => post (and have tried page) but still no luck. Obviously the code above needs to sit within the standard page loop. Does this mean I need to use query_posts instead? Many thanks, Adam


title: Redesigning Custom Post Type "Add New" page

text: I've been browsing all over google for a solution to this. I'm writing a custom post types plugin for work to log-in visitors that we get. I initially wrote a mock-up _without_ custom post types, then I came around here from a google search and saw a screenshot that showed an example of custom post types to store information about Attorneys. It showed that someone redesigned the "add new"/"edit" page for custom post types with a whole new interface. I was wondering if wordpress @ stackexchange would have any resources to redesign the custom post types "add/edit" pages. I can't remember the search terms that I did to find that article however. Thanks,   -Zack


title: Can a scrollable date picker be done in Wordpress for archives?

text: I've been asked by a client to do this: ![enter image description here](http://i.stack.imgur.com/1jJCe.png) But I have no idea how I would go about it, particularly in Wordpress. I searched around Google a bit, but it looks like this design was just lifted from an iPhone or is a Flash animation (I'm lame at Flash, so want to keep things all-based in HTML, CSS and JS - preferably jQuery). Has anyone done this sort of thing? I'm assuming it would be quite complicated as the date picker needs to be populated dynamically as more and more posts are archived and to load the different queries created by selecting a month and year (to show the list of article titles to the right of it) would require some Ajax right? Thanks for any pointers, especially if you can show me where a tutorial exists for this! Osu


title: Remove from "Wordpress" when reciving email (Should I remove filter?)

text: I am getting "Wordpress" when I sending my email using wp_mail. So to remove "Wordpress" from my e-mail I am using filter like so:               //Remove "Wordpress" when receiving email      function remove_from_wordpress($email){     $wpfrom = get_option('blogname');     return $wpfrom;     }          add_filter('wp_mail_from_name', 'remove_from_wordpress');      It works great and now I am getting site name instead.      My question: Is this a proper way to do it? Because I am concerned that my filter will maybe break some other plugins. If that is the case how can I avoid that?   Thank you.


title: Why does my css file keep caching on wp-multisite?

text: I am quite a newbie in web design and I hope someone can solve this problem for me, I have also tried wordpress forum but can't find the answer. I have a multisite (sub domain) with a strange caching problem that only happens on all sub sites. Everytime I make a css change I have to wait 10mins/a few hours until it takes effect. I'm trying to find out where my theme css files keep caching, its not browser caching, I don't have any cache plugins, and no caching in my htaccess, I have shared hosting and all my host caches are disabled who have also confirmed this. Even if I start a brand new install of multisite with no plugins installed, this will keep happening to all sub sites. My main site is: http://reccoa.com and I have a sub site on: http://test1.reccoa.com both are sharing the same theme For this example I have just deleted my custom1 theme css file: wp- content/themes/custom1/style.css so if you view reccoa.com, it will have no stylesheet and if you view page source and click the following link:               <link rel='stylesheet' id='andym-css' href='http://reccoa.com/wp-content/themes/custom1/style.css?ver=2.0.2' type='text/css' media='all' />      You will get a 404 error, and rightly so because I've deleted the css file. but if you view: http://test1.reccoa.com, this site displays with the css file. And if you view page source and click the following link:               <link rel='stylesheet' id='andym-css' href='http://test1.reccoa.com/wp-content/themes/custom1/style.css?ver=2.0.2' type='text/css' media='all' />      You can see my whole stylesheet (that will take 10mins/a few hours before it removes). Where is this css file coming from when I have deleted it? Does anyone know how I can find out where this file is coming from on my server: http://test1.reccoa.com/wp-content/themes/custom1/style.css?ver=2.0.2


title: Wordpress theme switcher

text: I want to set up a theme demos site, so I am looking for a theme switcher. I have tried a few of them, they create the demo url like:               example.com/whatever?themedemo=theme-name      But I am looking for any plugin which generates cleaner urls, for example: example.com/whatever/theme-name If there is any, please let me know. So I am looking


title: 400 Bad Request on Custom Post Type Rewrite

text: I'm doing some rewriting of the url for a taxonomy and custom post type based on some code I found on here. However on my custom post type archive url I'm getting a 400 Bad Request. I honestly just want to redirect it, but none of my attempts to do so seem to work. My url looks like:               http://example.com/products/%product_description%/      Here is my actual code:               register_post_type('products', array(     'labels' => $labels,     'public' => true,     'show_ui' => true,     'menu_icon' => 'dashicons-admin-plugins',     'capability_type' => 'page',     'hierarchical' => true,     'rewrite' => array('slug' => 'products/%product_description%', 'has_archive' => 'products'),     'query_var' => true,     'exclude_from_search' => false,     'supports' => array(       'title', 'editor', 'revisions',     ),     'show_in_menu'  => true,     'has_archive' => true,       ));     }     add_action('init', 'cptProducts');               function taxProductDescriptions() {       register_taxonomy('product-descriptions','products',     array(       'hierarchical' => true,       'labels' => array(         'name' => _x( 'Product Descriptions', 'taxonomy general name' ),         'singular_name' => _x( 'Product Description', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Product Descriptions' ),         'all_items' => __( 'All Product Descriptions' ),         'parent_item' => __( 'Parent Product Description' ),         'parent_item_colon' => __( 'Parent Product Description:' ),         'edit_item' => __( 'Edit Product Description' ),         'update_item' => __( 'Update Product Description' ),         'add_new_item' => __( 'Add New Product Description' ),         'new_item_name' => __( 'New Product Description Name' ),         'menu_name' => __( 'Product Descriptions' ),       ),       'rewrite' => array( 'slug' => 'products', 'hierarchical' => true, 'with_front' => true ),       'query_var' =>true,     )       );     }     add_action( 'init', 'taxProductDescriptions' );               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');      function mmp_rewrite_rules($rules) {     $newRules  = array();     $newRules['products/(.+)/(.+)/(.+)/?$'] = 'index.php?products=$matches[3]'; // my custom structure will always have the post name as the 5th uri segment     $newRules['products/(.+)/?$'] = 'index.php?product-descriptions=$matches[1]';          return array_merge($newRules, $rules);     }          function filter_post_type_link($link, $post)     {     if ($post->post_type != 'products')     {       $link = str_replace('%product_description%', '', $link);       return $link;     }          if ($cats = get_the_terms($post->ID, 'product-descriptions'))     {         foreach($cats as $cat){            $slug .= $cat->slug . '/';         }         $link = str_replace('%product_description%', substr($slug, 0, -1), $link); // see custom function defined below     }     return $link;     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);


title: Blog page problems

text: Right, please excuse the stupid question. On my new blog I want the home page to be the "home" page I've created, and not the list of articles... that's fine, I go to `Settings -> Reading -> Front page displays` and change `Front page` to `Home`. But now I want `/blog/` to list my articles, however I get a 404 :S I'm a bit stuck on this one, any help would be mucho appreciated.


title: How can I permanently cache or "archive" a WP blog without needing future maintenance

text: I have a client who has an annual complete makeover of their website design and content, but they still want their old sites available to view (each with that year's respective design/CSS). Once these blogs are "archived", I don't want to have to maintain them any more w.r.t. updating plugins and core files. Previously, when I have left plugins un-updated for too long, I have had some security issues (or at least, that's what my host blamed the last few hack attempts on). I know there are auto-updating plugins out there, but I don't know about you - I always have to check that nothing is broken with each update (whether auto- updated or manual). I've considered just generating an html mirror, but are there any other "maintenance free" way I can "archive" my old blogs?


title: WooCommerce causing page editor javascript error

text: Im trying to get WooCommerce installed correctly so I can do a bulk import of a clients product database into this. Basically when I activate the WooCommerce plugin it causes the page editor javascript to die. I end up with the following JavaScript error > `Uncaught ReferenceError: switchEditors is not defined` Im using the latest version of WooCommerce and the latest version of WordPress - both downloaded yesterday from the original sites not some other site that it could be damaged from. I'm also getting this PHP exception > `PHP Fatal error: Uncaught exception 'Mijireh_Exception' with message > 'Access key required to view checkout preview' in wp- > content/plugins/woocommerce/classes/gateways/mijireh/includes/Mijireh.php:112`


title: How to set two different themes on one WordPress? (Desktop vs. Mobile)

text: I created two WordPress themes. First for the Desktop and second for tablet/mobile. I want to set on one URL. When the website opens, the theme should change automatically based on resolution.


title: Stylesheet being loaded outside of <head>

text: Wordpress (3.6) is loading two stylesheets (`mediaelement-css`, .../wp- includes/js/mediaelement/mediaelementplayer.min.css?ver=2.13.0 and `wp- mediaelement-css`, .../wp-includes/js/mediaelement/wp- mediaelement.css?ver=3.6) in wp_footer instead of wp_head. I'm getting an HTML5 error because they did not add the attribute property. I found out that this error always happens if a stylesheet is loaded outside of `<head>` without the attribute property. If it is loaded within then it doesn't need the attribute property. Is there a way of loading the two stylesheets in `<head>` instead of `<body>` to get rid of the error?


title: Flexslider question

text: A client of mine is using Flexslider by WooThemes on their site and they want to disable swipe support on mobiles/tablets if there is only 1 slide (The script outputs "clone" slides which seem to be causing the problem). I've tried using CSS `display:none` and jQuery `remove();` to remove the clone slides but neither seemed to work. Is there any way that I can disable swipe (or navigation in general) if there is only 1 slide?


title: Custom Post Type pagination - normal solutions aren't helping

text: I have multiple custom post types and I need to be able to query them and page through them. This is the query I am trying:               $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;     $offset = ( 10 * $paged ) - 10;     $args=array('paged'=>$paged, 'posts_per_page'=>10, 'post_type'=>'custom-post-type-name', 'offset' => $offset);     query_posts($args);      I've reset the permalinks and I've set the posts per page of WordPress to a lower number than what I'm querying and all I get is a 404 when I go to /page/2/ (my permalinks are set as `/%postname%-%post_id%`). What's most confusing though is on a separate page the following works:               SELECT *, IFNULL(SUM(vote),0) as total FROM wp_posts post LEFT JOIN wp_wdpv_post_votes votes ON votes.post_id = post.ID WHERE post.post_type = 'custom-post-type-name' AND post.post_status = 'publish' AND post.post_date > DATE_SUB(NOW(), INTERVAL 1 DAY) GROUP BY post.ID ORDER BY total DESC LIMIT 0,3      but the following throws up the same 404 problems               SELECT *, IFNULL(SUM(vote),0) as total FROM wp_terms term JOIN wp_term_taxonomy taxonomy JOIN wp_term_relationships relationship JOIN wp_posts post LEFT JOIN wp_wdpv_post_votes votes ON votes.post_id = post.ID WHERE term.term_id = taxonomy.term_id AND relationship.term_taxonomy_id = taxonomy.term_taxonomy_id AND term.slug = 'games' AND taxonomy.taxonomy = 'category' AND post.ID = relationship.object_id AND post.post_type = 'custom-post-type-name' AND post.post_status = 'publish' AND post.post_date > DATE_SUB(NOW(), INTERVAL 1 DAY) GROUP BY post.ID ORDER BY total DESC LIMIT 0,3      Any help on this would be gratefully received.