title: Remove an uploaded header image

text: I'm developing a theme which supports a header image, when you've uploaded a few header images you can select to show them randomly as header image. When you want to remove one header image you can do that in the Media Library, but isn't there an easier way to remove them? Let's assume there are about 200 images in the Media Library and somewhere between them is a header image which you'd want to remove, how would you remove it? I believe there should be an easy way to remove a specific header image in the "Header" screen, but I can't seem to find this option (most probably because it doesn't exist)? **EDIT** ![Part of the WordPress custom header screen](http://i.stack.imgur.com/C5166.png) Currently there are 4 header images uploaded, these are shown randomly. Let's say I want to remove one header image so only 3 are shown. Is there are an other way rather than going to the Media Library looking between all the files for that one header image (really annoying) and then deleting it, to delete one single header image?


title: Remove Widgets in Dashboard

text: Another noob question...when authors log on and access their Dashboard, they see all sorts of widgets such as an Internet Explorer warning, news on what's going on with WordPress. Is there anyway to remove all of these for all users (present and future), so that they only see the 'Quick Press' & 'Right Now' widgets? Thanks!


title: Good plugin for managing outbound links?

text: I've looked around and around for a good WordPress plugin. I know this is a shopping question, but such an important aspect of managing your WordPress blog, I'm surprised to find that there isn't a more standard selection. Specifically, I need a plugin to help with:   * Set rel="nofollow"    * Open outgoing links in new tab/window   * Bulk processing   * Well-maintained What do you use?


title: url rewrite .htaccess extension to permalink

text: I have a custom page and template, that I'm passing a query-string to. It has a wordpress permalink like so /mypage/ I want to be able to add another rule so that the permalink receives a slug /mypage/this-slug is rewrote to /mypage/?myslug=this-slug


title: Creating a plugin that will display text on every page

text: I know there is going to be an easy way to do this but I just can't seem to find the best practice for the following; I have a plugin which when complete should generate HTML on every page, I want it to do this without the need for JavaScript and I want it to be independent of the theme when possible. It will appear on every single page, so it can't be a shortcode in a template file (but would a shortcode in the header.php file be appropriate?). Ideally there would be a hook that would allow me to insert code after the `<h1>` tag in the header (don't think it will be just that easy though!) Could someone point me in the right direction or send me some pseudocode to help me on my way? **Edit** Brian asked me What exactly are you trying to insert and where on the template, here is my answer; It will be a element styled from within the plugin with an options value generated by the plugin. It will be appearing at the top right of every page, in the header of the page.


title: why doesn't the_content() work in this {single-custom_post_type.php} page?

text:
This code is from my page `single-publication.php`. It outputs the relevant custom fields etc (here wrapped in template tags), but `the_content()` won't output the post content. I've resorted to using `$post->post_content` (which works), but the mystery remains:
         <?php printf("
%s
", get_the_title() ); ?>
<?php the_publication_credit(); ?>

<?php the_publication_date(); ?>

<?php echo $post->post_content; // the_content() doesn't work. Why not? ?>

      What's going on here? **EDIT:** I was driven to ask this question because I believed - mistakenly, as it turns out - that `$post` working and `get_the_title()` returning a title were an ironclad sign of being inside the loop. But apparently this is not the case. cf Codex on The Loop (second para) and Codex on get_the_title() (parameter list). Can anyone explain?


title: Automatically create a new page daily with last three posts

text: Is it possible to create the following:   * A new page dynamically daily, containing the last three posts   * Archive this page, so that tomorrow's page is a new page, with the three newest posts Basically I'd like to use WordPress for our news releases, we publish three each day. The day's page should contain all three stories, and then be archived so the next day's page can be created. If you have any ideas how to setup something like this I'd appreciate it.


title: Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !

text: What I want to do is a loop like this is something like this I'm really sorry but its hard to format here! I going to put this short url http://pastebin.com/dEdKzgJz so you can see it better... Can anyone help me with this? Any advice! Category 1   ........Child Category 1.1   ...........Sub-Child Category 1.1.1   .................Post Title 1   .................Post Title 2   .................Post Title 3 Category 2   ........Child Category 2.1   ...........Sub-Child Category 2.1.1   .................Post Title 1   .................Post Title 2   .................Post Title 3 Category 3   ........Child Category 3.1   ...........Sub-Child Category 3.1.1   .................Post Title 1   .................Post Title 2   .................Post Title 3


title: Custom taxonomy admin description

text: Is it possible to add a short description to a custom taxonomy's admin area? For example, I've added a taxonomy that determines what kind of banners are displayed on a post's page. In the meta box for this taxonomy on the Edit/Add Post page I'd like to add a little blurb explaining how it works.


title: Using HTACCESS for Secret Access

text: I saw this post yesterday http://digwp.com/2011/01/simpler-login-url/ where a 'custom' word is used to direct the user from `url.com/admin` to `url.com/wp- login`.php and I'm asking (also did so in the comments without an answer) if its possible to **deny any access** to the admin **unless used a secret url** , so if a user is not logged in and tries `url.com/wp-admin` or `wp-login.php` he's denied access and only if he tries `url.com/my-secret` he's then redirected to the admin? thoughts?


title: Modify WP-Admin login fields

text: Hi is it possible to modify the login fields required to login into wp-admin? Say to use the email address instead of the username together with the password to gain access. How would I go about doing that? thanks


title: Conflicting save_post functions when passing the post id and saving custom meta boxes for different post types

text: Post save functions are conflicting with each other when adding them to the save_post action hook. 2 different custom post types with 2 different (one for each post type) custom meta boxes. I'm only including the code for 1 of the meta boxes. The other one is very similar and each one works fine separately but not together. ### The 'register_metabox_cb' call back function:               function c3m_video_meta() {         add_meta_box('_c3m_video_embed', __('Enter Video Embed Code In the Box Below') , 'c3m_video_embed', 'video', 'normal', 'low');         }      ### Adding the meta box to the post edit screen:               function c3m_video_embed($post) {         global $post;         wp_nonce_field(__FILE__,'video_nonce');         $embed-code = get_post_meta($post->ID, '_embed-code', true);         echo '<input type="text" name="_embed-code" value=""' . $embed-code . '" class="widefat" />' ;          }      ### The save function:                 function c3m_save_video_meta( $post_id , $post ) {                       if ( !wp_verify_nonce( $_POST [ 'video_nonce' ], __FILE__ ) ) { return $post ->ID;                  }                 if ( !current_user_can( 'edit_post' , $post ->ID )) return $post ->ID;                  $c3m_video_embed-code [ '_embed-code' ] = $_POST [ '_embed-code' ];                              foreach ( $c3m_video_embed-code as $key => $value ) {                              if ( $post ->post_type == 'revision' ) return ;                                   $value = implode( ',' , ( array ) $value );                             if (get_post_meta( $post ->ID, $key , FALSE)) {                              update_post_meta( $post ->ID, $key , $value ); } else {                              add_post_meta( $post ->ID, $key , $value ); } if (! $value ) delete_post_meta( $post ->ID, $key );                              }     }      ### The action hooks: `add_action( 'admin_menu' , 'c3m_video_meta' );` `add_action( 'save_post' , 'c3m_save_video_meta' , 1, 2);` This is fine and dandy and works but when I add another meta box to a different post type and use a similar function (different function name, nonce name and key ) when the post is saved I get this error: > Notice: Undefined index: _embed-code in > /Applications/MAMP/htdocs/wordpress/wp-content/plugins/ieew-custom- > functions/ieew-custom-functions.php on line 181 > > Warning: Cannot modify header information - headers already sent by (output > started at /Applications/MAMP/htdocs/wordpress/wp-content/plugins/ieew- > custom-functions/ieew-custom-functions.php:181) in > /Applications/MAMP/htdocs/wordpress/wp-includes/pluggable.php on line 897 The undefined _embed-code is when saving the post that does not contain the _embed-code variable. Since the error messages are reversed depending on wich post type I try to save it leads me to believe that both (2 different) save functions are being added to the save_post action. They are also being added when saving a normal post. If I'm only using 1 of the save functions there are no errors when saving a normal post. Rather than this question being a **"Fix My Code"** question I would rather the answer contain the how and why of adding custom meta boxes and using the various nonce methods. Sure I could use the More Fields plugin but I would rather learn the best way to accomplish customizing the post edit screen with custom content types. I have used this same code and method to add multiple meta boxes to a single custom post type and it has always worked fine.


title: CSS - why does my sidebar drops to the bottom of the page?

text: I spent almost an hour searching why my sidebar here: http://www.r-bloggers.com/ Is dropping to the bottom of the page. Could you please advise on how to fix it? Thanks.


title: Extract visitor and other measure data from Wordpress

text: Is it possible to extract visitor data (such as number of views, time of views etc) from Wordpress or do you have to use the WP back-end or GA? Thanks Rich


title: How to know which order Wordpress places CSS files?

text: I've installed the Roots theme (version 4 so I can use the 1140px Grid) on Wordpress 3.3.1, and want to edit the CSS. Initially I only get the style.css file in the editor and can't see the others. The css files I need are located in a subfolder marked 'css', and I see from a quick Google search that there is a known bug with css subfolders, so I moved them into the root folder which seems to be working, but the site now looks a bit wonky, so I don't think it's quite right. How do I ensure that the css files are placed in the right order in the Wordpress code? At the moment I don't know how to find out which order they have been set in. Thanks, Jason


title: Edit Custom Database Tables in Wordpress

text: I have a site that uses custom database tables to manage info that is inserted by a process completely independent from Wordpress. The data from the table is used in the Wordpress site but it is not manageable through the Admin interface. I want to make it manageable via the admin backend. What is the basic process for this? In my mind I need to create a link in the Admin sidebar to "Manage Custom Data" and that link opens up a page that permits basic CRUD management of the various rows in the table. This would be effortlessly simply in vanilla code but I am not familiar with such custom aspects of modifying Wordpress so I am just looking for pointing in the right direction. Give me the big picture, in other words.


title: Using Amazon Book Gallery Plugins in Wordpress

text: I am new to WordPress plugins. I have installed "Now Reading Reloaded" Plugin. My objective is to display bunch of books which i am reading or referring on a separate page : Books. I have installed, Activated, Also registered the Amazon Web Services Access Key ID. How to set the Plugin to the Books Page and make the list of books to display on that page?


title: Page of posts made to look like homepage

text: Is there any way i can get a page of posts from a certain category to look like the homepage (twentyeleven theme) of just blog posts? Thanks


title: How to redirect url requests to https?

text: I've searched far and wide for a solution to this and I am sure it's simple but I simply couldn't find a solution. This is the regular wordpress redirect code:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>      How do I make it so that this will always route the url request to `https://`? **Note** : The reason this is posted here and not on any other SO site is that I thought there might be a catch when it comes to WP. BTW, I put the same question on ServerFault and got a big **On Hold** because "I did not try to solve this myself".


title: replace the WP_Query class in the main query

text: For a project I needed to heavily modify the behavior of WP_Query. So what I did was extending WP_Query basically like this:               class eacf_shared_query extends \WP_Query {              function query( $query ) {                  // do things before ...                  $posts = parent::query($query);                  // do things after ...                  return $posts;         }      This works like a charm for all my custom queries for which I now use my extended class, but I'm unable to find a way to stuff this into the main_query. So my question is: **Is there any known way to replace/extend the WP_Query class in the main_query?** * * * I did find the above to be the only solution and didn't get any further with using the filters supplied within the original class cause:   * There seems to be no filter pair that is guaranteed to be run before and after the query so I can't safely achieve a construct like in the example above.   * My _"do things after"_ logic contains nested calls to WP_Query() which too easily end up in a query-loop if I use filters.   * The SQL filters seem to be not powerfull enough to create a single query fetching all of the posts (like building a UNION query). I'm in the need of merging posts from different blogs in one query and it seems this can't be achieved with filters like `posts_clauses_request` or `query`.


title: How do I show a different secondary navigation menu for each section of my website?

text: My site is organised into three sections, like this:   * Reiki Basics (page ID 499) – page 1.1 – page 1.2 – page 1.3   * Practice & Study (page ID 501) – page 2.1 – etc   * Courses (page ID 471) – page 3.1 – etc. These all display in the primary menu at the top of the page. When you hover over ‘Reiki Basics’, you see an accordian come down with pages 1.1, 1.2 and 1.3. I want to create a secondary menu, in the sidebar, that only shows sibling pages (and the parent page). For example, when the user is browsing any page in the section 'Reiki Basics', including the 'Reiki basics' page itself, they would see links to all the pages in this section (1.1, 1.2, 1.3). They wouldn’t see pages from other sections. The same would work when they are browsing pages in section two. I want this menu to be created automatically for all new pages. I would rather not install any new plugins, although I do already use 'widget logic', which might help.


title: Update Post Meta of crowdfunding plugin on click front end

text:
I'm using the astoundify crowdfunding plugin which has a lot of custom fields while creating a campaign. I'm trying to create a _save and preview_ functionality on that page. There are at least 20 custom fields, I'd like to update from the front end when the user clicks on the save and preview button. so that When they come back to the campaign they can start where they left off. I'm going to show two of those fields, please tell me how this can be accomplished, in context to the 2 fields I have added below. There is a submit button on the page, which probably is doing the same thing but it validates and submits the campaign, I'm sure there is a way to just store the information added in the session to the database to edit and submit at a later time via the update_post_meta() function. Any help would be greatly appreciated as I've spent 2 days on this already.               <p class="atcf-profile-info-<?php echo $key; ?> atcf-box">     <label for="<?php echo $key; ?>"><?php printf( __( '%s URL', 'atcf' ), $method ); ?>     <input type="text" name="<?php echo $key; ?>" id="bio" value="<?php echo esc_attr( $user->$key ); ?>" />
     <?php _e( 'Biography', 'atcf' ); ?>     <textarea name="bio" id="bio" rows="4"><?php if(isset($user->user_description)) {echo esc_textarea( $user->user_description );} ?></textarea>


title: Creating array to compare custom field values

text:
I think I need some guidance here. I have a list of custom posts on a an archive template page that displays information from each of the custom posts. They are looped through using WPQuery:               <?php $restypes = new WP_Query( array( 'post_type' => 'reservation_type', 'posts_per_page' => -1 ) );?>      Each post has a several custom fields: `$price`, an optional `$promo_price` and a variable `$per` which determines if the price is per-person or per-room based on a custom taxonomy. The best price is then determined like so:                 if(in_array( 'dorm', $per )){           $person_room ='per-person';       } else {           $person_room ='per-room';       }              $post_id= $post->ID;       $promo_price = get_field('promo_price');       $norm_price = get_field('price');       $p_per_room = get_field('people_per_room');            if ($promo_price && !empty($promo_price)){                  if($person_room == 'per-room'){                 $addprice= $promo_price /$p_per_room;             } else {                 $addprice= $promo_price;             }                  $prices[$post_id]= $addprice;            } elseif ($norm_price && !empty($norm_price)){                  if($person_room == 'per-room'){                 $addprice= $norm_price /$p_per_room;             } else {                 $addprice= $norm_price;             }                  $prices[$post_id]= $addprice;       }            $best = array_keys($prices, min($prices));      My problem is that the array `$best` is not complete until all the posts have been looped through. The point of all this is to be able to add:               <?php     if(in_array($post->ID, $best)){?>

Best Price

     <?php  } else { ?>
     <?php } ?>      thus giving a different style to the item with the best price per-person. My question is would I need to create a separate loop to populate the `$best` array in order to do this? Or is there a better way? I was thinking initially of using the `orderby => 'meta_value_num'` having calculated the best price as a function and adding a meta value. PS The `get_field()` function comes from Advanced custom fields.


title: get_template_part and template file names

text: I have a custom post type that is going to use a loop in a couple different places and I wanted to make maintaining those loops easier. I remembered that get_template_part() is available and figured this would be an optimal time to get used to it. However, what has me at a standstill is how to set up a file for the loops so that I can call the specific parts accurately. Google, thus far, has been not helpful in understanding how get_template_part() and twentyten's loop.php actually work and call the 3 parts. I have it duplicated, stripped down and ready for altering for my CPT version, but that is it thus far. Any help?


title: mo / po translation files does not seem to work

text: I have a theme that was bought from themefuse and they say it supports localisation using a plugin called CodeStyling Localization However even though I make the necessary steps to translate strings in the theme, the translated texts do not appear in the frontend. The steps I have taken:   1. installing plugin   2. scan the theme    3. translate a few words   4. build "mo" file from plugin menu   5. empty cache + refresh ... no result Any ideas?


title: setting featured image is not working while running script in background, works when running that script from browser

text: I have creted a script which will fetch content from one of my site and automatically create new post in my wordpress blog. When I am running that script from browser, its working really cool! post is being created, intended image is being set as featured image but when I am trying to run it from background or as a cron job, post is being created, published but the featured image is not being set. Please suggest me the proper solution. Here is my code to set the featured image.               $wp_filetype = wp_check_filetype(basename($filename), null );     $wp_upload_dir = wp_upload_dir();     $attachment = array(             'guid' => $wp_upload_dir['url'] . '/' . basename( $filename ),             'post_mime_type' => $wp_filetype['type'],             'post_title' => preg_replace('/\.[^.]+$/', '', basename($post_title)),             'post_content' => 'just xyz',             'post_status' => 'inherit'     );     $attach_id = wp_insert_attachment( $attachment, $filename, $parent_post_id);     require_once(ABSPATH . 'wp-admin/includes/image.php');     $attach_data = wp_generate_attachment_metadata( $attach_id, $filename );     wp_update_attachment_metadata( $attach_id, $attach_data );     if( $featured )     {         set_post_thumbnail($parent_post_id, $attach_id);     }      Additional info if it can help you in finding the problem. `wp_get_attachment_image` was not even working exactly after attaching image and executing above code. It was returning empty string.


title: Permalinks for custom taxonomy stopped to work

text: I'm not sure when this happened, I just noticed it. I have custom taxonomies and post types. For the longest time I was able to go to `domain.com/taxonomy/term` and it would display the posts related. Now it's not. I'm still able to access it by `domain.com/?taxonomy=taxonomyhere&term=termhere` The last time I remember this working I was on Apache but have recently moved over to nginx. I thought I tested a while ago and it and it was working though.


title: Best way to load page content in Fancybox popup?

text: I would like to have some links which load the page content of the page they reference to inside a Fancybox popup(pages like "shipping" or "returns", mainly text content). I would create the pages an then I will add the permalinks to these pages to other sections, like footer or sidebar, and they will open in the popup window. Have you come across anything like that? What would be the best way to implement it?? Any suggestion will be greatly appreciated.


title: What are the permalinks options for "Category" base and removing it?

text: Under "Settings > Permalinks", we can set up the default category base name to use for our category landing pages. For example, site.com/ **categories** /my- first-category/. Is there **a setting I can add to my functions.php** to allow the option to remove the category base and direct link to the category? For example, the above link becomes: site.com/my-first-category/ I realize that this opens up the possibility of having conflicting post names and category names (assuming I have a post slug that's the same as a category slug for example), but in this case, my post permalinks end in .html and my category permalinks will not, so there should never be a conflict (I expect).


title: Get comments only for certain specific users in template file

text: To return comments for a specific user, I use the code below:               $arg = array('user_id' => $userID);      $coms= get_comments( $arg );       How can I modify the arguments of this function so that I get comments for a group of users (get only comments for specific 2 or 3 users)? The arguemnt 'user_id' should be an integer, I cant find a way to pass an array. Or should I use PHP or SQL to get my goal? Your time and consideration of this issue is appreciated.


title: How can I stop WP media uploader from creating duplicates of my uploaded images?

text: I have a setting in my theme that seeks to prevent the WP media manager upload utility from creating multiple copies of each image I upload. Apparently the latest versions of WP have changed the required settings to defeat this? Here's the current settings I have in my theme's functions.php...               if(get_option('thumbnail_size_h')!==0){update_option('thumbnail_size_h', 0);}     if(get_option('thumbnail_size_w')!==0){update_option('thumbnail_size_w', 0);}     if(get_option('medium_size_h')!==0){update_option('medium_size_h', 0);}     if(get_option('medium_size_w')!==0){update_option('medium_size_w', 0);}      Even with these settings, I'm still getting a duplicate image every time I upload. For example, if my image filename is foo.jpg and it is 800x600 pixels, WP creates two images foo.jpg and foo-800x600.jpg How can I force WP to not create the duplicate?


title: How do I pass an array as an argument to a WP-CLI command?

text: I want to use WP-CLI to create some new posts with custom taxonomy terms assigned. The challenge is that wp_insert_post's `tax_input` argument only accepts arrays, which I would have to specify on the command line. According to the codex, here is the format required:               $post = array(         'tax_input' => [ array( 'taxonomy_name' => array( 'term', 'term2', 'term3' ) ) ] // support for custom taxonomies     }      But I need something like this:               wp post create --post_type=lecture --post_title='Test Post #1' --tax-input=[BIG FAT ARRAY]      So my idea was to write a PHP script that executes the WP-CLI command with the array serialized:               //DEFINE VARIABLES     $post_title = "Test Post #1";     $tax_items = array( 9,11,17 );     $tax_input = array( 'course' => $tax_items );          //SERIALIZE THIS ARRAY     $tax_escaped = escapeshellarg(serialize($tax_input));          //WRITE THE COMMAND     $exec_string = 'wp post create --post_type=lecture --post_status=publish --post_title="%1$s" --tax_input=%2$s --porcelain';     $exec_command = sprintf($exec_string, $post_title, $tax_escaped );     $post_id = shell_exec($exec_command);          //THE OUTPUT     //wp post create --post_type=lecture --post_status=publish --post_title="Test Post #1" --tax_input='a:1:{s:5:"class";a:3:{i:0;i:9;i:1;i:11;i:2;i:17;}}' --porcelain          //RELATE THE NEW POST TO THE TAXONOMY TERMS     wp_set_object_terms( $post_id, $tax_items,'course');      Alas, this doesn't work. It creates the new post alright, but it fails to assign the 'course' taxonomy categories I want. Any help would be appreciated. I know that this overall strategy works, because I succeeded in creating and taxonomizing my posts using `wp_insert_posts`. So this exercise is for educational purposes and future reference.


title: Determine page content based on page parent

text: How can I display a gallery shortcode for pages who are children of the page with an ID of 9, and the regular content for pages who aren't? This is what I've tried so far, but it's not working:               <?php global $wp_query; if( (9 == $ $wp_query->post->post_parent ) :?>         <?php echo do_shortcode('[gallery link="file" columns="1" size="large"]'); ?>     <?php else (); ?>         <?php the_content(); ?>


title: Bootstrap Nav Menu not showing more than 1 dropdown

text:
I have this code to show my navigation menu in the `functions.php` file.               class BootstrapNavMenuWalker extends Walker_Nav_Menu {               function start_lvl( &$output, $depth = 0, $args = array() ) {                   $indent = str_repeat( "\t", $depth );         $submenu = ($depth > 0) ? ' sub-menu' : '';         $output    .= "\n$indent
\n";          }          function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {                   $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';              $li_attributes = '';         $class_names = $value = '';              $classes = empty( $item->classes ) ? array() : (array) $item->classes;              // managing divider: add divider class to an element to get a divider before it.         $divider_class_position = array_search('divider', $classes);         if($divider_class_position !== false){             $output .= "

\n";             unset($classes[$divider_class_position]);         }              $classes[] = ($args->has_children) ? 'dropdown' : '';         $classes[] = ($item->current || $item->current_item_ancestor) ? 'active' : '';         $classes[] = 'menu-item-' . $item->ID;         if($depth && $args->has_children){             $classes[] = 'dropdown-submenu';         }                   $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );         $class_names = ' class="' . esc_attr( $class_names ) . '"';              $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );         $id = strlen( $id ) ? ' id="' . esc_attr( $id ) . '"' : '';              $output .= $indent . '
';              $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        ) .'"' : '';         $attributes .= ($args->has_children)        ? ' class="dropdown-toggle" data-toggle="dropdown"' : '';              $item_output = $args->before;         $item_output .= '';         $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;         $item_output .= ($depth == 0 && $args->has_children) ? ' ' : '';         $item_output .= $args->after;                   $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );     }               function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {         //v($element);         if ( !$element )             return;              $id_field = $this->db_fields['id'];              //display this element         if ( is_array( $args[0] ) )             $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );         else if ( is_object( $args[0] ) )             $args[0]->has_children = ! empty( $children_elements[$element->$id_field] );         $cb_args = array_merge( array(&$output, $element, $depth), $args);         call_user_func_array(array(&$this, 'start_el'), $cb_args);              $id = $element->$id_field;              // descend only when the depth is right and there are childrens for this element         if ( ($max_depth == 0 || $max_depth > $depth+1 ) && isset( $children_elements[$id]) ) {                  foreach( $children_elements[ $id ] as $child ){                      if ( !isset($newlevel) ) {                     $newlevel = true;                     //start the child delimiter                     $cb_args = array_merge( array(&$output, $depth), $args);                     call_user_func_array(array(&$this, 'start_lvl'), $cb_args);                 }                 $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );             }             unset( $children_elements[ $id ] );         }              if ( isset($newlevel) && $newlevel ){             //end the child delimiter             $cb_args = array_merge( array(&$output, $depth), $args);             call_user_func_array(array(&$this, 'end_lvl'), $cb_args);         }              //end this element         $cb_args = array_merge( array(&$output, $element, $depth), $args);         call_user_func_array(array(&$this, 'end_el'), $cb_args);          }          }          register_nav_menus( array(     'primary' => __( 'Primary Menu', 'infi'),     'secondary' => __( 'Secondary Menu', 'infi' ),      ) );      And I used this code to show my navigation in the `header.php` file.                <?php                 $args = array(                     'theme_location' => 'primary',                     'depth'      => 0,                     'container'  => false,                     'menu_class'     => 'nav navbar-nav',                     'walker'     => new BootstrapNavMenuWalker()                 );                 wp_nav_menu($args);             ?>      But the menu is showing multilevels. Only a single dropdown is visible. If I add more than one dropdown items in the navigation, it simply doesn't show up. Any help please.


title: Saving category as insert post

text: I'm having a problem with `$_POST` a category. I got something like that :                   // ADD THE FORM INPUT TO $new_post ARRAY     $new_post = array(     'post_title'    =>  $title,     'post_content'  =>  $description,     'post_category' =>  array($_POST['cat']),   // Usable for custom taxonomies too     'tags_input'    =>  array($tags),     'post_status'   =>  'draft',           // Choose: publish, preview, future, draft, etc.     'post_type' =>  'post'  //'post',page' or use a custom post type if you want to     );      And the code about taking category:                        <fieldset class="category">         Type:         <select name="cat" id="categories">         <?php      $categories = get_categories('tab_index=10&taxonomy=category&orderby=name&hide_empty=0&include=6,7,8,9,10');     foreach ($categories as $category) {     $option = '<option name ="'.$category->category_nicename.'" value="'.$category->category_nicename.'">';     $option .= $category->cat_name;     $option .= '</option>';     echo $option;     }       ?>      </select>     </fieldset>      However, It doesn't work If I use `wp dropdown categories` this works, but I need to have a `name` for the options. `wp dropdown categories` doesn't provide the names itself. Is there anyone who knows what Am I missing here ? Edited * So after all It was simple enough to make it like that                     <fieldset class="category">         Type:         <select name="cat" id="categories">         <?php      $categories = get_categories('tab_index=10&taxonomy=category&orderby=name&hide_empty=0&include=6,7,8,9,10');     foreach ($categories as $category) {     $option = '<option name ="'.$category->category_nicename.'" value="'.$category->term_id.'">';     $option .= $category->cat_name;     $option .= '</option>';     echo $option;     }       ?>      </select>     </fieldset>


title: Events plugin for theater (event = performance of a production)

text: all event plugins I tried had the logic that an event has all information attached to it in a post-type. I have the case where I want to have events which are just performance date/time of a theater production. So I want one page describing the production and then a list of events / calendar to show the performances. As the performances can occur on different times on different days, the event plugin functionalities for recurring events do not fit (they all only support same time on different days). What are your suggestions to modeling this case? I guess its actually quite simple, but I can't get it. Thanks! Chris


title: Multi row post list

text:
I'm trying to create a 'two posts per row grid'. Here is the template i made:

         <?php get_sidebar(); ?>

             <?php query_posts('category_name=portfolio&posts_per_page=100');  $do_not_duplicate = $post->ID;?>                       <?php if (have_posts()) : while (have_posts()) : the_post();       if (in_array($post->ID, $do_not_duplicate)) continue;      ?>                  <?php the_content(); ?>                  <?php endwhile; else: ?>
<?php _e('Sorry, this page does not exist.'); ?>
             <?php endif; ?>

             <?php query_posts('category_name=portfolio&posts_per_page=100');  $do_not_duplicate = $post->ID;?>              <?php if (have_posts()) : while (have_posts()) : the_post();       if (in_array($post->ID, $do_not_duplicate)) continue;      ?>                  <?php the_content(); ?>                  <?php endwhile; else: ?>
<?php _e('Sorry, this page does not exist.'); ?>
             <?php endif; ?>
      Something is wrong, cause all posts are visible in both divs, how do I tell wordpress to only add odd posts to the first div and even posts to the second?


title: Where to hook settings api init

text: I am getting a bunch of notices in Theme-Checker for my settings api init function. The notices are all for 'undefined index' in the $_REQUEST array. Here is the code :               <?php          function typesetter_settings_api_init () {              if ($_REQUEST['update-settings']) {             typesetter_save_settings();         }         register_sections();              $current = $_REQUEST['tab'] ? $_REQUEST['tab'] : 'page';         $page = 'typesetter_options_'.$current;              $callback = 'typesetter_render_settings_field';         foreach ( typesetter_get_sections() as $section ) {             foreach ( typesetter_get_settings_fields($section) as $field ) {                 add_settings_field(                     $field['id'], // $id                     $field['title'], // $title                     $callback, // $callback                     $page, // $page                     $field['section'], // $section                     array(                         'id' => $field['id'],                         'type' => $field['type'],                         'choices' => $field['choices'],                         'desc' => $field['desc'],                         'class' => $field['class'],                         'std' => $field['std']                     )                 );                 // Register my setting so that $_POST handling is done                 register_setting($page, $field['id']);                  }         }          }// typesetter_settings_api_init()          ?>      I hook this into 'admin-init'. Am I doing something silly here? Do I hook it somewhere else? Should I just ignore the notices?


title: Posts2Posts, wp_query and orderby issue

text:
I've been working on this issue for several hours now and I'm stumped. The following query refuses to accept any orderby directive. **NOTE:** This is running on a single-cpt.php page within the normal WP Loop:               <?php $args = array(       'orderby' => 'title',           'order' => 'ASC',       'suppress_filters' => true,       'nopaging' => true,       'connected_type' => 'directory_to_projects',       'connected_items' => get_queried_object_id(),     );          $new_connected = new WP_Query($args);          // Display connected posts     if ( $new_connected->have_posts() ) { ?>
Projects

             <?php while ( $new_connected->have_posts() ) : $new_connected->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
             <?php endwhile;              endif;             wp_reset_postdata(); ?>
     <?php } ?>      I've confirmed I'm not running any page- or post-ordering plugins that might interfere with 'orderby'. Switching 'orderby' to something else (name, date, meta_value, you name it) has no effect whatsoever. **UPDATE:** Actually, no parameters for wp_query are working at all. I tried adding `'posts_per_page' => 2,` and that had no effect either. Must be a posts2posts thing but I believe support for that plugin has been discontinued. :( Anyone ever run into this? Any ideas? Thanks so much for your help!


title: Custom login redirects to wp-admin on wrong password

text: My custom login form redirects to the wp-admin login when an user doesn't manage to guesses his/her credentials right. How can I manage to redirect the user to the current form instead? And of course show the proper errors? Here is the code: (same as on WordPress manual)               $args = array(             'echo' => true,             'redirect' => site_url( $_SERVER['REQUEST_URI'] ),              'form_id' => 'loginform',             'label_username' => __( 'Username' ),             'label_password' => __( 'Password' ),             'label_remember' => __( 'Remember Me' ),             'label_log_in' => __( 'Log In' ),             'id_username' => 'user_login',             'id_password' => 'user_pass',             'id_remember' => 'rememberme',             'id_submit' => 'wp-submit',             'remember' => true,             'value_username' => NULL,             'value_remember' => false );           wp_login_form( $args );


title: Different Name and Email for wp_mail_from and wp_mail_from_name

text: I want to make the email and Name dynamic.Everything works fine.But I can't able to get the name and email for each doctors.I have attached my code which I have tried.please help Thanks in Advance.               function send_email_status($patient_id , $doctor_id, $status, $dateTime)     {         //Getting User Details From Database         $from_email     =  get_user_meta($doctor_id,'user_email',true);         $to            =  get_user_meta($patient_id,'user_email',true);         $doctorName    =  get_user_meta($doctor_id,'display_name',true);         $patientName   =  get_user_meta($patient_id,'display_name',true);         $appdate       =  date('Y-m-d',strtotime($dateTime));         $appTime       =  date( 'g:i a', strtotime($dateTime));         $statusMsg    =  $this->column_status($status);         // Email subject and body text              $subject = 'Appointment Status PeoplesDoc.com';         $mailheaders .= "MIME-Version: 1.0\n";         $mailheaders .= "X-Priority: 1\n";         $mailheaders .= "Content-Type: text/html; charset=\"UTF-8\"\n";         $mailheaders .= "Content-Transfer-Encoding: 7bit\n\n";         function my_mail_from( $doctor_id ){             return get_user_meta($doctor_id,'user_email',true);              }         function my_mail_from_name( $doctor_id ){         return get_user_meta( $doctor_id ,'display_name',true);              }         //filter hooks for from Name and from Email         add_filter( 'wp_mail_from', 'my_mail_from' );         add_filter( 'wp_mail_from_name', 'my_mail_from_name' );         // Call to wordpress Mail Function         if( wp_mail( $to, $subject, $message, $mailheaders ) ) {             // the message was sent...             $flag =true;         } else {             // the message was not sent...             $flag = false;         }         return $flag;     }


title: What are the security reasons to disallow Microsoft Word uploads?

text: When I try uploading a .doc or .docx file I get this message: > Sorry, this file type is not permitted for security reasons What are the security risks involved in a multisite installation (3.9.1)? I know how to enable the feature. Thank you.


title: How to add wordpress pagination

text: i must use pagination. Where can i found good tutorial? ` $wpdb->get_results("SELECT * FROM wp_ogloszenia_kupione WHERE klient_id = $current_user->ID"); `


title: Change label of title field for posts in the backend

text:
I am trying to add some HTML to the title label in the backend of WordPress. **Attempt 1:** I am using the following (simplified) function:               function change_post_titles() {         global $post, $title, $action, $current_screen;              $title = 'foo
bar';     }     add_action('admin_head', 'change_post_titles');      This works in the way that the label of the title field is indeed changed, however the HTML tags get encoded afterwards. This mean that the label looks like:               foo
bar      Instead of:               foo     bar      ![Encoded HTML](http://i.stack.imgur.com/z6bzh.png) **Attempt 2:** I also tried using a `gettext` filter, but that just completely filters (removes) the HTML.               add_filter('gettext', 'change_post_titles');     function change_post_titles( $translated_text, $text, $domain ) {         return $translated_text = 'foo
bar';     }      ![Removed HTML](http://i.stack.imgur.com/ZK8EQ.png) Is there any way to change the title label (programmatically) in a way I can add HTML?


title: Set variable in javascript and using in my shortcode

text:
my script is               function($) {        var google_map_address = $('#address').text();     $(function () {     $('#gmap').gmap3({         marker: {             address: google_map_address          },         map: {             options: {                 zoom: 14             }         }     }); });})(jQuery);      and my php code is                   init_shortcode();         function init_shortcode() {         $shortcodes = array(         'gmap' => 'spyrowebs_gmap');         foreach( $shortcodes as $tag => $func )             add_shortcode( $tag, $func );         }           function spyrowebs_gmap( $atts = array(), $content = '' ) {         $defaults = array(             'address' =>'',           );         $atts = shortcode_atts( $defaults, $atts );         extract( $atts );         $address=$address;         return '

'.$address.'

';     }      but this does not work i want to create a shortcode like               [gmap address="your address"]      now what is the problem when i assign a value to javascript variable like               var google_map_address = 'your address';      then its work while in the above its not working please any help. when i put the above code in my theme its work but when i use it in my plugin its not work.


title: Allowing Users to Register Themselves and Post : Does WordPerss Handle these Problems?

text: If one allows visitors of a WordPress blog to register themselves and post to the blog without moderation(i.e. without submit for review), malicious visitors may try to 1)Post a large number of posts and fill up the server space 2)Post a few large posts and fill up the server space 3)Create a large number of drafts and fill up the server space 4)Post inappropriate content Does WordPress have mechanisms to prevent these? Or any plugins to do this? P.S: If you see any other problems I have missed please point them out as well. Thanks


title: On WP Multi sites how many sites...!

text: He I'm Hieu, I work as IT Engineer in An Thanh company Vietnam. We have 5 hosts (Shared host: Godaddy) with more that 60 sites each. On the moment all of this main sites (5) go down regularly with 500 errors. All on different times and duration and go from some minutes 5, 15 and more to some hours. We haven't found the problem yet and because we don't have much experience with WP and, specifically, Multisite, we need to ask some questions.   1. What is the maximum number of sites for a WP Multisite? What are the limits on the database?   2. This interruption that we have I'm sure that is happening before with some with your other customers can you help me to know what the reason is...! I hope you can help me on the right way Tran Trung Hieu IT AN THANH Vietnam


title: rewrite rule for home/index page

text: I've been struggling for a while already and all of my attempts failed so I have no other choice but to ask for help here... a) I've made a custom post type `page_blox` whose `capability_type => 'page'` and `rewrite => array( 'slug' => 'blox' )` b) All of `page_blox` pages can be selected on **Reading Settings** screen (Admin) as 'Front page displays' > Static page So far so good. However... **The problem:** Front-end home page URL doesn't read **my_domain.com** any more but also appends `post_type` and page slug so it looks like **my_domain.com?page_blox=my-page-slug** **The Question:** I believe it has something to do with WP's rewrite rules so how do I remove that appendix (`?page_blox=my-page-slug`) from home page URL? My initial code did not score any results. Is there anybody willing to tell what's wrong with it?               function k_rewrite_rules( $wp_rewrite ) {         $frontPost = get_post( get_option( 'page_on_front' ) );         $wp_rewrite->rules = array( '^$' => $wp_rewrite->index . '?' . $frontPost->post_type . '=' . $frontPost->post_name ) + $wp_rewrite->rules;     }     add_action( 'generate_rewrite_rules', 'k_rewrite_rules' );


title: How to get viewed posts during an user session?

text: I want to track user activity on my blog by store viewed post id's in $_SESSION. So I wrote a plugin but wp call it twice. I get allways current post id and the id of the next post. This problem is also decribed here: http://shinephp.com/single-php-called-twice-how-to-stop/ I need an another solution without plugins or deactivating actions. Any ideas? Update: Sample               function handle_session(){          global $post;     // read session data     if(isset($_SESSION['mykey']) {     echo $_SESSION['mykey'];     }     // set session data     $_SESSION['mykey'] .= ','.$post->ID;          echo $_SESSION['mykey'];     } // end: handle_session          Output 1:      ''     Output 2:     ',1,2'      1 is the id of the current post and 2 of the next. Solution: Browser is sending a special header, so if it's header is sendet everything can be done but no session data have to be changend.               class Example{         private $prefetchRequest = false;              function __construct() {             add_action('init', array( $this, '_get_prefetch_header' ));             add_action('shutdown', array( $this, '_update_session' ), 9999);         }              function _get_prefetch_header(){                 if(isset($_SERVER['HTTP_X_MOZ']) && strripos('prefetch', $_SERVER['HTTP_X_MOZ'])!==false ){                     $this->prefetchRequest = true;                 }             }         function _update_session() {             if($this->prefetchRequest!==true) {                 $_SESSION['mykey'][] = $this->additional_session_data;              }         }        } // end: class Example


title: Register Taxonomy - What is `query_var`?

text: The Codex doesn't really explain it very well, what is it used for and how do I use it exactly?


title: How to joint develop a WP locally on two far away machines?

text: I was hoping someone can confirm to me, someone new to WP, how I can view a WP site created locally on 1 computer on another computer in a far away land. Basically my friend started developing a site on his MAC locally using MAMP and now wants me to continue working on it. He sent me a copy of his entire Htdocs folder, and thinks I should be able to see his work? wrong or right? What else is needed? I have installed XAMPP and have created a folder for his site in htdocs. I also created a database using MyPHPadmin and edited his wp-config to access this database. When i open the site It works, but I don't see any changes/posts etc. I can see all the themes he has downloaded and thats about it. I think, he needs to make a copy of his database to send me..is this right? Also, what is the easiest way for us to share back and forth locally hosted WP sites, so I can develop a site and send him to look at and vice versa..without the need for live hosting etc. remembering neither of us are particularly knowledgeable on matters!


title: arguments for comment_notification_text filter

text: From WP codex: > comment_moderation_text: applied to the body of the mail message before > sending email notifying the administrator of the need to moderate a new > comment. Filter function arguments: mail body text, comment ID. Nevertheless, when I put in my functions.php:               function x99($textMsg, $comId) {       if (is_null($comId)) {         return "empty";       } else {         return ($textMsg);       }     }     add_filter("comment_notification_text", "x99");      the notification message body is "empty". So comment ID is null. Why? How can I retrieve it?


title: Create attribute for woocommerce on plugin activation

text: I want to create attribute on plugin activation.By below code,i'm able to create attribute in database table `prefix_woocommerce_attribute_taxonomies` but these attributes are not showing (or listed ) under menu **Product -> Attributes**.               register_activation_hook( __FILE__, 'ravs_wpm_activate_plugin' );     function ravs_wpm_activate_plugin() {         global $wpdb;                   // attributes parameters         $wpm_attributes = array(             array(                 'label' => 'Quantity',                 'name' => 'qty',                 'type' => 'select',             ),             array(                 'label' => 'Paper',                 'name' => 'paper',                 'type' => 'select',             ),             array(                 'label' => 'Side',                 'name' => 'side',                 'type' => 'select',             )         );              //create default attributes         foreach ( $wpm_attributes as $attr ) {             $attribute = array(                 'attribute_label'   => $attr['label'],                 'attribute_name'    => $attr['name'],                 'attribute_type'    => $attr['type'],                 'attribute_orderby' => 'menu_order'             );                  $wpdb->insert( $wpdb->prefix . 'woocommerce_attribute_taxonomies', $attribute );         }              // //terms         // $wpm_terms = array(         //  array(         //   'label' => 'Single Side Price',         //   'slug' => 'single-side-price',         //  ),         //  array(         //   'label' => 'Double Side Price',         //   'slug' => 'double-side-price',         //  )         // );              // //insert default trems         // foreach ( $wpm_terms as $term ) {         //  wp_insert_term( $term['label'], 'pa_size', array( 'slug' => $term['slug'] ) );         // }     }      **Updated:** I found answer. Actually woocommerce set attribute list in a transient,so you have to delete transient on every modification related to attribute( edit, add, update).               delete_transient( 'wc_attribute_taxonomies' );


title: How do I echo saved data outside the function?

text: I know the data I want is stored as _$lineOne_ and I can _echo_ that inside the function. But I want to get the data outside of the function. I've tired:               $lineOne;      $instance['lineOne'];      Here's the code where I want to insert `$lineOne` (line 11) and the widget where the variable is loaded/saved: http://pastie.org/7142717


title: WordPress Hook for user register

text: how can I tell WordPress, that if a user registers, it shall execute my function?


title: How do I replace the e-mail form to functional e-mail subscription?

text: In `front-page.php` I have an e-mail form prototype in HTML:               <input type="email" class="form-control" id="email" placeholder="Enter your e-mail address">     <button type="submit" class="btn btn-default">Get notified</button>      * * * Most Wordpress plugin I found is usually a subscription form in widget and send subscribers e-mail automatically when there's a new blog post. This isn't what I'm looking for. I'm looking for a system that allow visitor to enter their e-mail address and their e-mail address will be added in a file, something like CSV format, so I could use an e-mail program (or Wordpress) to send them e-mail when I need to. I'm not picky, just anything that would work. Is there any Wordpress plugin that help me to achieve this? Thanks!


title: Post navigation using date

text:
On my site: www.finmand.dk/almastofa/nyheder (a danish site) I have used this code to navigate between the post:               <?php foreach(get_the_category() as $category)     { $thecat = $category->cat_ID; } ?>     <?php $result = "
";     $catposts = get_posts('category='.$thecat."&orderby=monthly=asc&numberposts=".$NUMBEROFPOSTS);     foreach($catposts as $single):         $result .= "
ID)."'>".$single->post_title."
";     endforeach;     $result .= "
";     echo $result; ?>      This right thing about the code is that it only shows on the News page /Nyheder. Problem is It only shows the newest post, and links to a page called sample- post. Which I don't have, so I get page not found. I would like it to link to page.php or single.php. But I can't figure out where to change it in the code. And I would like the navigation in the sidebar to be shown by Month and year posted. Not as now with name. But again - Beginner programmer with zero luck. So can anybody give me a hint on what to write? I know I may be playing with the big boys now regarding knowledge about "heavy" programming, and my problem may seem insignificant - but we all have to start somewhere. Hopeful Thanks Marlene


title: page not found in IE, but found in Chrome & Firefox

text: I use .html on PAGES plugin, and this works fine for me in Chrome and Firefox. However, Internet Explorer displays "page cannot be found". Why would one browser not display a page, but two others find it? Problem pages are:   * http://tech.doig.com.au/testimonials.html   * http://tech.doig.com.au/portfolio.html


title: How to add multiple buttons to TinyMCE?

text:
I've followed a tutorial on Nettuts on how to add a custom button to TinyMCE (http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right- way/) It works great and all, but i want to add many buttons and i wonder if there's a smart way to do this without having to duplicate all the code over and over. Here's the code i use for adding a button:               add_shortcode("quote", "quote");       function quote( $atts, $content = null ) {           return '
"'.$content.'"
';       }          add_action('init', 'add_button');       function add_button() {          if ( current_user_can('edit_posts') &&  current_user_can('edit_pages') )          {            add_filter('mce_external_plugins', 'add_plugin');            add_filter('mce_buttons_3', 'register_button');          }       }       function register_button($buttons) {          array_push($buttons, "quote");          return $buttons;       }       function add_plugin($plugin_array) {          $plugin_array['quote'] = get_bloginfo('template_url').'/js/customcodes.js';          return $plugin_array;       }      And then i create a customcodes.js file with this code in:               (function() {           tinymce.create('tinymce.plugins.quote', {               init : function(ed, url) {                   ed.addButton('quote', {                       title : 'Add a Quote',                       image : url+'/image.png',                       onclick : function() {                            ed.selection.setContent('[quote]' + ed.selection.getContent() + '[/quote]');                            }                   });               },               createControl : function(n, cm) {                   return null;               },           });           tinymce.PluginManager.add('quote', tinymce.plugins.quote);       })();      So again, how can i add multiple buttons without having to do all this code for each new button? Thanks :) Sebastian


title: separate categories with comma and srounded by single quote

text: hello and sorry for yet another beginner question i am extracting wordpress categories form the array but i want them to be separated by comma my code is               <?php     $args=array(     'child_of' => 79     );     $categories=get_categories($args);     foreach($categories as $category) {      echo $category->cat_id;     ?>      this will return some thing like 11223344556677 but i want the result like '11,22,33,44,55,66,77' thank you for your help


title: Automaticly add slug to posts

text: I'm using a us/news/%postname%/ structure for my permalinks. This works great for regular posts. However, I have a few different custom post types, and I don't want the us/news part in their slug. How do I have it both ways?


title: How to show custom field's value under post/page title in wp-admin

text: I'm trying to add the value of a custom field under the post/page title in wp- admin list of posts/pages (much like excerpt mode in posts list) without hooking into the columns process since other plugins are already doing that and it looks like each cancels the other. Here's a screenshot of what I'm trying to achieve: ![screenshot of pages list](http://i.stack.imgur.com/kToA2.png) Thanks!


title: wp_pagenavi function parameters

text: I've been searching all around the web for the API of the wp_pagenavi plugin, but seems that I can't find one. I just want to know: In examples that I found, the wp_pagenavi function has from 0 to 3 parameters. What are those parameters and what do they change? Also, what I've been meaning to do is, with WPML, translate my Page 1 of 5 in french (Page 1 de 5). Will these parameters help me translate that sentence, or is there another parameter/option to find to translate that. By the way, with WPML I can call different functions for different languages, so if it needs a parameter to change the language of the "Page 1 to 5" sentence, I'll be ok.


title: How to display products name in a non-alphabetical order, in a custom field (taxonomy)?

text: Now the order is: **apples, oranges, pears**.   But I want to be in a random order, for ex: **oranges, apples, pears**.   Or to write them in a order that I want. Is this possible? Taxonomy is like that:                       'fruits' => array(             'post-types' => array('products'),             'name' => 'Fruits',             'slug' => 'fruits',             'type' => 'tags' ),


title: adding meta data using plugin to top of head

text: It seems if you use the wp_head hook as an action to put your custom metadata into the head tags of your page, it is dependent on where the theme you are using calls the wp_head. In my case, it is at the end of the head tags. How can I force my meta data near the top of the head tags? I have a header.php file I'm calling in using a self-made plugin. I know how to write the function code to call the header.php. I just need to know how to hook it to the start of the head tags. Thanks, Derek


title: Wordpress Hide Show Content script and activate/deactivate script on screensize

text:
I am currently using jquery.expander.js to hide/show paragraph content. I want to only use this for screen sizes less than 500px width and less (for mobile phones) ONLY. I am working in wordpress 3.5 and genesis theme 1.9.1 My questions:   * Is there a good script proven and tested to load jquery.expander.js only on screen sizes 500px width and less. *The most important part is for desktop viewers if they reduce the screen size to 500px or less width it loads the jquery.expander.js and if they expand larger than 500px width it stops/kills the jquery.expander.js, again the reason being I just want to activate hide/show on a mobile device or desktop view that is 500px or less width.   * The Wordpress question is: When one of our marketers adds content to a page they will do this in the entry content window for that page, how can I edit my php so that it will somehow place a div of around the entry content. Sample code below for div and class name it needs for the script to work. `<div class="expander">` `<h1>Welcome and Thanks</h1>` `
Aliquam aliquet, est a ullamcorper condimentum, tellus nulla fringilla elit, a iaculis nulla turpis sed wisi. Fusce volutpat. Etiam sodales ante id nunc. Proin ornare dignissim lacus. Nunc porttitor nunc a sem. Sed sollicitudin velit eu magna. Aliquam erat volutpat. Vivamus ornare est non wisi. Proin vel quam. Vivamus egestas. Nunc tempor diam vehicula mauris. Nullam sapien eros, facilisis vel, eleifend non, auctor dapibus, pede.
` `
` *If I have not followed the forum rules let me know and I will adjust


title: Wordpress is rewrite my htacces file. I adding a font rule

text: I used webfonts in my Wordpress site. I need a rewriterule in my htacces. I put this in my htacces file:               RewriteRule ^fonts/(.*) /mikevierwind/wp-content/themes/roots/fonts/$1 [QSA,L]      But when i save this htacces file. Wordpress is rewriting the htacces file and my fonts rewriterule is gone. How can i fix that? Thank for helping!


title: trying to figure out how to use more that one image upload in the same section in theme customizer

text: i am trying to figure out how to use more that one image upload **in the same section** in **theme customizer**. the function is `new WP_Customize_Image_Control`. when you try to get the path of the image you have uploaded it will give you only from the first WP_Customize_Image_Control you have created. the others just not working. this is the code:               $wp_customize->add_section(         'head_section',         array(             'title' => 'Head',             'description' => 'head section.',             'priority' => 55,         )     );          $wp_customize->add_setting( 'img-upload' );          $wp_customize->add_control(         new WP_Customize_Image_Control(             $wp_customize,             'first-img-upload',             array(                 'label' => 'first image Upload',                 'section' => 'head_section',                 'settings' => 'img-upload'             )         )     );          $wp_customize->add_setting( 'img-upload' );          $wp_customize->add_control(         new WP_Customize_Image_Control(             $wp_customize,             'second-img-upload',             array(                 'label' => 'second image Upload',                 'section' => 'head_section',                 'settings' => 'img-upload'             )         )     );      then i try to get the link to the image by using               $first_image = get_theme_mod('first-img-upload');     $second_image = get_theme_mod('second-img-upload');     echo $first_image;     echo $second_image;      from here i just get the first link but the secend is empty. thanks for help.


title: Difference Between Admin and Super Admin in Database

text: I was looking at the user table and noticed for a super admin ( have access to network admin panel ) and an admin to a network site have same `wp_capabilities` which is `a:1:{s:13:"administrator";b:1;}` and also the `wp_user_level` is `10` for both. So, I was wondering **what is the database value that differentiate between a super admin and an admin?** I don't see any more usermeta that relates to network admin level. What is the proper way to assign super admin capability to a admin via:   1. Database Edit.   2. Via Code.


title: Show or hide custom menu widget in side bar conditionally

text: I have been trying and searching to accomplish this. I have the "custom menu" widgets "Members Area", "Admin Area" in side bar, assigned menus to them. Fine, they display. I want to show "Admin Area" widget only when the current user is admin. I believe it has something to do with adding a filter to "sidebars_widgets". Honestly, i do not have a clue to target the "Admin Area" widget. How do I handle this ?


title: How to close open divs in post loop

text:
I want to add some additional HTML markup to specific posts in a loop. For example in the post loop, I want to wrap the post 3, 4, 5 in two divs `.extra` and `.extra2` I want to display post in following order: Post 1, 3, 4, 5, 2 I am trying following:               <?php if ($query ->current_post == 0) { ?>
 Post # 1
     <?php } ?>     <?php if ($query ->current_post == 2) { ?>

     <?php } ?>       <?php if ($query ->current_post >= 2) { ?>
 Post # 3

 Post # 4

 Post # 5
      <?php } ?>      <?php if ($query ->current_post == 1) { ?>
 Post # 2
      <?php } ?>      Now I'm unable to figure out how to close the div `extra` and `extra2` after the post #5 and before the post #2. The number of posts are variable in the loop. If this method is not correct, please let me know how can I add additional markup for specific posts in the lop. Thanks.


title: Display site admin profile fields in header.php

text: I am working on a multisite setup and Im trying to display some meta from the site owner's profile. I tried the following code but it is echoing the super admin's meta instead of the current site admin --                <?php $user_id_from_email = get_user_id_from_string( get_blog_option(get_current_blog_id(), 'admin_email'));          $current_site_admin = get_userdata($user_id_from_email);          $twitt = (get_user_meta($current_site_admin, 'twitter', true)); ?>     <?php echo $twitt; ?>      Since there will be a lot of sites on the network and only one admin, im trying to retrieve this information dynamically. Any ideas on how to fix this? Thanks


title: Outputting posts from post id´s in variable

text:
I have a variable containing some post ID´s. I´d like to output the posts in that variable using the standard wordpress loop. How can I do that? Thanks! Added:               <?php      /*     Template Name: Favorites page     */          $favorites = wpfp_get_users_favorites($user = '');     $favorites_query = new WP_Query('post__in' => $favorites);          get_header();     get_sidebar();      ?>
     <?php get_template_part( 'menu' );          if(!$favorites) {     echo '
'; echo _e('Du har ingen favoritter', 'deals');      echo '
';     }          if($favorites) {     echo '
'; echo _e('Dette er dine favoritttilbud denne  uka. Favorittene dine vil kún være være tilgjengelig i denne nettleseren på denne maskinen.', 'deals');      echo '
';     }          while ($favorites_query->have_posts()) : $favorites_query->the_post();      $start = get_post_meta($post->ID, '5Start', true);     $stop = get_post_meta($post->ID, '6Slutt', true);           echo print_offer($post_id, $start, $stop);     endwhile;          if($favorites) {     echo '
';     wpfp_clear_list_link();     echo '
';     } ?>
           <?php      get_template_part( 'rightsidebar' );     get_footer();      ?>


title: Forcing frontend login with UI switch

text: Is there a way to force log-in even for _viewing_ a WordPress blog that the blog's owner can turn on and off by themselves? I can hardcode it in the template's `header.php` like so:               if ( !is_user_logged_in() ) {        wp_redirect( wp_login_url() );        exit;     }      but this can't be influenced from the blog's administration page. There is the force user login plugin, but it doesn't work in 3.x blogs. I'll try to patch the plugin for 3.x, but suggestions for other (native?) methods are welcome.


title: Remove toolbar option (and set to default to no) in user profile

text: I don't want users to be able to choose to display the admin bar/toolbar when they log into wordpress. It doesn't have a function for those users. Instead I would like for admin users to have the toolbar shown by default and anyone else to have the toolbar hidden by default. I can do this with a plugin by using css and all sorts to hide the toolbar and the option in the profile, however I was wondering if there was a "proper" way to do this at all? Thanks


title: Passing Custom Field Data as Array to be Saved (Resulting Custom Field Array is inconsistent)

text: I've been staring at this for hours, and it's clear I'm missing something, but I don't know what it can be... I have custom meta box for adding downloads to a particular post or page. All the data is save into one custom field key as an array. For each "download" we enter 3 pieces of info: resource name (input=text), resource link(input=text), and resource type (select list of like pdf,zip file, video, etc). The problem is when I save the data, it gets rearranged somehow, the order the data gets saved in and the resulting custom field array after the save is not consistent. And while saving, if I watch my log, data seems to be inserted randomly into the array for this custom field key. Here's the function which saves the data: http://pastebin.com/TY6LFuiL The specific section is question starts just below this comment: // If passed along is an array, we should remove all previous data Here's the bit that outputs the options: http://pastebin.com/EGF4dibZ - This is where things are getting messed up because, the order the data is saved and the order of the data in the resulting array for the custom field key is not consistent. For example, if I save the options as:               input 1(text): Resource Name 1 - wsm-content-downloads[]          input 2(text): http://link.com/1.pdf - wsm-content-downloads[]          input 3(select): PDF - wsm-content-downloads[]      The array looks like this BEFORE being saved:               Array     (         [0] => Resource Name 1         [1] => http://link.com/1.pdf         [2] => PDF     )      Then the function that saves the data, goes through and for each value of this array, saves it as custom field data for the same key (wsm-content-downloads) - which results in an array after saving:               Array     (         [0] => http://link.com/1.pdf         [1] => Resource Name 1         [2] => PDF     )      Here's a more detailed log:               http://pastebin.com/cdDsN5Sk      (had to code sample that last link because of limit on links) I print out the custom field data as an array after each save/update in the loop. You can see how the data is saved is not consistent at all... sometimes the value being saved/updated goes at the beginning of the resulting custom field data array, sometimes at the end and sometimes even shoved right in the middle... I need the custom field data array for this key (wsm-content-downloads) to be identical to the array I pass to the save function after all is said and done, but for some reason, it's not coming out like that... And perhaps the worst part is, this code works perfectly on my local server - on my live server it's doing this... Thanks in advance... Cheers, Bryan


title: WordPress 3.8 Test unit Import error

text: I've just updated my WordPress to 3.8 and I'm currently using multisite installed locally. It's a fresh new install. So I tried to import the test unit data from the WordPress codex which gives me a lot of errors. Here's a screenshot: ![enter image description here](http://i.stack.imgur.com/FtbHp.png) Does anyone know why I'm getting these erors? Thanks.


title: How to generate a sitemap with custom posts (not Google XML)

text: I'm looking for a way to generate a sitemap for display on my site that includes my custom posts. I'm not looking for an xml sitemap generator for search engines -- that is sorted using Google XML Sitemaps and Get Up and Running's patch for that plugin. I'm specifically looking for something to display to users. Normally, I'd use Dagon's sitemap generator, but it does not support custom posts, and the author does not seem to be responding to queries. Any hacks/patches/code snippets/ideas?


title: Adding custom html and standard widgets to sidebar

text:
I want to add both custom html that advanced text widgets can't support and the standard sidebar widgets in the same sidebar. However, when I put a sidebar widget into the theme, it removes all the custom html and just displays the widgets in the sidebar. It shouldn't be a tough fix, but I am pretty big php noob who learned wordpress by trial and error. I have attached the code from my sidebar:

Title goes here

Content goes here

Title goes here

Content goes here

      Thanks for any help


title: Problem to show custom post type in archive page category wise

text: I was facing problem to show custom post type post category wise. Then i found to solve the problem . i wrote below code in function page :               function my_blog_category( $query ) {     if ( is_post_type_archive( 'blog') && $query->is_main_query() ) {         $action =   (isset($_REQUEST['ac'])) ? $_REQUEST['ac'] : 'none';         if($action!='none') $query->set( 'category_name', $action );         }      }     add_action( 'pre_get_posts', 'my_blog_category' );      So when I click > local/wp/index.php/blog?ac=company-news it shows all company-new category's post. But main problem is that I upload all file to website server. Now filter is not working on my webserver. There I click > Mydomain/index.php/blog?ac=company-news it show all post, not filter by category. I don't why it not work on my live web server .


title: Disable creation of default content during installation

text: How can I disable or at least modify the default content inserted on a fresh wordpress install? For example to change the category from Uncategorised to News.


title: How to 301 private posts rather than 404?

text: How do I 301 redirect private pages, rather than 404 them? If a post is private, WordPress filters it out in the SQL query, so there are no $post variables to work with. I'd like for this code to work, but doesn't:               add_action('wp','redirect_stuffs', 0);     function redirect_stuffs(){     global $post;         if ( $post->post_status == "private" && !is_admin() ):             wp_redirect("http://dangayle.com/",301);             exit();         endif;     }      I don't know where that is set earlier than `wp`, other than the fact that I know it's a user role issue. If I could set a non-logged in user to have that capability, it would probably fix the issue:               $publicReader -> add_cap('read_private_posts');      The problem with add_cap is that only logged-in users have capabilities.


title: How can I get page slug

text: How can I get the slug of a page or post?


title: displaying tags in a widget

text: I have a widget which displays the latest projects as thumbnails on my website. When I mouse over a thumbnail the project title appears; this is the code for title: `<h2><?php echo get_the_title(); ?></h2>` So, I'm thinking to display also the tags from that specific project, to be something like beautiful, nature, landscape Is this possible, or could you give me some suggestions on how to achieve this ? Thanks!


title: Specific css on homepage, different one for other pages

text: Is there a way to have specific css on the homepage and use a different one for all the other pages?


title: Jetpack stats and caching strategy

text: I'm thinking about hosting a WordPress website with agressive caching/optimization strategies (like varnish, microcache, ngx_pagespeed, etc). But I still want Jetpack stats to work alright. What should I pay attention to? How does jetpack-stats count visits?   * tracking images?   * AJAX calls?   * internal WP hooks? Depending on its strategy, I'd probably have to tweak my cache configuration...


title: Ajax Validation for reCaptcha

text:
# Background I have a **registration form** that validates with AJAX using jQuery Validation Engine. The form was created using Theme My Login and contains **reCaptcha** which I implemented using WP-reCAPTCHA. Just like the rest of the fields, I needed to **validate reCaptcha using AJAX** as well, that is, without refreshing the whole page. So far I managed to make it work when the Captcha didn't validate. But **when it did validate** , ie. the input was correct, the page refreshed but with an **error message** which says **'That reCAPTCHA response was incorrect'**. Thus, the form was not saved. I tried using `console.log()` to check the output and the result is 'valid'. So I can't really tell where I went wrong. Currently I'm testing this locally using _XAMPP_. # The Code That I Used **The Javascript:**               (function($){            // Validate Captcha       $.fn.validateCaptcha = function() {              challengeField = $('input#recaptcha_challenge_field').val();         responseField = $('input#recaptcha_response_field').val();              $.ajax({             type: 'POST',             url: the_ajax_script.ajaxurl,             data: 'action=validate_captcha&recaptcha_challenge_field=' + challengeField + '&recaptcha_response_field=' + responseField,             async: false,                  success:function(result)               {                 //console.log( result );                      if(result != 'Valid') {                        $('#captchaError').html('
The security code you entered did not match. Please try again.
');                   $captchaFlag = 'Invalid';                   Recaptcha.reload();                      } else {                        $('#memberInformation span').css({'color':'green'});                   $('#memberInformation span').html(html.message).show(3000);                   $('#captchaError').html('
Success!
');                   $captchaFlag = 'Valid';                   dataString = form.serializeArray();                   getSearchMembers(dataString);                      }               }           }).responseText;       }              $('#registerform').submit(function() {           var form = $(this);                if (form.validationEngine('validate')) {             $('#memberInformation span').html('');             form.validateCaptcha();           } else {             $('#memberInformation span').css('color','#ff0000').html('Please fill out required fields').show(3000);           }           return false;         });          })(jQuery);      **The PHP:**               function validate_Captha() {       $privatekey = "xxxxxxxxxx"; //


title: Code working just in specific time period

text: I have this code in my style.css               iframe[src*="http://www.youtube.com/"]     {width:480px !important; height:305px !important;padding-top: 20px;display:none}      as you can see, it makes youtube videos not to display. But I want to display videos in some time period (for example: from 2.00 AM to 2.00 PM). How to do it? I have a theory, but I am not good at codes, so I am not able to do it myself.:               <this code work in some time period>     iframe[src*="http://www.youtube.com/"]     {width:480px !important; height:305px !important;padding-top: 20px;display:none}     </end of code>          <this code work in some time period>     iframe[src*="http://www.youtube.com/"]     {width:480px !important; height:305px !important;padding-top: 20px;}     <end of code>      Can anybody help me? Thanks a lot! :)


title: Admin Ajax is returning 0

text: I am relatively new to jQuery and AJAX in particular. I have a small issue with the return value always being 0, though I think this is actually the success message and it's not returning anything. I have scoured the Google-verse and I have the die() function on the PHP callback and I believe the add_actions are correct. I am working on a local host, though I doubt that affects it and this is all in the admin, not front end. I also checked that the js is enqueued and localised. I get a 200 OK message in the chrome developer area. I also tested out the basic AJAX from http://codex.wordpress.org/AJAX_in_Plugins and it also returned 0, which makes me wonder if it is something other than the code outlined below. Right now I am just trying to make it send something back to the jQuery. Any help would be appreciated. **The jQuery**               jQuery(document).ready(function(){         jQuery('.cl_link_buttons').val('id').click(function() {                      var currentid = jQuery(this).attr('id');                      //alert(currentid);                 console.log(currentid);                      jQuery.ajax ( data = {                     action: 'cleanlinks_ajax_get_post_data',                     url: ajaxurl,                     type: 'POST',                     dataType: 'text',                     "currentid" : currentid                      });                      jQuery.post(ajaxurl, data, function(response) {                          var dataz = response;                     alert( dataz );                     console.log (dataz); //show json in console                           });                      return false;              }); //end click event     }); //end doc ready      **The PHP**               add_action("wp_ajax_cleanlinks_ajax_get_post_data", "cleanlinks_ajax_get_post_data");     add_action("wp_ajax_nopriv_cleanlinks_ajax_get_post_data", "cleanlinks_ajax_get_post_data");          function cleanlinks_ajax_get_post_data() {          $from_ajax =  $_POST['currentid'];          echo "do" . $from_ajax . "something";          die();               }


title: Internal linking when on a shared IP

text: I have a WP site in a temporary location, and the site URL is an IP address followed by slash, tilde and the short site name. I also have a number of internal links in the pages that assume linking from the root - `<a href="/services">` - for example. Now these links do not work in the testing environment because of the shared IP. Does anyone know what I can do to make my internal links work, no matter where the site lives? UPDATE: I'm trying to update links (and the SRC of uploaded images) in the page content, not in a template file. ANOTHER UPDATE: I think I'm going to just go the manual route and drop in absolute URLs. Thanks! jen


title: WooCommerce - results per page not working after page reload

text:
What I wanted to achieve is to list some products on a custom page which belongs to two common categories. This part is working fine, except the results per page dropdown. When I change the dropdown values to 24/36/48, after page reload the number of products shown is the same as on the initial pageload. I have the following code:               $wp_query = new WP_Query(         array(             'post_type' => 'product',             'tax_query' => array(                 'relation' => 'AND',                     array(                         'taxonomy'  => 'product_cat',                         'field'     => 'slug',                         'terms'     => 'new-arrivals'                     ),                     array(                         'taxonomy'  => 'product_cat',                         'field'     => 'slug',                         'terms'     => 'earrings'                     )                 )         )     );     while ( $wp_query->have_posts() ) : $wp_query->the_post();     woocommerce_get_template( 'archive-product.php' );     endwhile;     wp_reset_postdata();     wp_link_pages(array('before' => '
Pages: ', 'after' => '
', 'next_or_number' => 'number'));      I would like to get some directions on how to customise the loop to meet also the results per page functionality. I know I am missing sending and getting the dropdown values, but have no clue (yet) on how to do it with best practice, without cruel PHP and JS. There must be some WooCommerce styled best practice. If my code can be customised or if I'm on a totally wrong way. If so, where I made the mistake? I thought this was will be the simple one, did not payed attention to the "posts per page" detail.


title: Add html plugin into wordpress

text: I purchased an HTML5 Video & Youtube background plugin, I want to use it with WordPress. http://codecanyon.net/item/html5-video-youtube-background/1555660 Any Suggestions? Maybe create a template, page,etc..?


title: Simple spam check for valid domain in commenter's email address

text: Many times commenters leave fabricated email addresses. As a really basic step, is there a plugin that checks to make sure that the domain actually exists?


title: Add a column before username in the users profile table

text: I want to reorder the Company column to be the first column in the table, the code is working fine but it's position is the last one. How can I get it to be in the first before the username?               function add_company_column($defaults) {         $defaults['company'] = __('Company');         return $defaults;     }          function view_company_column($value, $column_name, $id) {         if ($column_name == 'company') {             global $wpdb;             $companyID = get_usermeta($id, 'company');             $company = $wpdb->get_row("SELECT com_name FROM " . $wpdb->prefix . "companies WHERE com_id = " . $companyID);             return $company->com_name;         }     }          add_filter('manage_users_columns', 'add_company_column', 15, 1);     add_action('manage_users_custom_column', 'view_company_column', 15, 3);      Thanks


title: how to display json_encode via $wpdb

text: ive been struggling for quite a while how to make this work. i created a custom php, and used it as a **template page**. _[below code]_ i also ended up with this link `//localhost/site/?page_id=43` if i want to query an id, i just need to add `page_id=43&id=3` and it will display aa member name associated with the ID. whenenver i query an ID, i only get `{"result":[]}` on that page. can someone check my code please?               /*     Template Name: getID     */              global $wpdb;         if (isset($_GET['id']) === true && empty($_GET['id']) === false) {                   $query = $wpdb->get_results("SELECT * FROM `memberid` WHERE `memberid` = `$_GET['id']`");                 $array = array();                 while ($row = mysqli_fetch_array($query)) {             array_push($array, array('name' => $row [2]);            }                 echo json_encode(array("result" => $array));         }


title: php console log speed

text: How do I log speed benchmarks to a console in php? I don't want to `echo` the results for the user to see, but just in some kind of log. I know that I can get the time elapsed with this:               $first  = new DateTime( '11:35:20' );     $second = new DateTime( '12:00:45' );          $diff = $first->diff( $second );          echo $diff->format( '%H:%I:%S' ); // -> 00:25:25      but I want to log the time, and not `echo` it. Do I use the error_log?


title: Pass Query string to a 2nd Page Query

text:
I am trying to pass a query string called postcode (zip code in the states) from one page to another. On the 2nd page I want to use postcode to filter some details of people to identify the person with the relevant postcode. My query string for example is - `/registration/?postcode = 2880` I know that on the following line of code - which is about line 25:               where tblcoordinator_id_contact_details.Postcode = postcode");      If I put in the actual value of the postcode i.e. `'2880'` it gives me the correct result.   If I put in the querystring name of postcode i.e. `'postcode'` it gives every person.   If I put in the function name of the postcode i.e. `$vars` it gives me no results.   So I am at a real loss simple process. But not wanting to do posts using a page and filtering. So the code that I am using on page 2 or the registration page is - (by the way I am using a short codeplugin - Shortcode exec PHP)               global $wpdb;     function add_query_vars_filter( $vars ){         $vars[] = "postcode";         return $vars;     }          add_filter( 'query_vars', 'add_query_vars_filter' );          $result = $wpdb->get_results( "SELECT tblcoordinator_id_contact_details.ID,          tblcoordinator_id_contact_details.Firstname,          tblcoordinator_id_contact_details.LastName,          tblcoordinator_id_contact_details.Fullname,          tblcoordinator_id_contact_details.Location,          tblcoordinator_id_contact_details.Street,          tblcoordinator_id_contact_details.Postal,          tblcoordinator_id_contact_details.Town,          tblcoordinator_id_contact_details.State,          tblcoordinator_id_contact_details.Postcode,          tblcoordinator_id_contact_details.Phone1,          tblcoordinator_id_contact_details.Phone2,          tblcoordinator_id_contact_details.Fax,          tblcoordinator_id_contact_details.Email         FROM tblcoordinator_id_contact_details         where tblcoordinator_id_contact_details.Postcode = postcode"     );     //echo "
"; print_r($result); echo "
";     echo "Firstname"."  "."LastName"."

";     foreach($result as $row)     {         echo $row->Firstname."  ".$row->LastName."
";     }      Thanks Peter


title: E-commerce-like solution

text: I've been asked to build a website that is basically like a web-store, but without the need to sell products, what I mean by this is, the client wants to keep track and let visitors know of his product's stock, be able to catalog the store's products and other store like features. We're talking heavy machinery here, so there's no interest in making the product available to buy right away as some products require customer specifications that are different for everyone, thus making online buying unpractical. What I came here for is, based on this, what do you recommend? I can use a template or a plugin, I would rather use free stuff even if they require more work because I didn't give a high price for the website, I want to use WordPress because I like it so much and I'm used to working with it, I doubt you'll point me in another direction since this is a WordPress answers Q&A, but I'm open to other platforms if you have well built arguments as to why it is better than WordPress. This is my first online store in this terms, I have worked with Magento, and for the type of shop this requires, I think it just isn't worth the trouble of going through a whole Magento web-store, what do you think? I'm looking into Woocommerce, it seems like the best option and its free and has translation files, that should be useful, do you recommend?


title: how or where wordress collect unlogged user session

text: i see the pattern in some theme where we can collect session of unlogged user. for example, in a comment form: After user commenting, user can see that the their comment is waiting for a moderation. i want to know in what hook (the file, the class, or the functions) we can collect the information. fyi i'm need this information to extaned theme capability to handle unlogged user. For example show them 'message' that they need register before submitting something or uploading something.


title: Load Index on "Earlier" Post, Prev and Next Links

text: how would i load the index of my blog at a later point in the reverse chronological feed while maintaining the chronology of the feed overall? i found this explanation of how to load the feed at a specific time (today's date): Modify the main loop to display current month / year which i can modify to be 1 month ago for instance. how would i then insert posts around those from that date and keep the chronology of the feed? say I loaded posts from a month ago, i'd want a link to "previous" posts which loads any posts before 1 month ago, and a "next" link to any posts 1 month after. any help is greatly appreciated. thanks. -c


title: Editing Links in the Footer of WordPress Themes with Base64 Encrypted Code?

text: Some WordPress themes have their links encrypted in the footer and I am not able to edit them if I want to edit the links. This is the example code I found: > `<?php` > `eval(base64_decode('Pz4gCQkNCg0KCQk8ZGl2IGNsYXNzPSJjbGVhciI+PC9kaXY+DQoNCgkNCg0KCTwvZGl2Pg0KDQoJPCEtLSAvTWFpbiAtLT4NCg0KCQ0KDQoJPCEtLSBGb290ZXIgLS0+DQoNCgk8ZGl2IGlkPSJmb290ZXIiPg0KDQoJPD9waHAgdGhlX3RpbWUoJ1knKTsgPz4gPD9waHAgYmxvZ2luZm8oJ25hbWUnKTsgPz4gLiAgV29yZFByZXNzIC4gPD9waHAgaWYoaXNfaG9tZSgpKSA6ID8+PGEgaHJlZj0iaHR0cDovL3dvcmRwcmVzc3RoZW1lc2ZvcmZyZWUuY29tLyIgdGl0bGU9IldvcmRwcmVzcyB0aGVtZXMiPldvcmRwcmVzcyB0aGVtZXM8L2E+PD9waHAgZW5kaWY7ID8+PC9kaXY+DQoNCgk8IS0tIEZvb3RlciAtLT4NCg0KDQoNCjwvZGl2PjwvZGl2PjwvZGl2Pg0KDQo8IS0tIC9QYWdlIC0tPg0KDQoNCg0KDQoNCjw/cGhwIHdwX2Zvb3RlcigpOyA/Pg0KPC9ib2R5Pg0KDQoNCg0KPC9odG1sPiA8Pw=='));?>` Does any one know how to find the footer link we want from them and edit them?


title: How can I get posts in a subcategory to display on it's parent categories archive page?

text: Currently when you display an archive category page, it only displays it for the main parent, and doesn't display any of the posts that may be in the subcategories under it's parent. How can I alter it so that for every category archive it will display all posts under it, including the subcategory posts?


title: How to use wp rewrite to hide form action url?

text: I have a widget that I'm making that builds a multi-step form which retrieves xml data from a third party plugin (http://xmlplugin.com/geoquote.php). While this plugin is available for use already it isn't wordpress friendly at all. In `widget.php` I have the php that displays the form like this:               <form method="POST" action="<?php echo plugins_url( 'step2.php' , __FILE__ ) ?>" name="Calculate" onsubmit="return checkInput(this)">      The form is then rendered on the page in html like this:               <form method="POST" action="http://example.com/wp-content/plugins/geoquote_plugin/views/step2.php" name="Calculate" onsubmit="return checkInput(this)">      When submitting step1 the url for step two is:               http://example.com/wp-content/plugins/geoquote_plugin/views/geoquote_step2.php      Is there a way to rewrite the URL for step two to become something like this:               http://example.com/quote/step2.php      Even if it's not possible in the html it would be nice to not have `/wp- content/plugins/geoquote_plugin/` displayed in the url after submitting step one and redirecting to steop two. I know I can change th wp-content folder and plugins folder name, but I'd rather rewrite this to make the plugin work for any site as a wordpress plugin. Each step is a form written to a seperate file. Without rewriting every file of the prebuilt plugin, how can I rewrite the URLS? I tried this but it didn't do anything:               RewriteRule ^/quote/step-2$ http://example.com/wp-content/plugins/geoquote_plugin/views/geoquote_step2.php [QSA,NC,L]


title: Use blog as base for tags and categories

text: I have a site: `example.com` build in wordpress. I set up the posts page as `example.com/news`. I want my tags and categories to be:               example.com/news/tag/mytag     example.com/news/category/mycategory      instead of               example.com/tag/mytag     example.com/category/mycategory      Any idea how I can do this? Thanks!


title: How can I make Disqus comments not show up on pages?

text: I use Disqus to manage my comments. I'd like it to appear only on posts, and not on pages. How can I do that? If there's a way to selectively show it on some pages that'd be great, but in general I'd like the default to be hidden on pages.