title: Preserving $_GET parameter while using custom Rewrite Rule

text: This third party add-on plugin for Gravity Forms allows you to edit existing posts via the front end when you embed a form in your chosen template. All you need to do is append the GET variable/parameter `?gform_post_id=1` to the end of your URL which contains the current form and it will pre-populate your form with existing post data (from post meta fields, etc) and then update the post when you re-submit it. This works only when using a get style parameter attached to your URL in the form of `?gform_post_id=1`... where `1` is the post ID in this example. I don't want ugly URLs, I want pretty URLs, so I'm using the following re- write rules to tidy up my permalinks;               function gform_rewrite(){              global $wp_rewrite;              add_rewrite_tag('%gform_post_id%','([^&]+)');              add_rewrite_rule(             '^user/account/edit/([^/]*)/?',             'index.php?page_id=183&gform_post_id=$matches[1]','top'          );     }      Which takes this,               /index.php?page_id=100&gform_post_id=1      ...and allows for this instead,               /user/account/edit/1      My `query_vars` are set as you can see in a `var_dump`                 ["query_vars"]=>       array(56) {         ["page_id"]=>         int(100)         ["gform_post_id"]=>         string(3) "1"         //....etc      Of course though with pretty permalinks on, the `$_GET` variable no longer holds my `gform_post_id` parameter which means that although the following shows the correct destination as per the rewrite rule above,               /user/account/edit/1         ...it does not pre-populate my form with post data as it does when accessing the same page directly via,               /index.php?page_id=100&gform_post_id=1      Any thoughts on ways around this? ## Notes: The plugin as linked in my opening declares the following line;               $this->get_post_object($_REQUEST[$this->options['request_id']]);      ...to extract data out of of the $_REQUEST variable; The option `request_id` is mapped to `gform_post_id` which should be set as the `$_GET` variable parameter.                 public $options = array(         'request_id' => 'gform_post_id' // here we are...         ,'post_status' => 'default'         ,'capabilities' => array(           'update' => 'default'            ,'delete' => 'disable'          )         ,'entries' => true       );      I have tried hooking onto the `request` filter and setting the `$_GET` variable myself but to no avail. I could be hooking to late in the piece but as it stands I'm a little unsure of how to tackle this problem without directly modifying the plugin itself.


title: Search form is not working in live site

text:
I have installed a wordpress theme called suffusion. Search widget is not working in this theme. It shows nothing found always. I have search.php as below. It is working in local machine               <?php     global $suffusion, $suf_search_excerpt;          get_header();     $suffusion->set_content_layout($suf_search_excerpt);     suffusion_query_posts();     ?>
     <?php suffusion_before_begin_content(); ?>
     <?php     if ($suf_search_excerpt == 'list') {     get_template_part('layouts/layout-list');     }     else if ($suf_search_excerpt == 'tiles') {     suffusion_after_begin_content();     get_template_part('layouts/layout-tiles');     }     else if ($suf_search_excerpt == 'mosaic') {     get_template_part('layouts/layout-mosaic');     }     else {     suffusion_after_begin_content();     get_template_part('layouts/layout-blog');     }     ?>

     <?php get_footer(); ?>


title: Make a taxonomy column sortable in the admin?

text: I have a taxonomy term I have set to show as a column in the admin UI for my custom post type:               add_action( 'init', 'create_asset_tax' );          function create_asset_tax() {       register_taxonomy(         'asset_type',         'design_asset',         array(             'label' => __( 'Asset Type' ),             'rewrite' => array( 'slug' => 'type' ),             'show_admin_column' => true,             'hierarchical' => true,             'sort' => true         )       );     }      How would I make this column "sortable" in the admin UI for my custom post type? Most of the tips I've found here seem to be for sorting columns added, not for columns that result from a taxonomy term, so it's a bit confusing. Thanks.


title: Email "child comment" author when attached post has been deleted!

text: This function works great when trashing a comment or deleting a child comment, manually. But when I trash a post or even delete it, the action "delete_comment" doesn't seem to run.               function authorNotification($comment_id) {         $comment = get_comment($comment_id);         if ( $comment->comment_parent == 0 ) return;          $author = get_userdata($comment->user_id);         $headers = "MIME-Version: 1.0" . "\r\n";         $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";         $headers .= "From:  Brah.com <admin@brah.com>" . "\r\n";         $subject = "Your comment has been removed!";             $message .= "Hey brah! Your comment reply has been removed!";              wp_mail($author->user_email, $subject, $message, $headers);     }     add_action('delete_comment', 'authorNotification');      Any ideas?


title: Split into two seperate unordered lists with custom walker

text:
So I am trying to create a mega-menu using a custom walker through Wordpress. So far I have this for the walker:               class oe_walker extends Walker_Nav_Menu {              /**          * Specify the item type to allow different walkers          * @var array          */         var $nav_bar = '';              function __construct( $nav_args = '' ) {                  $defaults = array(                 'menu_type' => 'main-menu' //enable menu differenciation, used in preg_replace classes[] below             );             $this->nav_bar = apply_filters( 'req_nav_args', wp_parse_args( $nav_args, $defaults ) );              }              function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {                  $id_field = $this->db_fields['id'];             if ( is_object( $args[0] ) ) {                 $args[0]->has_children = ! empty( $children_elements[$element->$id_field] );             }             return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );              }              function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {                  global $wp_query;                  $imgsrc = $args->has_imgsrc = ! empty( $item->imgsrc ) ? $item->imgsrc : '';             $detail = $args->has_detail = ! empty( $item->detail ) ? $item->detail : '';                  $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';             $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';             $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';             $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                  // if we are at the top most level add a class to all links             if( $depth == 0 ) {                  $attributes .= ' class="top-level" ';             }                  $output .= '
';                  $item_output  = $args->before;             $item_output .= '';             $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;             $item_output .= '';             $item_output .= $args->after;                  $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );              }              function end_el( &$output, $item, $depth = 0, $args = array() ) {                  $output .= "
\n";              }              function start_lvl( &$output, $depth = 0, $args = array() ) {                  $imgsrc = $args->has_imgsrc;             $detail = $args->has_detail;                  $output .= '
';             $output .= '
';             //$output .= print_r($args);                  if( !empty($detail) ) {                 $output .= '

'.$detail.'

';             }             if( !empty($imgsrc) ) {                 $output .= '

';             }                  $output .= '
';              }              function end_lvl( &$output, $depth = 0, $args = array() ) {                  $output .= "

\n";              }          }      The trouble I am having is in the start_level method. Say I have 8 sub-links total.. Is there anyway I can split them up into two separate unordered lists containing 4 links each? The markup I am currently getting:

           Link

Link

Link

Link

Link

Link

Link

Link

Link

Text

Link

Link

Link

Link

                What I would like to achieve:

           Link

Link

Link

Link

Link

Link

Link

Link

Link

Text

Link

Link

Link

Link

                 Is this possible to accomplish using only 1 set of sub-links? I understand how the walker works and it creates the elements, which is mind boggling to me how I might be able to achieve this effect. Any ideas, suggestions are greatly appreciated. Thanks.


title: jQuery infinite scroll and pagination styling in wordpress

text:
I am building a wordpress theme with Masonry (Desandro) and Infinitescroll (Paul Irish). In my index.php for masonry loop I have written:-               <?php         $recentPosts = new WP_Query(array('paged'=>$paged)) ;                           ?>                 <?php while ($recentPosts-> have_posts() ) : $recentPosts->the_post(); ?>                          <?php                         /* Include the Post-Format-specific template for the content.                          * If you want to override this in a child theme, then include a file                          * called content-___.php (where ___ is the Post Format name) and that will be used instead.                          */                         get_template_part( 'content', 'masonry' );                          ?>                      <?php endwhile; ?>                       <?php else : ?>                      <?php //get_template_part( 'content', 'none' ); ?>                  <?php endif; ?>             <?php  wp_reset_postdata();  ?>      and for the paged link I have written:               <?php if($recentPosts != '-1') { ?>
<?php next_posts_link() ?>
                   <?php } ?>       For masonry and infinite scroll in my JS file I have written:-               jQuery(function($) {                         var $container = $('.content-area');                    $container.imagesLoaded(function(){                               $container.masonry({              itemSelector: '.mason',              isAnimated: true,                   animationOptions: { //add animations if you want                 duration: 900,                 easing: 'easeInOutExpo'             }                     });       });                          var $container = $('.masonrycontainer');                              $container.infinitescroll ({               navSelector  : '#page-nav',    // selector for the paged navigation                nextSelector : '#page-nav a',  // selector for the NEXT link (to page 2)               itemSelector : '.mason',                     loading: {                        finished: undefined,                   //loadingText  : "Loading new posts...",                   finishedMsg: 'No more pages to load.',                   img: 'http://i.imgur.com/6RMhx.gif',                   start: undefined                 }               },               //trigger Masonry as a callback               function( newElements ) {                 var $newElems = $( newElements ).css({                         opacity: 0                     });                  $newElems.animate({ opacity: 1 });                 $container.masonry( 'appended', $newElems, true );               }             );          });              });      Everything are working fine but what I see (you can see the demo here http://needlestosaymore.com/demo/)   1. The .gif image is loading at the extreme topmost side which I want to make in center.   2. The Paged 2 section i.e. all the old posts in the bottom section of the page, when loads first time those are overlapped. I have checked in Firefox's Inspector and found `"<div id="primary" class="content-area" style="position: relative; height: 3762.33px;"` , an inline-line style is generating giving a height of 3762.33px which I haven't coded anywhere, what I guess that the js code `container.masonry( 'appended', $newElems, true );` is generating this inline style. But as soon as I refresh the page the overlapping issue moves off. I am unable to understand what is the actual flaw I am doing. Please help me to find out. Thanks in advance.


title: Custom Taxonomy registered with multiple custom posts

text: I am using a custom taxonomy location with two custome post types (Place and Resorts) I have three issues here 1)Count shows sum of both CPT's on the taxonomy page How to show the counts separately ? 2)I want hide the category metabox in one of the CPT's How to do it? 3)show_ui false in one custom post type               register_taxonomy(locations', array('place','resorts'), array(         'hierarchical'  => true,         'labels'        => array(             'name'                      => __('Locations','tfuse'),             'singular_name'             => __('Location','tfuse'),             'search_items'              => __('Search Locations','tfuse'),             'all_items'                 => __('All Locations','tfuse'),             'parent_item'               => __('Parent Location','tfuse'),             'parent_item_colon'         => __('Parent Location:','tfuse'),             'edit_item'                 => __('Edit Location','tfuse'),             'update_item'               => __('Update Location','tfuse'),             'add_new_item'              => __('Add New Location','tfuse'),             'new_item_name'             => __('New Location Name','tfuse'),             'choose_from_most_used'     => __('Choose from the most used locations','tfuse'),             'separate_items_with_commas'=> __('Separate location with commas','tfuse')         ),         'show_ui'       => true,         'query_var'     => true     ));


title: Why WP_Query in functions.php is not working when get_posts works?

text:
I have following code in my functions.php. When I try to add new post_type (e.g. post,lawyers) it fills excerpt,slug (this affects in permalink structure), other metaboxes from first post of lawyers post type. I have googled but found something that says adding `global $post;` will solve my problem. But still problem exists.               function lawyers_checkbox_display( $post ) {         global $post ;          wp_nonce_field( 'lawyers_checkbox_display', 'lawyers_checkbox_display_nonce' );                   $data  = "";         if ($post->filter != 'raw') {                 $data = get_post_meta($post->ID,'_lawyer_id',true);         }              $args = array(                 'posts_per_page' => -1,                 'post_type' => 'lawyers',                 'post_status' => 'publish',                 );                 $query_lawyers = null;             $query_lawyers = new WP_Query($args);             while($query_lawyers->have_posts()):                 $query_lawyers->the_post();                             $select = @in_array($post->ID,$data) ? 'checked="checked"' : '';                              echo '<input type="checkbox" value="'.$post->ID.'" '.$select.' id="'.$post->ID.'" name="lawyer_id[]" />';                         echo 'ID.'">';                                 _e( the_title(), 'myplugin_textdomain' );                         echo ' ';                         echo '
';             endwhile;                  wp_reset_postdata();     }      I have found solution by using `get_posts()` in my function. Can any one explain what the difference it makes ? Why `WP_Query` is not working properly.                   function lawyers_checkbox_display( $post ) {         global $post ;          wp_nonce_field( 'lawyers_checkbox_display', 'lawyers_checkbox_display_nonce' );                   $data  = "";         if ($post->filter != 'raw') {                 $data = get_post_meta($post->ID,'_lawyer_id',true);         }              $args = array(                 'posts_per_page' => -1,                 'post_type' => 'lawyers',                 'post_status' => 'publish',                 );                      $myposts = get_posts( $args );                 foreach ( $myposts as $post ) {                   setup_postdata( $post );                        $select = @in_array($post->ID,$data) ? 'checked="checked"' : '';                               echo '<input type="checkbox" value="'.$post->ID.'" '.$select.' id="'.$post->ID.'" name="lawyer_id[]" />';                         echo 'ID.'">';                                 _e( $post->post_title, 'myplugin_textdomain' );                         echo ' ';                         echo '
';                 }                 wp_reset_postdata();     }


title: Is there a faster way than wp_insert_post to add content to a blog

text: I've written a plugin which retrieves an xml file, parses and creates a series of short posts from the content. Although each post is very short (sometimes just a single sentence, never more than a few sentences), there are around 1000 posts to create from the file. Using wp_insert_post takes enough time for this job to timeout giving a 500 status. I also encounter similar problems when deactivating the plugin and trying to move the same content. Are there any quicker ways of populating (or removing) posts?


title: Get which template being in use within WordPress-admin

text: I want to get the template in the theme which being in use of the current edited post(_type)/Page. Lets say im editing a single Post, Then i want to retrive that it using the template `single.php` And if im editing a Custom Post Type that have its own `single-{post_type}.php` i want to retrive that. How can i archive that? are there any global variables that store this information? I know that pages saves it as meta_data. I dont have mutch to go with but i have been looking att `get_query_template` and `locate_template` but i need something in the right direction. Thanks.


title: Get meta information from post parent

text: So I am in a single page and I want to get some meta information from a parent page. This code is inside my footer.php:               if (is_single()) {         global $post;         $parent = get_post_achestor ( $post->ID );         $some_value = get_post_meta( $parent, 'some_metabox_param', true);     }      It's not working people, can you please have a look? UPDATE: the parent page in question is template that has this loop               <?php query_posts( 'post_type=post&posts_per_page=5&paged=1' );      if ( have_posts() ) : global $more; ?>                   <div class="items">         <?php while ( have_posts() ) : the_post(); $more = 0; ?>              <?php get_template_part( 'content', get_post_format() ); ?>          <?php endwhile; ?>          </div>      <?php endif; ?>


title: New Theme creation

text: I am looking into creating my first ever WordPress theme. I want to move my current look and feel that I have created via html / css into WordPress. What I would like, is to have a list of categories on my home page. Then clicking on one of these categories will bring up a page which will display a list of posts on it with some description of the posts. Then if you click on a single post in this page it will load up a single page with a single post displayed on to it. (the full description will be displayed here) I'm not good at PHP as I mainly know HTML and CSS so if someone can guide me through how to do this or even point me in the direction of a related theme I would appreciate it. an idea of what I want, looks like this. This one is my current site created in HTML/CSS.


title: URL rewriting must be activated manually for my plugin

text: I am creating a Wordpress plugin which create pages (with `get_header()`, `get_footer()` and `get_sidebar()`) for searching through an API. Of course, I have defined some rules for URL rewriting like this:               function init() {         global $wp_rewrite;         add_rewrite_rule('my_plugin/(.+)/results?', 'index.php?my_plugin=results&data=$matches[1]', 'top');         ...         $wp_rewrite->flush_rules();     }      This function is called with this line in the constructor of my plugin:               add_action('init', array(&$this, 'init'));      The plugin works perfectly but I need to activate manually URL rewriting in **Settings > Permalinks** in my Admin Dashboard. I need only to select one option: _Day and name_ , _Month and name_ , _Numeric_ ,... (whatever). The problem is that when I install the plugin on a new Wordpress with Permalinks disable ( _Default_ ), I am getting always a **404 error**. This will only work if I activate manually Permalinks.   (I know this is done by the _.htaccess_ ). **Is there is a way to bypass this or to activate automatically Permalinks through my plugin ?   Other good solution is welcome.** I hope my question is clear.   Thank you.


title: Wordpress E-commerce change .CVS import delimiter

text: I'm trying to change the default comma (,) delimiter that WPEC import function detects to semicolon (;) with no luck. I edited import.php in this line:               while ( $row = @fgetcsv( $handle, $length, ',' ) ) {      to something like:               while ( $row = @fgetcsv( $handle, $length, ';' ) ) {      but it isn't working. Do I'm missing something or doing something wrong? I'm not a code master but I was reading that depending in your country (regional configuration), Excel outputs the .csv file with comma or semicolon. In my case my csv file is delimited by semicolons. I also looked for help at Wordpress forums but I can't get it working. Anyone can help me to figure out what's the problem? Thanks in advance. EDIT: Well...after a lot of research, I figured out which line I have to change. So, for those who are looking for a solution, here it is... Look at these line:               `while ( count($rows) < 5 && ( $data = fgetcsv($handle) ) !== FALSE ) {`      and change it like this:               `while ( count($rows) < 5 && ( $data = fgetcsv($handle, filesize( $handle ), ";" ) ) !== FALSE ) {`      Also, make the delimiter change mentioned originally.


title: image thumbnail in RSS Feed

text:
I dont have much coding knowledge. getting prob with RSS feed. I copy n pasted from somewhere this code. getting title and date.. its fine, but client needs now image thumbnail too. How to put image thumbnail. plz help me.. check below code...

 <?php echo $item->get_date('j F Y'); ?>
          <a target="_blank" href='<?php echo esc_url( $item->get_permalink() ); ?>'          title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>           <?php echo esc_html( $item->get_title() ); ?>
      Thanks in advance....


title: WP is easy, The client has to learn it, So what do i offer?

text: i am ok with wordpress functionality, but i am still confused with its business model. After spending some time learning it, I am considering using wordpress rather than doing everything from scratch as i am used to. but I see that the client will manage his content through the WP dashboard, so he has to learn wordpress and i admit that wordpress is really easy to use. **so what do i offer as a service vendor?** If the user knows how to deal with the posts and the content, it wouldn't take much time or effort for him to learn about plugins and other stuff and he will be on his own soon, **So what is my job then? Is my job as a website business just to install and configure wordpress? is it hard for the end user to do that?**


title: How to output meta_key in wp_postmeta?

text: I have a meta_key in wp_postmeta called _su_description. How do I output its value?


title: How to edit contents of dynamic_sidebar()?

text: I know PHP well but I'm new to Wordpress. I got an incomplete Wordpress website. It has a static home page with an Aweber newsletter form. I tried digging into installed theme and in `home.php` I came across:               <div class="home-infobox">     <?php if ( is_active_sidebar( 'homepage-infobox' ) ) : ?>         <?php dynamic_sidebar( 'homepage-infobox' ); ?>     <?php endif; ?>     </div>      Now when I view source on the home page, the Aweber newsletter subscription form appears exactly within `<div class="home-infobox">`. I have to make changes to the form as my first step and I tried to figure out from where is it fetching the content? Is it from the database or from any PHP files, I am totally clueless. Please help me figure this out.


title: How to create and link to administration page for a plugin?

text:
OK Full Code:               <?php          //check to see whether the user is an admin or not.     if (is_admin()) {               function wpsc_display_products_seo(){     global $wpdb;     $productList = $wpdb->get_results("SELECT * FROM " . WPSC_TABLE_PRODUCT_LIST . " ORDER BY name ASC");     echo  get_admin_page_parent();           $path = 'admin.php?page=wpsc_product_seo_details';     $url = admin_url($path);               ?>
<?php _e('Products List','wpsc'); ?>

Below is a list of products. Select a product to edit it's SEO properties.

                 	                 Product Name	                 Meta Title	                 Meta Description	                 Edit

             <?php if($productList) : ?>                 <?php foreach($productList as $product) : ?>                     <?php $meta = getProductMeta($product->id); ?>
                         <?php echo $product->name; ?>	                         <?php getVal($meta, 'meta_title'); ?>	                         <?php getVal($meta, 'meta_description'); ?>	                         <?php getVal($meta, 'meta_keywords'); ?>	                         <a href="<?php echo $url; ?>">Edit
                 <?php endforeach; ?>             <?php endif; ?>
          <?php          }          function wpsc_product_seo_details()     {         echo "
Hello
";     }          function getProductMeta($id)     {         global $wpdb;         $meta = $wpdb->get_results("SELECT * FROM " . WPSC_TABLE_PRODUCT_META . " WHERE product_id = $id");         if($meta)         {             return $meta;         } else {             return null;         }     }          function getVal($RS, $key)     {         if($RS)         {             if (property_exists($RS, $key))             {                 return $RS->$key;             }          }         return null;          }                             function wpsc_add_seo_admin_pages($page_hooks, $base_page) {             $page_hooks[] =  add_submenu_page($base_page, __('SEO For Products','wpsc'),  __('SEO For Products','wpsc'), 7, 'wpsc-module-seo', 'wpsc_display_products_seo');             return $page_hooks;         }         add_filter('wpsc_additional_pages', 'wpsc_add_seo_admin_pages',10, 2);     }          ?>      * * * ## OLD POST Hi Guys, I am currently writing a plugin for my client in wordpress. The issue I am having is when a user clicks on edit to change a record I am not sure how to create the admin link to do this. i.e.               <a href="<?php echo get_bloginfo('url'); ?>/wp-admin/admin.php?page=wpsc_product_seo_details">Edit               function wpsc_product_seo_details()     {         echo "
Hello
";     }      I know my markup for the tag is probably wrong but I was just testing. Do I need to register a hook to do this.


title: How to maintain changes to comment-template.php

text: I have made some custom changes to the file `wp-includes\comment- template.php`. These changes are periodically lost and I assume it's related to updates for WordPress and the file is modified/re-written. I have changed:               $comments_link = get_permalink( $post_id ) . '#comments';      To:               $comments_link = get_permalink( $post_id ) . '#disqus_thread';      Is there a way I can persist these changes so they are not lost? Or perhaps there is a better way to make these changes? _Edit_ I've tried this code in my themes `functions.php` file.               function custom_comments_link($comments_link, $post_id){         return get_permalink($post_id) . '#disqus_thread';     }     add_filter('get_comments_link', 'custom_comments_link', 10, 2);


title: wp_enqueue_style built in styles

text: I'm writing (rewriting) my plugin to use               wp_enqueue_script('jquery');     wp_enqueue_script('jquery-ui-dialog');      **Which is great!** But to use the dialog I need to load a jquery style sheet with wp_enqueue_style, is there a way to load a built-in style, similar to the way you can load the built in scripts (as seen above)? Or do I need to make a call to an external resource?


title: Creating a modal dialog without jQuery

text: I am writing a plugin that depends on modal dialogs for screen space. Right now I am using jQuery to create the dialogs, but I want a way that integrates better into the admin theme. Obviously WP has to have some sort of native dialog system (it's used for uploads). How do I access it?


title: Point homepage to custom php page

text: I've installed a store theme and my client asked me to use a different `homepage` before the current default homepage he wants to name `site.com/store`.   So I've renamed the original `index.php` to `store.php` and created another `index.php`. How can I do now to create a link to `store.php` from `index.php`? the contents of `store.php` cannot be posted in a static page because it's full of php code for last products etc. Does exist some way to point it?


title: Self-added mysql column as custom fields value

text: I am trying to add a value from a column that I've added myself to the wp_posts table as a custom field. So right now there is a column called 'shares' which holds an int value and I want that int value to become a custom field in my wordpress installation so I can use it in the range of features with other wordpress plugins such as sorting the posts etc. Is this even possible?


title: remove () from category number

text: I have found this code here.               $args = array(                        'hide_empty' => FALSE,                        'title_li'=> __( '' ),                        'show_count'=> 1,                    'echo' => 0     );                    $links = wp_list_categories($args);       $links = str_replace(' (', ' (', $links);       $links = str_replace(')', ')', $links);     echo $links;      This returns something like this `(5)`.   I want to remove `()` and show only 6.


title: Get term_taxonomy_id from return of wp_insert_post

text: I am trying to get the term_taxonomy_id from the returned array of wp_insert_term. Below is my code. The term is correctly added to the db, but it fails when i try to get the id and save it to a variable.               $menu_term = wp_insert_term('Main Menu','nav_menu');     $menu_tax = $menu_term['term_taxonomy_id'];


title: Images are not showing after moving Wordpress installation from server to localhost?

text: I moved my wordpress installation from server to localhost on my pc using the instructions in the following link http://www.premiumwebbloghosting.com/2012/07/moving-wordpress-from-hosting-to- localhost.html. I used the second option. After completing the process everything works fine on my pc. I can log to the admin panel using same users, i can access all pages on the website. There was only one problem which is the images are not showing. The images i uploaded to the website were named in Arabic alphabet, therefore were encoded by wordpress and resulted in weird file names!! I noticed that the file names are different than the one in the moved database. The original file name (after upload through wordpress) would be: ط¨ظٹط§ظ†ظ.   The file on my pc would be(not the actual file, the link on the database): Ø¬Ø¦ÙˆÙ†-ÙÙ. What is the reason of this change? I exported the database using UTF8. Why the file names changed when i moved the database to my local development pc? Another thing, Is there a way to prevent wordpress from encoding file names in Arabic, I would like my pictures in the uploads folder to have the same Arabic names, not weird letters!! EDIT: I just noticed that the links in server and localhost are the same before decoding, but they translate differently. Example: server link: http://mywebsite.com/wp- content/uploads/2014/01/%D8%A7%D9%84%D8%A7%D9%85%D8%A7%D8%B1%D8%A7%D8%AA.jpg localhost link: http:/localhost/wp- content/uploads/2014/01/%D8%A7%D9%84%D8%A7%D9%85%D8%A7%D8%B1%D8%A7%D8%AA.jpg but the link translate to different value than the picture's file name!


title: how to assign template from plugin directory to page in wordpress?

text: I have created one plugin as Store Locator, now i want to create page in wordpress and assign it template on activation of the plugin. the Code is like as follows :               $plugin_url = plugins_url('', __FILE__);     define('TEMPLATEPATH',$plugin_url);          function my_plugin_activate()      {              $post = array(               'comment_status' => 'closed',               'ping_status' =>  'closed' ,               'post_author' => 1,               'post_date' => date('Y-m-d H:i:s'),               'post_name' => 'Store Locator',               'post_status' => 'publish' ,               'post_title' => 'Store Locator',               'post_type' => 'page'         );           //insert page and save the id         $page_id = wp_insert_post( $post, false );         //save the id in the database              add_action( 'template_redirect', 'custom_template_redirect' );         }          function custom_template_redirect()      {              global $wp;         if ($wp->query_vars['pagename'] == 'store-locator') { // check the page slug             status_header(200); // a 404 code will not be returned in the HTTP headers if the page does not exists                  include(TEMPLATEPATH . "/template-my-page.php"); // include the corresponding template             die();         }     }      but this thing is not working. is there any other way i can do it?


title: Database Encoding and Editor Issue

text: I can't figure out what's going on. On a dev site, a whole bunch of question marks are showing up: `[http://192.185.118.90/~saintros/school/about/meet- faculty-staff/].` Also, when I go in to edit that particular page, the editor is blank, and it says there's an autosave that is newer than the current page. I check the autosave, and that is also blank. I checked the database, and the entries are not blank. My page header indicates the correct charset: `<meta charset="UTF-8">`. When I look at the database, all of the tables indicate utf8_general_ci. What could be causing this? Everything appears to be as it should. I've deactivated all plugins, switched themes, and nothing changes. Any ideas?


title: Google is indexing wordpress attachment pages

text:
I have a bit of a problem/issue what is freaking me out a bit. I hope you can help me. If i do site:www.somesitename.com search in Google i see that Google is indexing my attachment pages. I want to redirect attachment URL's to parent post and stop google from indexing them. I have used different redirect plugins in hope that i can fix it myself but plugins don't work. I get a error:"too many redirects occurred trying to open www.somesitename.com/?attachment_id=1982 ". Do i need to change something in my attachment.php fail? Any idea what is causing this problem?               <?php     /**      * The template for displaying attachments.      *      * @package WordPress      * @subpackage       */          get_header(); ?>

                      <?php                 /* Run the loop to output the attachment.                  * If you want to overload this in a child theme then include a file                  * called loop-attachment.php and that will be used instead.                  */                 get_template_part( 'loop', 'attachment' );                 ?>

                 <?php get_sidebar(); ?>

            <?php get_footer(); ?>


title: Some Subdomains on a Multisite Install Not Found

text: I am running WordPress multisite and can't access some subdomains. I can access the main website and other subdomains. According to isup.me these subdomains are up. Any idea why this would happen? ### I've tried   * Changing my DNS to Google DNS   * Restarting Computer   * Clearing Cookies But nothing has resolved the issue.


title: WPMU Hook for archive or deactivate blog?

text: I am trying to automatically clear the blog's cache when it is Archived (or Deactivated is fine) in a Multisite install. This is useful for anyone using a caching program like WP Super Cache as an archived or deactivated the blog will still show until the cache is cleared. I have tried:               add_action( 'archive_blog', 'wp_clear_cache_custom' );     add_action( 'unarchive_blog', 'wp_clear_cache_custom');      And:               add_action( 'archive_blog', 'wp_clear_cache_custom_archive', 10, 1 );     add_action( 'unarchive_blog', 'wp_clear_cache_custom_archive', 10, 1 );      With the function:               function wp_clear_cache_custom() {             global $wpdb;             wp_cache_clear_cache( $wpdb->blogid );     }      This same setup works fine for clearing the cache when a theme is changed, etc. but not for blog status changes. Any help is much appreciated. This page seemed to be close but no dice: Perform action on WPMU blog deletion


title: wp_enqueue_style will not let me enforce screen only

text: I am using Roots as the starter for a theme I have been working on. I then generated a print.css file, but in Chrome's case, it still is using the bootstrap-responsive.css queries, and messing things up. This answer on SO explains the issue, and I know it fixes what I am having an issue with (tried it). What happens is that when using this               wp_enqueue_style('roots_bootstrap_responsive_style', '/css/bootstrap-responsive.css', array('roots_bootstrap_style'), null, 'screen');      It always puts out               <link rel="stylesheet" href="/css/bootstrap-responsive.css">      When I really need it to show               <link rel="stylesheet" href="/css/bootstrap-responsive.css" media="screen">      If I try some of the other types listed on W3, some work and some don't (TV doesn't ever render anything, but print does). For example, my print one works fine:               wp_enqueue_style('roots_print_style', '/css/print.css', false, null, 'print');      How can I get this to work? Do I just do this in the header without using wp_enqueue_style, or am I missing something? I do not get any errors, and using WP 3.5.1.


title: How to preset a sidebar widget with default content via script?

text: I'd like to add some code to my plugin populate a specific sidebar (if it exists) with a text widget containing preset content. Assuming that the sidebar I'm trying to preset is referenced by ID as "my- widget", how would I preset the content's of that widget with a text widget containing the text "Hello World"?


title: How to link to images in my plugin regardless of the plugin folder's name

text: What is the correct method to refer to images from within your plugin code, so that no matter what the folder is named, they resolve correctly? I had an issue where a user downloaded my plugin twice, then used the 2nd downloaded file to install it. Since Windows automatically named duplicate files foldername(2).zip, when my plugin was uploaded to the site, it was placed in a folder named "foldername(2). So since my images were linked to wp- content/plugins/foldername/img/foo.png, none of the images were showing up.


title: Tag link suggestion plugin

text: Every time I write a post I make sure I add links to words that I have tags for. For example: "The economy of Brazil has improved in the last few years". This ensures that when people re-post my content, a lot of back-links will be created to my tags. This is quite a lot of work to do manually for every post. It would be cool if there was a plugin that would suggest tags to be applied when they match existing words in the text of the post. Is there such a thing?


title: How do I create my own admin button and theme settings page?

text: I have some options I want my client to be able to change, and so I need an options page for my theme that I can show for those with "editor" status. How can I do this and utilise the options in my pages?


title: Load CSS files in header of Bones theme?

text: I'm using the Bones theme, and I'm trying to turn jQuery plugins into WordPress plugins. In the init.php file for the 'Chosen' plugin I'm converting, I've included this code:               function chosen(){         wp_register_script("chosen-script",plugins_url( 'js/chosen.jquery.min.js' , __FILE__ ));         wp_enqueue_script("chosen-script");         wp_register_style("chosen-style",plugins_url( 'css/chosen.css' , __FILE__ ));         wp_enqueue_style("chosen-style");     }          add_shortcode('chosen', 'chosen');      Google PageSpeed came back with this error: > Put CSS in the document head (1): > > Link node chosen.css should be moved to the document head in www.blank.com/ How can I include this CSS file in the header?


title: Use union/intersection query_posts variables in uri request parameter form?

text: Usually when I create some form of query, I use an array for my arguments like this:               $postslistArgs = array(          'child_of' => 320,         'parent' => 320     );                               $postslist = get_pages($postslistArgs); There are other times, however, when I need/want to use URI-style query parameters like this:               get_pages('child_of=320&parent;=320'); That's all straightforward, but is there any way possible to use the URI parameter style on more advance union/intersection queries such as `post__not_in` that require an array of IDs?


title: Tips for using WordPress as a CMS?

text: I want to use WordPress as a CMS for a reasonably basic site rather than a blog. I have several pages and at the moment, I don't intend to have a "news" page. While there are ways to make this work, the focus in the wp-admin console is clearly on new posts, and creating pages with custom content like maps and galleries feels like I'm working around the system rather than with it. Do you have any suggestions as to using WordPress as a CMS? Specifically:   * Are there any good boilerplate themes that are designed around a CMS rather than a blog?   * Are there any good plugins to help with treating WordPress as a CMS? Alternatively, should I be using WordPress at all?


title: Is there a way to force ssl on certain pages

text: I want to force a secure connection on some of my pages (ones with forms), but I don't want the whole site to work with ssl (slows it down) Is there a way to configure specific pages to require ssl?


title: Redirect after User Activation

text: I am using BuddyPress 2 registration and activation for three different sites with my own registration form. To know where the user has registered, I add the user meta key `registered_from` at registration. Is there a way to redirect the user after activation to the site where he registered?


title: Empty "Forums" page BuddyPress site wide forums - bbPress

text: The main "Forums" page where all forums are supposed to be listed is empty. ![enter image description here](http://i.stack.imgur.com/dVE8b.png) What have I missed here or the combination of BuddyPress and bbPress caused this page not to work anymore? I have followed the installation guide here http://codex.buddypress.org/getting-started/installing-group-and-sitewide- forums/


title: Is it proper to build a site supporting blog visitors in WordPress?

text: I am quite new to WordPress and PHP. I am currently working on a website and I finally come down to WordPress. I guess I might be able to accomplish my work on top of WordPress but I am not sure. I want to hear you opinion. My requirements:   1. Users can register a blog in our site and publish their pages.    2. Users can embed images, audios and videos in their pages.   3. Users can custom the theme of their blogs.   4. Users can create/delete a list of visitors for their blog. Visitors should have basic infomation such as name, email and auto-generated passcode. (For example, a blog owner might want someone to enter a passcode to view a certain page of his blog)   5. Users can create polls in their pages. (A question and a list of answers)   6. Blog visitors can respond to a blog by comments or by answering the owner's questions.   7. Users (blog owner) can do statistics based on visitors' response. (For example, who respond to which questions) I think 1, 2, 3 are trivial in WordPress, but not sure if 4, 5, 6, 7 are proper to implement in WordPress, or if there are better options. (open source projects which I can build on, PHP/Java are both OK) My question is:   1. Am I in the correct way to build my site on top of WordPress?   2. It is convenient to implement functions of 4, 5, 6, 7 in WordPress?   3. Could you point me some WordPress examlpes already implemented 4, 5, 6, 7? Any help is much appreciated!


title: Multiple blog "feeds" in a single blog each with distinctly styled post pages

text: So, I get how to easily create separate blog "feeds" in a single blog by using categories. While I can style the category feed pages differently, unfortunately they both just provide links to the same style/theming of individual posts. I'm curious if there is any way for me to style the individual posts differently based on what feed category they were viewed from? Essentially, I want to have a feed for events and a feed for images, where the feed for image posts links to more gallery styled pages and the feed for events links to a more traditional blog post styled page. Blog posts could (and likely would) be categorized as both types, so how the post is displayed would be entirely dependent on how the user got to it. Anything like this possible?


title: Home page shows recent post, serps rank post within homepage

text: When I search for the title of one of my post in Google I see:               Site Name- Tag Line     www.mydomain.com     Gibberish gibberish gibberish Hereis the the title of my post       I have to go DEEP into the serps to find:               Post Title - Site Name     www.mydomain.com/post     description of the post is here      What gives? It looks so ugly when someone searches for a keyword and my main site comes up, title has no keywords, and all you see is the keywords in the description wrapped in between a bunch of irrelevant sentences.


title: Making an input field required from WP's perspective

text: Submitting a post comment without message leads to a white page with a clean WP error message "ERROR: please type a comment." Is it possible to achieve the same thing for input fields from a custom form? For instance, I've got my own custom contact page template containing a number of input fields, some of them I want to make required. How to get the same WP error message when those haven't been filled?


title: Twenty Twelve theme: remove margins

text: Maybe this is too simple question, but I've tried to find out the info by myself. How can I **remove margins** (all: left, top, right, bottom) for Twenty Twelve theme? This is what I mean: ![WordPress screenshot](http://i.stack.imgur.com/Ocl9g.png)


title: Wordpress search exact match

text: I have a few search filters set up and I found a few posts that shouldn't be in the search results. On looking into it further I found these posts match 'part' of the keyword. For example, searching for 'car' would match posts with 'carried', 'carbon', 'scar' and anything else with car in the word. I really want this to only pull posts that match 'car' exactly. Is this how wordpress works by default? I've already tried the `'exact' => true` argument on WP_Query but that makes the search horribly specific when using category filters etc. How can I set it so it matches keywords exactly?


title: Hebrew WP 3.5: plugin activated, does not appear in sidebar

text: I am trying to create a custom post type with mandatory custom fields. I've followed the Adding Custom Fields to a Custom Post Type, the Right Way tutorial, and installed the Advanced Custom Fields plugin on my Hebrew Wordpress 3.5: ![enter image description here](http://i.stack.imgur.com/PLbkM.png) The new custom post type ("Books") appears on the side bar, as expected. But there is no `Advanced Custom Fields` item on the sidebar, although the plugin is installed and activated. I've tried installing using the web interface and opening the zip file directly, with no results. How do I get the `Advanced Custom Fields` to appear on my sidebar menu?


title: WordPress nested loop not working

text:
Why is this code not retrieving the posts of custom post type "graphic- design"?               <?php         $args = array( 'pagename' => 'graphic-design' );         $query = new WP_Query($args);         while ( $query->have_posts() ) : $query->the_post();         ?>

<?php the_title(); ?>
                      <?php                 $inner_args = array( 'post_type' => 'graphic-design' );                 $inner_query = new WP_Query( $inner_args );                 while ( $inner_query->have_posts() ) : $inner_query->the_post();                 ?>
                         <?php the_post_thumbnail(); ?>
                      <?php                  endwhile;                 wp_reset_postdata();                 ?>
              <?php          endwhile;         wp_reset_postdata();         ?>      When I run the inner query on its own, outside of the outer query it works fine.


title: List of child custom post types lists all custom post types

text:
Several of my pages have some "posts" of custom post types as child posts. On these pages I want to list all of the child posts. Therefore I have this code:               <?php     $page_id = get_queried_object_id();     function subpage_peek($parent_id) {         // reset the query, just to be sure         wp_reset_postdata();         //query subpages         $args = array(                      'orderby' => 'menu_order',                      'sort_order' => 'ASC',                      'hierarchical' => 0,                      'post_parent' => $parent_id,                      'post_type' => 'kuenstler'         );         $subpages = new WP_query($args);              // create output         if ($subpages->have_posts()) :             $output = '
';             while ($subpages->have_posts()) : $subpages->the_post();                 $output .= '
'.get_the_title().'
';             endwhile;             $output .= '
';         else :             $output = '
No subpages found.
';         endif;              // reset the query         wp_reset_postdata();              // return something         return $output;     }     echo subpage_peek($page_id);     ?>      Why do this output all of my posts of the custom post type? # Update #1 This is my solution and it works:               <?php       wp_reset_postdata();       global $post;       $post = get_post(get_the_id());       $child_posts = types_child_posts('kuenstler');       foreach ($child_posts as $child_post) {         echo '
ID).'">'.get_the_title($child_post->ID).'
';       }     ?>      Does anyone know which kind of reset I have to use if I want of course the above code to be in the content body, but also in several sub-navigations which lists all of these sub-posts? At the moment the main loop (see above) works, but in each of my four sub-navigations not the children of page x are listed but the subpages of the main loop.


title: How to move the "create new account" higher in woocommerce

text:
I'm sorry if this turns out to be a stupid question, but I can't seem to find a way how to force the checkbox for "create new account" appear before everything else. I looked inside the `form-checkout.php` file in `theme/woocommerce/checkout` folder but can't make out which file should I go and look for this, so any help is appreciated. For reference my form-check.php looks like this:               if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly     global $woocommerce;     $woocommerce->show_messages();     do_action( 'woocommerce_before_checkout_form', $checkout );     // If checkout registration is disabled and not logged in, the user cannot checkout     if ( ! $checkout->enable_signup && ! $checkout->enable_guest_checkout && ! is_user_logged_in() ) {         echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) );         return;     }     // filter hook for include new pages inside the payment method     $get_checkout_url = apply_filters( 'woocommerce_get_checkout_url', $woocommerce->cart->get_checkout_url() ); ?>     <form name="checkout" method="post" class="checkout" action="<?php echo esc_url( $get_checkout_url ); ?>">         <?php if ( sizeof( $checkout->checkout_fields ) > 0 ) : ?>             <?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>

                     <?php do_action( 'woocommerce_checkout_billing' ); ?>

                     <?php do_action( 'woocommerce_checkout_shipping' ); ?>

             <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
<?php _e( 'Your order', 'woocommerce' ); ?>
         <?php endif; ?>         <?php do_action( 'woocommerce_checkout_order_review' ); ?>     </form>     <?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>      ![enter image description here](http://i.stack.imgur.com/MNT1b.jpg)


title: Custom paging function

text: I use this code for my custom paging :               global $wpdb, $table_prefix, $current_user;     get_currentuserinfo();     $umail = $current_user->user_email;     $paged = $wpdb->get_results("SELECT * FROM {$table_prefix}comments WHERE comment_author_email = '$umail'");          $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;     $pages = COUNT($paged);     $pages = ceil($pages / 2);          $querystring = "";     foreach ($_GET as $key => $value) {         if ($key != "page") $querystring .= "$key=$value&";     }          // Pagination     for ($i = 1; $i <= $pages; $i++) {         echo "<a " . ($i == $page ? "class=\"selected\" " : "");         echo "href=\"?{$querystring}page=$i";         echo "\">$i</a> ";     }      This code paginate my comments look like this : 1 2 3 4 5 6 7 8 9 10 11 How can change code to get paginate look like this: 1 2 3 ... 11 Thanks for any help.


title: Add category to my get_post query

text: I am using this Query to pull in the latest 3 post               <?php     $query = 'posts_per_page=3';     $queryObject = new WP_Query($query);     // The Loop...     if ($queryObject->have_posts()) {     while ($queryObject->have_posts()) {         $queryObject->the_post();         the_title();         the_content();                 comments_template();     }     }     wp_reset_postdata();     ?>       I need to add from category 1 I tried adding query_posts($query_string . '&cat=-3'); at the top of the query, it works but the formatting is not the same and the comment box is missing. I am using this query in a tabbing plugin and is the only query that pulls in the comment box that works in a tabbing plugin that I have found, so I am trying to get this particular query to work Thanks for any help


title: problem with php function error

text: Hi I seem to get this message > >     Warning: Creating default object from empty value in C:\xampp\htdocs\wp- > content\themes\knowledgepress\lib\ticket-functions.php on line 851 >   However looking at the code I cant see a problem?               if (!function_exists('woo_supportpress_get_ticket_details')) {         function woo_supportpress_get_ticket_details( $post_id ) {                   $status = current(wp_get_object_terms( $post_id, 'ticket_status' ));             $type = current(wp_get_object_terms( $post_id, 'ticket_type' ));             $priority = current(wp_get_object_terms( $post_id, 'ticket_priority' ));                  if (!isset($status->name)) $status = '';                  if (!isset($type->name)) $type = '';                  if (!isset($priority->name)) $priority = '';                  $ticket_details = array(                 'status' => $status                 ,'type' => $type                 ,'priority' => $priority                 ,'assigned_to' => get_user_by('id', get_post_meta( $post_id, '_responsible', true))                 ,'reported_by' => get_post_meta( $post_id, '_reported_by', true)                 ,'reported_by_email' => get_post_meta( $post_id, '_reported_by_email', true)             );                  /* Support 'Anybody' user */             if (!isset($ticket_details['assigned_to']->display_name)) $ticket_details['assigned_to']->display_name = 'Anybody';             if (!isset($ticket_details['assigned_to']->ID)) $ticket_details['assigned_to']->ID = 0;                  return $ticket_details;              }     }      line 851:               if (!isset($ticket_details['assigned_to']->display_name)) $ticket_details['assigned_to']->display_name = 'Anybody'; '


title: How to change format of file link (<a url="file_link"> Name </a>) when insert from media uploder

text: I want change some default wordpress functionality. From Media library when we select a file and press "Insert into page" (other than image file) It inserts in format `<a url="file_link"> Name </a>` I want to change this default format. option 1 : I want to add extra tags before A tag OR Option 2 : I want to assign extra classes to A tag depending on target file link extension. because i want to design that A tag with file extension icon image (eg. like a download button.)


title: wordpress loop and template files

text: I am curious how WordPress know that if I have a category.php and do the basic loop inside there that when I click on category A I get all of A's posts. The reason I ask, is because I have seen themes that just have an index.php and when you click on Category A in those themes you get all of A's posts, and they do not have a category.php file. Is there a trick to achieve this? because if you do: category.php and inside that do:               if(have_posts()){         while(have_posts()){             the_post();         }     }      You will get all posts for any category link you click on. How ever, as stated some people only have index.php in their theme and when you click on a category link you get all posts for that category, regardless of category clicked on. Much like global post_id is there a global category_id to query against?


title: remove auto generated pages from the menu?

text: I have a simple function that adds a couple of pages to the users website when they activate my plugin. Actually there are many plugins out there that generate custom pages for the user, plugins like woocommerce do this. Question: If the user does not have a menu assigned to their theme, many times the theme reverts back to simply showing a list of pages, I think by using the wp_list_pages() function. Is there a way of automatically excluding my dynamically created pages from wp_list_pages()?


title: Posts in nav menu

text: Hello I'm making menu and I want to add element of menu and in this element submenu which posts name and links to this posts. For example I have item menu called ` A->link1 to post link2 to post link3 to post` I dont want to use link in appearance->menu I would like to use custom post type but dont know how.


title: Why doesn't update_post_meta work for certain strings?

text: I am trying to store the local path to an uploaded file as a meta for a custom post type, using the following code:               $upload = wp_handle_upload ( $_FILES [WPSM_MAIL_META_ATTACHMENT], array ('test_form' => false ) );     if ((isset ( $upload ['error'] )) && ($upload ['error'] != 'Specified file failed upload test.')) {         die ( $upload ['error'] );          } else {         $path = $upload['file'];         //$path = 'C:\Users\Brady\Music\Honour, Valour, Pride';         update_post_meta ( 34, WPSM_MAIL_META_ATTACHMENT, $path );     }      With the `$path = $upload['file']` call I get that `$path` contains "C:\xampp\htdocs\wordpress/wp- content/uploads/2011/12/ReSharper-6.1-License18.txt", but my *post_meta* row for this post has a empty *meta_value* column after the update. When I use the commented out assignment of a test literal to `$path`, the meta_value column is properly updated to the text path string. I'm truly lost here. How can two string arguments to the same function call have such different effects?


title: Display gallery on top before content

text: Is it possible to execute the gallery shortcode before any other content no matter where the shortcode is in the post HTML?


title: Gallery just showing plain short code like [gallery ids="240,236,275"]. how to solve this?

text: I've followed this codex The WordPress Gallery after I added the gallery when see just plain text like [gallery ids="240,236,275"] the sample page : gallery page I did not add any filter or something for this on my `function.php` Do I want to add anything for that? How can I solve this..? Any help will be very much appreciated.


title: Extra text... after read more tag

text: I have some `<!--more-->` tags in my posts and they work...to a degree. Instead of doing a hard break after the `<!--more-->` tag, it continues on to show some of the next paragraph of text followed by a `...` How can I get the `<!--more-->` tag to be a hard break? Thanks example on homepage


title: How to test site speed?

text: I'm looking to measure how fast my site is processed. Is there any software out there that can do this? If it depends on the server, is there any way to monitor the speed from my localhost (purely CPU load?)


title: Exclude Duplicate Posts in this SELECT Query

text: I have this custom select query that pulls a specified number of posts from a specific category and displays them in the order of the latest comments. The problem is that if a post has both of the latest comments, it will get shown twice. I would like it to somehow detect duplicate posts and exclude them, showing only the most recent comment.               $sql =     "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID,         comment_author, comment_date, comment_approved, comment_type,comment_author_url,         SUBSTRING(comment_content,1,100) AS com_excerpt     FROM $wpdb->term_taxonomy as t1, $wpdb->posts, $wpdb->term_relationships as r1, $wpdb->comments     WHERE comment_approved = '1'        AND comment_type = ''        AND ID = comment_post_ID        AND post_password = ''        AND ID = r1.object_id        AND r1.term_taxonomy_id = t1.term_taxonomy_id        AND t1.taxonomy = 'category'        AND t1.term_id IN ($inlist)     ORDER BY comment_date DESC LIMIT 4";      Any ideas?


title: If function exists, and array is met, echo function?

text: I have a function like the following:               <?php echo my_custom_function( array( 'category_url'=>'My Special Category' ) ); ?>      It pulls data from the "My Special Category" and displays it. I want to put a conditional statement around it that says if, and only if, that category has stuff to display, to display it. There are more than one category_url's so wrapping it with an if statement and just using my_custom_function doesn't work because of the array, it throws the error: "Missing Argument 1". Any idea on how to make this function only echo if it exists AND if the argument is equal to itself? PHP noob question. ;) Thanks!!


title: Category Icon on custom post type

text: I am using custom post types "listings" and I have a category called "type" and 3 sub cats, "available", "pending", "sold". I want to display an image/icon on each post in the loop (not the single- listings.php) but the archive view, that corresponds to it's category. Take a look at woothemes' Estate for an example. They have an image over the featured image that says "on show". Any thoughts on how to go about this? or a plugin that might do something similar? thanks! I found this code reference:                <?php $cats = get_the_category(); echo $cats[0]->category_name;?>">      And then it said to style using the category as a class in the css, but no go. It returns nothing - wondering if custom post type cats need to be handled differently?


title: wp_insert_post breaks rewrite rules

text: I'm using `wp_insert_post` to programmatically add content to a site. This works fine with posts, categories and tags, but not with pages. When I attempt to add a page (i.e. post with post_type=page), the rewrite rules do not get properly regenerated (or something happens to them after `wp_insert_post`). Specifically, rules related to category and tag urls get lost, as listed below:               [category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]     [category/(.+?)/(feed|rdf|rss|rss2|atom)/?$] => index.php?category_name=$matches[1]&feed=$matches[2]     [category/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&paged=$matches[2]     [category/(.+?)/?$] => index.php?category_name=$matches[1]     [tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]     [tag/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?tag=$matches[1]&feed=$matches[2]      ...etc This means that tag and category archive urls get broken. Just clicking on Settings > Permalinks will repair them. Have tried to fix by using `$wp_rewrite->flush_rules()` immediately after `wp_insert_post` but this has not fixed the problem...


title: Iframe only visible after log in

text: I have a website on WordPress and I am trying to add a Iframe on its website. I have done similar sort of thing on two other websites previously without any issue.. Here is the website in question: http://sharingspider.com/nfs/ However, this time I am facing some permission related issue. I can view the Iframe only after logging in. Permission set are 777 for uploads folder where I have my iframe uploaded. I can access Iframe URL directly (http://sharingspider.com/nfs/wp-content/uploads/slider/slider.htm) Demo ID : temp password: password use the above username and password to see the issue Could someone share any insight on why this is happening with this particular site? thanks in advance, Aashish


title: Multiple Parameters for a Shortcode

text:
I am working on building some shortcodes for my blog. I can set a single parameter for my shortcode, but not sure how to set different parameter. For example, I can use `[myshortcode myvalue]` to output a html block within the post content. Here is what I am currently using:               function test_shortcodes( $atts ) {         extract( shortcode_atts( array(             'myvalue' => '

'              ), $atts ) );              return $myvalue;     }     add_shortcode( 'myshortcode', 'test_shortcodes' );      Now, how can I use `[myshortcode myothervalue]` to output a different block of html? Please note that the shortcode is same, only the parameter is changed.


title: Custom gallery in wp3.5

text:
I used a tutorial I found for a slick little custom gallery in 3.4, but upon upgrade to 3.5 it no longer works. I'm trying to learn php still and can't seem to get this working again, as I either get errors or nothing at all. Anyway, prior to the upgrade all the user had to do was hit "Add media", upload whatever images he wanted displayed in the post [products, in this case], set the order of the images with the first image being the top/full size image, and then type his description in the text field, and when he hit submit it spit out the above all nicely formatted, like so:               single.php          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     x First image attached to post, large size x     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx          --------------> Output of content box <--------------          xxxxxxxxxxxxxxxxxxxxxxxxxxxx  xxxxxxxxxxxxxxxxxxxxxxxxxxxx     x second image, thumbnail  x  x third image, thumbnail   x     xxxxxxxxxxxxxxxxxxxxxxxxxxxx  xxxxxxxxxxxxxxxxxxxxxxxxxxxx      Here is where I called it in single.php:

<?php wpo_get_images('large','1','0','large',"$post->ID",'1','feat-img','div','main-thumb'); ?>
                     <?php the_content(); ?>
                                 <?php wpo_get_images('thumbnail','0','1','large',"$post->ID",'1','bot-thumbs','div','inner-element'); ?>

      And this is from my functions.php:               // Add the ability to use post thumbnails if it isn't already enabled.     // Not required. Use only of you want to have more than the large,     // medium or thumbnail options WP uses by default.          if ( function_exists( 'add_image_size' ) ) add_theme_support( 'post-thumbnails' );          // Add custom thumbnail sizes to your theme. These sizes will be auto-generated     // by the media manager when adding images to it on a new post.     if ( function_exists( 'add_image_size' ) ) {     add_image_size( 't1x1', 145, 200, true );     add_image_size( 't2x1', 307, 200, true );     add_image_size( 't2x2', 307, 417, true );     }          ///////////////////////////////////////////////     //     // Start WPOutfitters.com Custom Gallery Function     //     //////////////////////////////////////////////          function wpo_get_images($size = 'thumbnail', $limit = '0', $offset = '0', $big = 'large', $post_id = '$post->ID', $link = '1', $img_class = 'attachment-image', $wrapper = 'div', $wrapper_class = 'attachment-image-wrapper') {     global $post;          $images = get_children( array('post_parent' => $post_id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') );          if ($images) {              $num_of_images = count($images);              if ($offset > 0) : $start = $offset--; else : $start = 0; endif;         if ($limit > 0) : $stop = $limit+$start; else : $stop = $num_of_images; endif;              $i = 0;         foreach ($images as $attachment_id => $image) {             if ($start <= $i and $i < $stop) {             $img_title = $image->post_title;   // title.             $img_description = $image->post_content; // description.             $img_caption = $image->post_excerpt; // caption.             //$img_page = get_permalink($image->ID); // The link to the attachment page.             $img_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);             if ($img_alt == '') {             $img_alt = $img_title;             }                 if ($big == 'large') {                 $big_array = image_downsize( $image->ID, $big );                 $img_url = $big_array[0]; // large.                 } else {                 $img_url = wp_get_attachment_url($image->ID); // url of the full size image.                 }                  // FIXED to account for non-existant thumb sizes.             $preview_array = image_downsize( $image->ID, $size );             if ($preview_array[3] != 'true') {             $preview_array = image_downsize( $image->ID, 'thumbnail' );             $img_preview = $preview_array[0]; // thumbnail or medium image to use for preview.             $img_width = $preview_array[1];             $img_height = $preview_array[2];             } else {             $img_preview = $preview_array[0]; // thumbnail or medium image to use for preview.             $img_width = $preview_array[1];             $img_height = $preview_array[2];             }             // End FIXED to account for non-existant thumb sizes.                  ///////////////////////////////////////////////////////////             // This is where you'd create your custom image/link/whatever tag using the variables above.             // This is an example of a basic image tag using this method.             ?>             <?php if ($wrapper != '0') : ?>             <<?php echo $wrapper; ?> class="<?php echo $wrapper_class; ?>">             <?php endif; ?>             <?php if ($link == '1') : ?>             <a href="<?php echo $img_url; ?>" title="<?php echo $img_title; ?>">             <?php endif; ?>             <img class="<?php echo $img_class; ?>" src="<?php echo $img_preview; ?>" alt="<?php echo $img_alt; ?>" title="<?php echo $img_title; ?>" />             <?php if ($link == '1') : ?>                          <?php endif; ?>             <?php if ($img_caption != '') : ?>
<?php echo $img_caption; ?>
             <?php endif; ?>             <?php if ($img_description != '') : ?>
<?php echo $img_description; ?>
             <?php endif; ?>             <?php if ($wrapper != '0') : ?>             </<?php echo $wrapper; ?>>             <?php endif; ?>             <?php             // End custom image tag. Do not edit below here.             ///////////////////////////////////////////////////////////                  }             $i++;         }          }     }      If someone could steer me in the right direction, and maybe even explain what broke and any additional info so I could learn as much as possible would be great!


title: List of Registered Taxonomies of Current Post

text: I am trying to get list of registred taxonomies of current post,   I mean:               register_taxonomy('color',array('thing'),$args) ;     register_taxonomy('shape',array('thing'),$args) ;     register_taxonomy('material',array('thing'),$args) ;     // etc..      So how can I get the list of taxonomies that registred to 'thing' posttype? Must be something like:               $taxonomies = get_registred_taxonomies_of('thing') ;     print_r($taxonomies) // Show "color,shape,material"...      Any idea? Thank you!


title: Filter Orders in Admin area, based on Custom meta

text: **Story:** I have custom role `Staff` for my WooCommerce shop, When a Customer create an Order, the Order is assigned a custom meta name `handle_by` where the value is a random value of user where role is Staff. When Staff is login and click `WooCoomerce > Orders`, He/She will only see Orders where `handle_by` is match current user id. **Problem:** How to filter WooCommerce > Order to only show Order where the custom meta `handle_by` is match with current user login.


title: If Parent or Current Page Is, Then Statement?

text: I need a conditional statement which checks to see if the page the user is currently on is a child of a specific parent page or that parent page itself, and if so, display a link. How do I achieve this in WP?


title: Disable trim in WordPress

text: I have a post. That is that post:               - A     - B     - C      When I use function `the_excerpt()`, it changed:               - A     - B     readmore      I want it to have the old structure.               - A     - B     readmore      but I don't know I need can change where. Mayeenul Islam: thank you very much. I did it. I don't understand when i read your comment in the first. But i read again and i see problem.


title: Meta_query compare operator explanation

text: I noticed that there are bunch of operator can be use for compare in meta_query. However, I am not quite sure what operator I should use, it is somehow confusing like `=` and `LIKE` operator. I would like to know what exactly each operator mean, and in what condition I should use them.               =     !=     >     >=     <     <=     LIKE     NOT LIKE     IN     NOT IN     BETWEEN     NOT BETWEEN     NOT EXISTS      Thanks.


title: How can I keep the content of my pages version controlled?

text: We have a WordPress-based website that provides documentation to our REST API. Since our API is constantly changing, so is the documentation. However, we would like to keep the documentation version controlled so it can be matched against API commits. Is there a way to have WordPress pages get their content from a remote repository (GitHub, for example)? Or is there a way to push content to WordPress from some repository?


title: Subdomain for WP Mobile Edition and Cloudfare

text: Im using WP Mobile Edition and CloudFare. I added the subdomain m.mysite.com in DNS settings in CloudFare and point it to my hosting IP. But when accessing m.mysite.com, it will display default webpage /cgi- sys/defaultwebpage.cgi. Accessing http://m.mysite.com/msitemap.xml will return 404 page. How to add subdomain for WP Mobile Edition in CloudFare? Thanks


title: Which filter/action hook gets triggered after a query has been performed?

text: Is there an action or filter that gets called after an instance of WP_Query performs a query?


title: Custom Post Type Metabox - Not Saving

text:
I've added a custom post type, which is working great; I've also added two metaboxes, which appear to work well, but the content in them always disappears after a few minutes. If anyone could help out on this I would be eternally grateful, S. //meta box code//               add_action( 'admin_init', 'add_custom_metabox' );     add_action( 'save_post', 'save_custom_details' );          function add_custom_metabox() {         add_meta_box( 'custom-metabox', __( 'Product Description & Ingredients' ), 'descr_custom_metabox', 'sorbets', 'normal', 'low' );     }          function descr_custom_metabox() {         global $post;         $proddescr = get_post_meta( $post->ID, 'proddescr', true );         $ingredients = get_post_meta( $post->ID, 'ingredients', true );         ?>
Product Description:
             <textarea id="proddescr" name="proddescr" style="margin:0;height:7em;width:98%;" cols="45" rows="4"><?php if( $proddescr ) { echo $proddescr; } ?></textarea>

Ingredients:
             <textarea id="ingredients" name="ingredients" style="margin:0;height:7em;width:98%;" cols="45" rows="4"><?php if( $ingredients ) { echo $ingredients; } ?></textarea>
     <?php     }          function save_custom_details( $post_ID ) {         global $post;            if( $_POST ) {             update_post_meta( $post->ID, 'proddescr', $_POST['proddescr'] );             update_post_meta( $post->ID, 'ingredients', $_POST['ingredients'] );         }     }          function get_descr_ingred_box() {         global $post;              $proddescr = get_post_meta( $post->ID, 'proddescr', true );         $ingredients = get_post_meta( $post->ID, 'ingredients', true );              return array( $proddescr, $ingredients );     }


title: Page not found yet the posts are listed?

text:
OK, seriously. I have a really modified index.php. The result: after the second paginated page, the page returns `Not found` and 404, while the posts are shown already. Can anybody tell me, what it happening? Working example with the problem:   * everything ok: http://petermolnar.eu/photoblog   * everything still ok: http://petermolnar.eu/photoblog/page/2/   * Page not found: http://petermolnar.eu/photoblog/page/3/ and so on. The codes: **index.php**               <?php         define ('REDIRECT_TO_PORTFOLIO', get_option ('siteurl') . '/portfolio/through-a-lupe/' );         $_query_string = $query_string;              if ( is_home() || is_front_page() )         {             wp_redirect( REDIRECT_TO_PORTFOLIO );             exit;         }              $cat = get_query_var('cat');         if ( !empty( $cat ) ) :             $show_pagination = false;             $show_sidebar = false;             $posts_per_page = get_option('posts_per_page ');             $category = get_category( $cat );             $orderby = 'date';             $order = 'DESC';             switch ($category->slug) :                 case 'portfolio':                         wp_redirect( REDIRECT_TO_PORTFOLIO );                         exit;                     break;                 case 'photoblog':                     $posts_per_page = 4;                     $show_pagination = true;                     break;                 case 'wordpress':                     $orderby = 'modified';                     $show_sidebar = true;                     break;                 default:                     $show_sidebar = true;                     break;             endswitch;             $_query_string = $query_string . '&posts_per_page=' . $posts_per_page . '&order=' . $order . '&orderby=' . $orderby;         endif;              get_header();         query_posts( $_query_string );              if ( $show_sidebar ) :         ?>
         <?php         endif;              if ( have_posts() ) :             while ( have_posts() ) :                 get_template_part('singles');             endwhile;         endif;              if ( $show_sidebar ) :         ?>

         <?php             echo wp_list_posts( -1, get_option('posts_per_page ') );         ?>
         <?php         endif;              if( function_exists('wp_paginate') && $show_pagination )             wp_paginate();              get_footer();     ?>      **SOLVED** I could solved after a few hour, please see the first comment for explanation. It is caused by some kind of bug in pagination counter, it always uses the default value to count the pagination instead of the new one. Pagination would have to be re-calculated after a query_posts with per post values.


title: Build path for a custom portfolio plugin

text: I'm finishing up a personal site that I've spent many weekends on. I've left one of the (potentially) most complicated parts to the end of production. I'm looking for some advice on how to proceed with a fairly customized portfolio / gallery feature. I'll note that I'm relatively new to wordpress, but not to building things with code (as3, javascritp, c#). Use case looks like this: User opens portfolio page, and a limited number (3 rows of 3) of thumbnail containers populate the screen. Thumbs are pulled in via ajax, and rollovers / effects are applied on the client side. Click of thumb floats a div over the page (ala fancybox). Div contains a larger image and then another hunk of markup detailing category tags, year, notes etc. Link in floated div opens folio item in a "project" page (a custom template), with this same, but perhaps expanded, information. In the long run, the user will have the choice of a few different presentation options, but this is where I'm starting. The content is pretty varied, and so _the format must be pretty flexible_. Everything from single photos or illustrations, to a more complex breakdown and commenting of a completed project (web app or body of images, for example). At the minimum, I need a data returned from query variables - and the easiest would be to just write up a static xml file/s and just run the whole thing via ajax. I could easily build the whole thing on the fly, client side, and just call it a day. That being said, I would really like to integrate this content into wordpress and manage content dynamically. I've seriously considered rolling my own plugin to deal with data CRUD. I figure I need, at least one admin page, and then probably a couple of front facing templates for client side delivery. It would be nice to upload contents as well, but I can easily just use an ftp to do so. So, first real question: how should I proceed with my first plugin, and what built in WP functionality can I leverage to make the process as smooth as possible (making use of the WP_query, or the post / page system, for example). Ultimately, I just need a basic data source / delivery system that I can extract via json or otherwise, and all my needs would be met. Before I begin on one of these two build paths, is there a plugin that may suit my specific needs already? I've poked through Next Gen and the built in WP gallery, but I _think_ they may not be flexible enough... it doesn't seem like it. I'm not concerned with a wealth of features as much as a reliable data creation / delivery system. Thoughts? Thanks in advance -


title: Paypal Integration

text: i would like to integrate Paypal payments to my Wordpress website, in order to send a digital product. I only want a simple redirection to the paypal payments form, to either pay through paypal or with a credit card (i have a payments standard account there). The problem is the notifications system. I would like my client to be able to download my digital product right after the payment has occurred. Is there a plugin that handles this situation and makes sure that payment and delivery happen normally (using the paypal notifications system) ? I was taking a look at Paypal Framework and i happen to be a programmer. If i take a closer look at that, would it allow me to do what i want ?


title: How is my non-published blog getting so much spam?

text: A few weeks ago I created a new WordPress blog. I bought a new domain name for it, and I have not published/linked to the blog yet (because I wanted to get a few articles up first, I only have 2 so far). I have gotten about 10 spam comments already. I am confused how the spammers could be finding me?


title: What hook should be used to programmatically create a post only when master post is updated?

text: Pippin and Jean-Baptiste Jung have very good tutorials on how to programmatically create content when a new post is published using these four actions hooks...   * publish{post_type}   * add_action('new_to_publish_{post_type},   * add_action('draft_to_publish_{post_type},   * add_action('pending_to_publish_{post_type} ... to run this script...               global $user_ID;     $new_post = array(         'post_title' => 'My New Post',         'post_content' => 'Lorem ipsum dolor sit amet...',         'post_status' => 'publish',         'post_date' => date('Y-m-d H:i:s'),         'post_author' => $user_ID,         'post_type' => 'post',         'post_category' => array(0)     );     $post_id = wp_insert_post($new_post);      What hook should I be using to do this function **only** when a post is updated? Thank you!


title: Differentiate between posts and pages in search results

text:
How can one differentiate between posts and pages in search results? What I need to do is show a `the_time` div for posts but not show it for pages, as it's irrelevant. With a function? `<?php if (!is_page()) }` in the loop below doesn't help.               <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>     <a href="<?php the_permalink() ?>"><?php the_title(); ?>          //prevent this div from displaying for pages:
<?php the_time('F jS, Y') ?>
          <?php the_excerpt(); ?>          <?php endwhile; ?><?php else : ?><?php endif; ?>


title: wp_update_term: How could i update the "name"?

text: I was just looking at wp_update_term and haven't found any possibility to update the "name" of the term. My scenario is pretty simple: I got some predefined taxonomy terms in a config file like this (just an example):               $taxonomy_terms = array(       'taxonomy_a' => array( 'term_a', 'term_b', 'term_c' )      ,'taxonomy_b' => array( 'term_d', 'term_e', 'term_f' )     );      Now i'm trying to update these terms based on their id. So if the id exists, i change just the name. But here does my problem start: wp_update_term doesn't offer any possibility to update the name of term... Does anybody know of some work around, or do i just oversee something? Thanks!


title: WPMU - How to echo only one URL

text:
I have this code that I am using on a site to check if the current user has a blog on the our wp network and as of now it is echoing the URL for both the main site and their blog. I would like to know, how can I modify the code so that it only echoes for the user's site and not the primary/main site.               <?php if(is_user_logged_in()) {     global $current_user;       $blogs = get_blogs_of_user( $current_user->id );          if($blogs) {              foreach ( $blogs as $blog ) {              echo '
domain . $blog->path .'/upload-and-manage-documents/">My Documents
';              echo '
domain . $blog->path .'upload-and-manage-documents/?ptype=settings&tab=gateways">Settings
';                  }          }     } ?>              <?php endif; ?>      So as of now instead of 2 links, it is echoing 4. How can I fix this? Any help is appreciated. Thanks.


title: Need to check is_archive during init

text: I need to check if a page is an archive or not, before my plugin does some URI manipulations. These manipulations only work before `wp` but if I perform them first and then check `is_archive`, the check will always return false. How can I check `is_archive` (or achieve the same end result) during a pre-`wp` hook? It would be great if we could pass `is_archive` a postid to check, but it doesn't work that way. **EDIT** : I realize perhaps I'm explaining myself poorly, as archives don't even HAVE postids, as far as I know. I just need some way to check if the current URI is an archive or not, before `wp` fires. **EDIT** : On further experimenting, it appears that my URI manipulations can't take place any later than `init`, I think because by that point WP has already done its rewriting and such. So, I either need a way to check for an archive page status, within `init`, or do URI rewriting after `init`, either approach is fine with me as long as it gets the intended result.


title: Custom Post Type - Upload Form

text: So Im just getting started with Custom Post Types. I'm trying to make a custom post called a Certificate. The thing is, I don't need any of the usual 'editor' boxes or anything that would normally be in a post. All I need is an upload form for a user to upload a file. So I've set up the the Certificate post-type, and I made it so it doesn't support anything, so nothing appears on the page. I then added a 'admin_init' hook to display a form. But now i'm a little stuck. Can someone give me a breif outline of what hooks to use to process the form? How do I make it so it activates this hook only for 'Certificate' post types?


title: Repeatable configuration package

text: It's normal that a developer or a shop will spend several hours on each project running the same configuration options (for permalinks, SEO options, user roles, plugins that you always use etc.). I'm coming from Drupal, where installation profiles have allowed me to preconfigure a set of configuration options that I can replicate across dozens of sites. This has saved me and my clients hundreds of hours. I now have an opportunity to do the same in WordPress. I'd like to create a script that installs WordPress, installs some plugins and sets some initial configuration options. This has the potential for useful time/cost savings when scaled across many sites. Is this feasible? Or am I barking up the wrong tree?


title: Menus, but not by theme location

text: I'm trying to figure out how to display a menu that has been created, but without having to assign the menu to a theme location. From what I can tell, you have to assign a menu to a theme menu location and then `wp_nav_menu calls` a menu from whatever location you want. I don't want to have to assign a menu to a theme location. Instead, I want to be able to create a menu and then query it within my theme... regardless of theme location. I've created a plugin for myself that uses `wp_get_nav_menus` to list all of the menus I've created... I can then assign any menu to a page/post. Now, I'm stuck trying to figure out how to retrieve that specific menu... again, not menu theme location. Anyone?


title: How do I find users by password?

text: I need to add a passkey to each user, so I decided to just giving the user password that value and use WP functionality to store it/retrieve it. So now I need to find **what user that password belongs to** , so a single field would be necessary to identify him, rather than asking for email AND passkey. How do I find a user by password? I know what is stored in the DB are not passwords, but something else, but I don't care. We won't have enough users for getting two with the same MD5 (or whatever is stored) Thanks.


title: Keeping Objects in Memory

text: I have built a WordPress plugin using classes. Each project class is created for a specific user. I want to do three things:   * Keep the project object in memory for that user between his or her requests.   * Delete it once the user signs out or after a certain expiration time.   * Delete and recreate if user edits the project information (through a form) for that object. Does anyone know how to do that?


title: Anyway to assign custom post types to a specific category?

text: Is there anyway to assign all new posts that have a custom post_type to a specific category? For example, say I have a post_type that is for Actors. Is there anyway to assign any post that is under Actors to a "People" category? (but without displaying the Category box in the WordPress Admin)


title: Using WAMP, trying to create a plugin, getting error: You do not have sufficient permissions to access this page

text: Just trying to create a simple plugin with some Theme Options so I can practice. When I try to access the Theme Options page under Settings... I get the: You do not have sufficient permissions to access this page. This is all I have in the plugin:               add_action( 'admin_menu', function(){         add_options_page( 'Theme Options', 'Theme Options', 'administrator', __FILE__, function(){             echo 'Hello';         });     });      Here are the parameters from the WordPress codex:               <?php     add_options_page( $page_title, $menu_title, $capability, $menu_slug, $function);     ?>       I am the admin. Tried creating another admin account, same result. Tried setting the slug parameter to a different slug, same result. I'm using WAMP on my local machine. Any ideas? I came up short when trying to search for this issue when using WAMP on a local machine. Any help would be great.


title: Custom search: by post data and post metadata?

text: I'm struggling with a WordPress search function. Maybe it will just help if someone can explain to me how the built in WordPress function works. But here's what I want:   * Two search fields, by name and by location   * The first field should check all the common post data (only posts) + categories   * The second field should only check on the posts custom fields   * Only one field needs to be filled First of all, is this even possible or do I have to use native php+sql? If it is possible, can you please give me a hint on where to start?


title: Is there a plugin to show the code tag button on the visual editor?

text: I write a programming blog, so sometimes I just have to write a word to represent a `command` or `function` which I like writing between the code tags. (See, what I just did there). So, just like StackExchange has the "code" button, is there a plugin to add this button to the visual editor? I know I got it on the HTML editor, but I rarely use it. I was thinking of writing a plugin for this, but just in case I'm asking first in case anyone knows of a plugin doing this already.


title: get_post_meta Not Working After Moving The Second Custom Metabox to The Side

text: I got 3 custom metaboxes in my custom post type. The previous structure is like the following:               Metabox 1     Metabox 2     Metabox 3      If the `Metabox 2` is moved to the side, the `Metabox 1` won't be able to get data from wordpress database using `get_post_meta("$post->ID", "_meta_key", true );` I have try to globalize `$post` and also replaced `$post->ID` with `get_the_id()` but nothing is working. How to make it working? **EDIT:** I found that it is caused by WP_Query. Best Regards


title: How to add a new tab to page editor

text: Anyone knows how to achieve this? ![enter image description here](http://i.stack.imgur.com/wN92P.png) It has something to do with meta boxes, but I just can't figure out the proper syntax.


title: How do I enable the customize theme page to accept svg's?

text: I'm currently working on a theme that enables the user to upload a logo via the customize theme page. I want the user to be able to upload an SVG as a logo. Wordpress does not allow SVG's to be uploaded by default. So I used a snippet of code to enable SVG's in de media uploader.               function cc_mime_types( $mimes ){         $mimes['svg'] = 'image/svg+xml';         return $mimes;     }     add_filter( 'upload_mimes', 'cc_mime_types' );      I figured this would also allow me to upload SVG's via the customize theme page (`customize.php`) . This doesn't seem to work. When I upload an svg via the normal media uploader, the file gets uploaded succesfull. When I try to upload an svg via my logo uploader on the customize theme page, nothing happens. Not even an error. My code to enable logo uploading via the customize theme page:               function themeslug_theme_customizer( $wp_customize ) {         $wp_customize->add_section( 'themeslug_logo_section' , array(             'title'       => __( 'Logo', 'themeslug' ),         'priority'    => 30,         'description' => 'Upload a logo to replace the default site name and description     in the header',     ) );     $wp_customize->add_setting( 'themeslug_logo' );     $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize,     'themeslug_logo', array(         'label'    => __( 'Logo', 'themeslug' ),         'section'  => 'themeslug_logo_section',         'settings' => 'themeslug_logo',     ) ) );     }     add_action('customize_register', 'themeslug_theme_customizer');      Does anyone know how to enable SVG upload specificaly for the customize theme page?


title: wordpress multisite not installing

text: When trying to install multisite on my wordpress blog, I get a blank page on the 2nd step where I should get the options to choose from subdomain or sub directory. I've tried installing on several occasions and still the same problem persists. All plugins are deactivated. Help plsssss