title: Change get_current_user_id code to the author's profile

text: I've been modifying a long abandoned plugin project that provides a Stackoverflow inspired badge system for Wordpress. I have upgraded some of its code so it functions with the new Wordpress version. You can view the entire code here if you are interested: http://pastebin.com/kCWWLPL2 I want to add a code to the author.php page to list the author's awarded badges. So far, I have only managed to display the logged in user's badges with this working code:               <?php     $user_id = get_current_user_id();     if ($user_id != 0) {       rhb_list_badges(array('user_ID' => $user_id));     }     ?>      I was told to use this code to display the author's badges:               <?php     $author = get_user_by( 'slug', get_query_var( 'author_name' ) );      if ($author->ID > 0) {       rhb_list_badges(array('user_ID' => $author->ID));     }     ?>      But it does not return anything on the page. Why? What am I doing wrong here? How can I alter the working get_current_user_id code example so that it will **display the author's badges and not the logged in user's one**?


title: Is dynamic URL possible in Wordpress

text: I know the title seems little bit confusing, but what I am looking for is something possible in symfony or ror. I have a page with this URL: `http://mydomain.com/job/`. Now I want this URL structure `http://mydomain.com/job/php-developer/45`, `http://mydomain.com/job/java- developer/46`. Now the parameters after `/job/` are dynamic, and they are not any page or post, they fall under a page `job` Is this possible in Wordpress? **UPDATED QUESTION:** Ok as per @Gioia's answer I updated my code. Below is my code:               add_filter('query_vars', 'add_query_vars');     function add_query_vars($aVars) {         $aVars[] = "job_title";          $aVars[] = "job_id";          return $aVars;     }          add_action( 'init', 'add_rules' );       function add_rules() {         add_rewrite_rule('^/job/([^/]*)/([^/]*)/?','index.php?page_id=13338&job_title=$matches[1]&job_id=$matches[2]','top');     }      So now this is throwing me 404 page when I try this URL `http://mydomain.com/job/php-dev/45`. But when I try this URL `http://mydomain.com/index.php?page_id=13338&job_title=php-dev&job_id=45` it works.


title: which is the best way to customize nav-menu-template.php?

text: I have modified the function `start_el` in `nav-menu-template.php` substituting `$item->ID` with `$item->title` so that the html `li` elements in menu have a more readable class names. In detail, I have changed the line               $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );      to               $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->title, $item, $args );      This makes the editing of the `style.css` file for a theme easier. I wonder if it is possible to "transfer" the change from `nav-menu-template.php` to the theme (maybe `functions.php`?), so that I will not be forced to modify the file every time I upgrade WP version.


title: Removing side bar widgets from GovPress theme

text: ![enter image description here](http://i.stack.imgur.com/mBTkh.jpg) I'm using the GovPress theme, I've created a child theme. I now want to remove the sidebar widgets, as they are no use to me. I've read multiple articles online, but none of them work. I believe I need to create a functions.php in my child theme, but what needs to go into this file?


title: When importing a database any page with a wp_query in doesn't work

text: I've noticed this a lot, when I export a database from a test site and import it into a live site, any (or most) page with a wp_query in it doesn't show up correctly (It shows the theme, but as though I'm viewing a page with no content in) But if I create another page, using the same template as the one with the wp_query in it works just fine (As long as I don't give it the same slug). It also works correctly if I simply rename the page slug Does anyone know why this might be? This is a sample wp_query that I use;               <?php         $args = array(             'post_type' => 'offers',             'posts_per_page' => -1,             'order' => 'asc'         );         $offer_query = new WP_Query( $args );         while ( $offer_query->have_posts() ) : $offer_query->the_post();     ?>              <!-- SOME FANCY CONTENT HERE -->          <?php endif; wp_reset_postdata();?>


title: User registration add user ID?

text: I have created a custom user registration template for my WP website, based on this code: http://www.tutorialstag.com/create-custom-wordpress-registration- page.html. Now I was wondering if it is possible to add the user ID to the username. The reason I want this is that when a user registers, the (new) user is never a duplicate. So when a new user has the same username as an already registered user, no errors are shown, but the new user is created normally by adding the user ID / or maybe some other random number? Anyone who can help me further? Thanks.


title: Multiple Wordpress Pages

text: Not sure how to approach this one. I have a wordpress page that uses a mysql query to grab info from a database based on the page title. I basically want to replicate that page to 50 or so different pages all with different titles but the same page code. What would be the best option for doing something like this?


title: How to have multiple archive pages?

text: I am building a site that needs pages such as News, Events, Projects and People. My question is, how should I achieve this in WordPress? Do I use custom post types? And if so, how do I have a page for each?


title: How to remove title (home) from static page skeleton template

text: I am trying to remove the page title (home) from my index page. I made my home page my static page. I am using the skeleton theme https://github.com/simplethemes/skeleton_wp I'm new to wordpress so I hope I'm explaining this right.


title: How can i display 3 post types in same page?

text: How can i display 3 post types in same page search results. http://cinema.trancelevel.com/ For example i have post_type1-Movies post_type2-Trailers post_type3-Subtitrari Wen i search i want to display the search results.. Ex: i Search for Battleship Movie. I want the search results to display somting like this 1.)The movie: Battleship 2.)The Trailers: - Battleship HD - Battleship Trailer Oficial 3.)The News All the news that contain the word Battleship. Or.. how can i display for each post_type diferent themplate... EX: For Movies it show fine: -http://cinema.trancelevel.com/?s=Battleship&post_type=post For Trailers it show the teme of movies: -http://cinema.trancelevel.com/?s=Battleship&post_type=trailers Wath i use in Search               <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">     <input class="search_input" type="text" name="s" id="s" value="Cauta filme, subtitrari, trailere, stiri" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>         <select name="post_type" class="search_select">             <option value="post">Alege:</option>             <option value="post">Filme</option>             <option value="persoane">Actori</option>             <option value="trailers">Trailere</option>         </select>         <input type="submit" id="searchsubmit" class="search_buton" value="Cauta" />     </form>


title: Best way to handle a form post in plugin

text: I'm doing a plugin that needs to be able to post data to a third party API. Users will fill out a form and press submit. The form itself - would it be "correct" to simply append html to a page content with a the_content() filter? I'm adding the form based on a bunch of settings saves as meta for each page or post. I'd like to avoid tampering with templates... With other words; if some meta is set for the page - append some html (the form that users will input data to). Also - when users press "submit" in that form - how should I handle the request? Right now I'm thinking that I will load wordpress in a totally separate php-file (in order to get my hand on all those funky wp-functions and constants) - but that feels kind of wrong... Is there a build-in way to both display the form and then handle the request? Thank you very much!


title: Style wp_list_categories

text: I think this is a fairly simple question and im sorry if it is but how would I add a `<div>` to each individual category within this code:                   <?php     $taxonomy = 'category';     // get the term IDs assigned to post.     $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );     // separator between links     $separator = ',';          if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) {              $term_ids = implode( ',' , $post_terms );         $terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy . '&include=' . $term_ids );         $terms = rtrim( trim( str_replace( '<br />',  $separator, $terms ) ), $separator );              // display post categories         echo  $terms;     }        ?>      I want to add `<div class="btn-standard">` to each category. Please note that I only want to display the categories relavent to the post.


title: Thickbox hacking - removing fields

text: ## Default (big and ugly) Thickbox I don't like how this Thickbox's page looks at all, I almost never use all these settings fields so decided to get rid off them, at least on pages where I'm uploading images as theme options. ![enter image description here](http://i.stack.imgur.com/rREMu.png) ## A (very) simple Thickbox Using attachment_fields_to_edit & media_upload_tabs filters I made it look much simpler: ![enter image description here](http://i.stack.imgur.com/UV6c5.png) If you're wondering how to do that (these filters/hooks are poorly explained), here's the code:               function thickbox_fields($form_fields, $post){         unset(            $form_fields['post_title'], //disables "Title" field and so forth...            $form_fields['url'] );            $form_fields['image_alt'],             $form_fields['post_excerpt'],             $form_fields['post_content'],             $form_fields['align'],             $form_fields['image-size'],          );              return $form_fields;     }          function thickbox_upload_init(){         add_filter('attachment_fields_to_edit', 'thickbox_fields', 10, 2);     }          add_action('admin_init', 'thickbox_upload_init');      ## The trouble Unfortunately after deleting image-size and url fields I'm not sure how to overwrite its values with desired content (in this case the url and image-size set to "full", always). I'm uploading things based on this simple yet powerful tutorial using this code on admin page:               jQuery(document).ready(function() {          jQuery('#upload_image_button').click(function() {      formfield = jQuery('#upload_image').attr('name');      tb_show('', 'media-upload.php?type=image&TB_iframe=true');      return false;     });          window.send_to_editor = function(html) {      imgurl = jQuery('img',html).attr('src'); //imgurl is always empty after deleting url field      jQuery('#upload_image').val(imgurl);      tb_remove();     }          });      And as comment states `imgurl = jQuery('img',html).attr('src')` is just empty, in addtion when I disable just image-size and leave url alone - its size is always set to "medium", any ideas how to fix that? I was trying to pass URL and image-size like this:                function thickbox_fields($form_fields, $post){             unset(                $form_fields['post_title'], //disables "Title" field and so forth...                $form_fields['url'] );                $form_fields['image_alt'],                 $form_fields['post_excerpt'],                 $form_fields['post_content'],                 $form_fields['align'],                 $form_fields['image-size'],              );                  $form_fields['url'] = 'not sure how to get the url here, but this doesnt work anyways';             $form_fields['image-size'] = 'full'; //yup, this also doesn't work at all                  return $form_fields;         }      I know these fields are arrays, but `$form_fields['image-size'] = array('size' => 'full')`, doesn't work either. Any hints? **TL;DR** - how to hide url and image-size fields from Thickbox and then send value of url field's to front-end? Also, how to force Thickbox to upload files as "full", because with image-size unset it returns links to medium-sized uploads all the time. I guess image_size_input_fields filter could be helpful.


title: Why does WP load so many files in the head of source code? How do I optimize it?

text: I have noticed that wordpress loads a bunch of files into the head of a site. This looks really sloppy and discloses vital information about the file structure of a website. Depending how many plugins are installed a site can easily have 10+ `<link>` and `<script>` tags. I understand how these files may work together, but it _does_ look excessive and unorganized. That said, is there a way to optimize this and somehow combine certain files to reduce the number of files loaded? There are benefits that can be gained from this, such as improved performance and security. If anyone has any suggestions please let me know.


title: Dynamically Populating Image/Excerpt/LInks from Pages in WordPress

text: I am after some guidance with the following HTML to WordPress conversion. Based on the linked image (see HTML Divs screen image), which has the following three divs, which will be individual pages within my WordPress site, after conversion, i.e.: see:> html Divs               1) Solar Pool Heating     2) Domestic Hot Water &     3) Solar Electric      Can somebody please let me know how through the use of the WordPress loop and built in functions, I can obtain the image for each div from the main page as well as an excerpt of the page content for each of the divs together with the "Read More" which would then take me to the actual page to read all of the page? I'm not sure if this is possible but I have always wanted to know how this can be done as this would assist my understanding of this area. Hopefully someone can assist. Thanks.


title: How to use the thumbnail size with catch_that_image

text: Im using `catch_that_image()` to grab the first image of posts and use that as a thumb in a loop but the thumb is only 40px/40px and the image has to be scaled dramatically so I'd like to figure out how to use the thumbnail size image that gets stored to reduce scale size. Here's the function.               function catch_that_image() {     global $post, $posts;     $first_img = '';     ob_start();     ob_end_clean();     $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content,   $matches);     $first_img = $matches [1] [0];          return $first_img;     }


title: How to debug 'Notice: Undefined index' on a Request['action']

text: I use the next code in order to save the options of my theme (by using the Wp Settings API), but when I debug it, I get the **'Notice: Undefined index: action'** error/notification. In order to fix it, I added "isset()" before the first $_REQUEST. Now the notification is not apperaring, but the options are not saved when I click the 'SAVE' button. What I'm doing wrong? How can I fix it? Thank you in advance.               function mytheme_add_admin() {     global $themename, $options;     if ( isset( $_GET['page'] ) && $_GET['page'] === basename(__FILE__) ) {         if(isset( $_REQUEST["action"] ) && $_REQUEST["action"] === 'save') {                 foreach ($options as $value) {                     update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }                 foreach ($options as $value) {                     if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }                 header("Location: themes.php?page=theme-options.php&saved=true");                 die;         } else if(isset( $_REQUEST["action"] ) && $_REQUEST["action"] === 'reset') {             foreach ($options as $value) {                 delete_option( $value['id'] ); }             header("Location: themes.php?page=theme-options.php&reset=true");             die;         }     }     add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');     }


title: querying a custom field

text: I'm trying to hack a plugin to show the contents of a custom field where its currently showing the title. how would I get this to show a custom field called restaurants instead? Thanks,                           $pois = $map->pois;                 foreach ($pois as $poi) {                     if ($marker_title == 'post')                         $poi->title = $query_post->post_title;


title: Strip Twitter Username from Profile Field with URL and Save to New Profile Field

text:
Let me start by saying, I am not a coder, but enjoy learning. Here is the situation. I have many custom profile fields for social media added to my user profiles. The user enters the full URL of their profile, then their information is displayed on their author page with their bio, profile image, all posts, etc. I also want to use ONLY the Twitter username so that when a user makes a post, the post will be automatically tweeted with their username using YOURLS: WordPress to Twitter plugin. This is a feature of YOURLS and I have no issue setting it up. I do not want to ask the user to enter their username in a separate field and I do not want to go in and manually edit each user. As well, I do now want this field to be visible to the user. From experience, I have found that many people are unclear as to their actual Twitter username. A lot of times they enter @Username or #Username or their complete profile URL or their profile URL without http:// instead of simply, Username. This is the main reason I changed the profile fields to require the full URL instead of simply the username. Ok, that's what I want. Here is what I believe I need and have done:   1. Create the custom field for user to enter their Twitter profile URL   2. Create the custom field to place the Twitter username once it has been stripped from URL   3. Strip the URL (using regex, I imagine)    4. Add the stripped username to the new field    5. Hide the field from the user   6. Add new field to YOURLS tweet template 1 - The custom profile fields were were created using (also removed other fields):               // Contact Info fields in profile     add_filter('user_contactmethods','new_contactmethods',10,1);     function new_contactmethods( $contactmethods ) {     $contactmethods['twitter'] = 'Twitter (Full URL)';     $contactmethods['facebook'] = 'Facebook (Full URL)';     $contactmethods['googleplus'] = 'Google+ (Full URL)';     $contactmethods['linkedin'] = 'LinkedIn (Full URL)';     $contactmethods['delicious'] = 'Delicious (Full URL)';     $contactmethods['flickr'] = 'Flickr (Full URL)';     $contactmethods['picasa'] = 'Picasa (Full URL)';     $contactmethods['Vimeo'] = 'Vimeo (Full URL)';     $contactmethods['youtube'] = 'YouTube (Full URL)';     $contactmethods['reddit'] = 'Reddit (Full URL)';        unset($contactmethods['yim']); // Remove YIM        unset($contactmethods['aim']); // Remove AIM        unset($contactmethods['jabber']); // Remove Jabber        unset($contactmethods['msn']); //Remove Messenger             return $contactmethods;     }      2 - The new custom field was created using:               add_action( 'show_user_profile', 'my_show_extra_profile_fields' );     add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );          function my_show_extra_profile_fields( $user ) { ?>

                 Twitter Username	                                  <input type="text" name="twitter_username" id="twitter_username" value="<?php echo esc_attr( get_the_author_meta( 'twitter_username', $user->ID ) ); ?>" class="regular-text" />

     <?php }      3 - Strip the Twitter username from the Twitter URL. This is where I have no idea what I am doing. I found this thread, but I am unfamiliar with regex. Regex - Extract Twitter Username from URL 4 - As well, once getting the Twitter username, I do not know how to add it to a separate field. I suppose this would also need to update whenever the Twitter URL field is changed as well... 5 - And I have used the following method to hide the field from all users who are not Admins (I have also hidden the entire "Personal Options" section)               //Hide Profile Page Options from all except Administrator     if (!current_user_can('administrator')){     function hide_profile_page_options() {     global $user;     $hide_profile_options = "";     print($hide_profile_options);     }     add_action( 'admin_head', 'hide_profile_page_options'  );     }       6 - twitter_username has been added to the YOURLS tweet template I hope everything is clear. If not, let me know and I will try to go more in- depth.


title: Displaying a full post instead of a slug per category?

text: I have a single category on my blog that I want to display full posts in when looking at the category instead of just slugs. The category is for Podcasts, and presently it displays slugs which:   * Do not display links to mp3 files   * Do not display the Google Reader Media Player I'm using Wordpress 3.0.4 with the Hybrid News theme.


title: How do I query multiple specific posts from a custom taxonomy?

text: WordPress 3.2.1. I want to query several specific posts that are part of a custom taxonomy. This is what my query looks like for retrieving one post, using the id for that post.               $args = array(         'post_type'=> 'portfolio',         'skill-type'    => 'the-letter-d, food, kids-meal',         'p' => 56     );     query_posts( $args );      This works for just getting one post, but I'm looking to get multiple posts. I've tried using 'post_in' => array(56,40,7...etc) in place of 'p'=> 56 and it didn't work. I'm assuming that doesn't work with custom post taxonomies or else I am just doing it wrong? I've also tried using the following, removing the terms list since it's not really needed.               $args = array(         'post_type'=> 'portfolio',         'post_in' => array(56,40,7)     );     query_posts( $args );


title: Change permalinks on move from one site to another

text: I'm in the finishing stages of moving a site from Wordpress.com to a privately hosted .org installation. I've purchased the site-redirect upgrade and this is working fine, however on the new installation I have (and would _like_ to have) a different permalink structure to the one offered on .com. I need to find a way to redirect on the new site, from the old permalink structure to the new (/%postname%-%post_id%.html). To make things more difficult, I'm running on IIS6 (sorry) and using the Helicon ISAPI_Rewrite plugin to use .htaccess - which has a different syntax to mod_rewrite. Docs are here: http://www.helicontech.com/isapi_rewrite/doc/ Can anyone help?


title: Category 'pad_counts' &  'parent' conflict

text:
Below is the current loop I have setup:                   <?php             //start products category loop             $args = array(                 'hide_empty'  => 0,                   'parent'      => 0,                 'orderby'     => 'name',                 'order'       => 'ASC',                 'taxonomy'    => 'profile_categories',                 'pad_counts'  => 1             );                  $categories = get_categories($args);             foreach($categories as $category) { ?>                 <?php                  // setup the category ID                 $cat_id = $category->term_id;                 // Get category name                 $cat_name = $category->name;                 // Get category count                 $cat_count = $category->count;                      //get the category url                 $cat_url = get_term_link( $category->slug, 'profile_categories' );                      echo "
";                 echo $cat_name;                 $subcat_args = array(                     'hide_empty'  => 0,                       'orderby'     => 'name',                     'child_of'    => $cat_id,                     'order'       => 'ASC',                     'taxonomy'    => 'profile_categories',                     'pad_counts'  => 1                 );                 $subcategories = get_categories($subcat_args);                 $subcat_count = count($subcategories);                 if ($subcat_count > 0) { echo ' ('.$subcat_count.' Subcategories)'; }                 echo "
";                      echo '';                 echo __('View all','roots');                 echo "";                      // Get posts belonging to current category                 $post_args = array(                     'posts_per_page' => 4,                     'post_type' => 'moulding_profiles',                     'tax_query' => array(                         array(                             'taxonomy' => 'profile_categories',                             'field' => 'id',                             'parent' => 0,                             'terms' => $cat_id                         )                     )                 );                 $posts_query = new WP_Query($post_args);                 if ($posts_query->have_posts() ) {                     echo '
';                         while ($posts_query->have_posts()) : $posts_query->the_post(); ?>
<a href="<?php the_permalink();?>"><?php the_title(); ?> -> Width: <?php the_field('mp_profile_dimensions_width',get_the_ID()); ?> Height: <?php the_field('mp_profile_dimensions_height',get_the_ID()); ?>
                         <?php endwhile;                      echo '
';                 } // done our wordpress loop. Will start again for each category                 wp_reset_query(); // reset the query ?>             <?php } // done the foreach statement ?>      What this does is list categories within a taxonomy called `profile_categories`, and then lists `4` items that are within each category. The category argument is using `parent => 0` so that only top-level categories are shown. What I'd like to do is also use `pad_counts => 1` to grab the count of not only the category, but all subcategories within that. So - if I'm thinking of this correctly, `parents` conflicts with `pad_counts`. I've looked through the codex about this and am stuck in the mud on if this is even possible - or if I'm that clueless and am missing something obvious. Any help would be greatly appreciated. Thanks! **Update** : Using http://codex.wordpress.org/Function_Reference/get_categories as a reference, when `parent` is set to `0` (to only show top-level categories), the `$category->count` and `$category->category_count` does not include the count of the sub-categories - still thinking this is a bug unless someone knows of a workaround.


title: How to load WP functions?

text: I have a `mymail.php` script which sends a email (I managed to do it using `require_once( $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/class-phpmailer.php' );`.) and outputs a plain text string (Such as "Email is sent successfully.") I want to use the functions defined in WP in this my script. The particular function I want to call is `get_option()` in order to retrieve the email user of the site owner. Which file to import for the particular `get_option()` function and which to import the entire WP core (like the context available for theme's .php files?


title: URL rewrite( I think? )

text: I have a URL: www.example.com/my_cool_pancakes. When a User goes to this URL, I would like the URL to instead be www.example.com/pancakes. How do I do this? Is this URL rewriting? I have studied URL rewriting, but I am still not sure about how it works, or even if it is the method I should use to do this. If it is, could you show me how? Thank you :) PS: www.example.com/my_cool_pancakes is an archive page template for a custom post type if that makes any difference.


title: Display Taxonomy Terms in an option tag with value being the slug

text: I have a custom taxonomy filled with terms that I wish to display in a fashion such as below.               <option value="[SLUG]">[TERM]</option>     <option value="[SLUG]">[TERM]</option>     <option value="[SLUG]">[TERM]</option>     ...      I have attempted to use "wp_dropdown_categories" but I was unable to find a way to change the value="[TERM_ID]" to value="[SLUG]" I also tried to use "wp_list_categories" and have it display with out the li's hoping there was a tag like "wp_nav_menu" has with 'before'=>'','after'=>'' but the documentation for "wp_list_categories" doesn't seem to support that. If you have any ideas on how to accomplish this it would be much appreciated.


title: Getting undefined index id error in theme

text: I am getting Notice: Undefined index: id on the line $id = $option['id'];   in my wordpress theme adminfunctions.php file Can you please help.               function of_option_setup(){             //Update EMPTY options             $of_array = array();             add_option('of_options',$of_array);             $template = businessgrow_get_option('of_template');             $saved_options = businessgrow_get_option('of_options');             $std = '';             foreach($template as $option) {                 if($option['type'] != 'heading'){                     $id = $option['id'];                     if (isset($option['std'])) {                     $std = $option['std'];                     }                     $db_option = businessgrow_get_option($id);                     if(empty($db_option)){                         if(is_array($option['type'])) {                             foreach($option['type'] as $child){                                 $c_id = $child['id'];                                 $c_std = $child['std'];                                 businessgrow_update_option($c_id,$c_std);                                 $of_array[$c_id] = $c_std;                              }                         } else {                             businessgrow_update_option($id,$std);                             $of_array[$id] = $std;                         }                     }                     else { //So just store the old values over again.                         $of_array[$id] = $db_option;                     }                 }             }             businessgrow_update_option('of_options',$of_array);         }


title: Wordpress Comment. Need some details of wp_comments DB table

text: Today I was doing some research on wordpress comments. **I am looking for making a Comment Type** which I can use as a review on wordpress custom post type which I use for business directory listings. Looking at the wp_comments table of wordpress Here is the table fields. Please fill me up for the purpose of each table field (looks at 10, 12, 13):   1. **comment_ID:** ID for the comment   2. **comment_post_ID:** The post for which the comment is posted   3. **comment_author:** Comment author name   4. **comment_author_email:** Author name for the comment   5. **comment_author_url:** Author url   6. **comment_author_IP:** Author IP address   7. **comment_date:** Comment Date   8. **comment_date_gmt:** GMT time of the comment   9. **comment_content:** Contents of the comment (comment body)   10. **comment_karma:** What is this? Does wordpress have any default karma calculation? or its placed for plugin authors   11. **comment_approved:** Flag for the comment status.   12. **comment_agent:** Not sure what it is?   13. **comment_type:** What is it? Can wordpress have a default comment_type functionality like custom post type?   14. **comment_parent:** For threaded comment   15. **user_id:** user id if comment author is a registered user of the site. I was wondering if i can use wordpress comment table and comment meta table to make the total review system working. The reviewer have to be registered before send review. So that will save lots of work. Also i need to know how the wordpress current comment functions will work with this method. As every comments has its own post id so it think that will not be a problem. And also when I import the CPT I will also able to import all the comments and fields (if i add some comment meta fields) right? So, if i sum up my questions are:   1. what is 10, 12 and 13 db table field for comments? Does wordpress uses it or I can use it for saving extra information. And How do i use wordpress comment meta table. **Any codex page link will be greatly appreciated.**   2. when I import the CPT I will also able to import all the comments and fields (if i add some comment meta fields)?


title: Adding Sidebars in WordPress Theme

text: Can anyone help me on how to add two sidebars on the main page of my WordPress site. I need one on the left and the right. I'm new to WordPress and don't know much about the code, even when I tried reading the codex. My website is here I am using a Ready To be theme, with Ready E-Commerce plugin


title: how to transfer wordpress sql/database from local to live

text: So for backing up any/all my wordpress sites i use a tool called "BACKUP BUDDY" and its a great tool and all but lately its been really buggy and today finally it went kaboom! Usually my workflow is that i develop the site on my local machine using WAMP/MAMP. when done and ready for testing, i use the tool to backup/transfer to real server etc. Since my tool stopped working(uploads half the content) i decided to just do it manually by installing Wordpress first on the real webserver(done), Applying my theme(done), then exporting the database sql from the local server(done), and thereafter importing it to the real server(done) and the 2xs that ive done it the site comes up blank.(outcome equals fail) im assuming that something has to be changed/done in order for it to work but not sure what. Any ideas as to what im doing wrong? because as of now, if i cant do it like this, id have to manually create ALL the pages etc and its not alot but would like to know the proper method in how to do this. Thanks in advanced.


title: Basic Multisite Question - Managing Content Centrally

text: Is it possible to manage content on multisite installations centrally? If I have a network of 20 sites, is it possible to change the content on one site and have it update across the network, or will I have to make the change on each site one at a time? More specific case, If I have a Terms and Conditions page that must appear on each site, that requires periodic changes can I make the change once and have it replicate. Any suggestions/directions/resources for managing this process effectively would be appreciated.


title: Using plugin_dir_path() with WordPress on MAMP

text: I have the following directory structure: Root Install: /Users/philipdowner/Sites/montanaliving Within the root installation I have the following plugin structure: /wp-content/plugins/manifest-rets/ Then, within the plugin folder I have 2 php files manifest-rets.php phrets.php In the main plugin file, I have the following code:               <?php     /*     Plugin Name: Manifest RETS     Plugin URI: http://manifestbozeman.com     Description: Uses the phRETS library to connect to a RETS server     Version: 1.0b     Author: Philip Downer     Author URI:http://philipdowner.com     License: GPL2     */          define('MR_PLUGIN_PATH', plugin_dir_path(__FILE__));              //echo MR_PLUGIN_PATH;     include_once(MR_PLUGIN_PATH.'phprets.php');           ?>      However, when running the plugin I get the following error stating that the phrets.php file could not be found. It's driving me batty! Any suggestions? Am I overlooking something obvious? > Warning: include_once(/Users/philipdowner/Sites/montanaliving/wp- > content/plugins/manifest-rets/phprets.php) [function.include-once]: failed > to open stream: No such file or directory in > /Users/philipdowner/Sites/montanaliving/wp-content/plugins/manifest- > rets/manifest-rets.php on line 15 > > Warning: include_once() [function.include]: Failed opening > '/Users/philipdowner/Sites/montanaliving/wp-content/plugins/manifest- > rets/phprets.php' for inclusion > (include_path='.:/Applications/MAMP/bin/php/php5.3.6/lib/php') in > /Users/philipdowner/Sites/montanaliving/wp-content/plugins/manifest- > rets/manifest-rets.php on line 15 I've tried passing in the ABSPATH constant, and using PHP's set_include_path() function to no avail.


title: Is it possible to cancel a post status transition?

text: # Question I want to cancel `pending_to_published` actions: Posts that match certain criteria should that go from `pending` to `published` should stay pending. (Alternatively, I need a to make add an "Approve" button to posts of a certain taxonomy, if that's easier) # Context A WP installation has a portfolio tax, of which posts are automatically created using a Gravity Form. These posts are saved with the status of "pending". These posts have a ZIP file associated with them. When a user submission (portfolio post) is approved (published), the ZIP is unpacked and processed. Doing this on the main HTTP server makes it lag or crash if multiple submissions are approved in a short period of time. To fix this, the ZIP processing script has been rewritten and moved to another EC2 instance (the site is on AWS). The idea is to have a WP plugin that would move the ZIP file to a `queue` directory, and use sockets to tell the other server to start processing it's queue. There are two ways to go about this:   * Hook onto the `pending_to_published` action and cancel the change.   * Add a button just for this ...which brings me to my initial question.


title: How to make a newly registered site on multisite network "live" only when the user is ready

text: By default, a new site created on a multisite installation is "live" and viewable by everyone (if they know the address) right after the user creates it. What is the best approach to changing this so that the site they register is only live when they are ready? By ready, I mean they have chosen a theme, uploaded a logo, entered their content etc and are ready for it to be publicly viewable. My initial thoughts are to create an option in the database for each new site that by default is set to '0'. The new site would just display a "coming soon" page to someone that isn't logged in. Then in the site's theme options panel or similar, there would be a "make my site live" button which updates the option in the database and shows the correct theme. Can anyone think of a better way?


title: Limiting the number of posts in WP_Query leads to unexpected result

text: The following is supposed to display 10 posts. Sometimes it displays 11, sometimes 12, and sometimes the desired 10 posts. It behaves the same if I swap `posts_per_page` for `showposts` or `numberposts` . Where do I need to search for the problem?               <ul>         <? wp_reset_query(); ?>          <?  $args = array(             'orderby'           => 'rand',             'posts_per_page'    => '10',         );         $query_footerFavorite = new WP_Query($args);              while ($query_footerFavorite->have_posts()) : $query_footerFavorite->the_post(); ?>                  <li>                 <a href="<? the_permalink(); ?>" title="<? the_title_attribute(); ?>">                     <? the_title(); ?>                 </a>             </li>              <? endwhile; ?>         <? wp_reset_query(); ?>                      </ul>      Edit: It seams there is a problem with the posts_per_page, see `print_r($query_footerFavorite)`:               WP_Query Object ( [query_vars] => Array ( [orderby] => rand [posts_per_page] => 10 [error]


title: Create HTML newsletter source from Wordpress

text: Is there a way to export certain posts into an HTML newsletter format that is suitable to email to subscribers? I am thinking of something that allows me to select a certain amount of posts, etc and that then generates in-line HTML content with those posts in them in a format I can copy and paste into a newsletter management tool (i.e. mailchimp, campaigner, etc). I've noticed that some mail providers like mailchimp, aweber, etc offers RSS to email, which looks pretty handy and might work - unfortunately my client is using campaigner.com which does not appear to offer this. Perhaps there is another straight forward way to generate an HTML email?


title: Can I create multiple instances of the BuddyPress Activity Stream with separate themes?

text: I'm trying to take advantage of BuddyPress 1.7's new theme independence to effectively create different pages and instances of the Activity Stream with different themes. I can use HeadSpace (an options plugin) to change the theme for a specific page and one "Template" under Page Attributes is BuddyPress - Activity Directory. ![enter image description here](http://i.stack.imgur.com/fuFCK.png) ![enter image description here](http://i.stack.imgur.com/AXQ5h.png) I use both in conjunction (as shown above), but setting HeadSpace to use a child theme returns the BuddyPress Default Theme (but correctly returning another instance of the Activity Stream, proving that it can be done) and trying to use a normal WordPress theme (i.e. Twenty Twelve) returns an HTTP 500 error. Is this possible, and how?


title: Join new table with SQL query

text: I created a plugin with a new table (`wp_soundcloud`) and I need to retrieve the data from that new table along with the post data. Here is my query:                $querystr = "         SELECT $wpdb->posts.*,          FROM $wpdb->posts          LEFT JOIN $wpdb->soundcloud ON($wpdb->posts.ID = $wpdb->soundcloud.idpost)         WHERE $wpdb->posts.post_type = 'soundcloud'         AND $wpdb->posts.post_name = '$name'         ";      $pageposts = $wpdb->get_results($querystr, OBJECT);      …and here is debug:                 ["last_query"]=>       string(176) "         SELECT wp_posts.*, .*         FROM wp_posts          LEFT JOIN  ON(wp_posts.ID = .idpost)         WHERE wp_posts.post_type = 'soundcloud'         AND wp_posts.post_name = 'test-demo'         "      …and the error:                 ["last_error"]=>       string(226) "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM wp_posts          LEFT JOIN  ON(wp_posts.ID = .idpost)         WHERE wp_posts.post_' at line 2"      The problem is the `LEFT JOIN ON(wp_posts.ID = .idpost)`. But why did the query not `JOIN` the table?


title: How to display category specific post content on a page

text: Hi I need to display posts in a category on my page template. How can I do this? Thanks


title: Force user to login in home page

text: I have a custom login form working properly on my home view. Nice. But what I want is when user try to view some page, be redirected to my home view instead of wp-login. Im trying to do this way:               add_action('template_redirect', 'redirect_to_login');          function redirect_to_login(){      if(!is_user_logged_in()){        wp_redirect(home_url()); exit;      }     }      It's not working. Browser says it has too many redirects. What can I do? Thanks!


title: home_url(); showing current page instead of site address

text: Does anyone have an idea why my home_url() function gets the URL of the current page instead of the site address? (The site runs locally using MAMP.)


title: Wordpress Super Admin menu not enabled

text: Hi I am trying to create a social network using buddypress.I found a book that has detail instructions on how to create a number of wordpress sites : wordpress blueprints Just to be clear I have wordpress installed on localhost in e-commerce folder.The first stept that I done was to add this code in wp-config.php:               <?php     define('WP_ALLOW_MULTISITE', true);     ?>      This enabled the instalation menu.After I clicked install I was asked to create a folder in wp-content named blogs.dir. I was give this code to put in wp-config.php:               define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     $base = '/e-commerce/';     define('DOMAIN_CURRENT_SITE', 'localhost');     define('PATH_CURRENT_SITE', '/e-commerce/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      and this code to put in wordpress .htaccess file and replace what is there:                 RewriteEngine On     RewriteBase /e-commerce/     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]     RewriteRule . index.php [L]      Next I was asked to relog and after relog a Super Admin menu should have appeared in the dashboard but the menu is not appearing for me. What is the problem and how can I conrect it?


title: How can i show only 30% of the "the_content("More...")"?

text: I'm trying to make a page that has all the posts in it and shows 30% or less of the content of the post. So I'm editing a page template and I can't figure out how to show only 30% of the content. I'm new to this so please don't spam me with "go google it you noob" , stuff like that. Thank you in advance and have a nice day!


title: How to correctly move jquery script to external file

text: I have a jQuery floating navbar plugin that works fine when all the code is inserted in the head. However the ammount of code in the head became unmanageable so I put the code in the root directory in a file called sscroll.js. I have tried to include the file the following ways but they don't work. (No errors are coming up on firebug) `<?php wp_enqueue_script('sscroll', 'sscroll.js', array('jquery')); ?>`               <script type="text/javascript" src="sscroll.js"></script>     <script>     $('#sidecontainer').stickyfloat({duration: 400 });     </script>      >               <script type="text/javascript" src="sscroll.js">$('#sidecontainer').stickyfloat({duration: 400 });</script>      >               <script type="text/javascript" src="sscroll.js"></script>      I prefer using the enqueue script, but I'll be happy with anything that works. Any suggestions welcome. Thanks!!!


title: custom field as a boolean with a checkbox?

text: I have installed the more fields plugin which gives me access to a custom field checkbox. When setting the field up through the plugin the caption says: Creates single checkbox, which key is either on/off. As you can see by the query I am looking for all the events whose event-archive = on. Is there a better way to do this? This doesn't return any posts anyways. Is there a better way to build a boolean field?               $archive_query = new WP_Query(             array(                'post_type'  => 'event',        // only query events               'meta_key'    => 'event-archive',  // load up the event_date meta               'order'       => 'desc',         // ascending, so earlier events first               'posts_per_page' => '5',               'meta_query'  => array(                  array(         // restrict posts based on meta values                   'key'     => 'event-archive',  // which meta to query                   'value'   => 'on',  // value for comparison                   'compare' => '=',          // method of comparison                   'type'    => 'CHAR'         // datatype, we don't want to compare the string values                  ) // meta_query is an array of query ites                 ) // end meta_query array               ) // end array             ); // close WP_Query constructor call


title: Conflict between wp_list_pages and get_posts - list pages not displaying

text:
This has only been a problem since I updated to Wordpress 3.1 I have a page that displays a list of custom post types. The page is the child of a parent page. There is a sidebar that lists sibling pages. The code for the two is conflicting somehow, and I can't get the list of pages to show up. This is the code to display the list of custom post type (in my case 'sponsor'):               <?php     $args = array( 'numberposts' => 30, 'post_type' => 'sponsor' );     $sponsors = get_posts( $args );     foreach ($sponsors as $post) :  setup_postdata($post);      ?>

<?php the_title(); ?>
     <?php the_content(); ?>
          <?php endforeach; ?>      This is the code in my sidebar to list the sibling pages:               <?php         if (!$post->post_parent) {             $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');         } else {             $p = end(get_post_ancestors($post->page));             $children = wp_list_pages('title_li=&child_of='.$p.'&echo=0');         }     ?>     <?php         if ($children) {             $parent_title = end(get_post_ancestors($post));     ?>
         <?php echo $children; ?>     <?php } ?>
      Nothing is showing up in the sidebar. I tried deleting the code for the posts, and the list of pages showed up correctly. But something about the "get_posts" is not letting the "list_pages" work. Anyone know what alternate code I can use?


title: The new WordPress 3.1 "Admin Menu" isn't appearing on my site or in the Dashboard

text: WordPress 3.1 added the Admin Bar feature, similar to the one used in WordPress.com websites, which appears on both the website and Dashboard for logged in users (if enabled in your User settings). I've updated to WP 3.1 and enabled both settings for the admin bar ("when viewing site" and "in dashboard"), as well as clearing all caches (through W3 Total Cache) and my browser cache. Any ideas on why I'm still not seeing the admin bar? I am using a custom theme, but I don't see how that would affect the Dashboard admin bar.


title: making urls clickable for wordpress custom post type field?

text:
Here is the code I'm using to add a custom field to a post type I have set up. As you can see it creates an input box which allows me to add whatever I want. I want to put urls in this box (without the "http://", e.g. "example.com") and have them be automatically clickable. Is there a way?               add_action("admin_init", "add_friends_fields");          function add_friends_fields(){         add_meta_box("artist_links", "Links", "artist_links", "friends", "normal", "low");     }          function artist_links(){         global $post;         $custom = get_post_custom($post->ID);         $artist_links = $custom["artist_links"][0];         ?>         Links:

         <input size="50" name="artist_links" value="<?php echo $artist_links; ?>" />         <?php     }      -edit-

Artists
             <?php                 $i=1;                      $temp = $wp_query;                 $wp_query = null;                 $wp_query = new WP_Query();                 $wp_query->query('post_type=friends&posts_per_page=-1');                      while ( $wp_query->have_posts() ) : $wp_query->the_post();                      $custom = get_post_custom($post->ID);                 $artist_links = $custom["artist_links"][0];                 $artist_bio = $custom["artist_bio"][0];             ?>                  <article class="mgm-artist<?php if($i%6 == 0) { echo ' right'; }; $i++; ?>" id="post-<?php the_ID(); ?>">                 <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'video-thumb' ); } ?>

Name: <?php the_title(); ?>

Bio: <?=$artist_bio?>

Link(s): <?=$artist_links?>

                  <?php                 endwhile;                  $wp_query = null;                 $wp_query = $temp;                 wp_reset_query();             ?>


title: Does plugin's uninstall.php file have access to the plugin 's object?

text: I read on the codex that the best way to implement a clean uninstallation functionality to a plugin is by adding a uninstall.php file inside your plugin directory. I'm wondering: can i use my plugin's Class instance data inside the uninstall.php file? This is the code sitting in my uninstall.php file:               if(!defined('WP_UNINSTALL_PLUGIN')) exit;     delete_option('my_plugin_options');     $table_name = $wpdb->prefix . $this->dbName;     $wpdb->query("DROP TABLE `$table_name`");      I'm wondering if the table_name variable will be properly retrieved, or if i should hardcode it. As per my tests, the table remains after deletion, so i guess i'l fallback to using a hook inside my plugin's file, unless i'm missing something?


title: Permalink Structure for Multiple Post Type Archives by Taxonomy

text: Recently I have been working on an advanced WordPress project, and I'm stuck with changing permalink structure for custom post types. I have created 3 post types lets say: _type1, type2, type3_ and a taxonomy _test_ registered for all of them. I have 3 terms in the custom taxonomy _cat1, cat2 ,cat3_ Here's what I want to achieve: instead of accessing all posts from cat by > siteurl/test/cat1 I want to access each post-type archives by taxonomy cat like: > siteurl/type1/cat1


title: Ordering Submenu Pages in WP 3.1

text: I just recently upgraded to WordPress 3.1 a few moments ago. However, I noticed that when you have Post Types show up under a *main* menu page, it overrides the link fo th menu link. ![](http://i.stack.imgur.com/Kms5A.png) Here's my `register_post_type` arguments for "Visitor" post type.                   $v_args = array(             'labels' => array (                     'name' => 'Visitors',                     'singular_name' => 'Visitor',                     'add_new_item' => 'Register New Visitor', // TODO: http://codex.wordpress.org/Function_Reference/register_post_type#Arguments                 ),             'public' => true,             'publicly_queryable' => false,             'exclude_from_search' => true,             'show_ui' => true,             'show_in_menu' => 'argus',             //'show_in_menu' => false,             'hiearchical' => false,             'supports' => array( '' ),             'capabilities' => $visitor_caps,             'register_meta_box_cb' => array ( &$this, '_wp_visitor_meta_box_cb' ),         );              // http://codex.wordpress.org/Function_Reference/register_post_type         register_post_type( $post_type, $v_args );      Here is the call to `add_menu_page` that adds the link to the admin menu.               public function _wp_admin_menu( )     {         add_menu_page( 'Argus', 'Argus Admin', 'argus', 'argus', array( &$this, '_wp_argus_main_panel' ), '', -1 );         add_submenu_page( 'argus', 'Argus Administration', 'Main Menu', 'argus', 'argus', array( &$this, '_wp_argus_main_panel' ) );                 // save having to register 'admin_menu' action across every sub-plugin         // There is no 'admin_menu' function/method in any class stored in $classes         foreach( self::$classes as $class => $obj )         {             if ( method_exists( $obj, 'admin_menu' ) )             {                 $obj->admin_menu();             }         }     }      **Please note:** The call to `add_submenu_page` was added after the fact and doesn't change the behavior or output one bit. I added this to re-add the default link that 3.0.4 added by default under the link header generated by `add_menu_page`.


title: Good RSS Feed Parser to use on php file?

text: Was trying to use EmbedRSS Plugin but the php code that I used to put it into my index.php file doesn't work.                [cetsEmbedRSS id='http://deannaschneider.wordpress.com' itemcount='2' itemauthor='1' itemdate='1' itemcontent='1']      convert into php:                <?php echo do_shortcode ('[cetsEmbedRSS id='http://deannaschneider.wordpress.com' itemcount='2' itemauthor='1' itemdate='1' itemcontent='1']'); ?>      I switched to Wordpress's built in rss and used the following code:                <?php include_once(ABSPATH . WPINC . '/rss.php');      wp_rss('http://www.ssupremacy.com/bbs/rss.php?fid=3', 10); ?>      When I replace "3" with "4", the feed shows but it doesn't show in fid=3. And I want more to show then just a list of links. I want an excerpt of the forum post, date, author, etc. Any ideas?


title: Shared upload folder in wordpress multisite

text: I have a wordpress multisite, where I would like all the images uploaded through the main site (mysite.com) to be accessible to `sub1.mysite.com` and `sub2.mysite.com`. All the images should be in one folder without subdirectory (e.g: `wp-content/uploads/image.jpg`). I tried the bellow function, but my images for subdomains are uploaded to `wp-content/uploads/sites/#blog_id/`               function wpse_16722_upload_dir( $args ) {         $newdir = '/';              $args['path']    = str_replace( $args['subdir'], '', $args['path'] ); //remove default subdir         $args['url']     = str_replace( $args['subdir'], '', $args['url'] );               $args['subdir']  = $newdir;         $args['path']   .= $newdir;          $args['url']    .= $newdir;               return $args;     }     add_filter( 'upload_dir', 'wpse_16722_upload_dir' );


title: recent comments filter by author, page, category

text: is there any way to display recent comments in a widget area   * only for **one page**? = Comments that are belongs to one page.   * comments of **one category** but not from admin ( or some other user ) I want to have two widget on my home page   * 10 last comments for one page   * 10 last comments for one category except my own comments


title: Post belonging to many categories

text: I have a post that belongs to two categories (Drinks, Food). The post appears on category pages under `/category/drinks` and `/category/food` When I click on the post under category archive `/category/drinks` it takes me to a post page that's in `/food/` Is there any way to solve this in a way that the post stays in the same category?


title: add class to internal links in content

text: i want to add a class to all links inside of the_content, that point to other interal content, f.ex. other posts and pages. i want to do this automatically. dunno if the best practise would be, to look for content or try to hook into the tinymce editor.. and eather way around, i don't know how.. this is what i have:               text      and i want it to be               text


title: Pagination for categories with a different amount of posts on first page not appearing on 2nd page

text: I wish to show a different number of posts (4) on the first page of a category page, while showing a different number of posts on the following pages (16 posts on each). I have an extra condition for the first page to have only 4 posts instead of 16, that there must be a page with the same name (this is not relevant for the problem but just to explain what is happening in the code below). I am doing it similar to as it is explained in the question here where I have the following two functions. (Other answers seem to work similarly too so I should be in the right track I hope).               function paginate_categories( $query )      {          // not an admin page and it is the main query     if (!is_admin() && $query->is_main_query())     {         if (is_category())         {             if (get_page_by_title(get_queried_object()->cat_name) != null)                 $startpage_total = 4; // show 4 posts on start page if there is content (i.e. there is a page with the same title)             else                 $startpage_total = 16;                  $pages_total = 16; // show 16 posts on all other pages                  if(!is_paged()) {                 $query->set('posts_per_page', $startpage_total);             } else {                 // a paginated page                 $query->set('posts_per_page', $pages_total);                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $offset = $startpage_total +($pages_total*($paged-2));                 $query->set('offset', $offset );             }         }       }     }     add_action( 'pre_get_posts', 'paginate_categories' );          function itsme_adjust_category_offset_pagination( $found_posts, $query ) {         $ppp = get_option( 'posts_per_page' );         if ($query->is_main_query() && is_category() &&  (get_page_by_title(get_queried_object()->cat_name) != null))         {             $first_page_ppp = 4;                  if( !is_paged() ) {                 return( $found_posts );             } else {                 return( $found_posts - ($first_page_ppp - $ppp) );             }         }     }     add_filter( 'found_posts', 'itsme_adjust_category_offset_pagination', 10, 2 );      My paginator code that I am including in my category template looks like this:               <?php         global $wp_query;              $big = 999999999; // need an unlikely integer         $add_args = False;         $search_query = get_query_var('s');         if (isset($search_query) && (trim($search_query) != ""))         {             $add_args = array('s' => $search_query);         }              $args = array(             'base' =>  str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),             'format'       => '/page/%#%',             'total'        => $wp_query->max_num_pages,             'current'      => max( 1, get_query_var('paged') ),             'show_all'     => False,             'end_size'     => 1,             'mid_size'     => 2,             'prev_next'    => True,             'prev_text'    => __(' '),             'next_text'    => __(' '),             'type'         => 'list',             'add_args'     => $add_args,             'add_fragment' => '',             'before_page_number' => '',             'after_page_number' => ''         ); ?>              <div id="paginate">             <?php echo paginate_links( $args ); ?>         </div> <!-- #paginate -->      I have 8 posts at the moment under my category and the first page is correctly displaying 4 posts with the paginator displaying 2 pages, with a link to go to the next page. However, when I go to the next page, the paginator doesn't display at all. I dont get the same page links so that I can go back to the previous page. The reason for this is that `$wp_query->max_num_pages` is set to 1 (because 8 < 12). Is there something I am still missing to get this working correctly?


title: Wordpress rewrite my URL when i use pagination

text: I've just created a rewrite rules to integrate pagination in my page music (displaying custom post_type "music") in order to : 1. displaying a specific page from a long musical playlist. 2. in this page, playing a specified track Here is the rule for pagination : `add_rewrite_rule('music/page/([0-9])+/([^/]+)/?', 'index.php?pagename=music&paged=$matches[1]&trackid=$matches[2]', "top");` But now when I enter : http://carbonpaper- dev.imperatorium.org/music/page/2/track-2442 Wordpress rewrite my link with a repetition of /page/2/ : http://carbonpaper- dev.imperatorium.org/music/page/2/track-2442/page/2/ I search a solution to keep the first URL. I try get_rewrite_permalink() function but it's not ok.. Any suggestions ? beR- The blog is in test phase so sorry for inconveniences...


title: Add custom fields within meta box class "on the fly"

text: I'm one of the contributors for the Meta Box Class here on Github (link) and before I get too deep, I wanted to ask if anyone knew of a straight forward way to allow users to add additional fields "on the fly", having an "add" button with a text field to add additional fields (i.e. list items). I've seen this done a few ways in the past, but I'm all for not reinventing the wheel.


title: Second Level Menu

text: I'm trying to figure out how to do, Second Level Menu as a template function, that persistent when visiting any level, whether its a top level page, or a grand children Page. Any Ideas?


title: Storing meta fields multiple times OR once with multi dimensional array?

text: I got some options that I expand using a repeater type field. The values I save for each field is already an array so in essence I'm saving a multi dimentional array per option. (See this weekly trading hours picker http://foxinni.com/screens/trading_hours-20120828-162304.png) **My question is this** : Is it better to store the meta values in one meta field as a double serialized value, or is it better to split them into one dimentional values but storing as multiple custom fields with the same name in the db? _Reason I ask is becuase it's easier to manage just one custom field, and as I've come to find, having duplicate meta field ID's as a bit of a pain to manage. Checking the old value to verify the correct field is cumbersome imo.._


title: Front-end update_post_meta snippet displays white screen?

text: Thanks to @Anu's correction I now have a function to update_post_meta from the front end. Something is wrong in my script however, because with the function below nothing is being displayed on the page. It only displays is a white screen. if I take out the `if ( empty($_POST) ||` section the page template will display, but any changes I make to the form are not saving. What am I missing?               // top of page     if ( empty($_POST) || !wp_verify_nonce($_POST['name_of_nonce_field'],'name_of_my_action') )         { //if fail nonce check, exit script            exit;         }     else :         {         global $post;         $postid = $post->ID;         $data = $_POST['priceone'];         update_post_meta($postid,'metakey',$data);         }     endif;          // in single.php     $priceone = get_post_meta($post->ID, 'priceone', true);     <form method="post" action="">        <?php wp_nonce_field('update_drw_postmeta','drw_inventory'); ?>        <label>This is label</label>        <input type='text' name='priceone' value='<?php echo $priceone ?>' />        <input type='submit' value='save' />     </form>


title: I'm looking for a plugin to execute a specific task a certain time

text: I'm looking for a plugin capable of execute a task (in my case, switch the sticky attibutte of certains) in a specific hour (for example 22:00 hrs), Anyone knows a plugin with those capabilities? Thanks in advance


title: Shortcode attribute "title" doesn't appear in $atts array

text:
In a post, I have this text:               [bhours shortcode="test" title="test"]      But the "title" attribute appears to be ignored. Here's a var_dump of the $atts attribute array               array(1) {       ["shortcode"]=>       string(4) "test"     }      Here's the PHP code:               function bhour_shortcode_handler($atts){         global $post,$bhourdays;              $output='';              echo var_dump($atts);              if(isset($atts['shortcode']) && !empty($atts['shortcode'])){                       if(isset($atts['title']) && empty($atts['title'])){                 $output.='';             }             elseif(isset($atts['title']) && !empty($atts['title'])){                 $output.='
'.$atts['title'].'
';             }             else{                 //get title from post                        }              }                   $output.='
this is a test
';              return $output;     }          add_shortcode('bhours', 'bhour_shortcode_handler');      Is the "title" attribute some sort of reserved word?


title: Wordpress get embedded/attachment video

text: I’m looking a way to get embedded video in PHP from WordPress post on a single.php page. I’ve implemented a slider that pulls post attachment images and would like to do the same for video. As the media upload limit in WordPress and practicality of uploading video to CMS are leading me away from using similar method, I need to find a way to get embedded videos. get_embedded_video() is now depreciated and I cannot find anything else that can replace it. I tried get_attached_media() despite embedded is not clearly attached, and it didn’t work. Any solution to this problem?


title: How to add field above password section in profile page

text: I managed to create new custom fields in the profile page. However, the new fields are located below the Password section. My new fields is more about the user personal details, which should located below/above Biographical Info section. But this new field always display below to the password section, this will be very odd for users to read. I found a post talking manipulating the DOM by javascript here. But the codes somehow didn't work for me, I don't know why. So, I would like to find an alternative way. Please advise. Thanks


title: Access Tables with number prefix

text: I have multiple sites setup within my site. I need to access all the various options tables which are named 'wp_#_options'. How can I select these tables that have a number prefix? Using `$wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->7_options." WHERE ....."));` gives me a parse error.


title: How to make my plugin able to be updated from admin panel?

text: Most of the Wordpress Plugins are able to be updated from admin panel. You go to `Admin Panel > Plugins > Installed Plugins >` and if you have an outdated(old plugin) that has a new version, you can click Update to download the new plugin. How to add this to my plugin? Is this made with the:               Plugin URI: http://mysite.com/wp/plugin      If yes, than how to set up that folder? Should i name every new version in zip files in that folder? Or how to tell the version of plugin to wordpress?


title: Wordpress pagination /page/2 part added at the end of url

text: The pagination works, but not the default URL of the 'next' button. It ads the `/page/2/` part at the end of my url where a `$_GET` is stored. Is there a way I can move the `/page/2/` part to the end of my url before the `$_GET` section? This is how it is right now:               http://websitename.com/custom-post-type/?merken-selection=fiat#038;transmissie-selection=0&fuel-selection=0&addition-selection=0/page/2/      But it needs to become the following:               http://websitename.com/custom-post-type/page/2/?merken-selection=fiat#038;transmissie-selection=0&fuel-selection=0&addition-selection=0/      This is my query:               $paged = 1;     if ( get_query_var('paged') ) $paged = get_query_var('paged');     if ( get_query_var('page') ) $paged = get_query_var('page');          $taxedQueryArgs = array(         'post_type' => 'lease_fop',         'paged' => $paged,         'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'merk',                 'field' => 'slug',                 'terms' => $merk,                 'operator' => 'AND'             ),             array(                 'taxonomy' => 'transmissie',                 'field' => 'slug',                 'terms' => $transmissieSoort,                 'operator' => 'AND'             )         )     );          query_posts( $taxedQueryArgs );     ...      This is the wordpress function I use for the pagination:               /**      * Paginate for custom post types      *      */          function paginate() {         global $wp_query, $wp_rewrite;         $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;         $pagination = array(             'base' => @add_query_arg('page','%#%'),             'format' => '',             'total' => $wp_query->max_num_pages,             'current' => $current,             'show_all' => true,             'type' => 'plain'         );         // if ( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'pagina/%#%/', 'paged' );         // if ( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) );         echo paginate_links( $pagination );     }      When I comment out the last two rules, as you can see in the snippet above, it works. The url is then: `http://websitename.com/custom-post-type/2/?merken- selection=fiat...` without the fancy 'page' part in between, as the function would suggest.


title: Is it possible in WordPress

text: I am trying to create a ranking based on user donation, my problem is I am not sure if wordpress user meta support append For each Project a user can donate money via paypal In **WordPress User Meta** I am not sure how if is possible to append and integrate 2 column field for each donation amount and project made 1st field is a dropdown field(containing the projects) = second field(amount) The project list will be handled by a custom post type with a custom field of amount and if the user donated to that page it will be credited to the current user and update the project and amount field. in other words, i would like to append a user meta in the admin via the front end, i know its possible appending via backend but how about if the data is coming from the front end any security or limitation?               $user_id = get_current_user($id);     $project = $product_name;     $amount = $project_amount     If ($project != $product_name) {      **add_user_meta( $user_id, '$project', ??);**     **add_user_meta( $user_id, '$amount', ??);**     }     else     {      **add_user_meta( $user_id, '$project', ??);**      **add_user_meta( $user_id, '$amount', ??);**     }      the problem now is the how would I add the project and amount data at the same column or append another row if the project is not identical


title: Paginate_links links not working accordingly to how I do query the page

text: Ok, I've a custom post type page to which I have attached the paginate_links function to navigate through the elements. If I don't do anything and let WP using whatever mechanism is attached to the archive page, then the paginate_links work fine but the previous link never goes back to the page one. Changing manually the links works fine. On the contrary, if I do something like the answer suggested here, overriding the wp_query object, the paginate_links move to the second page but the "current" remains set always on page 1. CODE               $current = get_query_var('page') ? get_query_var('page') : 1; // Get query var     $record_per_page = 2; // How many faqs to display on each page     $offset = ( $current - 1 ) * $record_per_page;              $args = array(             'post_type'         => 'faqs',             'orderby'           => 'date',             'order'             => 'desc',             'page'              => $current,             'offset'            => $offset,             'posts_per_page'    => $record_per_page,         );               $the_query = new WP_Query( $args );         $temp_query = $wp_query;         $wp_query = NULL;         $wp_query = $the_query;              $row                = 1;         $total              = ceil(wp_count_posts('faqs')->publish / $record_per_page);              while ( have_posts() ) : the_post();             echo get_the_ID();           endwhile;              // Reset postdata         wp_reset_postdata();              if ( $total > 1) {                  $paginate_links = paginate_links( array(                 //'base'      => @add_query_arg( 'page', '%#%' ),                 'base'      => '%_%',                 'prev_text' => __('« Indietro'),                 'next_text' => __('Avanti »'),                 'mid_size'  => 5,                 'format'    => '?page=%#%',                 'current'   => $current,                 'total'     => $total             )); echo $paginate_links;         }          // Reset main query object     $wp_query = NULL;     $wp_query = $temp_query;      Any idea of what's happening?


title: Custom user roles for access to specific parts of the site

text: I need to create specific sections of my site which should only allow certain users to access them. So basically, I'll be having a staff section - if the user is a staff member, they'll see a link to the section and obviously be able to see all the info there. I've looked into a couple of things, namely adding user roles but they all seem to have a set list of capabilities that I can set. There isn't anything that I can find that will allow me to restrict users access to certain parts of the site. I don't mind using plugins or anything like that - any suggestions would be welcome.


title: Stand alone website with two WordPress pages

text: I have a stand alone website that currently uses WordPress for only one of the pages. When I initially installed WordPress I created a new folder entitled 'blog' to use as my root directory. What I am trying to do now is create a second page that will utilize WordPress, but I don't want that page to be www.mysite.com/blog/newpage. I want my newly created page that will utilize WordPress to be www.mysite.com/newpage. What is the best way to accomplish this task? I thought about adding my WordPress theme to the root directory of my static site, but I have had trouble with that in the past. I would appreciate any guidance.


title: Change the date format

text: Sorry I'm newbee of wordpress. I want to change the format from Fri, 4 Oct 2014 to 04/10/2014. I changed the format from general - settings but still looks like same. I've already check this post : Here is the html of my page:               <time class="item-to" datetime="2014-10-04T00:00:00+00:00">Fri, 4 Oct 2014</time>      Should I change something in core wordpress files?


title: Image Upload HTTP 500 Internal server error

text: While I upload images the images are uploaded in the uploads folder but dont get response rather it get a HTTP error(500 Internal server error). I have tried all the solutions to fix the upload image.Turned off the mod_security from the htaccess.Increased the memory size.Also changed the permalink to default previously it was postname.I have also tried with both the flash uploader & the browser uploader.And get the error in the async- upload.php.


title: Hook on creating a menu entry?

text: I need to run some code after a new item has been inserted into a WordPress nav menu. Is there any hook on menu modification or something similar?


title: Merged two WP_Queries, posts per page and pagination not working

text: I merged two WP_Queries with the code below, it has pagination setup as well as posts per page in the final combined object but those settings aren't working. My page shows 24 posts, where is it getting this number from and why isn't pagination working?               $args1 = array(         'post_type' => 'post',         'posts_per_page' => -1         );     $query1 = new WP_Query( $args1 );              $args2 = array(         'post_type' => 'product',         'product_tag' => 'home',         'posts_per_page' => -1         );     $query2 = new WP_Query( $args2 );          $paged = get_query_var('paged') ? get_query_var('paged') : 1;          $finalargs = array(       'paged' => $paged,       'posts_per_page' => 3     );          $wp_query = new WP_Query($finalargs);          $wp_query->posts = array_merge( $query1->posts, $query2->posts );          $wp_query->post_count = count( $wp_query->posts );          echo '<pre>';     //var_dump($wp_query); exit(0);     echo '</pre>';      The output of var_dump is below, so if my wp_query has posts per page and pagination setup why isn't it working?               object(WP_Query)#566 (47) {       ["query"]=>       array(2) {         ["paged"]=>         int(1)         ["posts_per_page"]=>         int(3)       }       ["query_vars"]=>       array(61) {         ["paged"]=>         int(1)         ["posts_per_page"]=>         int(3)         ["error"]=>         string(0) ""         ["m"]=>         string(0) ""         ["p"]=>


title: Every time I de-activate a custom plugin, the site encounters a critical error

text: I have a custom plugin that I no longer use. I was looking to de-activate it from my site (and, subsequently, my network) but every time I attempt to, I get this error: > Please activate the {plugin name} plugin with no further output from WordPress (it's just the text and nothing else!) I'm effectively locked out of everything on the web end with no options but to restore the DB to an earlier version. Has anyone ever experienced something like this before?


title: Add a string after each item in Wordpress sub menu

text:
I am trying to add a special character to display a » alongside each menu item in Wordpress. So for example About us » Contact us » And so on... Here's my code
<?php echo $children; echo '»'; ?>
      I expected this would do the job, but it just puts the » below the list. Here's the full code                     <?php           if($post->post_parent) {           $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");           $titlenamer = get_the_title($post->post_parent);           }                else {           $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");           $titlenamer = get_the_title($post->ID);           }           if ($children) { ?>
             <?php echo $titlenamer ?>

<?php echo $children; echo '»'; ?>


title: How to customize navigation menu?

text: I'm new to Wordpress and I've tried `wp_nav_menu` function. If i get it right it is a standard way to show you navigation menu created with help of the Menu Manager. What is bothering me is the fact that it internally creates a bunch of CSS classes I probably don't need. I have control over the container `div`(delete it, change its class and so on) and the `ul` element itself, it is also possible to add extra elements before and after an anchor element. What i couldn't find out is how to remove those bizillion classes attached to list elements(`li`). Is there any way to achieve this? And another question would be: could it harm? I have noticed that there are some classes, which could be used by another built in Wordpress functions. If there is a way to remove those, which should definitely stay?


title: User profile update author

text: So I'm trying to create email notifications to certain users to update them on updates to user profiles. I'd like to send these users the profiles that were updated, and also which user made these updates. Sometimes administrator-level users may make changes to other user profiles. I know I can hook into the profile_update to send emails when an profile is updated, but the big question is how to get information on who made these profile updates? Any suggestions on how to do this would be appreciated. Thank you


title: the_post_thumbnail fetches wrong image

text: We currently have a strange issue with a wordpress site. We have Featured Images on a good number of pages, including the one that we selected as the start page of the blog – the site uses a custom start page. Alas, instead of pulling the Featured Image for that blog, it takes the image it finds on the first article of the blog. Which is kind of strange, considering the call is at a place where we haven't entered the loop yet. So I'm at loss. How can I get the function to output the right image? (WordPress 3.5.2; Theme “Responsive”)


title: Add taxonomy to custom post type archive

text: This is my first question so bear with me. I'm trying to setup a custom post type which has a few taxonomies associated with it. Each taxonomy is hierarchical. What I would like to achieve is a better url structure than what is happening right now. My permalinks are set to the default "post name" setting. What I would like to achieve is something like this: domain.com/custom-post-type/taxonomy/type what ends up happening is I just get: domain.com/taxonomy/type This is essentially a career board where I have different taxonomies representing different categories. For example there is "job sector" for different types of jobs. Should these be set as hierarchical? When I use a plugin called "Custom Post Type Permalinks" I can get it to work the way I want but I was wondering if its possible without a plugin. here is my code for the custom post type plugin I've created:               <?php     add_action( 'init', 'career_forum' );     // let's create the function for the custom type     function career_forum() {          $labels = array(             'name' => _x( 'Careers', 'post type general name' ),             'singular_name' => _x( 'Career Listing', 'post type singular name' ),             'add_new' => __( 'Add New', 'career' ),             'add_new_item' => __( 'Add New Career Listing' ),             'edit_item' => __( 'Edit Career Listing' ),             'new_item' => __( 'New Career Listing' ),             'view_item' => __( 'View Career Listing' ),             'search_items' => __( 'Search Careers' ),             'not_found' => __( 'No careers found' ),             'not_found_in_trash' => __( 'No careers found in trash' ),             'parent_item_colon' => ''         );         $args = array(              'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => true,             'has_archive' => true,             'menu_position' => 5,             'rewrite' => array( 'slug' => 'careers', 'with_front' => false ),             'supports' => array( 'title', 'editor', 'thumbnail')     );          register_post_type( 'career_listings', $args );     }     add_action( 'init', 'create_career_forum_taxonomies', 0 );     // function for adding taxonomies for Career Forum     function create_career_forum_taxonomies() {         // Job Sectors         $labels = array(             'name' => _x( 'Job Sectors', 'taxonomy general name' ),             'singular_name' => _x( 'Job Sector', 'taxonomy singular name' ),             'search_items' => __( 'Search Job Sectors' ),             'all_items' => __( 'All Job Sectors' ),             'parent_item' => __( 'parent Job Sector' ),             'parent_item_colon' => __( 'Parent Job Sector:' ),             'edit_item' => __( 'Edit Job Sector' ),             'update_item' => __( 'Update Job Sector' ),             'add_new_item' => __( 'Add New Job Sector' ),             'new_item_name' => __( 'New Job Sector Name' ),         );          register_taxonomy( 'job_sector',          array( 'career_listings' ),          array(          'hierarchical' => true,         'labels' => $labels,         'show_ui' => true,         'query_var' => true,         //'rewrite' => array( 'slug' => 'job-sector', 'hierarchical' => true, 'with_front' => true ),         )     );          // Regions     $labels = array(         'name' => _x( 'Regions', 'taxonomy general name' ),         'singular_name' => _x( 'Region', 'taxonomy singular name' ),         'search_items' => __( 'Search Regions' ),         'all_items' => __( 'All Regions' ),         'parent_item' => __( 'parent Region' ),         'parent_item_colon' => __( 'Parent Region:' ),         'edit_item' => __( 'Edit Region' ),         'update_item' => __( 'Update Region' ),         'add_new_item' => __( 'Add New Region' ),         'new_item_name' => __( 'New Region Name' ),     );          register_taxonomy( 'region',          array( 'career_listings' ),          array(          'hierarchical' => true,         'labels' => $labels,         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'region', 'hierarchical' => true ),         )     );          // Position Type     $labels = array(         'name' => _x( 'Position Types', 'taxonomy general name' ),         'singular_name' => _x( 'Position Type', 'taxonomy singular name' ),         'search_items' => __( 'Search Position Types' ),         'all_items' => __( 'All Position Types' ),         'parent_item' => __( 'parent Position Type' ),         'parent_item_colon' => __( 'Parent Position Type:' ),         'edit_item' => __( 'Edit Position Type' ),         'update_item' => __( 'Update Position Type' ),         'add_new_item' => __( 'Add New Position Type' ),         'new_item_name' => __( 'New Position Type Name' ),     );          register_taxonomy( 'position_type',          array( 'career_listings' ),          array(          'hierarchical' => true,         'labels' => $labels,         'show_ui' => true,         'query_var' => true,         'rewrite' => array( 'slug' => 'position-type', 'hierarchical' => true ),         )     );     }


title: Using custom templates for post_is_in_descendant_category

text: I'm using this function on functions.php and the goal is to call a specific template for any post inside a main category but this isn't working when I need to call a generic template for any other categories... Help, please! This is my code inside single.php:               <?php get_header(); ?>     <?php if ( in_category( 'cat1' ) || post_is_in_descendant_category( 3 ) ) {?>     <?php get_template_part('single-cat-1');?>          <?php } if ( in_category( 'cat2' ) || post_is_in_descendant_category( 1102 ) ) {?>     <?php get_template_part('single-cat-2');?>          <?php } if ( in_category( 'cat3' ) || post_is_in_descendant_category( 81 ) ) {?>     <?php get_template_part('single-cat-3');?>          <?php } else if (array(post__not_in(1102,81,3))) { ?>     <?php get_template_part('single-generic');?>     <?php }?>


title: After submit comments select the current tab

text:
In my `single.php` I have 3 tabs one for description, others for comments and reviews my question is when I submit the comments, the first tab is always selected. My code:

                         Description                          Comments                         Reviews

                         <?php the_content(); ?>

                         <?php if ( comments_open() || true): ?>                             <?php comments_template( '', true ); ?>                         <?php endif ?>

REVIEW

      How can I pass the attribute `class="selected"` dynamically?


title: How to get one result using wpdb class?

text: function asec_get_link_color() {             global $wpdp;         $query = "SELECT value FROM wp_theme_options WHERE property = 'link-color'";         $result = $wpdb->get_results($sql);         return $result;     }      It doesn't return any value.


title: Can't see gravity form $object

text: Hey I am using gravity forms v1.7.13 I created a form with two fields name and email and I need to modify form data before creating entries in database for that I am using gform_pre_submission_filter and my code is something like this: I Have added this to my functions.php               function gf_filter($form) {        //Here I am printing the form object i get after submission.          echo '<pre>';         print_r($form);         echo '</pre>';         exit;          }          add_action('gform_pre_submission_filter_1','gf_filter');      but the forms keeps on loading and doesn't shows the $form object I don't know what's wrong.


title: jQuery cycle thumbnails?

text:
jQuery cycle thumbnails ? Hi all I have a demo here (not in Wordpress) where I'm using the jQuery cycle plugin to create the slideshow and the thumbnails. http://www.ttmt.org.uk/forum/wordpress/ I want to create the same thing in Wordpress http://www.ttmt.org.uk/wordpress/ Here I have one page with the images added directly to the content of the page. I'm using the same cycle code as the non-wordpress page. The image placeholders are added for the thumbnails but not the images. Can anyone see why the thumbnails are not shown? Is there another way to do this. I tried to use Wordpress plugins to do this but they all limited the slideshow images to being the same dimensions. I need the images to be different sizes. --UPDATE-- The home page has this php that simply outputs the page content. The images have been added directly to the page
                   <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
              <?php the_content(); ?>

               <?php endwhile; endif;?>
      This the jquery I'm using to try and create the thumbnails. I'm using Timthumb to resize the thumbs.


title: Query specific posts from parent by slug rather ID

text: I'm developing a theme in a local machine and migrating it to a production server. To keep things in sync, i'm trying to avoid any queries of specific ID's On the homepage, i'm trying to query the top 3 pages (by menu_order) from a parent page (NOT the homepage). It works perfectly with the hardcoded ID, but i'm stumped trying to figure out a way to do this without the ID. Seems like I should be able to use the slug, but I can't figure it out. Here's the code i'm working with:               $args = array(     'post_type' => 'page',     'posts_per_page' => 3,     'post_parent' => '74',     'orderby' => 'menu_order',     );     query_posts($args);      So rather than 'post_parent' => '74' I want to use the page slug (e.g. 'books'). Any ideas? This question seems promising, but as others commented, I'd also like to avoid direct DB queries and the second suggestion didn't work working.


title: Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?

text:
I am literally clueless as to why the code does not function properly on the first page, but functions as expected on the second page. I have already tried running the second query via another WP_Query() to no avail. See for yourself: http://blog.donovanglover.com/ The second query should return the latest 3 posts in the pagination loop, yet it also returns posts from the first query. Instead of 3 posts on the homepage, there are 6, but on the second page, you see the expected 3. My code is below:
     <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>
Featured Posts

     <?php wp_reset_query(); ?>     <?php $sticky_query = new WP_Query('nopaging=true'); ?>     <?php if(have_posts()) : while ($sticky_query->have_posts()) : $sticky_query->the_post(); ?>     <?php if(is_sticky()) : ?>
<a rel="bookmark" href="<?php the_permalink(); ?>"><?php echo the_post_thumbnail('full'); ?>
<?php the_title(); ?>

     <?php endif; ?>     <?php endwhile; else: ?>
Sorry, no posts matched your criteria.
     <?php endif; ?>     <?php wp_reset_postdata(); ?>

The New Stuff

     <?php wp_reset_query(); ?>     <?php query_posts('showposts=3&paged='.$paged); ?>     <?php if(have_posts()) : while(have_posts()) : the_post(); ?>

<a rel="bookmark" href="<?php the_permalink(); ?>">                             <?php echo the_post_thumbnail('full'); ?>                             <?php the_title(); ?>
                         <?php the_excerpt(); ?>

     <?php endwhile; else: ?>
Sorry, no posts matched your criteria.
     <?php endif; ?>     <?php wp_reset_query(); ?>

                     <?php previous_posts_link('← Newer Entries') ?>                     <?php next_posts_link('Older Entries →') ?>

      Am I doing something wrong, or would this be the expected output?


title: Functions Error: Impacting Galleries

text: The function below controls an option inside an options panel. What it does is choose the number of posts being displayed in a particular archive (to_count archives, to_count_home, to_count search are assigned to the homepage, archives.php, and search results respectively). When I change the number of posts being display it also (for some strange reason) changes the number of images being displayed in a gallery via [gallery] inside a post. I'm not sure why this is happening, since these codes are not being called inside single.php               // Posts per page     add_filter('parse_query', 'wpq_parse_query');     function wpq_parse_query($query)     {         if($query->is_archive())         {             $query->query_vars['posts_per_page'] = get_option('to_count_archives', 10);         }         if($query->is_home())         {             $query->query_vars['posts_per_page'] = get_option('to_count_home', 10);         }         if($query->is_search())         {             $query->query_vars['posts_per_page'] = get_option('to_count_search', 10);     }          return $query;         }


title: Creating a custom login on site.

text:
Evening, I'm trying to make a simple 'login' feature for my site. I'd rather just have a dropdown box of sorts, and to login, the redirect back to the page you submitted it on. I've some code I found (I'm VERY new to wordpress), and it doesn't seem to be working right, when I click 'send', nothing changes. The page gives no errors, and it just sits there, it doesn't say I've logged in, or give any indication it's acting different.               <?php if (!(current_user_can('level_0'))){ ?>
Login
     <form action="<?php echo get_option('home'); ?>../../wordpress/wp-login.php" method="post">     <input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />     <input type="password" name="pwd" id="pwd" size="20" />     <input type="submit" name="submit" value="Send" class="button" />
            <input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me            <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
     </form>     <a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password     <?php } else { ?>
Logout
     <a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">logout
     admin     <?php }?>


title: Jetpack breaks including post (via permalink)

text: On another website, I've been dynamically including posts `<?php include '[post].php' ?>` via the permalink, from my Wordpress site. I recently installed the Jetpack plugin for my Wordpress site, and now when I try including the post it displays a smiley :) in my content area, then forwards to a completely blank white screen with only the smiley. I know the smiley face is part of how Jetpack functions, but is there any way to get these to function in unison?


title: How to create a Mashable like collapsing navigation menu in Wordpress?

text: If you look at the top navigation menu of Mashable you would see that when we resize the view port, the top level menu items collapse under a sub-menu item "More". As we reduce the width of the viewport further, more and more items collapse under a single top level menu list item "More". I want to achieve something like this under Wordpress. Any pointers on this?