title: How Can I Limit Users to Post Creation For My Frontend Theme?

text:
I have exactly a same site like stachexchange. In my theme all users can ask questions. But I want to limit users to post for preventing spam. Example: **1 post per hour**. Default new registration role is author. Bainternet's Posts Creation Limits plugin doesn't work with front end and I don't have any shortcode in my theme. Here is the my posting ask a question front page.Please help me.I am using Robust Q&A Theme.(In themeforest)                   <?php     /**      * @package WordPress      * @subpackage Robust Q&A - WPQA      */      ?>          <?php     include (TEMPLATEPATH . '/translations.php');     // Define the Post Redirect     $redir = $post->ID;          /////////////////////////////     //$_COOKIE Checkers       //     ///////////////////////////          // Get Question Reported Cookie to Display Success Message     if (isset($_COOKIE['content_reported_'.$post->ID])) {         $reported_content = $_COOKIE['content_reported_'.$post->ID];         if(isset($reported_content) && $reported_content != NULL) {             $message = $t_message_sucsess_content_reported;         }     }          // Get Answer Posted to Question Cookie to Display Success Message     if (isset($_COOKIE['answer_posted_'.$post->ID])) {         $new_answer_posted = $_COOKIE['answer_posted_'.$post->ID];         if(isset($new_answer_posted) && $new_answer_posted != NULL) {             $message = $t_message_answer_success_posted;         }     }          // Get Comment Posted on Answer Cookie to Display Success Message     if (isset($_COOKIE['comment_posted_'.$post->ID])) {         $new_comment_posted = $_COOKIE['comment_posted_'.$post->ID];         if(isset($new_comment_posted) && $new_comment_posted != NULL) {             $message = $t_message_sucsess_comment_on_answer;         }     }          // Get Question Already Reported Cookie to Display Error Message     if (isset($_COOKIE['already_reported_'.$post->ID])) {         $already_reported_question = $_COOKIE['already_reported_'.$post->ID];         if(isset($already_reported_question) && $already_reported_question != NULL) {             $message = new WP_Error('already_reported_question', $t_message_already_reported_content);         }     }          // Get Forgot Question Note Cookie to Display Error Message     if (isset($_COOKIE['forgot_add_note_'.$post->ID])) {         $forgot_question_note = $_COOKIE['forgot_add_note_'.$post->ID];         if(isset($forgot_question_note) && $forgot_question_note != NULL) {             $message = new WP_Error('forgot_question_note', $t_message_forgot_note_text);         }     }          // Get Question Note Added Cookie to Display Success Message     if (isset($_COOKIE['question_note_added_'.$post->ID])) {         $question_note_added = $_COOKIE['question_note_added_'.$post->ID];         if(isset($question_note_added) && $question_note_added != NULL) {             $message = $t_message_note_added_to_question;         }     }          // Get Best Answer Selected Cookie to Display Success Message     if (isset($_COOKIE['best_answer_selected_'.$post->ID])) {         $best_answer_selected = $_COOKIE['best_answer_selected_'.$post->ID];         if(isset($best_answer_selected) && $best_answer_selected != NULL) {             $message = $t_message_best_answer_selected;         }     }          // Get Remove Question Email Alerts Cookie to Display Success Message     if (isset($_COOKIE['removed_question_email_alerts_'.$post->ID])) {         $remove_message_email_alerts = $_COOKIE['removed_question_email_alerts_'.$post->ID];         if(isset($remove_message_email_alerts) && $remove_message_email_alerts != NULL) {             $message = $t_message_email_alerts_removed;         }     }          if ( isset($_POST['answer_post']) == '1') {         $answer_content = $_POST['answer_content'];         $source_link = $_POST['source_link'];         $message = post_new_answer($answer_content, $source_link);     }          if ( isset($_POST['comment_on_answer_post']) == '1') {         $comment_content = $_POST['comment_content'];         $comment_parent_id = $_POST['comment_parent_id'];         $message = post_new_comment_to_answer($comment_content, $comment_parent_id);     }          if ( isset($_POST['best_answer_post']) == '1') {         $best_answer_id = $_POST['best_answer_id'];         $best_answer_parent_question = $_POST['best_answer_parent_question'];         $message = select_best_answer($best_answer_id, $best_answer_parent_question);     }          if ( isset($_POST['report_content']) == '1') {         $reported_item_id = $_POST['reported_item_id'];         $reported_type = $_POST['reported_type'];         $question_id = $_POST['question_id'];         $message = report_content_item($reported_item_id, $reported_type, $question_id);     }          if ( isset($_POST['add_note_to_question']) == '1') {         $add_note_text = $_POST['add_note_text'];         $question_id = $_POST['question_id'];         $message = add_note_to_question($add_note_text, $question_id);     }          if ( isset($_POST['remove_email_alerts']) == '1') {         $question_id = $_POST['remove_alerts_question'];              $message = remove_question_email_alerts($question_id);     }          get_header();?>

                                                  <?php //get_search_form(); ?>

<a href="<?php echo home_url(); ?>/<?php echo $t_ask_a_question_permalink;?>/"><?php echo $t_ask_question; ?> <img src="<?php echo get_template_directory_uri(); ?>/images/grey-add-btn-icon.jpg" alt="" />
                             <?php if ( current_user_can('manage_options')) {?>
<?php edit_post_link($t_edit_page_link); ?>
                             <?php } ?>                             <?php include (TEMPLATEPATH . '/breadcrumb.php'); ?>

                                                                         <?php if (have_posts()) : ?>                         <?php query_posts($query_string . ""); ?>                         <?php while (have_posts()) : the_post(); ?>
                             <?php                              if (isset($message)) {                                 display_message($message);                             } ?>
                                 <form action="" method="post" name="reportContent">
<?php echo $t_report_content_message_text; ?>

                                     <input type="hidden" value="<?php echo $post->ID ?>" name="reported_item_id" />                                     <input type="hidden" value="Question" name="reported_type" />                                     <input type="hidden" value="<?php echo $post->ID; ?>" name="question_id" />                                     <input type="hidden" value="1" name="report_content" />                                     <input type="submit" class="process" value="<?php echo $t_report_question;?>" />                                 </form                                 >

                                          <?php                                          // Get data for displaying avatar                                         $author = $authordata;                                          $blog_url = get_template_directory_uri();                                         $selected_avatar_image = get_user_default_icon($author->ID);                                         $avatar_image = '/images/default-user-avatar-'.$selected_avatar_image.'.jpg';                                         $url = $blog_url . $avatar_image ;                                              // Get data for linking to member profile when clicking avatar image                                         $main_url = home_url();                                         $author_name = get_the_author_meta('nicename');                                         $profile_link = '/'. $t_profile_permalink .'/';                                         $author_profile_link = $main_url . $profile_link . $author_name;                                         $email_question_asker = get_post_meta($post->ID, 'alert_asker_emails', true);                                     ?>                                                           <div class="questionBox" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<?php the_title(); ?>
                                             <a name="<?php the_ID(); ?>">
<?php the_content(); ?>

                                                 <form action="" method="post" name="addNoteToQuestion">                                                     <?php echo $t_add_note_popup_heading_text; ?>:                                                     <textarea name="add_note_text"></textarea>

                                                     <input type="hidden" value="<?php echo $post->ID ?>" name="question_id">                                                     <input type="hidden" value="1" name="add_note_to_question" />                                                     <input type="submit" class="process" value="<?php echo $t_add_a_note_link;?>" />                                                 </form                                                 >

                                                 <form action="" method="post" name="removeEmailAlerts">
<?php echo $t_remove_email_alerts_text;?>

                                                     <input type="hidden" value="<?php echo $post->ID ?>" name="remove_alerts_question">                                                     <input type="hidden" value="1" name="remove_email_alerts" />                                                     <input type="submit" class="process" value="<?php echo $t_remove_email_alerts_link;?>" />                                                 </form                                                 >

                                                                                <?php // Show Question Note if Set                                             $author_note = get_post_meta($post->ID, 'question_note', true);                                                  if ($author_note != NULL) { ?>
<?php echo $t_author_note_heading_text;?>:
<?php echo $author_note; ?>
                                             <?php } ?>                                                  <?php // Show Source Link Code if Set                                             if (isset($source_link) != NULL) { ?>
<?php echo $t_link_text;?>: <?php echo $source_link; ?>
                                             <?php } ?>                                                  <?php                                             $posttags = get_the_tags();                                             if ($posttags) {?>
<?php the_tags($t_tags_text.' ' , ' ', ''); ?>
                                             <?php } ?>
<?php echo $t_in_text;?>: <a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/"><?php the_category(', ','multiple') ?> | <?php the_time(get_option( 'date_format' )); ?>
                                                  <?php // ADD Question Note                                             global $current_user;                                             get_currentuserinfo();                                                  if ($post->post_author == $current_user->ID && $author_note == '') { ?>
|<a href="#addNotePop" onclick="return; false" class="boxy" title="<?php echo $t_add_a_note_link;?>"><?php echo $t_add_a_note_link;?>
                                             <?php } ?>                                                  <?php                                              $email_question_asker = get_post_meta($post->ID, 'alert_asker_emails',true);                                                  if ($post->post_author == $current_user->ID && $email_question_asker == 'true') {?>
|                                                 <a href="#removeEmailAlerts" onclick="return; false" class="boxy" title="<?php echo $t_remove_email_alerts_link;?>"><?php echo $t_remove_email_alerts_link;?>
                                             <?php } ?>

<a href="<?php echo home_url(); ?>/<?php echo $t_profile_permalink;?>/<?php echo $author->user_nicename; ?>/"><?php echo $author->display_name; ?><?php echo getPointLevel($author->ID, 'sm'); ?><?php $expert_user = get_user_meta($author->ID, 'expert', true); if($expert_user == 'yes') { ?><img src="<?php echo get_template_directory_uri(); ?>/images/expert-badge-icon.png" alt="<?php echo $t_expert_text;?>" class="expertImg" /><?php } ?>
                                           <?php                                     if (is_user_logged_in()) {                                     ?>                                          <div class="bylineBoxShare" id="report<?php echo $post->ID ?>"><a href="#reportPop" onclick="return; false" class="boxy" title="<?php echo $t_report_question;?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_question;?>" />
                                          <?php } else { ?>
<a href="<?php bloginfo('siteurl'); ?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_report_content_text;?>"><img src="<?php echo get_template_directory_uri(); ?>/images/flag-this-icon.png" alt="<?php echo $t_report_question;?>" />
                                           <?php } ?>                                          <span class="adminURL" id="<?php echo admin_url();?>">                                     <span class="templateURL" id="<?php echo get_template_directory_uri(); ?>">                                     <?php $post_id = $post->ID;?>                                     <?php $current_like_count = get_post_meta($post_id, 'like_count');?>                                     <?php if (isset($current_like_count[0]) == NULL || $current_like_count[0] == 0){$current_like_count[0] = 0;}?>                                     <span class="likeCount-<?php echo $post_id ?>" id="likeCountCurrent-<?php echo $current_like_count[0]?>">                                          <?php                                     if (is_user_logged_in()) {                                              global $wpdb;                                         $current_user_id = get_current_user_id();                                              $get_user_liked_question_value = "SELECT * FROM " . $wpdb->prefix . "rqa_liked_content WHERE user_id ='". $current_user_id . "' AND like_content_id ='". $post_id . "'" ;                                         $users_liked_question_value = $wpdb->get_results($get_user_liked_question_value);                                              if (isset($users_liked_question_value[0]->user_id) == $current_user_id && isset($users_liked_question_value[0]->like_content_id) == $post_id) {                                              ?>

<img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?>

                                              <?php } else { ?>
                                                 <div class="bylineBox right likeThisLink" id="like-this-<?php echo $post_id; ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?>

                                                   <?php } ?>                                          <?php } else { ?>

<a href="<?php bloginfo('siteurl'); ?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>" title="<?php echo $t_login_signup_like;?>"><img src="<?php echo get_template_directory_uri(); ?>/images/like-icon.png" alt="<?php echo $t_like_text;?>" /><?php if ($current_like_count[0] > 0) { echo $current_like_count[0];} else {echo $t_like_text;} ?>

                                     <?php } ?>

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

                                      <?php                                 // List out the number of Answers - Exlcuding Comments on Answers                                 $answers_count = c_parent_comment_counter($post->ID);                                      // Var to show comments on answers count - not used                                 // $comments_on_answers_count = $post->comment_count - $number_of_parents;                                      if ($answers_count < 1) {?>
<?php echo $t_no_answer_yet_answer_now_text;?>
                                 <?php }                                 if ($answers_count == 1) {?>
<?php echo $answers_count; ?> <?php echo $t_answer_text;?>
                                 <?php }                                      if ($answers_count > 1) { ?>
<?php echo $answers_count; ?> <?php echo $t_answers_text;?>
                                 <?php } ?>

                                  <?php comments_template(); ?>                                  <?php                             // If logged in change nav to My Account and Log Out                             if ( is_user_logged_in()) { ?>                                     <?php // Users cant post answers ?>                                 <?php $users_cant_answer = get_option('robust_qa_admin_answer_only');                                 if ($users_cant_answer == true && (!current_user_can('manage_options') && $current_user->expert == 'no')) {?>
<?php echo $t_admins_answer_questions_only_text; ?> <a href="<?php echo home_url(); ?>/<?php echo $t_ask_a_question_permalink;?>/"><?php echo $t_admin_answer_link;?>
                                 <?php } else {?>

<?php echo $t_answer_this_question_heading;?>

                                                  <form action="" method="post" name="answerSubmitForm" id="answerSubmitForm">

                                                 <fieldset><textarea rows="10" cols="40" name="answer_content" id="answer_content" ><?php if (isset($_POST['answer_content'])) { echo $_POST['answer_content']; }?></textarea></fieldset>                                                 <?php echo $t_source_link_heading;?>: (<?php echo $t_optional_text;?>)                                                 <input type="text" name="source_link" class="sourceLinkInput" value="http://" />                                                 <input type="hidden" name="answer_post" value="1">                                                   <input type="submit" value="<?php echo $t_add_answer_btn;?>" />

                                             </form>

                                      <?php } ?>                             <?php } else { ?>

<?php echo $t_must_be_logged_in_to_answer;?>

<?php echo $t_already_a_member_text;?> <a href="<?php echo home_url();?>/<?php echo $t_login_permalink;?>/?redir=<?php echo $redir; ?>"><?php echo $t_login_text;?>
<?php echo $t_not_member_yet_text;?> <a href="<?php echo home_url();?>/<?php echo $t_signup_permalink?>/?redir=<?php echo the_ID(); ?>"><?php echo $t_signup_text;?>

                             <?php } ?>

                                     <?php                                      $single_cat = get_the_category();                                     $single_parent_cat = get_category($single_cat[0]->category_parent);                                     $main_question_id = get_the_ID();                                          if ($single_cat[0]->category_parent != 0) { ?>
<a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/<?php echo $single_parent_cat->slug; ?>/<?php echo $single_cat[0]->slug; ?>/"><?php echo $t_more_category_questions_heading;?>
                                     <?php } elseif ($single_cat[0]->category_parent == 0) { ?>
<a href="<?php echo home_url(); ?>/<?php echo $t_category_permalink;?>/<?php echo $single_cat[0]->slug; ?>/"><?php echo $t_more_category_questions_heading?>
                                     <?php } ?>
<?php echo $t_related_questions_heading;?>:

                                     <?php                                      if (have_posts()) :                                      $args = array(                                         'posts_per_page' => 5,                                         'cat' => $single_cat[0]->cat_ID,                                         'orderby' => 'date',                                     );                                     query_posts($args);                                          ?>                                     <?php while (have_posts()) : the_post();?>                                          <?php if ($post->ID != $main_question_id ) { ?>
<a href="<?php the_permalink(); ?> "><?php the_title(); ?>
                                     <?php } ?>                                     <?php endwhile; ?>                                 <?php endif; ?>                                 <?php wp_reset_query();?>

                                               <?php get_sidebar(); ?>

                   <?php get_footer(); ?>      <?php if ( is_singular() ) wp_enqueue_script( "comment-reply" ); ?>


title: Hosting Wordpress on Google Apps Engine (GAE)

text: At Google's 2013 IO conference, one of their many announcements was the ability to host PHP sites and apps on their Google Apps Engine. They even created a tutorial explaining how to set up a Wordpress site on GAE: https://developers.google.com/appengine/articles/wordpress. I am curious about the supposed performance benefits of running a WP site on GAE. What are the advantages and disadvantages of using GAE versus a hosting service provider like BlueHost or GoDaddy?


title: Sidebar on Single Product Page WP e-commerce on the wrong spot

text: I cannot get the sidebar on my WP site (twenty-eleven theme) working properly in my wp e-commerce shop. On the products page the sidebar is on the right side of the page, as it should be. On a single products page, however, the content of the sidebar is showing below the content. Have spend many hours searching how to fix this but no luck. Any help would be greatly appreciated. Here's a link to a single productpage: http://test.boarddesign.nl/?wpsc- product=gopro-kite-line-mount Sidebar is below the content Here's a link tot a correct page: http://test.boarddesign.nl/?page_id=43


title: How to unpublish multiple posts in one click?

text: I need to unpublish 200 posts in order to make some hard edition. These posts are from 2012 and my site is live with all the posts since 2013 until today. I would like to find a solution to be able to bulk unpublish posts of year 2012 in order for our team to edit them. If there's no solution by date, the other alternative is to select all the posts and un publish them. What would be the plugin or solution in this case?


title: How to connect different CPTs together?

text: I hope this question has its place here. I've always thought that connecting different Custom Post Types together is a rather common need, like in popular tutorial examples of custom taxonomy usage (books/authors/titles, films/actors/directors, etc). I personally use "Posts 2 Posts", but support stopped. On Google the most relevant results point to this plugin right now. Which long term alternatives exist? What would a seasoned WordPress web developer use to design a book/author/title management system with WordPress today, if P2P plugin is finished?


title: wp_query for displaying attachments with a tag

text: So I am running the following query:               <?php         $args = new WP_Query(array(             'post_type' => 'attachment',             'posts_per_page' => -1,             'oderby' => 'title',             'order' => 'ASC',             'post_status' => 'any',             'post_parent' => null,             'tax_query' => array(                 array(                     'taxonomy' => 'post_tag',                     'field' => 'slug',                     'terms' => 'logo'                 )             )         ));              while ( $args->have_posts() ) : $args->the_post();          ?>      An issue that I need to address is a better sorting method for the attachments. Currently I can only get it by title ASC or DESC. I am aware of the other orderby attributes available with the WP_Query but not all seem to work. I was wondering if anyone knows of a way to modify the upload date of images in the media library because then I could modify my query to go based off of date and we can just edit the dates of the images to show newer ones first etc. Any ideas that could help me with getting more of a manual control of this would be great. Thanks!


title: Dynamic content in pages

text: I'm looking to have dynamic content in pages. I've created this page: coaches/basketball/mike-johnson That works great and does everything I want it to do. However, I also want to create something like this without having to go into the admin and create a page each time: coaches/basketball/joe-smith coaches/basketball/ben-murray Is there a good way to do this automatically without manually inserting a new page? Would I need to create a PHP function that would add a page into the database? That doesn't seem like it would scale well for thousands of coaches. I understand how to create coaches/basketball/page?coach_id=100 coaches/basketball/page?coach_id=101 coaches/basketball/page?coach_id=102 etc This is what I'm really looking for, just with a clean URL and also so the page is searchable. Thanks in advance for the help!


title: How to implement just the wp commenting area on my custom site?

text: I'm searching for some site where I can find **line by line** explanation of an wp theme's code.   Because, I want to implement on my site just commenting area.   I don't need sidebar, gadgets, searching, archives... all the toys.   My page has everything I need, except commenting area, but I can't find which code lines stands after pressing "submit" button.   I tried to find such a simple template - without success.


title: Query posts by custom fields

text: I am making a theme for a hotel, and I need to be able to provide functionality to search by the following custom fields: Location and Price. I need to be able to query them from the query string itself... ie: yoursite.com/?post_type=rooms&location=south yoursite.com/?post_type=rooms&price=20.95 yoursite.com/?post_type=rooms&location=north&price=35 I have found many different questions/answers to this, but none of them seem to specifically address my issue. This one, notably, I believe is really close to solving the issue for me: Query posts and filter at query time by value of custom meta It doesn't make much sense to me. I am used to PHP, however I am new to WordPress as a CMS.


title: Create a Page Templete to Display Table Of Content for Custom Taxonomies

text:
I have created a custom post type named "Training" & a Custom Taxonomy for the same named "Table Of Content" I need to create a Page template to display Table Of Content Something like this

 Custom Taxonomy 1

 Child Taxonomy 1

 Post Title 1

 Post Title 2

 Post Title 2

 Child Taxonomy 2

 Post Title 1

 Post Title 2

 Post Title 2

 Custom Taxonomy 2

 Child Taxonomy 1

 Post Title 1

 Post Title 2

 Post Title 2

 Child Taxonomy 2

 Post Title 1

 Post Title 2

 Post Title 2

      Here is the php code in functions.php for creating custom taxonomy               // Custom Taxonomy for Training     $labels = array(         'name'                          => 'Table of Content',         'singular_name'                 => 'Table of Content',         'search_items'                  => 'Search Table of Content',         'popular_items'                 => 'Popular Table of Content',         'all_items'                     => 'All Table of Content',         'parent_item'                   => 'Parent Table of Content',         'edit_item'                     => 'Edit Table of Content',         'update_item'                   => 'Update Table of Content',         'add_new_item'                  => 'Add New Table of Content',         'new_item_name'                 => 'New Table of Content',         'separate_items_with_commas'    => 'Separate Table of Content with commas',         'add_or_remove_items'           => 'Add or remove Table of Content',         'choose_from_most_used'         => 'Choose from most used Table of Content'         );          $args = array(         'label'                         => 'Table of Content',         'labels'                        => $labels,         'public'                        => true,         'hierarchical'                  => true,         'show_ui'                       => true,         'show_in_nav_menus'             => true,         'args'                          => array( 'orderby' => 'term_order' ),         'rewrite'                       => array( 'slug' => 'table-of-content', 'with_front' => false ),         'query_var'                     => true     );     register_taxonomy( 'tableofcontent', 'training', $args );      Thanks & Regards


title: Dynamically changing header text depending on URL in Wordpress html page

text: My shopping cart displays the order history on the last page the customer visited. For example, www.someurl.com/item1 is the last page the customer visited before checkout. An order confirmation email is sent with a link to that order as well as the customers entire order history. The link address is www.someurl.com/item1/#!/~/orderConfirmation. I would like my header to read "item1" on www.someurl.com/item1, and "history" on www.someurl.com/item1/#!/~/orderConfirmation. I am using Wordpress 3.5.2 with a twenty-twelve child theme Can this be accomplished? Any help is greatly appreciated


title: Hide the 'Gallery Settings' section of the Gallery tab of the media Thickbox

text: When I invoke the media uploader from a certain page, I'm looking for a way to hide all of the 'Gallery Settings' options at the bottom of the Gallery tab. I have set a referrer (`dd-options-footer`), so I can check that to ensure the code is only added for my desired page, but it seems that whatever I add does not work. I've tried adding both custom CSS and JS to do this, but it appears that WP overrides this in `wp-admin/js/gallery-min.js` when it outputs the content of the tab. Anyone know how I can do this? Thanks.


title: Prevent/Disable Automatic Update Check

text: WordPress automatically checks for updates to itself and all installed themes and plugins. This adds an annoyingly long delay to loading ( _any_ ) WordPress pages. In only happens once per day and subsequent page-loads don’t do it, but it is so long, that it makes me think twice about whether it is worth opening that first page at all (especially if I only need to do a quick thing rather than spending all day in WordPress). I only update once in a while anyway, and would much rather perform updates manually anyway, so I created a plugin to remove the _Updates_ button from the admin bar. I thought that would do the trick, but apparently in only removes the button and the actual check is still performed in the background. Every other program in the world lets you turn them off automatic updates, so I expect that there should be a way to do the same for WordPress, but if there is, it is a little too-well—hidden. When I tried to find a solution, all of the questions that came up were the opposite, about finding a way to force automatic updates to actually apply (not just automatically check for updates). How can automatic update checks be turned off in WordPress?


title: Implementing an OR statement to wordpress wp_query

text: I am trying to return all posts that meet the following conditions: The category must be 63 OR the post must have a value associated with the meta key named 'android_link' My current argument array currently does not work because it is asking for both of these conditions to be met. Is it possible to change it so that only one of these conditions must be met to return a post?                   $args = array(             'paged' => $paged,             'order' => 'DESC',             'meta_key' => 'android_link',             'post_type' => array( 'post', 'app' ),             'cat' => '63',                  'meta_query' => array(                 array(                     'key' => 'android_link',                     'compare' => 'EXISTS',                     )                 )             );


title: Search Result Customization

text: I need the search for highly customized. I've a custom post type with custom field. Search result should be displayed in this way:   1. First search should be performed into all title and displayed them   2. Then into a custom field and shown then (except those which were shown in step 1) So, I planned about using fully custom MySQL query. I'll search inside title first and store post ids into an array. Then run another query into post meta table and show result except those posts which were shown in first step based on the array of post id. Don't know if it's a good idea. Can you please give me an idea to perform my task in an effective way? Thanks


title: Limit search to a parent page and its child pages

text: Is it possible to modify the default "search engine" to limit the search to a specific page and its sub-pages? And how? Thanks!


title: How can I add only related products?

text: I want to seperate tabs and related products, so I used:               remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );     do_action( 'woocommerce_after_single_product_summary' );      This code worked well, but i want to add related products again to the single product page. How can I add related products only? Thank you.


title: Determine plugin name from within plugin_action_links filter

text: Is there any way to determine what plugin the plugin_action_links filter is addressing when it processes the filter? I'm trying to add some actions for each plugin on the `/wp-admin/plugins.php` page. Code looks as so:               public function _add_plugin_links(){         $plugins = get_plugins();         foreach($plugins as $k=>$plugin){             add_filter( 'plugin_action_links_' . $k, array(&$this, '_plugin_action_links') );         } // foreach $plugins     }          public function _plugin_action_links( $links ) {        $plugin = 'test'; // Somehow get plugin name here?        $links[] = 'Plugin name is: '.$plugin;        return $links;     }      I am able to append this text to the end of each plugin link list, but cannot determine exactly which plugin I am adding the text to. Adding a global variable from within `_add_plugin_links()` simply returns the very last plugin that is parsed from the plugins list.


title: Add Schema Image Designation Inside a Wordpress Function?

text: I would like to add itemprop="articleSection" to a thumbnail.               <?php the_post_thumbnail('thmb-index'); ?>      This is what I've tried:               <?php the_post_thumbnail('post-thumbnail',array('itemprop'=>'image')); ?>      How can I do this in the most simple and effective way? Preferably, I would like to incorporate it into `<?php the_post_thumbnail('thmb-index'); ?>` itself, not functions.php.


title: Add a "default sorting" menu to child store pages

text:
I'm new to WordPress WooCommerce and I can't figure out how to add a "default sorting" drop-down filter to my _category_ shop pages. I know it's on the plain old "SHOP" page, but my navigation doesn't even show that page (I set that up that way by choice). I have category pages (Cupcakes, Balloons, Plush, Cakes) and sub-category pages (for example: Cupcakes—Flavors Cupcakes—Assortments, Cupcakes—Holiday&Seasonal [etc.]), and I would like to have a "sort-by (price, popularity, average rating, newest) drop-down menu on ALL of those unique pages. Seems like such a basic thing. Does anyone know how to do this? Is it even possible? I am using the "Shoppest" theme. Here is my full archive-product.php page code.               <?php          /**           * The Template for displaying product archives, including the main shop page      which is a post type archive.           *           * Override this template by copying it to yourtheme/woocommerce/archive-     product.php      *      * @author      WooThemes      * @package     WooCommerce/Templates      * @version     2.0.0      */               if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly               get_header('shop'); ?>                   <?php                  /**          * Shoppest - remove woocommerce_output_content_wrapper & breadcrumb          *           * woocommerce_before_main_content hook          *          * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)          * @hooked woocommerce_breadcrumb - 20          */         do_action('woocommerce_before_main_content');     ?>          <?php         // check sidebar position         $options = get_option('shoppest');         $layout = ( isset($options['shop_layout']) && !empty($options['shop_layout']) ) ? $options['shop_layout'] : 'sidebarleft';         //echo $option['shop_layout'];         if ( $layout != 'fullwidth' ) {             $cssclass = 'span9';             if ( $layout == 'sidebarleft') $cssclass .= ' contentright';         } else {             $cssclass = 'span12';         }     ?>          <div role="main" id="content" class="<?php echo $cssclass; ?>">              <?php // make show page title false ?>              <?php if ( apply_filters( 'woocommerce_show_page_title', false ) ) : ?>
<?php woocommerce_page_title(); ?>
              <?php endif; ?>              <?php              /*              *  Shoppest - remove woocommerce_archive_description [ that display description]              *              *  @hooked sama_shop_slider - 10              */             do_action( 'woocommerce_archive_description' );         ?>              <?php if ( have_posts() ) : ?>                  <?php                 $options = get_option('shoppest');                 $icon_layout = ( isset($options['shop_icon_layout']) ) ? $options['shop_icon_layout'] : true;             ?>
                          <?php                         /**                          * Shoppest - remove woocommerce_result_count                          *                          * woocommerce_before_shop_loop hook                          *                          * @hooked woocommerce_result_count - 20                          * @hooked woocommerce_catalog_ordering - 30                          */                         do_action( 'woocommerce_before_shop_loop' );                     ?>                          <?php if ($icon_layout) { ?>
                             <?php _e( 'Display', 'samathemes' ); ?>
                                 <button id="grid" class="btn btn-primary active"></button>                                 <button id="list" class="btn"></button>

                     <?php } ?>
             <?php woocommerce_product_loop_start(); ?>                      <?php woocommerce_product_subcategories(); ?>                      <?php while ( have_posts() ) : the_post(); ?>                          <?php woocommerce_get_template_part( 'content', 'product' ); ?>                      <?php endwhile; // end of the loop. ?>                  <?php woocommerce_product_loop_end(); ?>                  <?php                 /**                  * woocommerce_after_shop_loop hook                  *                  * @hooked woocommerce_pagination - 10                  */                 do_action( 'woocommerce_after_shop_loop' );             ?>              <?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>                  <?php woocommerce_get_template( 'loop/no-products-found.php' ); ?>              <?php endif; ?>              <?php             /**              * woocommerce_after_main_content hook              *              * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)              */             do_action('woocommerce_after_main_content');         ?>
           <?php         /**          * woocommerce_sidebar hook          *          * @hooked woocommerce_get_sidebar - 10          */         if ( $layout != 'fullwidth' ) {             do_action('woocommerce_sidebar');         }     ?>          <?php get_footer('shop'); ?>


title: how to fix broken links in archive.php

text:
Here's more info to clarify my question. I used WordPress for the blog page of my site http://prygara.com/blog/. When you go to Post Categories on the left and then Posted In link or if you just go into a single post and then Categorized As link, I am getting Error 404 - Not Found. I don't know PHP language but my guess is that the error is due to a broken link. Though I may be wrong. The following code may be the culprit in archive.php               <?php the_tags(__('Tags:', 'kubrick'), ', ', '
'); ?>           <?php printf(__('Posted in            |           <?php edit_post_link(__('Edit', 'kubrick'), '', ' | '); ?>          <a class="page" href="<?php comments_popup_link(__('No Comments »', 'kubrick'), __('1     Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick')    ); ?>      Appreciate any help


title: custom post template ignored after altering permalinks

text: I've built a site with a custom post type called Testimonials and am using a custom template to display the posts _edit: template name is page- testimonials.php_. All is working as expected with the default permalink structure, however when I set the permalinks to /%postname%/ the custom template is ignored and the posts are showed on a blog archive.... Here's the code I've used to register the post type. Have I missed something required to make it use the proper template with custom permalinks?               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'testimonial',             array(                 'labels' => array(                     'name' => __( 'Testimonials' ),                     'singular_name' => __( 'Testimonial' ),                     'add_new_item' => __('Add New Item'),                     'edit_item' => __('Edit Item'),                     'new_item' => __('New Item'),                     'view_item' => __('View Item'),    'add_new_item' => __('Add New Item'),                     'edit_item' => __('Edit Item'),                     'new_item' => __('New Item'),                     'view_item' => __('View Item')                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'testimonials',                 'show_in_nav_menus' => true,                 'capability_type' => 'page',                 'hierarchical' => true,                'supports' => array( 'title', 'editor', 'thumbnail' ),                'query_var' => true)             )         );     }


title: Multiple wp_query loops showing first 5 posts on all pages instead of older posts[Resolved]

text:
I am trying to highlight the newest post in a separate layout and rest of them in a masonry index. There are 5 posts per page and I am getting the newest 5 posts on previous posts pages as well. I had all posts in a single loop under masonry index. I tried making the first element of masonry index a different width via css first-of-type property but it disturbs the masonry layout. Then I decided to use a separate loop for first post and second one with masonry layout for rest of posts, but I ended up getting first 5 posts on every page where older posts should be shown. Please advise how this can be resolved. Thanks in advance!               <?php      //First Query     $args1 = array(     'posts_per_page'   => 1,     'post_type'        => 'albums',     'post_status'      => 'publish',      );      $query1 = new WP_Query($args1);          //First Loop     if ( $query1->have_posts() ) {       while ( $query1->have_posts() ) {         $query1->the_post();?>         <?php get_template_part( 'entry-slide',get_post_type('albums') ); ?>         <?php comments_template();        }      }        wp_reset_postdata();            echo'
';       //Query2          $args2 = array(     'offset'           => 1,     'post_type'        => 'albums',     'post_status'      => 'publish',     'suppress_filters' => true );           $query2 = new WP_Query( $args2 );          //loop2     if ( $query2->have_posts() ) {      while( $query2->have_posts() ) {         $query2->the_post();?>
         <?php get_template_part( 'entry',get_post_type('albums') ); ?>
        <?php comments_template();         }      } //end second loop            echo '
';      get_template_part( 'nav', 'below' );?>

      <?php get_sidebar(); ?>

            <?php get_footer(); ?>      **UPDATE #1:** Wow! this worked(I added $paged variable before the loops):                 $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;      and then in the args i removed the offsets and added this instead:                 'paged' => $paged      But now I am getting a duplicate latest post because of removing the offset in the second loop. Please share your ideas on how the duplicate can be removed. Will this work : add offset in second loop in $args2 if it is the first page? Let me try and I'll share how that worked. **UPDATE #2** I have added this code to add an offset and remove duplicate latest post on the 1st page:               if ( $paged == 1 ){               $offset=1;           } else{               $offset='';           }      This helped but I am getting a post duplicate in the previous posts. I am yet to figure out why that's happening (and would appreciate if you can share your ideas). Rest all good.


title: How to set separate "lang" attribute for post or page titles

text: I am creating a multilingual website in English and Hindi on WordPress. Half of the site is in English and rest is Hindi. In a previous question asked by John Doe here at stackexchange s_ha_dum showed how to do that with all the posts' titles. What I want is to give Hindi lang attribute to Hindi content and English lang attribute to English content. Let me know if question is not clear enough, thanks in advance


title: post__in works but also prints the word Array

text: First line of the code below carries post ids captured via a form. Then rest of the code helps pull the post-thumbnail of the respective post ids               $sel_ids = $_SESSION['selected_ids'];     if ( ! is_array( $sel_ids ) ) { //the check to prove that $sel_ids is a valid array     return;     }          require_once('../../../../wp-load.php');          $args = array( 'post__in' => $sel_ids, 'post_type' => 'post' );     $posts = get_posts($args);          foreach ($posts as $post) {         echo get_the_post_thumbnail($post->ID, 'coverimage');     }      ![enter image description here](http://i.stack.imgur.com/snVly.jpg) > Thumbnails display fine but before the thumbnails, the code also outputs a > word `Array` which is definitely unwanted. * * * I have tried commenting out the lines one by one to isolate what line exactly is the culprit. So I found that this line `$args = array( 'post__in' => $sel_ids, 'post_type' => 'post' );` generates the unwanted string `Array`. My guess is the var `$sel_ids` needs some work. **FYI** a `var_dump($sel_ids)` prints `array(2) { [0]=> string(2) "67" [1]=> string(2) "16" }`. I also tried the code `explode(',', $sel_ids);` from the answer here but it prints a warning `Warning: explode() expects parameter 2 to be string`. Which I think makes sense because I know that $sel_ids is an array, but then why is it printing the word `Array`, odd. * * * **FYI** Since the code is a part of an html email. Here is a relevant part of the source of the email in gmail. Just in case it helps to infer the issue better.               Array<img src="http://xxxxxxxxx.com/wp-content/uploads/2014/04/360.jpg">       * * * **UPDATE** : Test code `<pre><?php print_r($args);?></pre>` outputs the results below. I suspect the word `Array` is being printed out from `[post__in] => Array`. How do I remove or replace this.               Array     (         [post__in] => Array             (                 [0] => 67                 [1] => 16             )              [post_type] => post     )


title: Default permalink changes

text: I need to use in my permalinks same titles for different post types and as far as I know the slug must be unique so the permalinks cannot be: custom-post-type-1/hello-world custom-post-type-2/hello-world custom-post-type-3/hello-world it will be like this: custom-post-type-1/hello-world custom-post-type-2/hello-world-2 custom-post-type-3/hello-world-3 how can I add a default -1 to the first permalink so the links will be like this: custom-post-type-1/hello-world-1 custom-post-type-2/hello-world-2 custom-post-type-3/hello-world-3


title: Error in database connection

text: I am using Wamp server, I want to develop website using WordPress. I have configured wp-config.php. Still it is showing me > Error establishing a database connection. How should I solve this error?


title: Allow variable amount of comments before pagination

text: There is an option in the admin settings allowing you to define how many comments should be listed before creating a new page for the next ones. I would like to have the same number of comments for all my posts unless it belongs to one specific category (where I would like to set a different number of comments before pagination). How can I do that?


title: Help with if statement inside while loop

text: I have the following snippet of code, basically I get the set value of id from the metabox, get the current id based on the loop, try and match, if htey match I want to pull the values from the matched id, currently i can only get the id, but i would like to get the associated custom field values of that post as well. Also I don't know why, even if it matches the value, it will still echo out the else statement twice, i guess cause it's in the while loops, but how do i get ride of that?               <?php                        $list_agent = get_post_meta( $post->ID,'ec_agents',true );                           $args = array( 'post_type' => 'agent_type');                                $the_query = new WP_Query( $args );                         $id = $post->ID;                         while ( $the_query->have_posts() ) : $the_query->the_post();                                  if ($id == $list_agent) {                                 echo "success";                                 the_title();                                      //Both Meta values not showing                                 echo get_post_meta( $post->ID,'_agent_phone',true );                                 echo get_post_meta( $post->ID,'_agent_email',true );                             } else {                                 echo "better luck next time";                             }                         endwhile;                              wp_reset_postdata();                         ?>


title: Single file upload

text: I would like to allow user to only upload one file at a time using the flash uploader interface. I found around here a link to a hack allowing to generate an error message when more than one file is selected but that's not what I want. I would like to only take the first file into consideration and just ignore the other files. Would it be possible?


title: Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins

text: I'm trying to adjust the comments screen for non admins to my project. Right now I'd like to disable **Quick Edit | Edit | History | Spam** under any comment left for any post created by the user. Thanks!


title: Storing Comment Meta as an Array

text:
I need to add multiple checkboxes to a post comment form (a Woocommerce product review form, to be exact) that allows people to choose which health condition the product is best for. Upon choosing X number of checkboxes and leaving a written comment, I need those values stored in the commentmeta table as an array. Then I need to print out each selected checkbox value inside that person's comment as an unordered list. Where I'm stuck is storing more than one checkbox in commentmeta. Here's what I have so far for creating the checkboxes:               add_action( 'comment_form_logged_in_after', 'additional_fields' );     add_action( 'comment_form_after_fields', 'additional_fields' );     function additional_fields () {              echo '
' .         ''. __('Conditions') . '*:
         ';              $conditions = array(             "cancer" => "Cancer",             "crohns" => "Chrons",             "fibromyalgia" => "Fibromyalgia"         );         foreach( $conditions as $condition )             echo '<input type="checkbox" name="condition" id="condition" value="'. $condition .'"/> '. $condition .'';              echo '
';          }      Then here's where I store the data:               add_action( 'comment_post', 'save_comment_meta_data' );     function save_comment_meta_data( $comment_id ) {              if ( ( isset( $_POST['condition'] ) ) && ( $_POST['condition'] != '') )             $filtered_condition = wp_filter_nohtml_kses($_POST['condition']);              add_comment_meta( $comment_id, 'condition', $filtered_condition );          }      This only stores one of the values, though. How do I get it to store the values of each selected checkbox as an array? Elsewhere in the site, I need to sort products by those values. So, if 2 products have had the Cancer checkbox selected, I'll output those 2 products on the page by querying which products have that meta value.


title: meta_query and strange orderby behaviour

text: this is my problem query, which picks all future or pending events.   Note that some posts only have _startdate without _enddate (1-day events).               $args = array(      'post_type'=> 'events',      'meta_query' => array(         array(         'key' => '_startdate',         'value' => $today,         'type' => 'DATE',         'compare' => '>='         ),         array(         'key' => '_enddate',         'type' => 'DATE',         'value' => $today,         'compare' => '>='         ),         'relation' => 'OR',         ),     'meta_key'=> '_city',      'orderby' => 'meta_value',      'order' => 'ASC',     ) ;      Everything works great until I change **_city** to **_startdate** or **_enddate**. Can you please help me with this query (to sort by _startdate ) ? Thanks


title: Get term name and term parent into custom post type permalink

text: **That i would like (for taxonomy page):** Current URL : myurl.com/commerce/artisans/boucherie/ What i try to do URL :myurl.com/commerce/artisans/alimentation/boucherie/ Alimentation is the parent of Boucherie. **That i would like (for single page) :** Current URL : myurl.com/commerce/artisans/alimentation/singlepost What i try to do URL : myurl.com/commerce/artisans/alimentation/boucherie/singlepost Alimentation is the parent of Boucherie. Thank you for your help. This is my code:                    //This code tells WordPress when to run our setup function     add_action('after_setup_theme', 'map');          function map(){          //setup slider post type     //Set the names of the labels for the Post type interface      $post_labels = array(             'name' => 'Carte',             'singular_name' => 'Carte',             'add_new' => 'Ajouter un point carte',             'add_new_item' => 'Ajouter un point carte',             'edit_item' => 'Editer un point carte',             'new_item' => 'Nouveau point carte',             'view_item' => 'Afficher un point carte',             'search_items' => 'Rechercher un point carte',             'not_found' =>  'Aucun point carte',             'not_found_in_trash' => 'Aucun point carte trouves dans la corbeille',             'parent_item_colon' => ''         );               //Setup the rules for this post type. You can read more about what each of these do in     //the WP codex under register_post_type().         $post_args = array(             'labels' => $post_labels, //Add the labels that we set above             'public' => true,             'publicly_queryable' => true,//hide this post type from being accessed directly             'show_ui' => true,             'show_in_menu' => true,             'query_var' => true,             'rewrite' => array('slug'=>'commerce/artisans/%map_categories%','with_front'=>false),             'capability_type' => 'post',             'hierarchical' => false,             'supports' => array('title','editor' ), //specify what items the post type supports.             'has_archive' => false,             'menu_icon' => get_stylesheet_directory_uri() . '/map.png',         );         //register the post type using the arguments we have setup above.         register_post_type('map',$post_args);         register_taxonomy( 'map_categories', 'map', array( 'hierarchical' => true, 'label' => 'Categories', 'query_var' => true, 'rewrite' => array('slug'=>'commerce/artisans','with_front'=>false) ) );          }          function map_categories_link( $post_link, $id = 0 ){         $post = get_post($id);           if ( is_object( $post ) ){             $terms = wp_get_object_terms( $post->ID, 'map_categories' );             if( $terms ){                 return str_replace( '%map_categories%' , $terms[0]->slug , $post_link );             }         }         return $post_link;       }     add_filter( 'post_type_link', 'map_categories_link', 1, 3 );


title: Problems with functions.php! Error!

text:
Suddenly I got the message: > **Parse error: syntax error, unexpected T_CLASS in > /home/spandabe/public_html/wp-content/themes/modularity-lite/functions.php > on line 72** when opening my site www.spandabel.dk I only changed things in header.php, not in functions.php! And now I cannot do anything before I get this right! This is how my functions-php looks like:                   <?php     /**      * @package WordPress      * @subpackage Modularity      */          $themecolors = array(         'bg' => 'eeeeee',         'border' => 'eeeeee',         'text' => '111111',         'link' => '000000',         'url' => '000000'     );     $content_width = 950; // pixels          // Grab the theme options page     require_once ( get_template_directory() . '/theme-options.php' );          // Add default posts and comments RSS feed links to head     add_theme_support( 'automatic-feed-links' );          // Add post thumbnail theme support     add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 150, 150, true );          // Add a new image size     add_image_size( 'modularity-slideshow', 950, 425, true );          // Register nav menu locations     register_nav_menus( array(         'primary' => __( 'Primary Navigation', 'text_domain' ),     ) );          // Get wp_page_menu() lookin' more like wp_nav_menu()     function modularity_page_menu_args( $args ) {         $args['show_home'] = true;         $args['menu_class'] = 'main-nav';         return $args;     }     add_filter( 'wp_page_menu_args', 'modularity_page_menu_args' );          // Give Modularity a custom background     add_custom_background();          // Allow custom colors to clear the background image     function modularity_custom_background_color() {         if ( get_background_image() == '' && get_background_color() != '' ) { ?>                                  <?php }     }     add_action( 'wp_head', 'modularity_custom_background_color' );          // To use a sidebar, or not to use a sidebar, that is the question. This generates the appropriate class     function modularity_sidebar_class() {         $options = get_option( 'modularity_theme_options' );              if ( $options['sidebar'] == 1 ) {             echo "15 colborder home";         }         else {             echo "24 last";         }        }          // The header business begins here:          // No CSS, just IMG call     define('HEADER_TEXTCOLOR', '');     define('HEADER_IMAGE', '');     define('HEADER_IMAGE_WIDTH', 950);     define('HEADER_IMAGE_HEIGHT', 250);     define( 'NO_HEADER_TEXT', true );          function modularity_admin_header_style() {     ?>          <?php     }          add_custom_image_header( '', 'modularity_admin_header_style' );     // and thus ends the header business          // Comments in the Modularity style     function modularity_comment( $comment, $args, $depth ) {         $GLOBALS['comment'] = $comment;         switch ( $comment->comment_type ) :             case '' :         ?>         <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">             <div id="comment-<?php comment_ID(); ?>" class="comment-wrapper">
                     <?php echo get_avatar( $comment, 75 ); ?>
                         <?php comment_author_link(); ?>

                     <?php if ( $comment->comment_approved == '0' ) : ?>                         <?php _e( 'Your comment is awaiting moderation.', 'modularity' ); ?>
                     <?php endif; ?>                     <?php comment_text(); ?>
                         <?php                             /* translators: 1: date, 2: time */                             printf( __( '%1$s at %2$s', 'modularity' ), get_comment_date(),  get_comment_time() ); ?><?php edit_comment_link( __( '(Edit)', 'modularity' ), ' ' );                         ?>

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

              <?php                 break;             case 'pingback'  :             case 'trackback' :         ?>

<?php _e( 'Pingback:', 'modularity' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'modularity'), ' ' ); ?>
         <?php                 break;         endswitch;     }          // The Sidebar business     $options = get_option( 'modularity_theme_options' );     if ( $options['sidebar'] == 0 ) {         $optional_description = __( 'The optional Modularity Lite sidebar is currently deactivated but can be activated from Appearance > Theme Options', 'modularity' );        } else {         $optional_description = '';      }          if ( function_exists('register_sidebar') ) {         register_sidebar(array(             'name' => 'Sidebar',             'id' => 'sidebar',             'description' => $optional_description,             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));              register_sidebar(array(             'name' => 'Footer 1',             'id' => 'footer-1',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));              register_sidebar(array(             'name' => 'Footer 2',             'id' => 'footer-2',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));              register_sidebar(array(             'name' => 'Footer 3',             'id' => 'footer-3',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));              register_sidebar(array(             'name' => 'Footer 4',             'id' => 'footer-4',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));      }                    // Load Base Javascripts     if (!is_admin()) add_action( 'init', 'load_base_js' );     function load_base_js( ) {              wp_enqueue_script('jquery');         //wp_enqueue_script('jquerynav', get_bloginfo('template_directory').'/js/nav.js', array('jquery'));         wp_enqueue_script('cycle', get_bloginfo('template_directory').'/js/jquery.cycle.js', array('jquery'));         //wp_enqueue_script('search', get_bloginfo('template_directory').'/js/search.js', array( 'jquery' ) );          }          // Load Dom Ready Javascripts     function load_dom_ready_js() { ?>                        <?php }     add_action('wp_head', 'load_dom_ready_js');      Does anybody have an idea what has happened?? Thanks in advance! / Anne btw - the theme I'm using is Modularity Lite


title: How can I save a multiple select array with the settings API for a plug-in options page?

text:
I'm thinking this may be more of a problem with my PHP rather than my use of the settings API, but I can't seem to get Wordpress to save an array of data for a multi-select box. The multi-select box corresponds to a custom meta field, and the select options are the custom post types that will display that meta field. Here is the display code:               case 'select2':               echo "<select id='$id' style='width:15em;height:10em;' class='select$field_class' name='" . $buddha_option_name . "[$id]' multiple>";               foreach($choices as $item) {                        $item = explode("|",$item);                   $item[0] = esc_html($item[0], 'buddha_textdomain');                        $selected = ($options[$id]==$item[1]) ? 'selected="selected"' : '';                   echo "<option value='$item[1]' $selected>$item[0]</option>";               }              echo "</select>";               echo ($desc != '') ? "
$desc" : "";          break;        `$choices` is defined here as 'choices':               $options[] = array(           "section" => "custom_meta",           "id"      => BUDDHA_SHORTNAME . "_meta_email",           "title"   => __( 'Email Meta Box', 'buddha_textdomain' ),           "desc"    => __( 'Select post types to have custom email meta box.', 'buddha_textdomain' ),           "type"    => "select2",           "std"    => print_r($buddha_option_name[$id]),           "choices" => array( __('Posts','buddha_textdomain') . "|post", __('Pages','buddha_textdomain') . "|page", __('Faculty/Staff','buddha_textdomain') . "|staff", __('FAQ','buddha_textdomain') . "|faq", __('Documents','buddha_textdomain') . "|docs", __('Courses','buddha_textdomain') . "|courses" )       );      And the validation code:               case 'select2':                      // process $select_values                          $select_values = array();                          foreach ($option['choices'] as $k => $v) {                              // explode the connective                              $pieces = explode("|", $v);                                   $select_values[] = $pieces[1];                          }                      // check to see if selected value is in our approved array of values!                      $valid_input[$option['id']] = (in_array( $input[$option['id']], $select_values) ? $input[$option['id']] : '' );                  break;       Currently, if I select more than one value from the multi-select field, WP will only save one value (usually the first alphabetical value). I need it to save more than one value in the array. I thought adding `[]` to the end of `[$id]` might help, but no.


title: I need to find which is the file that checks the DB for correct login (username, password)

text: I let users to register in my page, however I want to improve the password security that is saved in the DB. For this I need to find out which is the file that makes the query   `where pass=pass and login=login` Which one is it? Thank you.


title: Clickable image link sends people to wrong URL

text:
On my website www.wilsonstransportation.com, on the header of our custome theme page, we have a "Get a Quote" image on the right hand side. When you click it, it is taking people to http://wilsonstransportation.com/wp- content/themes/wilsons/contact-us/get-a-quote . It should be sending people to www.wilsonstransportation.com/contact-us/get-a-quote . We are losing quite a bit of business because of this. In the header.php, this is what shows up:
     <a href="<?php bloginfo('template_url'); ?>/contact-us/get-a-quote" class="">      how do I change the URL to go to the normal page again? This all of a sudden changed when we updated a few wordpress things. HELP


title: How to prevent new terms being added to a custom taxonomy?

text: I've created some custom taxonomies using register_taxonomy, but I want to prevent new terms from being added. I noticed that there is a 'capabilities' argument available in register_taxonomy, is that what I should be using and if so, how would I use it? Here's some of my code, I'm using a plugin I created to add the taxonomies (hence the public static function part). Is there an easy way to prevent new terms being created for my taxonomy? Thanks Osu               public static function register_directory_styles_taxonomy()         {             $labels = array(                 'name'                      => 'Music styles',                 'singular_name'             => 'Music style',                 'search_items'              => 'Search music styles',                 'all_items'                 => 'All music styles',                 'parent_item'               => 'Parent music style',                 'edit_item'                 => 'Edit music style',                 'update_item'               => 'Update music style',                 'add_new_item'              => 'Add new music style',                 'new_item_name'             => 'New music style',                 'choose_from_most_used'     => 'Choose from most used music styles'             );                  $args = array(                 'hierarchical'  => true,                 'labels'        => $labels,                 'rewrite'       => false                 // 'show_ui'        => false             );                  register_taxonomy( 'ibmstyles', 'ibmdirectory', $args );         }


title: WordPress Comment spam issue

text: I'm Trying to completely disable WordPress Comments. I have manually disabled comments via the WordPress back-end setting and I also created a new blank file called "no-comments-please.php" and then I added the below to my functions.php. Yet the comments show up in their numbers.               add_filter( 'comments_template', 'remove_comments_template_on_pages', 11 );     function remove_comments_template_on_pages( $file ) {     if ( is_page() )     $file = STYLESHEETPATH . '/no-comments-please.php';     return $file;     }


title: how to implement next/prev within category archive?

text: I click on a link in my WP site to open a category archive. I see a list of posts for that category. I click on the permalink of one of those posts to see the full post. at the top of the window are prev/next arrows. I click on them expecting to be taken to the prev/next post within the same category, but that doesn't happen. I'm taken instead to the prev/next post within the post_type=post collection of posts. is it possible to set up the system so that when a post is displayed from a category archive, clicking on the prev/next buttons takes the visitor to the prev/next post within the same category?      ### update I apologise for the lack of detail.   for those people who need more information...   the category archive/listing currently loads a default 'index.php' template.   each post within the archive list has a permalink link.   the permalink link loads a default 'single.php' template (note. there can only be one permalink per post) Michael is correct. the theme is using the next_post_link() and previous_post_link() functions. the in_same_cat parameter is interesting but not really useful because it refers to the categories of the currently viewed post, not the category currently being viewed. a method would be needed to indicate that a specific category is being viewed, and it's id, so that the current page could point to the previous/next posts in that specific category rather than the complete collection of posts. I'm wondering if the permalinks would need to be adjusted on the category archive page to indicate that a category is being perused; eg, add a query to the permalink; '&cat=7'. the single.php page could then check for presence of the query variable and react accordingly. if this method was used, would I need to use a non-core variable to prevent WP from loading the wrong template? or... would it make sense to create a category.php page with a loop of only one post per page? again, my apologies for not giving specifics in the initial question. cheers,   Gregory


title: Weird: /?name in URL leads to blog

text: This is a strange behavior I can't come up with a good explanation for: **If you append`/?name` to a WordPress URL, it is loading the blog page.** I came up with it by creating a custom Aweber "thank you" page, which is supposed to load at http://mydomain.com/thank-you. However Aweber appends a lot of information to the URL via query strings, so the URL ends up being something like: `http://mydomain.com/thank- you/?email=my%40email%2ecom&from=my%40email%2ecom&listname=name&meta_adtracking=location&meta_message=1&meta_required=email&name=&submit=Submit` This doesn't open the thank you page but the blog. As soon as I remove the `name` part, it loads the correct page. And reverse engineered: every WordPress page seems to load the blog if `/?name` is appended to the URL. See:   * rollingstones.com (I'm not allowed to post 2 links)   * rollingstones.com/?name (Interestingly enough the rolling stone example doesn't affect pages. `/band/` stays `/band/` even when going to `/band/?name`. In my example it also affects the page) Any ideas where this behaviour comes from, and how to overcome it? Thanks!


title: Using Ajax in the prev_posts_link and next_posts_link

text: I am using the add_filter() function in my functions.php file, to give my prev_posts_link and next_posts_link individual classes. The following code successfully loads the individual classes, prev_button and next_button.               add_filter('next_posts_link_attributes', 'posts_link_attributes_1');     add_filter('previous_posts_link_attributes', 'posts_link_attributes_2');          function posts_link_attributes_1() {     return 'class="prev_button" onclick="javascript:ajax_loadContent(\'box-right\',' .      next_posts_link() . '");return false"';     }          function posts_link_attributes_2() {     return 'class="next_button" onclick="javascript:ajax_loadContent(\'box-right\',' .      previous_posts_link() . '");return false"';     }      I am also using the `onclick="javascript:ajax_loadContent(\'box-right\',' . previous_posts_link() . '");return false` code to load posts in my box-right DIV, using Ajax. Unfortunately, when I use `. previous_posts_link() .` in with my onclick attribute, it only gives me the `.../posts.php` instead of `...posts.php?paged=2` Any idea what I have done wrong? Thanks.


title: sort by name (slug) custom post type

text: What's wrong in this query ? the sortby=name doesn't change anything.               $the_query = 'posts_per_page=-1&sortby=name&order=ASC&post_type=mycustom&custom_cat=mycat';     // query is made                    query_posts($the_query);


title: How to send form values from the script in functions.php and not from the form on my website?

text: I have a form on my website and depending on if the user check paypal or wire- transfer the form action should always go to functions.php where I have this simple check at the end of the file:               if ( isset( $_POST['submitted'] ) && isset( $_POST['post_nonce_field'] ) && wp_verify_nonce( $_POST['post_nonce_field'], 'post_nonce' ) ) {          // CODE AFTER SUBMIT HERE           }      So, my question is how do I do some stuff using an if condition in my functions.php before posting the form to PayPal? Because all tutorials have form action `https://www.sandbox.paypal.com/cgi- bin/webscr` How could I send all the post info from the formular (I can grab the values and stoere them in variables) via this address `https://www.sandbox.paypal.com/cgi-bin/webscr`? Is it somehow possible doing this and not using form to send the values there? **Does WordPress have any function to send post request to a distant url?**


title: How to use mysql IN statement with wpdb update method?

text: I am using wpdb update method and wish to update records where the id is not found within multiple ids. So if I wanted to update records where each had an id of `1` I would do for example:               $wpdb->update(                  'wp_my_tables',                  array(                      'active' => 0                 ),                  array( 'id' => 1 ),                  array(                      '%d'                 ),                  array( '%d' )              );      But how would I edit that so it does NOT update values where the ids are for example `1,2,3` ?


title: Wordpress templates bug

text: I have a WP problem that's driving me crazy. I have created several templates, and it decides to switch them all the time... I think it does when I create a new template file, but it never did that before. I'm scared that it's actually when I edit a post that it messes up some other page because if it is, I'll have a mad client on the phone every other week so I'ld like to know if anyone know what the problem might be... PHP files names are structured like that : template-something.php They are directly on my theme's folder. Inside these I put this comment :               /* Template Name : Page Something */      And then it's usual php... Anyone know how this could happen ? I have used templates several times and never had this problem...


title: `wp_editor()` CSS messing up the jQuery Dialog

text:
I have a custom admin page that includes both the user of `wp_editor()` and a jQuery dialog. For reasons unknown to me, the instance of `wp_editor()` uses some of the same css class names as dialog, and one in particular (`ui-widget-overlay`) is messing up my jQuery dialog. I'm unable to interact with the dialog due to the `z-index` of the overlay as set by `editor.css`, and the overlay is darker, with a stripe in the middle. Has anyone encountered this issue before? If so, how did you work around it?               function do_refreshing_invitees_dialog(){     ?>

                 <img src="<?php echo $this->loader_path; ?>ajax-loader-bulk-dialog-invitees.gif" />

Please wait while the refreshed invitee's are generated...

     <?php     }      ![Dialog working fine, but CSS messed up by wp_editor\(\)](http://i.stack.imgur.com/pchOZ.png)


title: Bogus postings to my blog

text: Are you folks addressing the ultra vexing question of bogus posts to our blogs. As I understand it, as the blog owner, I am the only one who can post to it; others may comment on what I post, but not post themselves. Yet every day, mysteriously, posts appear at my blog contributed by bogus users. Do you know to what I am referring, and if so, is there a fix? And it's getting worse and worse by the day. I've been reduced to considering moving away from WP and embracing some other system.


title: Listing all post from different custom post type for the logged in user

text: I'm trying to show in a list page all the post that the current logged in user could have created in differents custom post type (5) For exemple : the user makes a new post using a form using new_post.php and it's added in the WP custom-post-type 'Cookies' if it's what he selected from a dropdown list. Then the user want to see his post so i'd list him all the post he made no matter what custom-post-type he posted to. Thks in advance for the help


title: setcookies and header send

text: I put simple php condition in the header.php of template as this :               setcookie("test_time_".$cookie_id."", $cookies_times, time()+3600);      The result always as this **headers already sent** , i use this inside plugin and also i try outside the plugin and the result always the same It´s possible use cookies in header or what can i do for fix this problem , i need use cookies for works little function


title: Media Library not showing images when adding to Posts (but retrieving image info via ajax)

text: When uploading an image to a post/page, the media library doesn't display any images (when there are some), and then 'fails' when you try and upload (although the image is actually uploaded). I've checked file permissions (everything is owned by the server which has full and appropriate access; i've event tried setting it to 777), and deactivated all plugins and tried switching themes. None of which helped. this happens even with 2013 active. The strange thing is that I can see the ajax request in the inspector, and it's retrieving all the information about the images ( from the `wp- admin/admin-ajax.php` request), in the `data` object. So wordpress should know it's there.... I just upgraded to 3.6 to see if it fixed the problem (which started in 3.5.2), but nothing has changed. I'm using nginx, not apache; Does anyone have any idea about what could be failing here and/or what could be causing this? (even somewhere to start looking would b super helpful). I've tested with a fresh DB and it's still happening.


title: Wordpress Multisite - Can 2 domains share a database of users?

text: I'm creating a Wordpress site for a client. In the future, my client would like to have a second site that uses Wordpress as well. Ideally, we'd like people that have accounts on the first site to be able to use that same account on the second site. Is this something that can be achieved with Wordpress Multisite? If so, how? The kickers is that each site would need to have it's own domain. For example, http://www.firstblog.com and http://www.secondblog.com would be two different sites sharing the same user accounts. Any help or insight would be greatly appreciated.


title: Sell "create a post", paid account for post creation

text: How can in wordpress, one sell the "create post" option To elaborate more. One has to pay an amount before he can make create a post on the wordpress site. MORE ELABORATION Suppose a person pays $20, he gets to write a post on wordpress. This is just like a paid listing website. If the person wants to create another post, he has to pay another 20 Bucks.


title: WordPress Multisite Network installation and dev questions

text: Please go easy on me. I'm a clutzy dinosaur. I currently have a large, unwieldy website hand-coded in html/css with php includes. It currently has a single WP installation in a subdirectory. The plan is to reorganize, and I want to use WP as the CMS and incorporate 3 WP blogs for 3 subdomains. Ideally, would like to create a WP multisite network to allow for further expansion and to save admin trouble. I just want to confirm that if I install WP in the root directory and create 3 blogs (in subdomains), does this mean my website's home page is the mother blog's index.php? Essentially, I will have created 4 blogs - mother at root and 3 children in subdomains? How to set this up on my Mac (OSX 10.5.8) running MAMP for development? And then how to migrate to server without breaking?


title: wp_signon( $creds, false ); not working

text: In my multisite i'm using a custom blog registration using : `wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);` and the site creation is successfull. and i want users automatically sign into their site admin panel on signup,for that i use :               $creds = array();     $creds['user_login'] = $_POST['username'];     $creds['user_password'] = $_POST['password'];     $creds['remember'] = true;          $user = wp_signon( $creds, false );          if ( is_wp_error($user) )        echo $user->get_error_message();      But this will return an error : _ERROR: The password you entered for the username mysite is incorrect. Lost your password?_ i need auto signin without using a plugin!!! Please help...


title: the post thumbnail, scale

text: I'm trying to figure how to scale the_post_thumbnail to a specific width? Can you guys help? Currently I'm using               <?php             //Resize post thumbnail             $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'single-post-thumbnail' );             $thumbnailHeight = $thumbnail[1];             $thumbnailWidth = $thumbnail[2];             if($thumbnailHeight != 0){                 $ratio = $thumbnailWidth/$thumbnailHeight;                 $width = 220;                 $height = $width * $ratio;             }else{                 $height = $thumbnailHeight;                 $width = $thumbnailWidth;             }         ?>      And printing the thumbnail with                <img src="<?php echo $thumbnail[0]; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>"/>      It works but.... Thanks!


title: Change Post and CPT author on the fly while publish the post

text: I am developing my site and require to change post author id on the fly while publishing. All post will be write and publish by admin but as content provided by different author and need to change post author id from admin to other author ( author id will get from custom field ) So how to do this on the fly while publishing. Here is my theme metabox.php code I am using wpalchemy metabox script and below code is in my cpt loop php file               // getting custom field value from image_artist     // this is giving value like artist_login_name / id     $png_gallery_meta->the_field('image_artist');     $artist_info = $png_gallery_meta->get_the_value();          // to separate artist_login_name and id     $string = $artist_info;     $artist = substr($string, 0, stripos($string, "/") );          // getting first name and last name from user id     $author_first_name = get_userdata(basename($string))->first_name;          $author_last_name = get_userdata(basename($string))->last_name;      So I am using above code to get user info from custom field dropdown selection box. Now how can I use above value to change id on the fly while admin publish the post the post author id should change with above id value get from selection box. I hope now it is more clear.


title: WP_Query not returning correct result with meta_query parameter

text:
I've got the following loop on my index.php template:
                      <?php                  $args = array(                      'meta_query' => array(                         'meta_key' => 'is_url',                          'meta_value' => 'yes',                          'meta_compare' => 'NOT LIKE'                     ),                 );                      $main_query = new WP_Query( $args );                 while ( $main_query->have_posts() ) : $main_query->the_post();                 ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<a href="<?php the_author_link(); ?>"><?php the_author(); ?><?php echo the_time(); ?>
                 <?php the_excerpt(); ?>                      <?php endwhile; wp_reset_postdata(); ?>
      The query should return all posts that do not have the custom field 'is_url' set to 'yes'. It is returning all posts, regardless of the value of is_url. I usually use Custom Post Types for this sort of thing, so I haven't used the meta_query too extensively. Anybody know what I'm doing wrong?


title: Contact Form 7 Custom module

text:
I am using a custom post type name `venue` and I am using a `<select>` dropdown on one of the contact form by loading up a custom module in CF7 but when the form is submitted, my data shortcode is not replaced with the data filled by the user. I just see this `[selected-venue]`. Here is my code for custom module:               <?php          wpcf7_add_shortcode( 'party-venue', 'wpcf7_venue_shortcode_handler', true );          function wpcf7_venue_shortcode_handler( $tag ) {              global $wpdb;              $query = "SELECT post_title FROM {$wpdb->posts} where post_type = 'venue' and post_status = 'publish';";              $result = $wpdb->get_col( $query );              if ( $result ) {             $output = '<select name="contact_venue" id="contact_venue" class="input-select">';             $output.= '<option></option>';             foreach ( $result as $venue ) {                 $output.= '<option value="'.$venue.'">'.$venue.'</option>';             }             $output.= '</select>';         }              return $output;     }      My contact form's code is               namePlease enter your full name[text* your-name class:input-textarea]      emailPlease enter a valid email address[email* your-email class:input-textarea]     phonePlease enter a phone number to reach you at[text phone class:input-textarea]     party size*Min 50 guests for free bottle, 15 guests for buy 1 bottle get 1 free*[text party-size class:input-textarea]
     venuePlease select your party venue[party-venue selected-venue id:contact_venue]     datePlease enter your party date (mm/dd/yy)[text date id:contact_date class:input-textarea]     How did you hear about us?Please select one of the options[select menu-367 class:input-select "" "CitySearch" "Facebook" "Facebook Ad" "Friend" "Google Search" "NYC Daily Deals" "Yelp"]          [submit class:input-submit]      And here is my message body:               From: [your-name] <[your-email]>     Subject: Book a party!          Message Body:     Phone: [phone],      Party Size: [party-size],      Venue: [selected-venue],      Date: [date]     How did you hear about us: [menu-367]      When I get the email on form submission, `[selected-venue]` is not replaced with the actual value of the select dropdown. What I am doing wrong?


title: view queries made?

text: I know I can use `get_num_queries()` for the number of queries. However, how can I see what queries Wordpress actually makes? I've tried using $query but that didn't work.


title: Querystring parameter getting lost in rewrite rule

text:
I have successfully added a custom post type and the permalink structure works great. So, for instance, I've got a custom post type `books`, and the permalink to a book is `/books/the-dictionary`. My `single-book.php` page template accepts a `letter` parameter to customize the content displayed on the page. I'd like to be able to link to this like `/book/the-dictionary/q`. I've added the following to my theme's functions.php file:               function my_init() {         add_books_rewrite();          function add_books_rewrite() {         add_rewrite_rule("books/([^/]+)/([^/])/?$", 'index.php?pagename=$matches[1]&letter=$matches[2]', "top");         global $wp_rewrite;         $wp_rewrite->flush_rules();     }     function add_books_query_vars($query_vars) {         $query_vars[] = "letter";         return $query_vars;     }     add_filter("init", "my_init");     add_filter("query_vars", "add_books_query_vars");      It took a few tries with using the flushing code above, manually going to the permalink settings page and saving, and fixing stupid errors in the regex, but eventually I was able to verify that the rewrite was added correctly by using Jan Fabry's fabulous rewrite analyzer plugin. ![confirmed in rewrite analyzer](http://i.stack.imgur.com/GFYM8.png) So, from here I think it's smooth sailing, right? Yeah...not exactly. When I load up my site and go to `books/the-dictionary/q`, it does load `the- dictionary` content correctly, but it is losing the parameter. The thing that I find interesting is that if I load `index.php?pagename=the- dictionary&letter=q`, everything works great. To retrieve the parameter, I have the following code:               global $letter;     echo $letter. " - global";     echo "
";     $current_letter = (isset($wp_query->query_vars["letter"]) ? $wp_query->query_vars["letter"] : "all");     echo $current_letter . " - query_vars";     echo "

";      I've also been looking at `$_SERVER["QUERY_STRING"]`. These are populated when I use `index.php?pagename...&letter...`, but not when I use `/books/pagename/letter`. So, it seems like a few things are happening here. WordPress isn't completely dropping the parameter since things work if I specify index.php with the appropriate querystring variables. This seems to indicate the rewrite rule isn't working correctly. However, the Rewrite Analyzer plugin seems to say things are set up properly for what I'm going for. I'm a bit confused at what I should be looking at here to fix the disconnect. Sorry if I'm missing something obvious. ):


title: Looking for a hook to add attachment information to the media library tab

text: I would like to be able to determine if an image has been attached to a post by looking at the collapsed viewmedia library tab. Is there's a hook I can use to add that data to this view of the Media Libray tab? I've included a mock-up of what I'd like the media library to look like. ![enter image description here](http://i.stack.imgur.com/q1D7j.png) Is it possible to amend the current media library tab or would I have to create a custom tab to get this functionality?


title: Get most recent posts by category that aren't first overall

text: > **Possible Duplicate:**   >  Duplicate posts I'm trying to create a home page, in which there is a top posts section that displays the three most recent posts (for all categories), and category subsections that display the most recent posts for that category only. I know how to get that far, but I'm not sure how to make sure there isn't any overlap (I don't want any posts to show up both at the top and in the category section of the page). Is there an efficient way to do this?


title: Duplicate post issue on multiple category loops on one page (1 post)

text: > **Possible Duplicate:**   >  Duplicate posts I am building a homepage template and it has an area with 4 separate category loops in a grid layout. Each loop will only show one post. The posts that I will be working with have multiple categories assigned to them and we don't want to have more than one instance of a post displaying amongst the 4 loops. For example if my latest post is assigned to all of the 4 categories that are setup to loop on the homepage, how can we set a priority so that it only displays in one of the categories and not the other three? I tried excluding the 3 other categories inside of each of the loops but then it just skips over all posts until it finds one that only has one category assigned to it and that won't work for this project. Let me know if you need further clarification. Does anyone have any thoughts or ideas on this. Thanks, Andrew


title: Faster better ways of adding/updating images in Wordpress?

text: I've used/developed Wordpress for 7 years and one of the worst aspects of it is uploading images. It is a HUGE pain the ass. You have to go to the page, upload it through the dialog, then place it, blah blah. It's a massive waste of time and resources. I suppose you could just edit the images on the server directly. Has anyone found a better way to work with images on WP?


title: How to add H4 tag to the_content filter (after content)?

text:
I would like the H4 title to display before the loop starts and only once. The problem I'm having is that H4 tag title I've created either gets stuck in the loop or it displays on the top of the post, before the content, which is what I do not want. This is what I have.               //Related stock photo function     function custom_content_after_post($content){         if (get_post_type( get_the_ID() ) == 'portfolio') {                  //Query for the the related posts - portfolio custom post type             $loop = new WP_Query( array('post_type' => 'portfolio', 'posts_per_page' => 5, 'orderby' => 'rand'));             $sptitle = '
Related Stock Photos
';                  while ( $loop->have_posts() ) {                 $loop->the_post();                      $content .= '
';                 $content .= '
';                 $content .= '
';                               //Display post thumbnail assigned to it.                 $content .= '
';                 $content .= '' .get_the_post_thumbnail($page->ID, 'thumbnail'). '';                 $content .= '
' . get_the_title() . '
';                                  $content .= '
';                 $content .= '
';                 $content .= '
';             }         }         return $content;     }          add_filter( 'the_content', 'custom_content_after_post' );


title: Add Class After 4th Post

text:
I need to add a "div" after the 4th post. I am showing 8 posts on the page and the code i am using above shows the div after the 4th and 8th... o just need the 4th to show not every 4th, just after the first 4th.               <?php if (have_posts()) : $count = 0; ?>       <?php query_posts("showposts=8&post_type=vender_list&orderby=rand");?>        <?php while (have_posts()) : the_post(); ?>         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php echo eh_postImage(240,240,1); ?>          <?php the_title(); ?>          <?php the_content_rss('', FALSE, '', 60); ?>
     <?php if ($count % 4 == 3) { ?>

     <?php } ?>        <?php $count++;  ?>     <?php endwhile; endif; wp_reset_query();?>


title: How to include wp-load.php from any location?

text: I have a plugin which calls a stand-alone php script (myAjax.php) via a jQuery.ajax() script inside the plugin. I need to place the following code into the myAjax.php file:               require_once('../../../wp-load.php');          if (!is_user_logged_in()){         die("You Must Be Logged In to Access This");     }     if( ! current_user_can('edit_files')) {         die("Sorry you are not authorized to access this file");     }      However, I'd like a more bulletproof method of specifying the path to wp- load.php in case the actual relative path is different than my example.