Specific way to allow Wordpress users to view their current password? And edit it?

I know the built in user manager doesn't allow a user to see what her current pass is, just recover / reset it via email or write in a new one in the admin but I am looking for a plugin or other method to circumvent this and allows for the creation of a user profile page that permits a user to see her current password in a field and update it form there, if they wish. I realize standard Wordpress won't allow this so I am open to a plugin like s2member -- or any other -- but not sure if any of them do this. I use Amember on one site and it integrates with WordPress via a plugin and you may edit and view passwords in Amember in the way I mentioned but I can't host Amember on a host like WPENGINE with additional security stringency. Thanks.


How to remove a meta description or other <head> contents

I have a plugin that generates a meta description or title as two of its features. However I run into the problem of other SEO plugins possibly being installed, and ending up with two meta descriptions or duplicate titles. Ideally, I'd like to detect what is already in the `<head>` section and if a meta description is present, re-write it with the output from my plugin. If no meta description is present, then I simply add one (that's the easy part). Same situation for titles. Trouble is I can't seem to find any way to get the contents of `<head>`, as one can with `the_content` in a filter or action hook. It's not an option to edit the theme as this must work regardless of the installed theme. I need a way to accomplish this using a hook or some other method from within my plugin itself. Suggestions? Thanks!


Catch all taxonomy template

I've created a custom taxonomy and I'm trying to get Wordpress to display the taxonomy template when no term is defined. Currently Wordpress is only showing the template when a term is defined on the URL. My taxonomy is called `projects` and defined like this:               $args = array(         'labels' => array(             'name' => "Categories",             'singular_name' => "Category",             'search_items' => "Search Categories",             'popular_items' => "Popular Categories",             'all_items' => "All Categories",             'parent_item' => "Parent Category",             'parent_item_colon' => "Parent Category:",             'edit_item' => "Edit Category",             'update_item' => "Update Category",             'add_new_item' => "Add New Category",             'new_item_name' => "New Category Name",         ),         'hierarchical' => TRUE,         'label' => 'Categories',         'query_var' => TRUE,         'rewrite' => array(                 'slug' => 'projects'         ),     );          register_taxonomy('projects', 'project', $args);      Next to this I have created a template file called `taxonomy-projects.php`. Currently when I browse to the `http://mysite.com/projects` URL, Wordpress falls back to the `index.php`. How can I make it so that when no term is defined, Wordpress shows my `taxonomy-projects.php` template? **UPDATE** : I should have added this straight away, I'm clearing my rewrite rules each time I make a change to try again.


Parent/Child pages

I find that the parent/child pages in the "Pages" area of WordPress has become a bit confusing since the introduction of the new menu creation area. Using the new menu system, as far as I know I can set a page which is actually itself a child page (in the pages section) to be a parent of a page which is actually itself a parent. Can someone tell me, is the whole parent/child pages scenario now superseded by the new menu system, and unless we plan on using wp_list_pages in the theme should we avoid having child pages altogether and instead just decide where they go in the menu area. What is normaly done on a site that doesn't use wp_list_pages ?


Offset for Loop

I want to have an offset of 4 posts for my related posts. I'm using Flowplayer's jQuery Tools Scrollable, so I want people to be able to scroll through the 4 latest posts, then the next 4 posts etc. I tried something like that, but I keep getting error messages:
Related Posts

                                                             <?php          $backup = $post;         $tags = wp_get_post_tags($post->ID);         if ($tags) {         $tag_ids = array();         foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;             $args = array(         'tag__in' => $tag_ids,         'post__not_in' => array($post->ID),         'posts_per_page'=> 12     );     $my_query = new WP_Query( $args );     if( $my_query->have_posts() ):     ?>
         <?php         while ( $my_query->have_posts() ) : $my_query->the_post(); ?>         <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(array(120,80)); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

     // if this is not the last post             // and remainder of current post plus one then divided by four is zero             // close the container and open a new one           <?php  if( $my_query->current_post != ( $my_query->post_count - 1 ) && ( ( $my_query->current_post + 1 ) % 4 ) == 0 ):                 ?>

                 <?php             endif;              endwhile;         ?>
             <?php     endif; ?>              <?php         $post = $backup;         wp_reset_query(); ?>

                            <?php comments_template(); ?>

             <?php endwhile; else: ?>
Sorry, but you are looking for something that isn't here.
              <?php endif; ?>      The error I get is the following: > Parse error: syntax error, unexpected T_ENDWHILE in > /hermes/bosweb25a/b155/ipg.zoomingjapancom/wp-content/themes/alltuts- > child/single.php on line 165 Line 165:               <?php endwhile; else: ?>      **EDIT:** This is my original setup without the offset (just the same loop twice). This works fine without any errors:
Related Posts

                                                            <?php                                  $backup = $post;                                 $tags = wp_get_post_tags($post->ID);                                 if ($tags) {                                     $tag_ids = array();                                     foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;                                          $args=array(                                         'tag__in' => $tag_ids,                                         'post__not_in' => array($post->ID),                                         'showposts'=>4, // Number of related posts that will be shown.                                         'caller_get_posts'=>1                                     );                                     $my_query = new wp_query($args);                                     if( $my_query->have_posts() ) {                                         while ($my_query->have_posts()) {                                             $my_query->the_post();                                         ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(array(120,80)); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                                         <?php                                         }                                         echo '';                                     }                                 }                                 $post = $backup;                                 wp_reset_query();                                  ?>

                                              <?php                                  $backup = $post;                                 $tags = wp_get_post_tags($post->ID);                                 if ($tags) {                                     $tag_ids = array();                                     foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;                                          $args=array(                                         'tag__in' => $tag_ids,                                         'post__not_in' => array($post->ID),                                         'showposts'=>4, // Number of related posts that will be shown.                                         'caller_get_posts'=>1                                     );                                     $my_query = new wp_query($args);                                     if( $my_query->have_posts() ) {                                         while ($my_query->have_posts()) {                                             $my_query->the_post();                                         ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(array(120,80)); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                                         <?php                                         }                                         echo '';                                     }                                 }                                 $post = $backup;                                 wp_reset_query();                                  ?>
      Here's the whole single.php: http://pastebin.com/x2mbQUFM I cannot seem to spot the mistake and hope somebody can help me out here. Thanks a lot in advance!


Got a problem with a widget

i am trying to build a widget that would display a list of top authors on sidebar.. This is not my first widget but it is my second one so my apologies if i am way off.. The problem is that when i drag the widget into the side (in admin ofcourse) and saves it apears no where..later when i check i see after refreshing the widgets page it doesent apear to exist.. **here is my widget code:** --> http://pastebin.com/Hf4xTUHG i know it rather langthy but can anyone help / give an idea as to why this is happening?


Buddypress integration with wordpress

I needed some directions to work on my problem. I would like to have buddypress installed on my site so that every user is able to see a link blog on his/her profile thorugh which they can post their own blog post. Is this something doable with wordpress and buddypress? Any help is much appreciated.


Show Custom Post From Logged In Author

I have a custom home page set up so soon as users log in they see an overview of their account. I want to show them all of their own posts but im having trouble and can only get it to show current published posts to everyone. I need to show only the logged in user their own post I am also having issues with the categories showing all categories in the post type and not just what the post has. What do i need to use rather than wp_list_categories to just list cats attached to post?               <?php       query_posts( array( 'post_author' => $current_user->ID, 'post_status' => 'publish' , 'post_type' => array(    'user_lists' )  ) ); ?>          <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>       <?php echo '

';       echo ''; the_time('F j, Y'); ?> at       <?php the_time('g:i a'); echo '';        echo '

';        echo wp_list_categories('taxonomy=list_type&type=user_lists&title_li=&style=');         echo '

';        echo wp_list_categories('taxonomy=list_state&type=user_lists&title_li=&style=');         echo '

';         the_tags('', ', ', '');       echo '

'; ?>       <form class="delete-coupon" action="" method="post">         <input type="hidden" name="postid" value="<?php the_ID(); ?>" />         <input class="more-button" type="submit"  value="Delete" />       </form>       <?php  echo '

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


WAMP to XAMPP WordPress transfer

I want to switch a WordPress site from a wamp localhost to xampp localhost. Using the Tools > Export, I saved the WordPress content to an XML file. I did not create a similar backup of the MySQL databases (and won't be able to) but have all the files from wamp. How can I make this transfer without having to install a new version of WordPress? There are important settings in widgets and plugins that I need preserved. I am looking to place the relevant wamp and WordPress files in the correct xampp and WordPress folders. Thanks in advance.


Custom metabox not working

Morning! I have a call in my `functions.php` file to include a custom meta-box php file in my theme's directory called: `/metaboxes/home-meta.php` The code is as follows for the call:                   add_action( 'add_meta_boxes_page','load_home_meta' );         function load_home_meta() {             $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;             if($post_id == '104'){                 include( get_template_directory() . '/metaboxes/home-meta.php' );             }         }      The include is now working (had an `add_meta_boxes` function wrapped around my metaboxes within the `home-meta.php` file below (updated code)). However, I'm getting errors in each metabox siting the first `case` within the `switch` for the callback functions. An example error is: > Warning: Invalid argument supplied for foreach() in > /Users/[my_mac]/Sites/[site_dir]/wp- > content/themes/[site_theme]/metaboxes/home-meta.php on line 224 The `home-meta.php` code is:                   <?php              /**          * Home Page Custom Meta Content          *         **/          add_meta_box(           'home_meta_box', // $id           'Home Page Content', // $title            'show_home_meta_box', // $callback           'page', // $page           'normal', // $context           'high'); // $priority     add_meta_box(           'home_meta_box_lower_1', // $id           'Home Lower Left', // $title            'show_home_meta_box_lower_left', // $callback           'page', // $page           'normal', // $context           'high'); // $priority         add_meta_box(           'home_meta_box_lower_2', // $id           'Home Lower Center', // $title            'show_home_meta_box_lower_center', // $callback           'page', // $page           'normal', // $context           'high'); // $priority      add_meta_box(           'home_meta_box_lower_3', // $id           'Home Lower Right', // $title            'show_home_meta_box_lower_right', // $callback           'page', // $page           'normal', // $context           'high'); // $priority                    // Creating Array for Fields         $prefix = 'home_';         $home_meta_fields = array(             array(                 'label' => 'Caption Title',                 'desc' => 'Upper section H2 caption title.',                 'id' => $prefix.'title',                 'type' => 'text'             ),             array(                 'label' => 'Caption Sub Title',                 'desc' => 'Upper section H3 caption title.',                 'id' => $prefix.'sub_title',                 'type' => 'text'             ),           array(                 'label'=> 'Caption',                 'desc'  => 'Caption text block.',                 'id'    => $prefix.'caption',                 'type'  => 'textarea'             ),             array(                   'label'  => 'Caption Image',                   'desc'  => 'Upload a pre-cropped 1140px wide x 530px tall web-optimized image.',                   'id'    => $prefix.'image',                   'type'  => 'image'               )         );// end caption array              $prefix2 = 'home_lower_left_';         $home_meta_fields_lower_left = array(             array(                 'label' => 'Column Title',                 'desc' => 'H2 title for column.',                 'id' => $prefix2.'title',                 'type' => 'text'             ),             array(                   'label'  => 'Column Image',                   'desc'  => 'Upload a pre-cropped 360px wide x 300px tall web-optimized image.',                   'id'    => $prefix2.'image',                   'type'  => 'image'               ),             array(                 'label' => 'Column Sub-Title',                 'desc' => 'H3 sub-title above text block.',                 'id' => $prefix2.'sub_title',                 'type' => 'text'             ),           array(                 'label'=> 'Text block',                 'desc'  => 'Caption text block.',                 'id'    => $prefix2.'caption',                 'type'  => 'textarea'             ),             array(                 'label' => 'Button Label',                 'desc' => 'Button link label (what user reads on button).',                 'id' => $prefix2.'btn_label',                 'type' => 'text'             ),             array(                 'label' => 'Button Title Tag',                 'desc' => 'On hover and SEO text.',                 'id' => $prefix2.'btn_title_tag',                 'type' => 'text'             ),             array(                 'label' => 'Button URL',                 'desc' => 'URL where button links to. Enter http:// to work.',                 'id' => $prefix2.'btn_url',                 'type' => 'text'             )         );// end lower left array              $prefix3 = 'home_lower_center_';         $home_meta_fields_lower_center = array(             array(                 'label' => 'Column Title',                 'desc' => 'H2 title for column.',                 'id' => $prefix3.'title',                 'type' => 'text'             ),             array(                   'label'  => 'Column Image',                   'desc'  => 'Upload a pre-cropped 360px wide x 300px tall web-optimized image.',                   'id'    => $prefix3.'image',                   'type'  => 'image'               ),             array(                 'label' => 'Column Sub-Title',                 'desc' => 'H3 sub-title above text block.',                 'id' => $prefix3.'sub_title',                 'type' => 'text'             ),           array(                 'label'=> 'Text block',                 'desc'  => 'Caption text block.',                 'id'    => $prefix3.'caption',                 'type'  => 'textarea'             ),             array(                 'label' => 'Button Label',                 'desc' => 'Button link label (what user reads on button).',                 'id' => $prefix3.'btn_label',                 'type' => 'text'             ),             array(                 'label' => 'Button Title Tag',                 'desc' => 'On hover and SEO text.',                 'id' => $prefix3.'btn_title_tag',                 'type' => 'text'             ),             array(                 'label' => 'Button URL',                 'desc' => 'URL where button links to. Enter http:// to work.',                 'id' => $prefix3.'btn_url',                 'type' => 'text'             )         );// end lower center array              $prefix4 = 'home_lower_right_';         $home_meta_fields_lower_right = array(             array(                 'label' => 'Column Title',                 'desc' => 'H2 title for column.',                 'id' => $prefix4.'title',                 'type' => 'text'             ),             array(                   'label'  => 'Column Image',                   'desc'  => 'Upload a pre-cropped 360px wide x 300px tall web-optimized image.',                   'id'    => $prefix4.'image',                   'type'  => 'image'               ),             array(                 'label' => 'Column Sub-Title',                 'desc' => 'H3 sub-title above text block.',                 'id' => $prefix4.'sub_title',                 'type' => 'text'             ),           array(                 'label'=> 'Text block',                 'desc'  => 'Caption text block.',                 'id'    => $prefix4.'caption',                 'type'  => 'textarea'             ),             array(                 'label' => 'Button Label',                 'desc' => 'Button link label (what user reads on button).',                 'id' => $prefix4.'btn_label',                 'type' => 'text'             ),             array(                 'label' => 'Button Title Tag',                 'desc' => 'On hover and SEO text.',                 'id' => $prefix4.'btn_title_tag',                 'type' => 'text'             ),             array(                 'label' => 'Button URL',                 'desc' => 'URL where button links to. Enter http:// to work.',                 'id' => $prefix4.'btn_url',                 'type' => 'text'             )         );// end lower right array                   //The Callback         function show_home_meta_box() {         global $home_meta_fields, $post;         // Using nonce for verification         echo '<input type="hidden" name="home_meta_box_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />';                  //Begin field table and loop             echo '
';             foreach ($home_meta_fields as $field) {                 // get value of this field if it exists for this page                 $meta = get_post_meta($post->ID, $field['id'], true);                 // begin a table row with                 echo '
                                 '.$field['label'].'	                                 ';                                 switch($field['type']) {                                     // case items will go here                                     // text                                       case 'text':                                           echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="30" />
'.$field['desc'].'';                                       break;                                     // textarea                                       case 'textarea':                                           echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'.$meta.'</textarea>
'.$field['desc'].'';                                       break;                                     case 'image':                                           $image = get_template_directory_uri().'/library/images/img-preview-blank.png';                                             echo ''.$image.'';                                           if ($meta) { $image = wp_get_attachment_image_src($meta, 'medium'); $image = $image[0]; }                                                          echo    '<input name="'.$field['id'].'" type="hidden" class="custom_upload_image" value="'.$meta.'" />
                                                          <input class="custom_upload_image_button button" type="button" value="Choose Image" />                                                           Remove Image
'.$field['desc'].'';                                       break;                                   } // end switch                 echo '
';             } // end foreach             echo '
'; // end table         }              // Save the Data         function save_home_meta($post_id) {               global $home_meta_fields;                    // verify nonce               if (!wp_verify_nonce($_POST['home_meta_box_nonce'], basename(__FILE__)))                    return $post_id;               // check autosave               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)                   return $post_id;               // check permissions               if ('page' == $_POST['post_type']) {                   if (!current_user_can('edit_page', $post_id))                       return $post_id;                   } elseif (!current_user_can('edit_post', $post_id)) {                       return $post_id;               }                    // loop through fields and save the data               foreach ($home_meta_fields as $field) {                   $old = get_post_meta($post_id, $field['id'], true);                   $new = $_POST[$field['id']];                   if ($new && $new != $old) {                       update_post_meta($post_id, $field['id'], $new);                   } elseif ('' == $new && $old) {                       delete_post_meta($post_id, $field['id'], $old);                   }               } // end foreach           }           add_action('save_post', 'save_home_meta');         // end Upper Home Content              // Lower Left         //The Callback         function show_home_meta_box_lower_left() {         global $home_meta_fields_lower_left, $post;         // Using nonce for verification         echo '<input type="hidden" name="home_meta_box_left_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />';                  //Begin field table and loop             echo '
';             foreach ($home_meta_fields_lower_left as $field) {                 // get value of this field if it exists for this page                 $meta = get_post_meta($post->ID, $field['id'], true);                 // begin a table row with                 echo '
                                 '.$field['label'].'	                                 ';                                 switch($field['type']) {                                     // case items will go here                                     // text                                       case 'text':                                           echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="30" />
'.$field['desc'].'';                                       break;                                     // textarea                                       case 'textarea':                                           echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'.$meta.'</textarea>
'.$field['desc'].'';                                       break;                                     case 'image':                                           $image = get_template_directory_uri().'/library/images/img-preview-blank.png';                                             echo ''.$image.'';                                           if ($meta) { $image = wp_get_attachment_image_src($meta, 'medium'); $image = $image[0]; }                                                          echo    '<input name="'.$field['id'].'" type="hidden" class="custom_upload_image" value="'.$meta.'" />
                                                          <input class="custom_upload_image_button button" type="button" value="Choose Image" />                                                           Remove Image
'.$field['desc'].'';                                       break;                                   } // end switch                 echo '
';             } // end foreach             echo '
'; // end table         }              // Save the Data         function save_home_meta_lower_left($post_id) {               global $home_meta_fields_lower_left;                    // verify nonce               if (!wp_verify_nonce($_POST['home_meta_box_left_nonce'], basename(__FILE__)))                    return $post_id;               // check autosave               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)                   return $post_id;               // check permissions               if ('page' == $_POST['post_type']) {                   if (!current_user_can('edit_page', $post_id))                       return $post_id;                   } elseif (!current_user_can('edit_post', $post_id)) {                       return $post_id;               }                    // loop through fields and save the data               foreach ($home_meta_fields_lower_left as $field) {                   $old = get_post_meta($post_id, $field['id'], true);                   $new = $_POST[$field['id']];                   if ($new && $new != $old) {                       update_post_meta($post_id, $field['id'], $new);                   } elseif ('' == $new && $old) {                       delete_post_meta($post_id, $field['id'], $old);                   }               } // end foreach           }           add_action('save_post', 'save_home_meta_lower_left');         // end lower left              // Lower Center Column         //The Callback         function show_home_meta_box_lower_center() {         global $home_meta_fields_lower_center, $post;         // Using nonce for verification         echo '<input type="hidden" name="home_meta_box_center_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />';                  //Begin field table and loop             echo '
';             foreach ($home_meta_fields_lower_center as $field) {                 // get value of this field if it exists for this page                 $meta = get_post_meta($post->ID, $field['id'], true);                 // begin a table row with                 echo '
                                 '.$field['label'].'	                                 ';                                 switch($field['type']) {                                     // case items will go here                                     // text                                       case 'text':                                           echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="30" />
'.$field['desc'].'';                                       break;                                     // textarea                                       case 'textarea':                                           echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'.$meta.'</textarea>
'.$field['desc'].'';                                       break;                                     case 'image':                                           $image = get_template_directory_uri().'/library/images/img-preview-blank.png';                                             echo ''.$image.'';                                           if ($meta) { $image = wp_get_attachment_image_src($meta, 'medium'); $image = $image[0]; }                                                          echo    '<input name="'.$field['id'].'" type="hidden" class="custom_upload_image" value="'.$meta.'" />
                                                          <input class="custom_upload_image_button button" type="button" value="Choose Image" />                                                           Remove Image
'.$field['desc'].'';                                       break;                                   } // end switch                 echo '
';             } // end foreach             echo '
'; // end table         }              // Save the Data         function save_home_meta_lower_center($post_id) {               global $home_meta_fields_lower_center;                    // verify nonce               if (!wp_verify_nonce($_POST['home_meta_box_center_nonce'], basename(__FILE__)))                    return $post_id;               // check autosave               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)                   return $post_id;               // check permissions               if ('page' == $_POST['post_type']) {                   if (!current_user_can('edit_page', $post_id))                       return $post_id;                   } elseif (!current_user_can('edit_post', $post_id)) {                       return $post_id;               }                    // loop through fields and save the data               foreach ($home_meta_fields_lower_center as $field) {                   $old = get_post_meta($post_id, $field['id'], true);                   $new = $_POST[$field['id']];                   if ($new && $new != $old) {                       update_post_meta($post_id, $field['id'], $new);                   } elseif ('' == $new && $old) {                       delete_post_meta($post_id, $field['id'], $old);                   }               } // end foreach           }           add_action('save_post', 'save_home_meta_lower_center');         // end lower center              // Lower Right Column         //The Callback         function show_home_meta_box_lower_right() {         global $home_meta_fields_lower_right, $post;         // Using nonce for verification         echo '<input type="hidden" name="home_meta_box_right_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />';                  //Begin field table and loop             echo '
';             foreach ($home_meta_fields_lower_right as $field) {                 // get value of this field if it exists for this page                 $meta = get_post_meta($post->ID, $field['id'], true);                 // begin a table row with                 echo '
                                 '.$field['label'].'	                                 ';                                 switch($field['type']) {                                     // case items will go here                                     // text                                       case 'text':                                           echo '<input type="text" name="'.$field['id'].'" id="'.$field['id'].'" value="'.$meta.'" size="30" />
'.$field['desc'].'';                                       break;                                     // textarea                                       case 'textarea':                                           echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'" cols="60" rows="4">'.$meta.'</textarea>
'.$field['desc'].'';                                       break;                                     case 'image':                                           $image = get_template_directory_uri().'/library/images/img-preview-blank.png';                                             echo ''.$image.'';                                           if ($meta) { $image = wp_get_attachment_image_src($meta, 'medium'); $image = $image[0]; }                                                          echo    '<input name="'.$field['id'].'" type="hidden" class="custom_upload_image" value="'.$meta.'" />
                                                          <input class="custom_upload_image_button button" type="button" value="Choose Image" />                                                           Remove Image
'.$field['desc'].'';                                       break;                                   } // end switch                 echo '
';             } // end foreach             echo '
'; // end table         }              // Save the Data         function save_home_meta_lower_right($post_id) {               global $home_meta_fields_lower_right;                    // verify nonce               if (!wp_verify_nonce($_POST['home_meta_box_right_nonce'], basename(__FILE__)))                    return $post_id;               // check autosave               if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)                   return $post_id;               // check permissions               if ('page' == $_POST['post_type']) {                   if (!current_user_can('edit_page', $post_id))                       return $post_id;                   } elseif (!current_user_can('edit_post', $post_id)) {                       return $post_id;               }                    // loop through fields and save the data               foreach ($home_meta_fields_lower_right as $field) {                   $old = get_post_meta($post_id, $field['id'], true);                   $new = $_POST[$field['id']];                   if ($new && $new != $old) {                       update_post_meta($post_id, $field['id'], $new);                   } elseif ('' == $new && $old) {                       delete_post_meta($post_id, $field['id'], $old);                   }               } // end foreach           }           add_action('save_post', 'save_home_meta_lower_right');         // end lower right              ?>


Password protecting a page

I'm trying to password protect a page but it doesn't seem to be working. I've set the password for the page but when you navigate to it it just loads up like normal and doesn't ask for any passwords. This is the loop I have on my page:               <?php     /**      * @package WordPress      * @subpackage Default_Theme      * Template Name: Page      */          get_header(); ?>          <?php     global $post;     if ( post_password_required( $post ) ) {     ?>          <?php $fields = get_acf(); ?>

          <?php } else { ?>         Not passworded                        <?php if (have_posts()) : ?>             <?php while (have_posts()) : the_post(); ?>                  <?php endwhile; ?>         <?php endif; ?>                 <?          } // Page isn't password-protected         ?>     <?php get_footer(); ?>      I want to password protect everything within the page. UPDATE: I have custom content on the page so if possible I need to be able to wrap some code around it all. Update: ![enter image description here](http://i.stack.imgur.com/cSsGc.png)


How many Custom Post Types to register?

My current WordPress site only exists of pages. The structure is as simple as this:               example.com/hotels      example.com/attractions      example.com/restaurants       I want to use Custom Post Types to add listings about individual hotels, attractions and restaurants. The new structure will look like this:               example.com/hotels/myhotel      example.com/attractions/myattraction      example.com/restaurants/myrestaurant      With myhotel/myattraction/myrestaurant being a Custom Post Type. All listings share the exact same custom fields. My Question: Do I need to create 3 Custom Post Types (hotel/attraction/restaurant) or should I register just 1 "global" custom post type - eg called "Place" - and specify if its a hotel/attraction/restaurant using hierarchical Custom Taxonomies? What are the advantages/disadvantages of these different approaches? Thanks!


Removing user contact methods works from functions.php but not from a plugin

I'd like to remove user fields and I used this code:               add_filter( 'user_contactmethods', 'newfields' );     function newfields( $user_contact ) {         unset($user_contact['facebook']);         unset($user_contact['twitter']);              return $user_contact;      }      If I use this code in `functions.php` of my theme, it works, but if I use this code in a plugin, it doesn't work. Why? How can I resolve it?


How can I control the HTML output of my post?

As you already know, WordPress manipulates posts, even if you write everything in **Text** mode. (replacing line breaks with `\r\n` 's , converting single quotes into double quotes etc.) I know this is good for helping us not to mess things up, however, in my case, I want to put HTML codes inside my post -both `<code>` and `</code>` tags , and some HTML directly-. so I want to make sure what I see in Text mode (or install an HTML mode somehow) , so that _What I See is What I Get_ , in terms of HTML :) Maybe a better explanation for what I want is this : What I write in "add new post" window should be **exactly** equal to what is printed between `<div class='entry-content'>` and `</div>`. Any tips for this? Should I change my theme? Or a plugin for tinymce? ## p.s.: I know single quotes should be escaped for database, but I want to preserve line breaks, html tags etc. So please tell me there is a way other than writing directly into the database.


Why is wp_enqueue_script not loading included jquery ui scripts?

Using Wordpress 3.4.2, the wp_enqueue_script documentation seems to indicate that jQuery UI libraries can be loaded simply by referencing their handles. I have the following code with no prior wp_register_script():               wp_enqueue_script('jquery');     wp_enqueue_script('jquery-ui-core');      The enqueue for 'jquery' works fine, but the enqueue for 'jquery-ui-core' isn't working. I realize that I can register and load script explicitly using Google CDN (or make explicit references to library elements in Wordpress install) ... but again documentation makes me think I shouldn't have to do this w/ Wordpress current version. Anyone know why this doesn't work?


List the 5 most recent child pages

I created a hierarchical custom post type for a gallery. The parent pages are the galleries and the child pages are the albums. I want to display the most recent albums on my sidebar (so basically the most recent child pages).               'post_parent' => 0      I only find this in the codex, but this is the opposite i want, this will only list the parent pages. Here is my code so far:               $albums = new WP_Query(array(         'post_type' => 'gallery',         'posts_per_page' => 6     ));


Getting Error "invalid secret string" by running wp-cron.php manually

I am trying to run the wp-cron.php manually by calling it that way:               http://mysite.com/wp-cron.php?doing_wp_cron      Disabling the auto cron function with :               define('DISABLE_WP_CRON', TRUE);      produces the same error. What could be the issue?


Modify Wp-Login Labels: Username to Email

Simple straightforward, question: How can you edit the labels of the wp- login.php form? I am using emails for logins, so I need to change 'username' to 'email' The answer here seems to be out of date, or just doesn't work with ssl or something: Function to change a label (Username) in a core WordPress File (wp- includes/general-template.php) I tried this in my functions file, but it didn't work:               function wpse60605_change_username_label( $defaults ){        $defaults['label_username'] = __( 'Email' );        return $defaults;     }     add_filter( 'login_form_defaults', 'wpse60605_change_username_label' );


make a dropdown custom field with 'cities' list in it

I am developing a website for real estates. I was wondering that how can I add a dropdown to my custom forms (theme my login plugin) for cities states etc. The basic point is that I dont want to add new tables in the database. I want to achieve this without that. Thanks


If post custom meta data is not set, show normal state

I'm much of a php-noob but have this idea of a loop for my site. I have the idea behind it but maybe you have an idea how to put this into code:               $customfield = get_specific_customfield          if $custom-field is = not empty     echo 'custom-field-input" class="'          else          echo '`<?php echo $thumbnail_src[0]; ?>" class="fancybox`'      (I have to integrate the fancy-box stuff to control how the input will be displayed)


Allow customers  to download updated versions of software

I will shortly be creating my WordPress website in which I will be selling a software product. Ideally, I would want two things to happen : 1) When a customer makes a payment(through PayPal account or PayPal credit card processing I suppose), they should be redirected to the download page to immediately download the software. 2) Since software tends to be updated into new versions quite a lot, I would really like to have a flexible way to allow customers to re-download the software using a well secure, secret uri, probably created with a token and based on some passwords. Hence, I would like to ask you how you would suggest I should handle that. I know that there are some WordPress plugins that would allow me to do (1), but i would really like to know your experience and if you use one, which plugin do you suggest? For (2), I don't really have any ideas yet? Is there a plugin or other solution ? Has anyone has done it?


Can I allow certain people to add/edit pages within a parent?

I'm planning on building a site with different sections, for example:   * Training   * Conferences   * Ideas A different person will be in charge of editing and managing each section. They will be able to edit the parent page and add, edit and delete sub-pages within each section. I don't want each person to be able to add/edit/delete pages from a section that they don't manage. As far as I can tell if I give each person an "editor" role then they will be able to add/edit/delete pages from each section. If I give them an author role, then they won't be able to add pages at all. Is there a way to achieve my goal from within Wordpress? If not, will I need to use a plugin, and if so, can you recommend one that will help?


Define permalinks for custom post type by taxonomy in WP 3.4

I want to create canonical permalinks for products and product types. I have the custom post types and custom taxonomy figured out, but I don't know if its possible to define permalinks with taxonomies. So my workflow, for example, would be this...   1. I create a custom post type called **products**.   2. Then I create a custom taxonomy for **product types**.   3. Then I add a product type called **'Chairs'** and add a product called **'Red Chair'** to this category. Once I create this product, the **desired permalink structure** to view this product would be formatted like so ->               http://shop.com/products/chairs/red-chair      Is this possible in wordpress 3.4? The meta boxes in my custom post type allow for selecting of the product types defined for my custom taxonomy, and there will only ever be one type per product. If possible, I would also like to include any parents of the selected product category if possible (For example, if the **'chairs'** category was a child of the **'lounge'** category, the permalink structure would be as follows ->               http://shop.com/products/lounge/chairs/red-chair      Here is how I create the custom post type and the custom taxonomy, I just need help defining rewrite / slug rules to include product type in the permalink.               /* Custom Post Type - Products ------- */     function products_init() {         $args = array(             'public' => true,             'label' => 'Products'         );         register_post_type( 'products', $args );     }     add_action( 'init', 'products_init' );          /* Custom Taxonomy - Product Type ------- */     add_action( 'init', 'create_prodtype' );     function create_prodtype() {         $labels = array(             'name' => _x( 'Product Type', 'products' ),             'singular_name' => _x( 'Product Category', 'product' ),             'search_items' =>  __( 'Search Product Types' ),             'all_items' => __( 'All Product Types' ),             'parent_item' => __( 'Products' ),             'parent_item_colon' => __( 'Products:' ),             'edit_item' => __( 'Edit Product Type' ),             'update_item' => __( 'Update Product Type' ),             'add_new_item' => __( 'Add New Product Type' ),             'new_item_name' => __( 'New Product Type' ),         );         register_taxonomy(             'products',             array('products'),             array(                 'rewrite' => array(                     'slug' => 'products',                     'hierarchical' => true                 ),                  'with_front' => false,                 'labels' => $labels         ));     }


Secure my "add_settings_field" translation?

I am using "add_settings_field" and want to provide translation for it , but my problem is security.   So is `__('My Checbox:' , 'domain')` secure enough for translation?      **If not what can I do about it?**      I have tried to use `esc_html_e( 'My Checbox:' , 'domain' )`   and `esc_html_( 'My Checbox:' , 'domain' )` but it breaks my page...               add_settings_field(        'add_checkbox',         __('My Checbox:' , 'domain'),<!--Is this secure when translating?-->            'my_checkbox_function',        'theme_options',        'theme_options'        );


Adding an assisting editor box to Post page

I run a multiple author platform and to improve the moderation, I want to add a couple of assisting editors. I want to add a custom box to the Post page where the assisting editor can confirm which tasks they have completed. So, this box would contain a checklist of options, for example: > >         1 => ' Proofread ', >         2 => ' Graphics Added ', >         3 => ' SEO Fixed ', >         4 => ' Ready for Publish ' >   And then contain a checklist that lists all assisting editors (users that can `edit_published_posts`) and there the user can mark themselves as they have contributed to the edit. The box could look like this: ![Editorial Tasks](http://i.stack.imgur.com/uiHre.png) Then finally, on the front end post page, I want to list which user(s) that have edited the post. In an attempt to do this, I have this code:               add_action( 'add_meta_boxes', 'assisting_editor' );     function assisting_editor() {         add_meta_box(             'assisting_editor', // id, used as the html id att             __( 'Editorial Tasks' ), // meta box title             'editor_tasks', // callback function, spits out the content             'post', // post type or page. This adds to posts only             'side', // context, where on the screen             'low' // priority, where should this go in the context         );          }          function editor_tasks( $post ) {         global $wpdb;         $value = get_post_meta($post->ID, 'rating', true);         echo '
Editorial tasks: ';              $ratings = array(             1 => ' Proofread ',             2 => ' Graphics Added ',             3 => ' SEO Fixed ',             4 => ' Ready for Publish '         );              echo '<select name="rating">';         echo '<option value=""' . ((($value == '') || !isset($ratings[$value])) ? ' selected="selected"' : '') . '> Untouched </option>';              // output each rating as an option         foreach ($ratings as $id => $text) {             echo '<option value="' . $id . '"' . (($value == $id) ? ' selected="selected"' : '') . '">' . $text. '</option>';         }         echo '</select>';              echo '
';     }          add_action( 'save_post', 'save_metadata');          function save_metadata($postid)     {            if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return false;         if ( !current_user_can( 'edit_page', $postid ) ) return false;         if( empty($postid) ) return false;                   if ( is_null($_REQUEST["rating"]) ) {             delete_post_meta($postid, 'rating');         } else {             update_post_meta($postid, 'rating', $_REQUEST['rating']);         }          }      **However** , this code adds a drop-down list, not a check-list, and more importantly, it does not list the editor users. **My question is** : how can I make a box like the picture above and with those features, and how do I echo the list of users that have edited the post?


How to get category id in single.php wordpress?

I need to `get category id` in `single.php`. I tried this:   `$cat_ID = get_query_var('cat');` It didn't work. What should I use instead?


Single-user registration to access all sites in WordPress MultiSite Network

Ok This is what i'm trying to achieve. A site network where user can post their articles and get rewarded for each post. For example, Lets say i have a main site example.com. I created a network like site1.example.com, site2.example.com, etc. So lets say i have around 10 subsites in my network. Each subsite have one custom post type. For example site1.example.com has custom post type videos and only dedicated for videos, site2.example.com has custom post type pictures and only dedicated for pictures, etc. Likewise i created 10 custom post types in 10 of my subsites. Now i want user access in all network sites with one registration. I mean user who register in site2.example.com should able to access all my network sites and create new posts. They all should be able to access even if i add a new site in my network. Is there any plugin available for this feature?. Please help me. Thanks


How to create a blogs category page with Blog-Types Plugin

I'm not a web developer so I don't know how to create an sql query to display information from my database. Here's what I wanted to do, I want to have a page that will display blog categories. When a visitor clicked a category, a list of blogs will be displayed under that category. I already have a table and information stored on my database however, i don't know how to display it on the frontend.                   CREATE TABLE `wp_blog_types` (       `blog_types_ID` bigint(20) unsigned NOT NULL auto_increment,       `blog_ID` bigint(20) NOT NULL,       `blog_types` TEXT NULL,       `blog_subtypes` TEXT NULL,       PRIMARY KEY  (`blog_types_ID`)     ) ENGINE=MyISAM;          CREATE TABLE `wp_signup_blog_types` (       `blog_types_ID` bigint(20) unsigned NOT NULL auto_increment,       `blog_types_domain` varchar(255) NOT NULL,       `blog_types_path` varchar(255) NOT NULL,       `blog_types` TEXT NULL,       `blog_subtypes` TEXT NULL,       PRIMARY KEY  (`blog_types_ID`)     ) ENGINE=MyISAM;      I wanted to display the information based on that sql code by using a shortcode.


Featured image thumbnail sometimes in content, sometimes changes header images

I am using wordpress 3.1 and when I use the featured image metabox to upload sometimes I see in my posts the image as part of the content and sometimes the header image changes as well. I cannot understand what is the reason. Any help will be appreciated. I am using                   if ( has_post_thumbnail() )      { // check if the post has a Post Thumbnail assigned to it.         the_post_thumbnail();     }       ## Update sorry i got confused with the editor. anyway what i need right now is to display the thumbnail in a size of 300x300 but have a larger image to display when the user clicks on the thumbnail. i saw the loop-attachment.php and i think i have to use this one.               <?php $attachment_page = get_attachment_link( $attachment_id ); ?>                     <?php $thumb=get_the_post_thumbnail(); ?>                         <a href="<?php echo $attachment_page; ?>">                         <?php the_post_thumbnail();?>                         </a>      but it is not working. i dont know if i have to post it as a new question also.


Changing the title tag from a shortcode

I currently have a shortcode which dynamically swaps out locations on a page to make each page specific to a location. For example the url               http://mywebsite.com/offers/scotland/      Would make the H1 of my website be               Special Offers Scotland      But now I also want to change the title tag to allow effect search engine optimisation. I am unsure if it's possible to do this within my shortcode as it will execute within the loop and therefore the header.php has already finished loading. Any guidance would be greatly appreciated.


Wordpress MU LDAP connection failures

I'm using Wordpress 3.8.1, WPMU Ldap Authentication plugin 4.0.2 (This site fixes the deprecated WordPress functions ), and Linode Hosting with Linux CentOS 6 and I'm still having problems connecting LDAP. When I test the connection it takes a long time and comes back a " ** _Connection: Failed_** ". Is there a way to look at a LDAP Debug file so I can check for errors?


Message box when accessed from iPad

I am still looking for a solution for this and can't seem to find it. I have the following code to start, but am not sure how to write the function to fire off a .js file. I need this to work on one specific page ID.               function ipad_alert() {      if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT'])) {?>           // link to .js file?       <?php }      }      add_action('init','ipad_alert');


Featured Image or Post Thumbnail Displaying on index.php?

When I'm on the main page, of my site, `site.com` it shows an excerpt of each post along with a category to the side. it also displays the same thumbnail image but above the content and I'm guessing because its grabbing the first image in the post.. I already tried removing `<?php the_post_thumbnail();?>` from the single.php and it didnt help. How do I stop any additional images from displaying on the homepage?


how get number of twitter followers in wordpress

I used function to get twitter followers               function twitter_count($twitter_user){              $count = get_transient('twitter_count');         if ($count !== false) return $count;              $count = 0;              $dataOrig = file_get_contents('http://twitter.com/users/show/'.$twitter_user);        if (is_wp_error($dataOrig)) {              return 'Error!!!';        }else{              $profile = new SimpleXMLElement ( $dataOrig );              $countOrig = $profile->followers_count;              $count = strval ( $countOrig );              }      set_transient('twitter_count', $count, 60*60*24); // 24 hour cache     return $count;      and I need replace `file_get_contents` for `wp_remote_get` how realize it?


I want to restrict admin panel from front user in wordpress

I am very new in wordpress. I am working on a project in which I want to restrict access to `wp-admin` url for admin login. I want when user as well as admin try to access the `wp- admin` they should redirect to home page. In home page I created a Login form. From where user as well admin would be able to login.


Utilise WP_Customize_Image_Control to only show image picker

I would like to achieve the following (using a copy of twentytwelve):   * Turn off custom-header theme support to prevent users being able to upload their own images (achieved)   * Create own section in customize admin area (achieved)   * Add a list containing thumbnails to be selected to replace header image. No upload capabilities. I am trying to hook into customize_register and utilize WP_Customize_Image_Control but get it to **only** display a predefined list of images without the upload options. This post explains how to use the customize_register and in the additional notes towards the bottom goes onto describe what each control can do. It suggests WP_Customize_Image_Control is used to upload AND display a list of images. I just want a list. This post shows you how to add the images to a 'default' tab but the original custom-header theme support has to be switched on which gives users the option to add header images from the admin page. I know I could do it using a simple drop down menu but I like the selector window which provides a visual prompt. Does anyone have a suggestion as to how I might utilize customize_register to achieve this?


PNG file uploads don't stay in Media Libtary

When uploading these I get the percentage count then the "crunching" alert but the crunching never stops to indicate that the file is done. I'll go into the media library and it will be there, sometimes it stays, often it disappears...It's not too big in size What is going on?


Choose custom post type template by category

I need to style my portfolio posts with different templates. My thought is that it would be done by category. I have tried using `in_category` and `is_category` and a lot of other work around's but to no avail. The code in my `single.php` file currently is:               <?php if ( '' != locate_template( 'content-'.get_post_type().'.php' ) ) // Check if themplate exists esle get default post content       {          get_template_part( 'content', get_post_type() );       } else {           get_template_part( 'content', 'post' );       }     ?>      And though I seem to understand what its doing can't seem to come up with a conditional allowing it to check the category and returning the template accordingly. What should I do?


Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have:   * Countries     * China     * Laos     * Vietnam   * Length of stay     * 2-4 Days     * 5-7 Days     * 8-10 Days What I want, is to filter posts by multiple categories. So, If the user is checking the country "Laos" and a length of stay of "2-4Days", I would like to retrieve only posts where the category "Laos" AND the category "2-4Days" has been attached. I tried to use the Query Multiple Taxonomies pluging. However, this plugging is retrieving all posts with the "Laos" category and all posts with the length of stay of "2-4Days". I know, that I can filter post with this query, but, I need some help to create this widget with the submit button. Also, I would like to customise it to remove parent categories and display them as a title (remove the checkbox of "Countries" and "Length of stay" and add to them a specific class)? Working query:               <?php     // cat 42=Laos      cat 57=2-4Days     $my_query_1 = new WP_Query(         array(             'category__and' => array(42,57)         )     );     while ($my_query_1->have_posts()) {         $my_query_1->the_post();         ?>         <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">             <?php the_title(); ?><?php the_excerpt(); ?>         </a>         <?php     }      Thanks for helping


If child is active add class to parent in customWalker

Im writing a customWalker for the wordpress main navigation area. But i am a little stuck on how to find and add a class to the parent of the child which is active. For instance I have the whole customwalker working perfect, all parents have a active class assigned when they are active, but how to I assign an active class to the parent when a sub class is active? I managed to assign a active class to the top depth when current_page_item was given like this:               if($depth === 0){                 $class_names = str_replace('current_page_item', 'active', $class_names);             }      But how would I write it for a child class to show the parent an active when the child is active? Thanks


How can i make like this structure?

Sorry, i'm newbie user Wordpress. Want a accordion list like this:               News     News 1     News 2     News 3      And when click a accordion item, get image/video slider. How can i make like this? Thank you Sample img: ![enter image description here](http://i.stack.imgur.com/rLn5Z.png)


Fatal error: Cannot redeclare comment_theme()

I have this wordpress site build up. In the blog section my post is getting repeated which I do not want how can I get rid of this situation Use this link: http://rymahrice.com/some-energy-drinks-contain-too-much- caffeine-for-kids/ scroll down and you will notice the error and the whole post being repeated. Below is the code:               <?php     /*         The template for displaying Comments.     */     ?>     <?php      function comment_theme($comment, $args, $depth) {         $GLOBALS['comment'] = $comment; ?>         <li <?php comment_class("clearfix"); ?> id="li-comment-<?php comment_ID() ?>">             <div id="comment-<?php comment_ID(); ?>" class="comment_wrap">
                     <?php echo get_avatar($comment,$size='60',$default=''); ?>                     <time class="comment_time"><?php echo get_comment_date(); ?></time>

<?php printf( '%s', get_comment_author_link()) ?>

                         <?php comment_text() ?>                         <?php if ($comment->comment_approved == '0') : ?>                         <?php _e('Your comment is awaiting moderation.', 'fringe_tech') ?>                         <?php endif; ?>                         <?php edit_comment_link(__('(Edit)', 'fringe_tech' ),'  ','') ?>

                         <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

     <?php     }     ?>
     <?php if ( post_password_required() ) : ?>
<?php _e( 'This post is password protected. Enter the password to view any comments.', 'fringe_tech' ); ?>

     <?php   return;         endif;     ?>          <?php if ( have_comments() ) : ?>
<?php         printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'fringe_tech' ),         number_format_i18n( get_comments_number() ), '' . get_the_title() . '' );         ?>
          <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>

<?php previous_comments_link( __( '← Older Comments', 'fringe_tech' ) ); ?>

<?php next_comments_link( __( 'Newer Comments →', 'fringe_tech' ) ); ?>

     <?php endif; ?>

             <?php wp_list_comments( array( 'callback' => 'comment_theme' ) ); ?>

     <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>

<?php previous_comments_link( __( '← Older Comments', 'fringe_tech' ) ); ?>

<?php next_comments_link( __( 'Newer Comments →', 'fringe_tech' ) ); ?>

     <?php endif; // check for comment navigation ?>          <?php else :         if ( ! comments_open() ) :     ?>
     <?php endif; // end ! comments_open() ?>          <?php endif; // end have_comments() ?>               <?php if ( comments_open() ) { ?>

<?php comment_form_title( __( 'Leave a Reply', 'fringe_tech' ), __( 'Leave a Reply to %s', 'fringe_tech' ) ); ?>

                 <?php cancel_comment_reply_link(); ?>
                  <?php              if ( get_option('comment_registration') && !is_user_logged_in() ) {                 printf( __('
You must be logged in to post a comment.

', 'fringe_tech' ), wp_login_url( get_permalink()) );             } else {              ?>                      <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="sendform">                          <?php if ( is_user_logged_in() ) { ?>
                         <?php printf( __('Logged in as %2$s.', 'fringe_tech' ), get_option('siteurl'), $user_identity ); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php esc_html_e('Log out of this account', 'fringe_tech'); ?>"><?php esc_html_e('Log out »', 'fringe_tech'); ?>
                          <?php  } else { ?>                                                                                <input type="text" name="author" class="input" id="author" value="<?php if($comment_author != "") { echo $comment_author; } else { echo "Name *"; } ?>" size="22" tabindex="1"  />                                                                                <?php if ($req) esc_html_e('* required', 'fringe_tech'); ?>                                                                                <input type="text" name="email" class="input" id="email" value="<?php if($comment_author_email != "") { echo $comment_author_email; } else { echo "Email *"; } ?>" size="22" tabindex="2" />                                                                                <?php esc_html_e('(will not be published)', 'fringe_tech'); ?> <?php if ($req) esc_html_e('* required', 'fringe_tech'); ?>                                                                                <input type="text" name="url" class="input" id="url" value="<?php if($comment_author_url != "") { echo $comment_author_url; } else { echo "Web Site"; } ?>" size="22" tabindex="3" />                                                                                <?php } ?>                                                                                <textarea class="textarea" name="comment" id="comment" cols="70" rows="10" tabindex="4"><?php esc_html_e('Message *', 'fringe_tech'); ?></textarea>

                                 <span class="small_buttons <?php if ( !is_user_logged_in() ) { ?>send_comment<?php } else { ?>send_comment_admin<?php } ?>">                                     <span class="<?php echo get_option("button_colors", "ocean"); ?>_l small_left"><span class="<?php echo get_option("button_colors", "ocean"); ?>_r small_right"><?php echo get_option("button_post_comment", "Post Comment"); ?>

<?php comment_id_fields(); ?>

                          <?php do_action('comment_form', $post->ID); ?>                      </form>                  <?php } ?>
     <?php }  ?>


Possible to paginate on single.php?

I know this sounds illogical and maybe it is, but the client's asked for it so I'm looking into a solution if possible. On a section of the site there's a link that leads to category-news.php, which displays all posts belonging to News. The user loads each of these posts dynamically through the use of InfiniteScroll, with the posts being paginated beforehand. The client has requested to also want this feature when viewing a single post item of the same category (i.e. "View more"). I can't seem to create a pagination for single.php, and would like to know if this is even possible to begin with? What happens now is that I get only 1 additional post beyond the current. Here's the code for single.php so far -               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>     <?php $currentID = get_the_ID(); ?>

         <?php the_post_thumbnail( array(466,9999) ) ?>

<?php the_title() ?>

<?php the_date() ?>

Share
         <?php the_content(); ?>

     <?php endwhile; endif; ?>     <?php     $paged = get_query_var('paged') ? get_query_var('paged') : 1;     $news = new WP_Query( array('cat' => 3, 'paged' => $paged, 'posts_per_page' => 1, 'post__not_in' => array($currentID), 'orderby' => 'date', 'order' => 'DESC') );     while ($news->have_posts()) : $news->the_post();     ?>

         <?php the_post_thumbnail( array(466,9999) ) ?>

<?php the_title() ?>

<?php the_date() ?>

Share
         <?php the_content(); ?>

     <?php endwhile; endif; ?>
<?php next_posts_link('') ?>
      (Running the current post first, then adding a WP Query to retrieve the rest.)


update_option creates an option, which empties on a blog reload

I am currently writing a plugin that allows all authors to be listed on a page. I've created an options page and wanted to create a function that allows administrators to exclude certain authors from the page. The options page is a list of checkboxes with the Author ID as a value. When the form is submitted, checkboxes are passed as an array to the processing function (which is below), the function combines all the values, and inserts the value into the database using "update_option()".               function wp_applugin_options_process() {             $arr = $_POST["excludeid"];       $excludeid = implode(" ",$arr);       $excludeid = esc_html( $excludeid);            update_option("wp_applugin_excludeids", $excludeid );          }      By default, the "update_option" creates the option, but leaves it empty. However, if I break the plugin, by placing the line "echo get_option("wp_applugin_excludeids")" right after the "update_option" line, not only does it echo the correct values, but the values are also loaded into the database. If I go to a page that doesn't run wp_applugin_options_process, the option "wp_applugin_excludeids" is deleted. Any ideas?


sort a custom field base on the date or anything

I'm working on a project right now and I'm facing an issue that is about to freak me out. Basically I had to display information of some courses, in order to do so, I create a custom field called "CourseInfo", that array includes, date, place, and a link to sign in. So the user create that custom field as long as he needs, cause courses can be infinites, however I need to order the output based on the course date and not based on the last custom field created. Since the course date includes month and the year, is there a change to order it basd on the date? I would appreciate any help! Thanks! UPDATE* ***** ------------------------------------------ Basically I'm using this code, maybe it will help                <?php $limit = 1; $courses = array_reverse($courses); foreach ($courses as $course) {                                 $course = nl2br($course);                                 list($date,$city,$link) = explode('
',$course);           echo "
";      echo "
$date
";      echo "
$city
";      echo "
Inschrijven
";      echo "
";           }  ?>      And the page is http://www.otoacademie.nl/dev/rijinstructeur-auto-b/ Notice there is not order. UPDATE===================================================== update dates format ![enter image description here](http://i.stack.imgur.com/xvULQ.png)


Get list of all registered sidebars

I am registering sidebars automatically for each category (a separate widget space per category). The technique I'm using is **here**. In the admin side I have an options page where I need to display a dropdown of all registered sidebars... Is there are way to dynamically get this list of registered sidebars? since they're being registered in functions.php I assume they're in memory, not in the database. I could keep track of the sidebars I register in some global variable, but just in case plugins register their own sidebars, I'd like to account for them too. I'll dig through the core if I have to, but thought someone might know off- hand:) Thanks


Query posts with double taxonomy

So I have a custom type called "vendors" and two custom taxonomies for it. One is "state" and the other is "type". I am trying to list all the vendors from a certain state on one page. I'm using the file called "taxonomy-state.php" which works perfectly. It displays all the vendors in the state. Now what I want to do is specify the types of vendors in order. So the page will look something like this: Vendors in "STATE": Vendor Type #1: Vendor #1 Vendor #2 Vendor #3 Vendor Type #2: Vendor #1 Vendor #2 Vendor #3 I got it to display vendors by state. But I need to display them in the above layout. I have an idea of how to do it. But I need to be able to make a query that can get a vendor from a certain state and certain vendor type. Thanks in advanced, Alain


More posts from the current author

On a multi author WordPress blog I need to show a list with more posts from the current author. The list is inside the Loop, so I can use `<?php the_author_meta('first_name'); ?> <?php the_author_meta('last_name'); ?>` and `<?php the_author_meta('description'); ?>`, but how to retrieve the user's posts?


WordPress : using AJAX to get posts & Sidebar Content to an external application

Hello friends I am trying to get my wordpress posts to display in a non- wordpress application. Currently I am getting them by using the following method. My wordPress page is something like this:

          <div id="footer"
      and I am using:               <?php file_get_contents('http://mysite.com/blog'); ?>      It's working ok but there are 2 issues.........   1. It is getting the entire page.   2. My page stops loading till it fetches the wordpress data.  Hence I thought AJAX was the solution. But I don't know AJAX. hence decided to seek help here. What I am looking for is that I just want the output content of #Content Div and #sidebar Div separately so that I can place them in my other application in two different places. I don't even need the CSS or JS as they are common for both my themes. I just want the output and separately placed at 2 different place. Please help.


When does wordpress process <!--nextpage-->

when does <!--nextpage--> get processed by wordpress filtering. i am adding multiple paged posts in post content on the content_save_pre and this is good for rendering my shortcodes, but <!--nextpage--> doesnt get processed and shows up as an html comment


how to get a different html for odd/even posts?

query posts           if posts exist             then begin the loop               if post is even:
title

content
               if post is odd:
its image
      this is what i'm trying to get, a different output for odd/even posts: for even posts we will show the title and the content while for odd posts we will show its image (the thumbnail, for example). How to get this result? I query post in this way               query_posts('category_name=category-name');      then i don't know how to continue


Mysterious template change after database import/export

When I switch databases from my local environment to the host, some of the pages inexplicably change templates. E.g. there is a custom template "Home" and when I switch the db's it ends up with the template "About". I figure it's something with the post metadata not saving correctly. It gets annoying to check every template to see whether it changed or not. I am using the Advanced Custom Fields and WPML plugins but not sure if this issue is related. Does anyone recognize this issue?


WP_rewrite static Page URLs

Just moved over from blogger to wordpress. To try and maintain old URLs, and respective comments etc I've changed the site URL in the wordpress settings to match the old blogger format which was http://blog.myURL.com/some-post-title. This works great.....but... What I want to do is change the URL structure of the 5 or so static pages, contact, about, home etc to be the root www.myURL.com/about, www.myURL.com/contact and NOT blog.myURL.com/about I have been trying all sorts of multisite, htaccess stuff and now WP_rewrite but I am at the end of my tether!! Help would be greatly, greatly appreciated!!


Redirect not working

I want to redirect the http://xyz.com/freebooks/ to http://xyz.com/shop/?min_price=0&max_price=0 I added this to the .htaccess and it redirects to the shop page but doesn't retain the /freebooks/ or filters like the original url. **.htaccees** :               RewriteEngine On     RewriteRule ^freebooks$ index.php?p=5&min_price=0&max_price=0  [NC,L]          # BEGIN WordPress          <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Resulting URL: `xyz.com/shop/` Expected URL: `xyz.com/freeabooks` (with the shop showing only freebooks)


Why WordPress automatic cropping all my images?

Am new to WordPress, when I upload any image, WordPress automatic crops into its own sizes which I have not mention in the media section (Settings » Media). Settings which I saved in media is:   ![Setting which i saved in media.](http://i.stack.imgur.com/6Gl0k.jpg) And when I check in the directory it crop automatically into these sizes:   ![enter image description here](http://i.stack.imgur.com/rzV8O.jpg) How this thing is happening?


Undefined index: id, when I save the options

I'm making a Wordpress theme and I get these 'Notices' repeated a lot of times when I save the options using the WP_DEBUG:               Notice: Undefined index: id in /var/www/Seozeta/wp-content/themes/seozeta/seozeta-options.php on line 997     Notice: Undefined index: id in /var/www/Seozeta/wp-content/themes/seozeta/seozeta-options.php on line 1000      The code is this:               foreach ($options as $value) {             if (isset($_REQUEST[ $value['id'] ] ) ) { //#997             update_option( $value['id'], $_REQUEST[ $value['id'] ]  );          } else {              delete_option( $value['id'] ); //#1000         }      }      It seems the initial **isset** should work and fix the problem, but it is not. I numbered the lines affected using the comments in PHP. What am I doing wrong? Any suggestions?


Vagrantpress + composer

I was looking at the roots.io blog, where I learned about Vagrant and Composer which in combination seem to give you a more intelligent development environment and dependency management system. I choose to get and install Vagrantpress since it seems like the easiest way to get started with wordpress + vagrant. The plus of Vagrantpress is that it installs Wordpress and all its dependencies for you. As I understand Composer in adjunction with Wordpress, is that the easiest way to combine the two is to use the Outlandishs WordPress Packagist. Now my question is, how are people using Composer and Vagrantpress tougher? How does your setup look like? Are there any good examples of composer.json file + Vagrantfile for Vagrantpress? /PS: If someone with enough rep could create the Vagrant and composer tags that would be great. No relevant tags really exist, but I hope the question is relevant enough.


How do I insert a new meta key / value pair, but only if another meta key is present?

I need to add a new meta key and value part only on posts where another key is present (regardless of its value). I tried to use a query to automate it, but my SQL is quite limited Here's what I tried:               INSERT INTO wp_postmeta (post_id, meta_key, meta_value)     SELECT     (SELECT meta.post_id     FROM `wp_postmeta` meta     INNER JOIN wp_posts posts ON meta.post_id = posts.id     WHERE meta.meta_key = 'existingkey'),     ('newkey'),     ('newvalue')      It returns the `#1242 - Subquery returns more than 1 row` error.


Knowing the total number of posts before to get into the loop

Is there a way to know the total number of posts before the loop starts? I'm thinking in use two loops. The first will do the counting, while the second one will handle the content. However, I don't think this approach is 'elegant'. Any other solutions?


Is it possible to upload multiple images via Media Library tab in Thickbox I've created?

I have a meta box upload button and I want to upload multiple images using that button. Firstly I enqueue required scripts:               add_action( 'admin_print_scripts-post-new.php', 'mycpt_admin_script', 11 );     add_action( 'admin_print_scripts-post.php', 'mycpt_admin_script', 11 );          function portfolio_admin_script() {         global $post_type;         if( 'mycpt' == $post_type )         wp_enqueue_script( 'mycpt-script', get_stylesheet_directory_uri() . 'mycpt.js' );         wp_enqueue_script('media-upload');         wp_enqueue_script('thickbox');     }      mycpt.js looks like:               jQuery(document).ready(function() {        jQuery('#cptbutton').click(function() {            tb_show('', 'media-upload.php?type=image&TB_iframe=true');            return false;        });     });      And then I just simply add meta box with this button:               <input id="cptbutton" type="button" value="Upload Image" />      Of course when I click it the Thickbox pops up with: >  Drop files here or > >     [ Select Files ] Plot twist - the files are already on the server (so I don't want to upload them all over again for every other post) and I want to just attach them to current post via Media Library tab: ![Media Library](http://i.stack.imgur.com/wEznI.png) When I click on any of these above and click "Insert into Post" it just adds one image, and it's over. How to select multiple images from Media Library? Is it even possible or my logic is wrong and I have to try something else? In short words - I want to upload / attach images for post's sidebar (it's replacing Featured Images). I'd love to just drag & drop multiple images or select multiple images from Media Library although I have no idea how to do that? I don't want to use Gallery.


How can I highlight a top level dashboard menu item created for a custom taxonomy?

I've used `add_menu_page()` to create a top-level dashboard menu item for a custom taxonomy. This is due to some specific needs with respect to this plugin. The menu item works fine, but when you click it, the Posts menu opens. I've tried to hook the `parent_file` filter to change that and the best I've been able to accomplish is to ensure that no menu appears.               add_action("admin_menu", "add_bureau_menu_item");     add_filter("parent_file", "fix_bureau_tax_parent");          public function add_bureau_menu_item() {         $tax = get_taxonomy("bureau");         add_menu_page("Bureaus", "Bureaus", "read", "edit-tags.php?taxonomy=" . $tax->name, "", "", 20);     }          public function fix_bureau_tax_parent($parent="") {         global $pagenow;         $tax = get_taxonomy("bureau");         if(!empty($_GET["taxonomy"]) && $_GET["taxonomy"]==$tax->name && $pagenow=="edit-tags.php") $parent = "edit-tags.php?taxonomy=" . $tax->name;         return $parent;     }      So, here's the question: is there a way to highlight a menu item created with `add_menu_page()` using the `parent_file` filter?


No option "I would like my site to be private, visible only to users I choose" in Privacy Settings

I am running WordPress 3.3.2 self-hosted. I used to see the option "I would like my site to be private, visible only to users I choose" under Privacy Settings but I no longer see this option. Instead, now I only see the options to make the blog visible or not visible to search engines, but no way to make it private. I have already tried deactivating all plugins and setting to a basic theme (Twenty Eleven 1.3) to see if my plugins or theme were causing a problem, but still do not see the old option. Any tips much appreciated!


How to change images size after theme modification?

The images in the previous theme were using a height and width listed in the source html. The new theme will resize the images using percentages, so I need to remove all the height and width in the source html. All images have a specific size.   1. How to remove the height and width when you have an installation with more than 500 posts?    2. How to deal with captions id and size?


How to display a sized image from Simple Fields repeatable field

I'm using the Simple Fields plugin (http://wordpress.org/plugins/simple- fields/) and am having the hardest time creating a slideshow from a repeatable field group. I've tried piecing everything that I could find from the documentation and from others who have had similar issues, but everything I try results in an "invalid argument" or no image src returned. This code is working, but I need to know how to tell it to display the 'large' size image:
         <?php             $slideshow_repeat = simple_fields_get_post_group_values(get_the_id(),"Slideshow", true, 2);                 foreach ( $slideshow_repeat as $slide ) {                     $image_src = wp_get_attachment_image_src($slide['Slide']);         ?>
             <img src="<?php echo $image_src[0]; ?>" alt="<?php echo $slide['Title']; ?>"/>
<?php echo $slide['Title']; ?>

<?php echo $slide['Caption']; ?>

<?php echo $slide['Image Credit']; ?>

              <?php             }         ?>
      If anyone can help, I'd really appreciate it.


Change text "My Basket" in woocommerce artificer theme

I am working with the woocommerce artificer theme and there is a place in the header where it says "My Basket" and then the amount that is in your cart. ![enter image description here](http://i.stack.imgur.com/CvA0S.png)   I would like to change the text to say "My Cart". I have looked around. I even found a post on here where the poster shows where the files come from the post can be found here: Change My Basket text in the header of WooCommerce Artificer theme I went into the theme-woocommerce file that they talk about and changed the text, although it did not change on the page. I went to the function woocommerce_cart_link() and I deleted everything in the function except: `<a href="" class="cart-button "> </a>` And the stupid My Basket thing still came up. I delete the class="cart-button " and the button disappears. Is there a hook on the class or how can I find the source so I can get this working? I would like to get the "My Basket" text to say "My Cart" and eventually I will try and change that thing to the left that looks like a cardboard box. Thanks for the help.


Get data from 3rd table

I have 3 tables:   * wp_posts   * wp_metadata   * users When I get my query from `wp_posts` I'm using `LEFT JOIN` to get the data from the `wp_metadata`, but how can I get a value from the 3rd table `users`? Example: I have one post on my WordPress blog. On that post I have some meta-fields - one of them is called `userid`. My users are located in a table outside of WordPress. How can I get the user's username from the table `users` where the post-meta-key `userid` is equal to the `users`-tables row ID? Here is my SQL-request as it is right now:               $result = query("     SELECT ID, post_title, post_excerpt, post_content,             m.meta_value AS placeid,             i.meta_value AS photoid,             r.meta_value AS rating,             u.meta_value AS userid,             b.username      FROM wp_posts p             LEFT JOIN wp_postmeta m ON (m.post_id = p.ID)             LEFT JOIN wp_postmeta i ON (i.post_id = p.ID)             LEFT JOIN wp_postmeta r ON (r.post_id = p.ID)             JOIN wp_postmeta u ON (u.post_id = p.ID)             LEFT JOIN brugere b ON (b.id = userid)      WHERE m.meta_key = 'placeid'             AND i.meta_key = 'photoid'             AND r.meta_key = 'rating'             AND u.meta_key = 'userid'             AND post_status = 'publish'      ORDER BY ID DESC      LIMIT 50     ");      I want _one_ query, because I'm using the query on a `print json_encode`.


BuddyPress: Conditionally filter directory based on Xprofile Field

**Members Loop Query** `<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>` **Question: How can this function be integrated into the members loop so that Female members are served a directory of males and male members are served a directory of females?****                   <?php          class BP_Custom_User_Ids {              private $custom_ids = array();              public function __construct() {                  $this->custom_ids = $this->get_custom_ids();                  add_action( 'bp_pre_user_query_construct',  array( $this, 'custom_members_query' ), 1, 1 );             add_filter( 'bp_get_total_member_count',    array( $this, 'custom_members_count' ), 1, 1 );              }              private function get_custom_ids() {             global $wpdb;                  // collection based on an xprofile field             $custom_ids = $wpdb->get_col("SELECT user_id FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 5 AND value = 'Female'");                       return $custom_ids;         }                function custom_members_query( $query_array ) {                  $query_array->query_vars['include'] = $this->custom_ids;              }                function custom_members_count ( $count ) {                  $new_count = count( $this->custom_ids );             return $count - $new_count;              }     }          function custom_user_ids( ) {              new BP_Custom_User_Ids ();          }          add_action( 'bp_before_directory_members', 'custom_user_ids' );      **Example:**               if {current user is "female" (filter members loop to show only males)}               else if {current user is  "male" (filter loop to show only females)}


update_post_meta array issues

I am not sure what I am doing wrong here and would appreciate the help I have an array the looks like this:               Array     (         [85369] => 3         [85368] => 13         [85378] => 23     )      When I try to update the database with               update_post_meta( $id, 'key', $MyArr);      in the databse the array is not stored. What is stored is:               a:0:{}      Any help would be appreciated Full Code:               function distance($lat1, $lng1, $lat2, $lng2, $unit) {     $theta = $lng1 - $lng2;     $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));     $dist = acos($dist);     $dist = rad2deg($dist);     $miles = $dist * 60 * 1.1515;     $unit = strtoupper($unit);         if($unit == "K"){         return round ( ($miles * 1.609344) );         }elseif ($unit == "N"){         return round ( ($miles * 0.8684) );         }else{         return round ( $miles );         }     }          $MilesArray = array();     $bounding_distance = 1;     $nearbys = $wpdb->get_results(              "              SELECT *                FROM rvty_geodata              WHERE (                     geo_latitude BETWEEN ($lat - $bounding_distance) AND ($lat + $bounding_distance) AND geo_longitude BETWEEN ($lng - $bounding_distance) AND ($lng + $bounding_distance)                  )             "     );            foreach ($nearbys as $nearby) {         $alt_id = $nearby->post_id;         $alt_lat = $nearby->geo_latitude;         $alt_lng = $nearby->geo_longitude;         if ($rvparks->ID != $alt_id) {             $Miles = distance($lat, $lng, $alt_lat, $alt_lng, "M");             $MilesArray[$alt_id] = $Miles;         }     }      asort($MilesArray);     if(count($MilesArray)>10){         $MilesArrayChunk = array_chunk($MilesArray, 10, true);         $ALTCGArray = $MilesArrayChunk[0];      }else{         $ALTCGArray = $MilesArray;     }     update_post_meta( $rvparks_id, 'alt_camps', $ALTCGArray);


Woocommerce + Show a menu with only the active category and sub-category

I have a menu structure that looks like this: Categorie 1   - Sub Category   - Sub Category   Categorie 2   - Sub Category   - Sub Category   Categorie 3 But I only want to show the active category with it's subcategories on the product archive and product detail pages. Like this:   Category 3   - Sub Cat   - Sub Cat The woocommerce widget shows all the categories and only the subcategories from the active category so I think it's not that hard to fix it but I can't find a solution on the internet (I fixed it by making different custom menu's and an if else function but with products in multiple categories it doesn't work well.)


show a nextgen gallery in a new page using custom theme

I am using NextCellent Gallery plugin and a custom theme. I created an Album, Gallery and wish to display the gallery in a new page. The gallery displays in the same page when `gallery>options>gallery settings>deactivate gallery page link` is selected. When the option is deselected the gallery displays as expected using the Twentythirteen theme. In the Wordpress dashboard under `gallery>manage gallery>create new page` I click the add page button for each gallery but none show using my custom theme. I don't know if I need to create a custom gallery, custom template or modify the page.php to get the galleries to display. I create a page Using a custom template `var_dump($gallery)` displays as null.               <?php      /*     Template Name: Gallery Template     */     ?>     <?php get_header(); ?>     <?php var_dump($gallery) ?>     <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($gallery)) : ?>

<?php echo $gallery->title; ?>

              <?php foreach($images as $image): ?>             <img src="<?php echo $image->imageURL; ?>" alt="<?php echo $image->alttext;?>">         <?php endforeach; ?>
          .     .     .     .          <?php endif; ?>          <?php get_footer(); ?>      I sense I am only missing one or two functions but after two weeks of trying no longer know where to look.


How to remove date in Recent Post widget?

I am stuck with this. I open the file default_widget.php inside wp-icludes folder, i want to remove the date displayed by the default recent post widget. I cannot find it! Pls help!!


creating a foreign key like relationship with custom post types

I am currently building a website, that is heavily reliant on custom post types, 2 of my custom post types are "Clients" and "Case Studies", now what I am wanting is a way to create a dropdown in the "Case Studies" custom post type so that I can select from the Clients that have already been added to the site? Is this possible, I assume it would be similar creating a relationship in database, and then pulling in the clients from the clients and table and placing them in a `<select>`.


List one post only from each subcategory using get_posts?

Custom Post Type = 'projects' with a Hierarchical Taxonomy = 'projects_category'               projects     - big-corporates     -- company one     ---- first project 1     ---- second project 1     ---- third project 1     -- company two     ---- first project 2     ---- second project 2     -- company three     ---- first project 3     ---- second project 3     ---- third project 3     - small-businesses     -- company four     ---- first project 4     ---- etc...     -- company five     -- company six Below I get a list of all projects listed in 'projects_category' under 'big- corporates' whereas I want to limit the list to just one project from each subcategory of 'big-corporates'.               <?php         global $post;         $args = array( 'post_type' => 'projects', 'projects_category' => 'big-corporates' );         $myposts = get_posts( $args );         foreach( $myposts as $post ) :  setup_postdata($post); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php #the_title(); ?><?php $terms = get_the_term_list( $post->ID, 'projects_category' ); $terms = strip_tags( $terms ); echo $terms; ?>
         <?php endforeach; ?>      I am trying to achieve a list like this:               company one (links to first project 1)     company two (links to first project 2)     company three (links to first project 3) How can I do that?


check if a comment was made by a registered user

Is there any _Conditional Tag_ to check whether a comment is made by registered user or not?


Get category id for a custom category and display it in a class

I am having trouble displaying my custom category ID to my li ID. The code I am using below is displaying the post ID of the post category instead of the custom category. What I am trying to do is assign a ID for each custom category that is assigned to the post. With each category having a different ID I will be able to assign a style to each one. How would I go about assigning a different ID or category ID to my li?                <?php $taxonomy = 'post_tools'; $terms = get_terms($taxonomy); if ( $terms && !is_wp_error( $terms ) ) :?>
                   <?php foreach ( $terms as $term ) { ?>                   <li id="tools-<?php $cat_id = $cat->cat_ID; ?>"><?php echo $term->name; ?>
       <?php } ?>
       <?php endif;?>


Allow user to create instances of custom field

I have a custom field for a links page which takes a name and an URL and saves it in the post meta. However, I want the user to be able to click "Add new link" and a new custom box appears so they can essentially have unlimited links. Ideally a plugin would be perfect, or any tips into which techniques I should look at. Thanks so much


Wordpress administration Over SSL - To Force SSL Logins and SSL Admin Access

I have a plan to enable SSL to admin login of my wordpress site, Is it a best practice? What will be the behavior of plugins? What are the pros and cons of my decision?


Add log in link to menu in Twenty Twelve

I can't find a way to add the log in link to the new theme of WordPress, Twenty Twelve. I did find a lot of answers on the older theme, where they suggest to add some code in the `functions.php` file. However, this do not work for me. Does anyone have a solution for this? You can see my homepage here: http://musikfest.dk/kursus/


Allow contributor role to upload images and not edit already published articles

I have the following two requirements:   1. I want to allow users with the contributor role to upload media (images mostly) in their posts and preferably they shouldn't be able to delete existing ones before submitting it for review.   2. I want to make sure once an article is published that it can't be edited by the contributor (the writer of the plugin with user role contributor) or if it can be edited the newer version isn't updated before going through a submission process. I was recommended the Role Scoper plugin but I couldn't figure out how to do it. Any information about any other plugin or how to do this in Role Scoper would be great.