Why does "get_option" pull in the older value in options.php, rather than the newer value, on submission of a form?

I'm building a simple post order "plugin" through my theme's functions.php. The function updates the value of an option in options.php on submission of a form. So, for instance, when "1" is inputted in the field next to a post in a WP_Query, the ID of that post is sent to an option in options.php called "post1". So the option is "post1" and the value is "1456" (the ID of the post). If "2" is inputted in the field, it sends the ID of the post to an option called "post2". I would have thought this is fairly straightforward. At the _start_ of the script, I call in all the options such that               $posts1 = get_option('post1');     $posts2 = get_option('post2');      and so on, such that `$posts1`, and `$posts2` are IDs of posts. I then pull these into an array which then goes into a `WP_Query`. This is so that the user knows what the current order of the posts is. Below then is another `WP_Query` that does all the aforementioned magic above of pulling the ID of the post into the option depending on what number the user selects when the form is submitted. What I would have expected is that upon submission of the form, where the options are changed (and they are changed, because I check in options.php each time), the reload of the page would present the newer list above – as in, with the options changed. However, what appears in the first `WP_Query`, which is pulling in the options as above and sending them to the array, is that the _older_ options are being pulled in by the script. I had thought maybe that the script was still working after submission and the options hadn't been changed in time for the page load, so I put a `sleep(10);` before the starting `get_option` list, but still, the older options are pulled in even after ten seconds. If I immediately refresh the page after the original submission and reload of the page, the new options are pulled in – just not on the original submission and reload. Why is this, and how can I fix it? Are there reasons why the script seems to be pulling in options that seem to be like cached or something? Thanks for your help. To reiterate, I am aware that the original `get_option` call is occurring before the `update_option`, but the `update_option` only occurs upon submission of the form, so the page is reloaded. The new options should be presented because the page is reloaded after the `update_option` occurs, but they don't. I _want_ the "old" options to appear on page load initially, so the user can see what the current order of the posts is, can update them, submit the form, then the page reloads, and they should be presented with the options they have just inputted. Here is a simplified version of the code (which I realise is inefficient and clumsy, but I don't think that should affect the issue at hand):                    <?php function functionpostorderit() {     ?>                    <?php          /* THE FIRST LOOP BELOW IS SO USERS CAN SEE THE CURRENT POST ORDER */                        global $post;         global $my_query;                                $posts1 = get_option('post1');                 $posts2 = get_option('post2');                 $posts3 = get_option('post3');                           $post_listids = array($posts1,$posts2,$posts3);                      array_filter($post_listids);                                $paged_l = 1;                 $posts_per_page_l = 25;                 $offset = ( $paged_l - 1 ) * $posts_per_page_l;                 $ids_to_query_l = array_slice( $post_listids, $offset, $posts_per_page_l );                                 $my_query = new WP_Query( array('post_type' => array( 'post', 'feature' ), 'post__in' => $ids_to_query_l, 'posts_per_page' => $posts_per_page_l, 'orderby' => 'post__in', 'ignore_sticky_posts' => 1, 'post_status' => 'publish') );                            if($my_query->have_posts()) {                  echo '
';                  $loop_counter = 0;                       while ( $my_query->have_posts() ) {                 $my_query->the_post();                      $loop_counter++;                        echo '
'.get_the_title() . '<input type="text" name="number_of_'.$loop_counter.'" value="" />'.'
' ;                             }             echo '
';                        }                         else {              }                   wp_reset_postdata();                     ?>
                        <form method="post" action="">                                    <?php                         global $post;         global $my_query;               /* THE SECOND LOOP BELOW IS THE ONE IN WHICH USERS PRIMARILY UPDATE THE ORDER */                               $my_query = new WP_Query( array('post_type' => array( 'post', 'feature' ), 'posts_per_page' => 25, 'orderby' => 'date', 'post_status' => 'publish', 'post__not_in' => $post_listids           ) );                            if($my_query->have_posts()) {                  echo '
';                  $loop_counter = 0;                       while ( $my_query->have_posts() ) {                 $my_query->the_post();                      $loop_counter++;                   $this_id = get_the_ID();                   echo '
' . get_the_title() . '<input type="text" name="number_of_'.$loop_counter.'" value="" />'.$this_id.'
' ;              ${'id_of_' . $loop_counter} = get_the_ID();              $current_id = get_the_ID();              ${'number_of_' . $loop_counter} = $_POST['number_of_' . $loop_counter];              $current_value_input = $_POST['number_of_' . $loop_counter];                                  if(isset($_POST['submit']))             {                   $current_number_of = 'number_of_'.$loop_counter;                                              if($current_value_input !== '') {                                $checking_for_equal = array('number_of_1','number_of_2','number_of_3');                   $remove_equal = array_search('number_of_'.$loop_counter, $checking_for_equal);              unset($checking_for_equal[$remove_equal]);                    foreach ($checking_for_equal as &$valued) {             $valued = $_POST[$valued];              }              if (in_array(${'number_of_' . $loop_counter}, $checking_for_equal))           {                if ($has_run !== "true") {                  echo "
Sorry, posts cannot have the same position. Try again.
";                  $has_run = "true";                  }                               }         else           {                                     if($posts1 == $current_id) {                              $option = 'post1';                              $new_value = '';                              update_option( $option, $new_value );                               }                               elseif($posts2 == $current_id) {                              $option = 'post2';                              $new_value = '';                              update_option( $option, $new_value );                               }                               elseif($posts3 == $current_id) {                              $option = 'post3';                              $new_value = '';                              update_option( $option, $new_value );                               }                                         else {                                    }                              $option = 'post'.${'number_of_' . $loop_counter};                    $new_value = ${'id_of_' . $loop_counter};                    update_option( $option, $new_value );                                   }                                        }                                }                                       }             echo '
';         } else {              }              wp_reset_postdata();                               ?>
<input class="submitter" type="submit" name="submit" value="Update" />
                           </form>                        <?php         }         ?>


Set post title and slug from meta fields not working

I have a custom post type where I have the post title disabled. I want to set the post title and slug from some custom fields. I was using this and it worked great, but since I've upgraded by site to 3.7.1 (or at least this was when I first noticed the problem), if I try to update the post, Wordpress duplicates it hundreds of times. I've tried changing the filter, such as to the code in this question, but it's still doing it. Any help or workarounds would be much appreciated. Initial code that worked but now doesn't:               function set_people_title( $data , $postarr ) {       if($data['post_type'] == 'people') {           $first_name = get_post_meta($postarr['ID'],'first_name',true);           $last_name = get_post_meta($postarr['ID'], 'last_name', true);           $post_title = $first_name . ' ' . $last_name;           $post_slug = sanitize_title_with_dashes ($post_title,'','save');           $post_slugsan = sanitize_title($post_slug);                $data['post_title'] = $post_title;           $data['post_name'] = $post_slugsan;        }        return $data;      }      add_filter( 'wp_insert_post_data' , 'set_people_title' , '10', 2 );


Execute a function using ajax

I have a function called `function getSingleAmazonProduct($asin='')`. It returns an amazon product. I have a form field to enter the `$asin`.
             <form id="productpreview" action="#">             <input type="text" id="asin" name="asin" value="" placeholder="Enter ASIN"/>             <input type="hidden" name="asin_form_post" value="1"/>                           <input type="submit" value="Preview"/>

          if ( isset($_POST['asin_form_post']) && $_POST['asin_form_post'] == '1') {         $asin = $_POST['asin'];         $preview = getSingleAmazonProduct($asin);     }      Can someone tell me how to use ajax to display the returned data within `asinpreview` div?


TinyMCE popup windows using WP functions

In my editor I would like to use a TinyMCE generated popup to insert in the textarea some complex shortcodes. I use the TinyMCE API to show the popup (bottom of this question). The popup is a PHP file inside my theme. I would like:   1. To protect this file from external access (`if ( ! defined( 'ABSPATH' ) )` does not work).   2. Use some WP functions inside this popup.  Which is the way you could suggest? _TinyMCE API call_               init : function(ed, url) {             // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mcecax_webnews');             ed.addCommand('mcecax_webnews', function() {                     ed.windowManager.open({                             file : url + '/dialog.php',                             width : 650 + ed.getLang('cax_webnews.delta_width', 0),                             height : 500 + ed.getLang('cax_webnews.delta_height', 0),                             inline : 1                     }, {                             plugin_url : url, // Plugin absolute URL                             some_custom_arg : 'custom arg' // Custom argument                     });             });     [...] CUTTED


Getting only direct child pages in WordPress with get_pages

I am trying to fetch all direct children of a page. But I am getting all children and grand children as well. Any ideas? **PHP Source:**               $args = array(              'child_of' => $post->ID,              'parent ' => $post->ID,             'hierarchical' => 0,             'sort_column' => 'menu_order',              'sort_order' => 'asc'     );     $mypages = get_pages( $args );          foreach( $mypages as $post )     {          $post_tempalte = the_page_template_part();          get_template_part( 'content' , $post_tempalte );     }      My `$args` should be correct according to the documentation, but it's totally ignoring `parent` and `hierarchical`. **My page structure is as follows:** > Parent   >  -Child 1   >  -Child 2   >  --Child 1 to child 2   >  --Child 2 to child 2   >  -Child 3 And I only want to get `child 1`, `child 2` and `child 3`.


Using a custom WP_Query with get_template_part loop

I have a query for a custom post type:               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $books = new WP_Query(array(         'post_type' => 'wiki',         'posts_per_page' => '50',         'paged' => $paged     ));     ?>      And i want to loop through these posts using the loop-books.php:               <?php get_template_part( 'loop', 'books' ); ?>      Inside the loop-books.php i have these, just like the regular loop.php, i just changed the have_posts and the_post function to work with the $books query:               <?php if ( $books->have_posts() ) : ?>               <?php while ($books->have_posts()) : $books->the_post(); ?>             <?php the_title(); ?><br/>         <?php endwhile; ?>     <?php endif; ?>      But after this, i get a php error:               Fatal error: Call to a member function have_posts() on a non-object in .../loop-books.php on line 1      So looks like the $books variable is not available inside the get_template_part function. How can i resolve this issue? If i put the $books query inside the loop-books.php its working fine, but i want to separate them.


Listen to Post action

I am writing a plugin that adds a custom metabox to the post page. I would like to trigger an event when the user navigates away from the _edit post_ page or when a user stops editing a specific post. Is there a way to listen to events on the post page?


Creating search form for custom database table

I have a custom table in the WP database which I can display fine, with pagination, using the following code:               <?php          global $wpdb;     $rows_per_page = 50;     $current = (intval(get_query_var('paged'))) ? intval(get_query_var('paged')) : 1;          $rows = $wpdb->get_results( "SELECT * FROM nc_rates_eng");      global $wp_rewrite;          $pagination_args = array(     'base' => @add_query_arg('paged','%#%'),     'format' => '',     'total' => ceil(sizeof($rows)/$rows_per_page),     'current' => $current,     'show_all' => false,     'type' => 'plain',     );          if( $wp_rewrite->using_permalinks() )     $pagination_args['base'] = user_trailingslashit( trailingslashit( remove_query_arg('s',get_pagenum_link(1) ) ) . 'page/%#%/', 'paged');          if( !empty($wp_query->query_vars['s']) )     $pagination_args['add_args'] = array('s'=>get_query_var('s'));          echo paginate_links($pagination_args);          $start = ($current - 1) * $rows_per_page;     $end = $start + $rows_per_page;     $end = (sizeof($rows) < $end) ? sizeof($rows) : $end;          echo "
";     echo "
";     echo "Destination	";     echo "Dial Prefix	";     echo "Cost per Minute (euros)	";     echo "
";     echo "
";               for ($i=$start;$i < $end ;++$i ) {     $row = $rows[$i];          echo "
";     echo "$row->r_dest	";     echo "$row->r_prefix	";     echo "$row->r_rate	";     echo "
";     }     echo "
";     echo "
";           echo paginate_links($pagination_args);          ?>      However, I would also like to be able to take input from the user to search this table and display the results in the same format. What's the best way to do this? I tried adding a simple form to the top of the page and plugging the result into the sql query:               <form method="get" id="searchform" action="">
     Destination: <input type="text" name="destination" id="destination" value="" />
     <input type="submit" id="searchsubmit" value="GO" />     </form>      .....               $dest=$_GET['destination'];     $rates_sql="SELECT * FROM nc_rates_eng WHERE r_dest LIKE " ."'%$dest%'";      .... And this works, but breaks the pagination function. Any help would be greatly appreciated!


Wrapping Featured Image on Add/Edit Page in div?

is it possible to wrap the featured image on the add/edit page in a div or other code? I don't mean on the front page of the website, but on the back end on the add/edit pages when you're typing up your post. I'm trying to add this code around it:

Featured Image Code

      The code for the featured image is in `\wp-admin\includes\post.php` but if I add it there it'll be lost when I upgrade. Thank you!


$wp_filesystem returns NULL. What are the dependencies?

I need to obtain a reference to the $wp_filesystem object. In the test below, the var_dump($wp_filesystem) returns NULL. What additional files are required in order to properly set up $wp_filesystem? I was expecting that since its called in file.php, loading that file would be sufficient to load the object.               <?php     require('../../../wp-blog-header.php');     require('../../../wp-admin/includes/file.php');          $mytest = somefunction();          function somefunction() {       global $wp_filesystem;       var_dump($wp_filesystem);            return;     }     ?>      UPDATE: I've found that I can call WP_Filesystem() directly to create it, so I'm getting the zip extracted fine, now the problem is that the zip file is copied to the destination folder rather than deleted as my ZipArchive method does.               require('../../../wp-blog-header.php');     require('../../../wp-admin/includes/file.php');          function openZip($file_to_open) {          global $target;           global $wp_filesystem;         if(class_exists('ZipArchive'))         {             $zip = new ZipArchive();               $x = $zip->open($file_to_open);               if($x === true)              {                   $zip->extractTo($target);                   $zip->close();                                 unlink($file_to_open);               } else {                   die("There was a problem. Please try again!");               }         }         else         {         WP_Filesystem();         $my_dirs = ''; //What should this be? I'm already passing he $target directory         _unzip_file_pclzip($file_to_open, $target, $my_dirs);         }     }


Rewrite author_name

I need to rewrite author_name to cat. I searched for hours but can't find anything. I restrict the search results by author instead category because of the performance, it's much faster.   For getting all posts from the user "alex" you have to type: `example.com/?author_name=alex`, I just need to change the "author_name" to "cat" it has nothing to do with the normal wordpress category structure.


Wordpress Database Slow - should I switch to InnoDB?

I have a WordPress site with well over 10k posts, and things are starting to get very slow whenever I am adding and editing posts. Pages load nice and fast for users, along with the admin lists of posts, but it is when writes or updates occur the server goes to 100% CPU and takes a long time (sometimes longer than PHP's timeout of 60s). I am thinking that this is likely to do with the table level locking of MyISAM, and am thinking of switching this to InnoDB. What are the implications of doing this? Some stats:               select  - per hour ~22k     update  - per hour ~7.6k     set option  - per hour ~7k      I know there are lots of other optimizations I can make, but my feelings are that this might have the biggest impact. Thanks **Edit** : I have found one of the major problems causing the slowness, it was YARPP (Yet Another Related Posts Plugin) that was regenerating the "relatedness" each time, and this seemed to be due to the 2k+ tags we have. I turned off the "consider tags" option and it has sped up considerably. Also, other plugins that regenerate things can cause these kind of issues, such as some XML sitemap plugins. So, my immediate issue is resolved, although I would still love to hear a good answer to InnoDB vs MyISAM for Wordpress!


Customizing 1 theme for multiple blogs in a multisite setup

I just converted a site to a multisite setup using WordPress 3.0.4. One thing I found in a hurry is that if I wanted to edit a theme's code, the changes would be reflected on all the subsites that use the same theme. Is there a to customize the code so that only a certain subsite receives the changes??


Custom post type - change name in sidebar

I've created a custom post type, as I'm making a site which will feature job listings. I want the sidebar in the dashboard to show "Jobs" as the name. Here is my code in functions.php               // Register Custom Post Type             function custom_post_type() {                      $labels = array(                     'name'                => _x( 'Jobs', 'Post Type General Name', 'text_domain' ),                     'singular_name'       => _x( 'job', 'Post Type Singular Name', 'text_domain' ),                     'menu_name'           => __( 'Post Type', 'text_domain' ),                     'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),                     'all_items'           => __( 'All Jobs', 'text_domain' ),                     'view_item'           => __( 'View Job', 'text_domain' ),                     'add_new_item'        => __( 'Add New Job', 'text_domain' ),                     'add_new'             => __( 'Add New Job', 'text_domain' ),                     'edit_item'           => __( 'Edit Job', 'text_domain' ),                     'update_item'         => __( 'Update Job', 'text_domain' ),                     'search_items'        => __( 'Search Jobs', 'text_domain' ),                     'not_found'           => __( 'Not found', 'text_domain' ),                     'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),                 );                 $args = array(                     'label'               => __( 'custom_job', 'text_domain' ),                     'description'         => __( 'Jobs Listing', 'text_domain' ),                     'labels'              => $labels,                     'supports'            => array( ),                     'hierarchical'        => false,                     'public'              => true,                     'show_ui'             => true,                     'show_in_menu'        => true,                     'show_in_nav_menus'   => true,                     'show_in_admin_bar'   => true,                     'menu_position'       => 5,                     'can_export'          => true,                     'has_archive'         => true,                     'exclude_from_search' => false,                     'publicly_queryable'  => true,                     'capability_type'     => 'page',                 );                 register_post_type( 'custom_job', $args );                  }                  // Hook into the 'init' action             add_action( 'init', 'custom_post_type', 0 );      However for some reason this shows up in WP as "Post Type" in the sidebar. But I can't see anywhere that it would be coming from... I thought the `name` label was the name shown in the sidebar? Where did I go wrong? ![enter image description here](http://i.stack.imgur.com/EncIw.png)


Random image from tag/custom type on sidebar

How would I pull a single random image from custom post type "athletes" and the custom image field "athletethumbnail" to be displayed in my sidebar? (I have PHP enabled for my text widget on sidebar.)


Display comment form of specific page in sidebar

I want to display the comment form of a specific page on a sidebar. It will look like this roughly. ![enter image description here](http://i.stack.imgur.com/S1URH.png) * * * ![enter image description here](http://i.stack.imgur.com/i92rH.png) * * * I tried modifying from comments.php and putting it on sidebar.php. But nothing shows up. Help please?               <?php $aspirasi = get_post(2); ?>      <?php if ( 'open' == $aspirasi->comment_status ) : ?>

<?php comment_form_title( __('Post a Comment', 'newtheme'), __('Post a Reply to %s', 'newtheme') ); ?>

                                <form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post">          <?php if ( $user_ID ) : ?>
<?php printf(__('Logged in as %2$s. Log out?', 'newtheme'),                                 get_option('siteurl') . '/wp-admin/profile.php',                                 wp_specialchars($user_identity, true),                                 wp_logout_url(get_permalink()) ) ?>
          <?php else : ?>
<?php _e('Your email is never published nor shared.', 'newtheme') ?> <?php if ($req) _e('Required fields are marked *', 'newtheme') ?>

<?php _e('Name', 'newtheme') ?> <?php if ($req) _e('*', 'newtheme') ?>

<input id="author" name="author" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="20" tabindex="3" />

<?php _e('Email', 'newtheme') ?> <?php if ($req) _e('*', 'newtheme') ?>

<input id="email" name="email" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" />

<?php _e('Website', 'newtheme') ?>

<input id="url" name="url" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" />

          <?php endif /* if ( $user_ID ) */ ?>

<?php _e('Comment', 'newtheme') ?>

<textarea id="comment" name="comment" cols="45" rows="8" tabindex="6"></textarea>

<?php _e('You may use these HTML tags and attributes:', 'newtheme') ?> <?php echo allowed_tags(); ?>

          <?php do_action('comment_form', $aspirasi->ID); ?>
<input id="submit" name="submit" type="submit" value="<?php _e('Post Comment', 'newtheme') ?>" tabindex="7" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
                          </form>

     <?php endif /* if ( 'open' == $post->comment_status ) */ ?>


Display featured posts for a custom post type by taxonomy

Ok, the quick explanation: I'm using a custom post type, 'lakes'. And, using custom taxonomies to organize them. They are: state, watertype and county. I've created a 'page' for each state that displays all the listings using that state's name in the tags. This part works fine. What we want to do is also have some of the lakes set with a tag of 'featured' and display those in a div in the top portion of the page just above the regular results. There would only be perhaps 5 set as featured but the query could also set a limit as well. Where i'm stuck is in how to create the query and results based upon the state page they are currently on. In other words, if they were on Alabama then i'd want the 5 featured listings in Alabama to display. If on Alaska, then the 5 featured from Alaska. These would just display in a typical unordered list that I would format with CSS in the stylesheet. I just haven't gotten any query and loop code to work as it just wants to show the same 5 results no matter what state page they are on. Ideas? Thoughts? Help? Thanks in advance to anyone and everyone. I AM researching the other similar posts as well but could not find the specifics about page-to-page issue.


WordPress Query Returning Every Post

I have a custom WP query that searches a single custom field, using an array. The custom field is for the country of origin of a post. The array I'm using are the names of the various countries in a region. The objective is to be able to return all posts from a region or continent. Here is my query:               $args = array(             'posts_per_page' => '-1',             'cat' => '4',             'meta_query' => array(                     array(                     'meta_key' => 'Country',                     'meta_value' => $country_search,                     'compare' => 'IN'                     )             )         );         $country_query = new WP_Query( $args );      The `$country_search` variable is an imploded array: 'Albania','Andorra','Armenia','Austria','Belarus','Belgium', etc. What happens is that no matter which region I search for, while the correct country array is returned, the query returns all of the posts in the database. I'm sure it's something simple, but my head is sore from banging it against the keyboard. I greatly appreciate any help. ty


Hide the form of the customer's personal details in the checkout page

How can I hide the form of the customer's personal details in the checkout page of Woocommerce when he/she is already registered and is buying another product?


Sort by category and then date?

I'll try to be as clear as possible. My Wordpress site has multiple custom categories and posts types all which need to be displayed on the home page blogroll. But I need the first post on the homepage always to be the most recent post from a specific category. For example the story at the top of the page will always be the latest "hot- dog" category; and below it; sorted chronologically are more "hot-dogs" mixed with "hamburger" and "nachos" How would I accomplish this?


Integrate Custom Post Type Events into Calendar

I've got a custom post type called Events on my site with a custom field called event_date created via Advanced Custom fields that stores its value in yymmdd format. Everything works just fine and I'm even able to list upcoming events sorted by event_date on my home page. Trouble is, I'd also like to list these events in the Wordpress calendar widget by event_date and I can't seem to figure out how to go about doing that. I see that someone has created a function that allows the Wordpress calendar to show custom post types, however it grabs _all_ custom post types and it can't filter by custom fields: http://bajada.net/2010/07/15/adding-custom-post-types-to-get_calendar-and-the- calendar-widget Can anyone offer any advice? I'd prefer not to use an event plugin since the ones I've tried are too complicated for the client or don't integrate nicely into what I've already built. However I'm open to using a calendar plugin that can tie into custom post types and fields. I just haven't been able to find one.


featured image as background image on pages

I'm adding a featured image on my page through the dashboard and I want to use it as a background image on the container div of the page. I want to apply the background image through css, so I am thinking to put a style attribute inside my markup. I'm thinking to make something like this:               <div id="<?php echo $post_name; ?>" class="page<?php echo $post_id; ?>" style="background: url(<?php wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' ); ?>) !important;">      But unfortunately this is not working. When I check the output is like this:               background: url() !important;      What is wrong with this ? Any suggestions? Thanks!


Query Pages and post excerpts dynamically

I have a custom home page, a blog page which includes a dynamic preview area of the latest 5 blogs, and some other miscellaneous pages. Im trying to design an "events" page where the main page has a sidebar that looks like this: http://imgur.com/ezEIApD You can then click on each section, which will open up and have a brief description of the event taken from the page with a read more link to go to that page. http://imgur.com/Gz9RDYx I have a parent page called "Events Main" and then I have some test pages set up as child pages of the "Events Main" page. How I could go about querying child pages to fill in that content dynamically? I'm currently using this code               $page_id = 85;     $page_data = get_page( $page_id );     $content = $page_data->post_excerpt;     $title = $page_data->post_title;     echo $page_data->post_title;     echo $page_data->post_excerpt;      but I have to go in and fill the page ID number for each section. I need it to automatically populate these fields, so whenever a new child page is added it will show up. Im using a very similar method in the blog part of my page where anytime a new post is added, the shows up on the blog home page and i can then click it to go to the actual post using this code:                   <?php query_posts("posts_per_page=5"); ?>     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>              <div style="color:#fff;" <?php post_class() ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>"><?php the_title(); ?>

<?php if ( function_exists( 'get_the_image' ) ) { get_the_image(); } ?>

                 <?php the_excerpt(); ?>

<?php include (TEMPLATEPATH . '/inc/meta.php' ); ?>

          <?php endwhile; ?>          <?php else : ?>
Not Found
          <?php endif; ?>       How to do that?


Post Type Rewrite Custom

Demo for example:   * `my-site.com/shop-virtual/` - Listing all posts of Post type "Products".   * `my-site.com/shop-virtual/products/category` - Listing all posts of Category.   * `my-site.com/shop-virtual/products/category/my-product-single` - Single post `/shop-virtual/` this is custom page with loop for post_type 'products'. Currently looks like this:   * `my-site.com/shop-virtual/` - page list   * `my-site.com/category/my-category` - For categories is thus with base categories of wp.   * `my-site.com/products/my-product` - this is single page of unique product. I tried to use the 'rewrite' the 'register_post_type' that way down but it did not work               register_post_type( 'products', array(         ...         'rewrite' => array("slug" => "shop-virtual/products", "with_front" => false),     ) );


Where is the code for "Front Page Template"?

I'm using the TwentyTwelve theme. For my static front page I'm using the "Front Page Template", but I want to modify it so it doesn't include the page's title on the rendered page itself. So I went looking for the template file for "Front Page Template" but it's not in the theme. I grepped for "Front Page Template" in the theme directory and got no hits. I poked around other locations in the WP hierarchy but can't find it. Where is it?


Wordpress 3.1 not autoupdating

Hay All, when i run the auto-update for WordPress 3.1 it doesn't do anything. It says               Downloading update from http://wordpress.org/wordpress-3.1.zip…     Unpacking the update…      But then the browser stops, it leaves a 3 megabyte "wordpress-3.tmp" file in my wp-content folder.


Show Daily Archives after specific dates

I am currently showing a daily archive using the following                <?php wp_get_archives('type=daily&limit=15'); ?>      It shows all the older posts as daily archives. However, Is it possible to show the archives only after a specific dates. For instance, I would like to show daily archives from August 1, 2013 onward only and not any post which was published before that. I have tried to use the following code but somehow does not work               <?php     function ($where) { return $where . ' AND  (post_date)>= 2013-08-01 '; }     add_filter('getarchives_where');     ?>     <ul>            <?php wp_get_archives('type=daily'); ?>     </ul>       Thanks


How to clear the cache?

I have made changes in my CSS, but it doesn't work. I know it's because of caching from admin panel. How to clear cache of my WP admin. Is there any method to clear the cache?


Google maps .gm-style div now displays as block, thus breaking the map

recently my Wordpress page with Google Maps started displaying markers in an odd fashion- look! ![enter image description here](http://i.stack.imgur.com/9N2R7.png) The problem is- Google changed they code and added this baby into the code:                 .gm-style div {         display: block;         }      Overriding the code with, let's say, `display:inline-block !important;` doesn't work, since a new display:block is being automatically generated by Google! (Picture below) ![enter image description here](http://i.stack.imgur.com/XZOF6.png) The site itself is here if anyone wants a peek:               `http://objekt.ee/properties/?lease=rent&view=map`


How do I add (css) class to a custom link to make it current_page_item

As a custom menu item wp doesn't add the class current_page_item All other links it does?

Home

Future TV Guide

About

      I would like to show it as an active link


Can I sell a theme based off of TwentyTen

Can I sell a theme I developed using TwentyTen


Injecting JavaScript into a Post with WP3.x

I have a client who is trying to inject some JS directly into a post using the web interface. The script is stripped out on the live site. I am unable to replicate this behavior on a local installation. The JS is added as expected. The main difference between my installation and the client's is that my installation is a fresh WP3 installation, whereas the client's is WP3 upgraded from WP2. Is this a configuration option or a legacy issue? Is there some other reason why this might be happening? Rich


Personalized Author Area

I have most of a site together that is set up to allow people to register as authors and post stories. I had originally suggested we use a form and have the client create the post, since he also wishes for people to add audio and images However, he says he wants it so any Author can add/edit/post anything (don't even get me started on security). I decided to let people register, then send them to a how-to page describing how to create a post, upload an image and add audio file, with screen shot pics. Not the best solution but in budget. Now my client wants this: _What I would like it to be is more of a personalized page. So I would have my pic in the upper left corner and then some information about myself. In the page we would then set up sections that show different types of content for that person. There will be a story section, a picture gallery and a media. I'm guessing that we'll want to have those link to a page that can show them in better organization than we can show on the person's home page (for lack of a better term for it at the moment)._ I personally don't see a cheap or easy way to do this, unless if there is a plugin out there that adds this sort of functionality. But beyond that, has anyone run into this and, if so, how did you solve this personalized page issue? I just don't know how to dumb this down any further for users without massive changes to the system. I'm guessing "knowing about it from the beginning" would have been the best solution...


How can I get a list of comments by target

I've been looking at the classes WP_Comment_Query and WP_Meta_Query but to be honest, I can't figure out how to use them together. I want to query the database for comments where `wp_posts::post_author == X` and `wp_comments::comment_post_id == wp_posts::post_id`. Could anybody give an example of usage? Since SQL is not my thing, and this next question is not really WP related, but how would a SQL query be built to handle 2 tables?


Is there a "widget slider?"

This is surprisingly hard to search for on the internet given the keywords that have to be used. I am looking for a widget slider. To be clear, not a slider widget which you can put photos, videos, etc into. I have 3 existing widgets. I would like them to rotate as would any set of photos in your typical slider. Has anyone seen anything like this? There would be a widget in the widget area, and then these 3 widgets would be added to that so that they rotate. I have a map widget, a WooCommerce widget, and a Text widget


Get URI from PodPress using PHP

We're using podpress as our podcast player, but we'd like to give the option to download the file on a page without a player. So I'm trying to figure out how to extract the URI from the metadata. I'm new to PHP, and struggling to learn it, so I've gotten this far:               <?php           $custom_fields = get_post_custom(get_the_ID());         $my_custom_field = $custom_fields['_podPressMedia'];         foreach ( $my_custom_field as $key => $value ){             echo $key . " => " . $value . "<br />";         }     ?>      which outputs               0 => a:1:{i:0;a:10:{s:3:"URI";s:85:"http://www.writingexcuses.com/wp-content/uploads/Writing_Excuses_8_1_Microcasting.mp3";s:5:"title";s:33:"Writing Excuses 8.1: Microcasting";s:4:"type";s:9:"audio_mp3";s:4:"size";i:12759440;s:8:"duration";s:5:"17:43";s:12:"previewImage";s:86:"http://legacieslost.com/writing/wp-content/plugins/podpress/images/vpreview_center.png";s:10:"dimensionW";i:0;s:10:"dimensionH";i:0;s:3:"rss";s:2:"on";s:4:"atom";s:2:"on";}}      So I can see the data I want right there, and I know I need to create another function that takes the first result and extracts just the value with the key URI, but I can't figure out what that function should look like. I haven't really figured out "array thinking" yet, despite a lot of time looking at this page on the PHP manual. http://php.net/manual/en/control-structures.foreach.php Any advice on construction?


Problems with custom post type and hierarchical permalinks

I have a custom post type "films" and a hierarchical taxonomy "genre" (terror,drama, action) I would like to obtain this urls:               www.domain.com/films  ----------------------------------> all the films     www.domain.com/films/terror/ ---------------------------> all terror films     www.domain.com/films/terror/vampires -------------------> all vampire films     www.domain.com/films/terror/vampires/post-name ---------> the post      How can I do it?


Replace get_the_title and the_exerpt with custom arrays

Here is the code in home.php:               <?php get_header(); ?>

             <?php          $cat1 = stripslashes(get_option('lx_feat_cat'));          //The Query     query_posts('category_name='. $cat1 . '&showposts=9');     //The Loop     if ( have_posts() ) : while ( have_posts() ) : the_post();          $link = get_permalink( $post->ID );     ?>
             <a href="<?php echo $link ?>">             <?php                  if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.                 the_post_thumbnail('thumbnail-home');                 }              ?>
             <?php $slide_title = get_the_title(); ?>
<?php _e($slide_title, lexington-theme); ?>
             <?php the_excerpt(); ?>

                     <?php endwhile; endif;     //Reset Query     wp_reset_query();     ?>

        I would like to replace get_the_title with a custom title and a custom the_exerpt for each slide. I figure I could create two arrays with my custom titles and exerpts and pull those instead of the ones from the database:               <?php     $get_the_title() = "Custom title 1";         $get_the_title() = "Custom title 2";         $get_the_title() = "Custom title 3";          etc for 9 slides..              $the_excerpt() = "Custom exerpt 1";         $the_excerpt() = "Custom exerpt 2";          etc...      My angle was replacing $get_the_title() with $get_the_title_custom[$link] but no luck. Not being that skilled in php, I cannot figure out how to do it without breaking something. Any help would be much appreciated.


jQuery code not working when included in functions.php

I feel like I am definitely missing something simple here... but for the life of me, can't find what I'm missing. I am of the "bad habit" of including jQuery functions directly in the header.php file (among other spots). This is frowned upon, as I understand, and functions should be kept in a separate file using the wp_enqueue function to load them (if I get that correctly). I have this simple function in my header.php that should fire on document ready:               <script>         // Scroll to Top         jQuery(document).ready(function () {             // Force element to hidden state when page loads             jQuery('.scroll-to-top').hide();                  // Check to see if the window is top if not then display button             jQuery(window).scroll(function () {                 if (jQuery(this).scrollTop() > 200) {                     jQuery('.scroll-to-top').fadeIn();                 } else {                     jQuery('.scroll-to-top').fadeOut();                 }             });             //Click event to scroll to top             jQuery('.scroll-to-top').click(function () {                 jQuery('html, body').animate({ scrollTop: 0 }, 800);                 return false;             });         });     </script>      So to do things "correctly", I take my code out and placed it in myScripts.js (removing script tags of course). I've created a functions.php file specific to my theme, and I've added this code:               <?php         function add_my_script() {             wp_enqueue_script(                 'myScripts', // name your script so that you can attach other scripts and de-register, etc.                 get_template_directory_uri() . '/js/myScripts.js', // this is the location of your script file                 array('jquery') // this array lists the scripts upon which your script depends             );         }              add_action( 'wp_enqueue_scripts', 'add_my_script' );     ?>      But when I load my page, the script doesn't work anymore. It's been working fine the "wrong" way for months now, but I'd really like to get it working as it should before I keep adding other scripts to the site. Any thoughts on what I'm missing here? Do I need another line / call somewhere to activate the script?


Show/Hide Custom Meta Boxes using any plugin

How can I show and hide the custom meta fields created using Advanced Custom Fields plugin? I want to handle the publish and unpublish of the fields and values from the admin panel. Is there any plugin for this?


Remove custom taxonomy 'post-type' from post URL

I want to remove custom taxonomy 'post-type' from post URLs like:               http://example.com/wordpress/post-type/post1      to               http://example.com/wordpress/post1      I have used lots of plugins and rewrote URL. But didn't get success. I can not mention real site URL.


How to add wordpress blog to Windows 2008 R2 site

One way is to install php and wordpress on server following WordPress Windows 2008 Web Server R2 IIS 7.5 setup. Is it possible to reroute url like blog.yourcompanyname.com to another ip address and use linux host to do job?


WordPress total posts per page changed and now 404 Http error comes out

I have migrate my web site from Joomla to WordPress. All are fine, I have create my Rewrites in htaccess to stop 404 from old URLs but I have problem with pagination. In Joomla web site, I had 6 posts per page, but now in WordPress I need to display 10 posts per page. That's fine too. The problem is that, in WordPress site now the very very last pages return 404 error because of the 10 posts per page I use now. i.e.: In Joomla to get the 60th article I had to go on page 10, but now page 10 does not exists anymore, because In WordPress the very very last page now is the page 6. In that case, I will try to access the 7th, 8th, 9th or 10th page I get a 404 HTTP Error. How can I fix that?


<!--more--> help

I have a custom post type called "Blog", in my templates I looping over the blog type and doing the following,               <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<?php echo strtolower(the_title()); ?>

<?php userphoto_the_author_thumbnail();?> Posted By <?php the_author(); ?> - <?php the_date("l jS M Y"); ?>

                         <?php $tags = wp_get_post_tags($post->ID); ?>                         <?php foreach ($tags as $tag) : ?>                             <a href="<?php echo $tag->slug; ?>"> <?php echo $tag->name; ?>  |                         <?php endforeach; ?>
                         <?php the_content("Read More"); ?>
             <?php endwhile; endif; ?>      My post consists of this content,               Hello World I am teaser              Hello World I am a the content      I am expecting the output to looks like this,               Hello Word I am teaser     Read More      However what I am getting is the following,                  Hello World I am teaser               Hello World I am a the content


Want Page Title to show on menu, but not on page

I have set up a static home page. I would like the title, Home, to show on the menu, but not on the page. Can you tell me how to accomplish this? Thank you.


PHP or JS for header image rotator?

I'm working on a site that is using this PHP script to load a random header image every time it reloads. I would like to use Javascript instead to allow the browser to cache images and improve load times and was wondering if there's any benefit to using the PHP script over some JS script for this scenario.


Widget content turns up before title

I've recently been trying to create a 'Popular Products' widget for for WP e-Commerce. Since there isn't built-in functionality, I referred to Dave Mackintosh's post here and gave it a shot. Still no success. But since there's a shortcode, I decided to use the 'Shortcodes in Widgets' plugin and place the shortcode in a text widget. It works now, but the issue now is the product list appears outside the widget area, just floating in the sidebar.


Two-step login process - Is it possible?

Is it possible to do the following with Wordpress (without hacking too much code - I would like to make this a general plugin using simple hooks)?   1. Log in with the username/password.   2. If username/password correct then have another authentication step (a token or a question).   3. If token is also correct, then give user access. For those of you that have bank accounts with Bank of America, this is very similar to their "sitekey" login system. If anyone has any tips or plugin examples, don't hesitate to link them. Thank you! This is virtually identical to the following question: http://wordpress.org/support/topic/two-step-authentication-login-needed on the official forums.


Importing multiple RSS feed into Wordpress and sorting them by date

I have found the following code to import feeds from multiple feeds and show them in wordpress. But, I want to sort all the combined feeds by date and show only 10. How can I do that? Thanks               <?php       $feed = fetch_feed(array('http://www.site1.com/feed/', 'http://www.site2.com/feed/'));     foreach($feed->get_items() as $item) {        echo $item->get_title();     }     ?>


Help with Wordpress function inside a shortcode

I'm trying to spice up a theme of mine with some shortcode buttons but I'm having quite a bit of trouble when trying to call the author's name within the button itself. I tried simply including               <?php echo do_shortcode('[button type="square" color="black" size="small"] Posted by <?php the_author(); ?> [/button]'); ?>      in the theme where I want the button with the author's name to appear, but it just gives a button that says 'Posted by '. I'm not the most experienced coder, but I know a little bit of everything from tinkering with various themes over the years. All help is appreciated, thanks in advance! -Matt


Favicon not working properly in chrome and in firefox

I am using wordpress for my website. I put the favicon.ico file in the wp- content folder and I inserted this code into the header: `<link href="http://seriousautosport.com/wp-content/favicon.ico" rel="shortcut icon" type="image/x-icon" />` Now the favicon works when I'm on the home page and it works on some other random pages. But not on every page. This happens in Chrome and in Firefox. IE works fine and I know why. But how do I get it to work in Chrome and Firefox? Help.


Pagination problem (plugin wp-pagenavi) with a custom post type?

I am currently developing a WordPress website with a custom post_type called "music". I use the plugin wp-pagenavi to paginate content "music". When I link on the first page, it's OK (see link below) http://carbonpaper- dev.imperatorium.org/music/page/1 But when I link on the 2nd page: http://carbonpaper- dev.imperatorium.org/music/page/2 the expected content is printed, but the template displayed is not the one related to the "music" `post_type/page` as the first page do but the one related to classic "posts" (not the same sidebar, no inclusion of music playback on click. ..) Here is my .htaccess:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-F     RewriteCond %{REQUEST_FILENAME} !-D     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Should I change this file? otherwise how to fit the extension `wp-pagenavi` with a custom post_type? or what should be the name for the file `{filename}.php` in order to respect hierarchy template? Thank you for your reply, and apologies for my English, I'm French...


Set RSS feed update time

I want to update my feed just once a day. For example: I want to update the feed every day at 12:00 pm. How to do this without a plugin ?


update_option method with support of utf8

I am using a plugin the updates the option table using update_option command. When I update content with hebrew characters it turns into gibrish. My database does support hebrew (or any other utf8 chars). Is there any workaround? Thank you!


Custom fields doesnt work well with any postTAB plugin

Here is my problem: I tried to implement custom fields (text) within a post tab. I tried many post tab plugins and the imlementation to template was succesfull... Unfortunately, the content of the custom field is showing always on TOP of the content and not inside... I tried eveything and every plugin, still same issue. I tried so far: WP UI, Post UI, Easy responsive tabs, everything. My following code:               <?php       $tabContent =  the_field('kotoba');      echo do_shortcode('[restabs alignment="osc-tabs-left" responsive="false"]          [restab title="Tab number 1" active="active"]'.$tabContent.'[/restab]     [restab title="Tab number 1" active="active"]'. the_field('text_field').'[/restab]     [restab title="Tab number 4"]Tab 4 content goes here.[/restab][/restabs]');               ?>


How do I prevent one of two multiple loops from repeating on a second page?

I have a page with multiple loops, but the first loop repeats on the second (or Older) page. I want to keep the formatting but stop the post from repeating. You can see the problem here: http://violentology.com/blog/ In my index.php file, I have the code:

                                  <?php get_the_image( array( 'meta_key' => 'feature_img', 'size' => 'full size', 'height' => '450', 'image_class' => 'post-feature-1' ) ); ?>

         <?php get_template_part( 'loop', 'index' ); ?>

         <?php get_sidebar(); ?>

`      In my loop, the code is as follows:
     <?php $my_query = new WP_Query('posts_per_page=1');       while ($my_query->have_posts()) : $my_query->the_post();       $do_not_duplicate = $post->ID;?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

<?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?> | <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>
                  <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>             <?php the_excerpt(); ?>     <?php else : ?>             <?php the_content(); ?>     <?php endif; ?>       <?php endwhile; ?>
               <?php /* Start the Loop. */ ?>     <?php if (have_posts()) : while ( have_posts() ) : the_post();        if( $post->ID == $do_not_duplicate ) continue; ?>

<?php get_the_image( array( 'meta_key' => 'feature_img', 'size' => 'medium', 'height' => '200', 'image_class' => 'post-feature' ) ); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

<?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?> | <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>
                  <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>             <?php the_excerpt(); ?>     <?php else : ?>             <?php the_content('Continue Reading',FALSE,''); ?>     <?php endif; ?>
          <?php endwhile; // End the loop. ?>          <?php endif; ?>
                 <?php next_posts_link('« Older') ?> | <?php previous_posts_link('Newer »') ?>
`


Best structure for entering recipes in a WordPress theme?

I'm working on building a recipe/meal planning site in WordPress. I need to have recipes indexable and sortable by the ingredients required, and I'm trying to figure out the best way of doing that. Ideally, I would like to have ingredients in one taxonomy, and utensils/appliances required in another taxonomy. I'm coming up against a stumbling block, though, because I can't think of any simple way to associate measurements with the ingredients. Where I'm at now is using custom fields for the ingredients and values for the measurements and units, like this: **Meta Key:** eggs **Meta Value:** 3|eggs **Meta Key:** flour **Meta Value:** 2.75|cups and so on. My question is, is there a better way of structuring this information? Related, there apparently is a microformat specification for recipes, which is essentially the format I plan on using for display. There is a WordPress plugin (hRecipe) to generate this output format, but its not semantic enough for my liking. If/when I figure out a better way of storing this kind of data, I'll probably release it as plugin...


What theme is good for posting code?

I have my blog hosted at www.alphaot.com and I guess it's good enough. But problems arise when the lines of code get longer than 30 characters. The lines just wrap and get icky or something they even don't wrap! In your experience what's a great WordPress theme for a developers blog to post code to? Also, I'm using Windows Live Writer, any extensions for code publishing you would recommend? **Edit:** More than plugins, I'm interested on a clean, free wordpress theme that is WIDE so the code doesn't have to be wrapped.


Order posts by price

I have a list of products on a page and am trying to order them by a custom field called "price". Unfortunately, $3,950,000 is coming before $349,000. I've used a couple of codes but neither one is working. Does anyone have any suggestions? Thanks. Here's the first code I've tried.               $query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value', 'meta_key' => 'price', 'order' => 'ASC' ) );      Here's the other code I've tried.               $query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value_num+0', 'meta_key' => 'price', 'order' => 'ASC' ) );


Permalink/Pagination issue: Category base name same as page name

I currently have a page called "Blog" (slug "blog"), which loads a index.php. All posts in index.php belong to only one post category. A sidebar on index.php contains category links (via wp_list_categories) which load archive.php for that given taxonomy. The problem I am running into is that I currently have the category base name set to the same slug as the page: "blog". I am aware that this can cause issues with the rewrite rules, but for the most part everything looks fine. The only issue is with pagination pages for index.php (mysite.com/blog/page/2 does not work while mysite.com/blog/foo-category/page/2 works fine). Is there a rewrite rule that can help with my current situation? And if so some help would be appreciated. If this is a bad idea, please speak up as well. I was hoping to achieve a somewhat RESTful url structure, but wordpresses permalink structure doesn't appear to be the most flexible. Thanks


Ajax calls in wordpress

I want to send a ajax request in wordpress which tracks my clicks. For now i have added this in my functions file :               add_action('init', 'my_script_enqueuer');            function my_script_enqueuer() {         wp_register_script("history_script", get_template_directory_uri() . '/js/history_script.js', array('jquery'));         wp_localize_script('history_script', 'myAjax', array('ajaxurl' => get_template_directory_uri().'/functions.php'));         wp_enqueue_script('jquery');         wp_enqueue_script('history_script');       }            add_action("wp_ajax_history_trace", "history_trace");            function history_trace() {           echo 'fasfasgasgas'; die;     }      and in my js file :               jQuery(document).ready( function() {             jQuery("#searchsubmit").click( function() {            jQuery.ajax({              type : "post",              dataType : "json",              url : myAjax.ajaxurl,              data : {action: "history_trace"},              success: function(response) {                 if(response.type == "success") {                    alert('success')                 }                 else {                    alert("false")                 }              }           })                })          })      But when i see my console the rquest appears in red color and there is no response. Please Help!!


Creating a custom menu with icon fonts

I want to create a custom menu with icon font markup. So I may need to have my list item have e.g. this:               <i class="gen-enclosed foundicon-left-arrow"></i>      contained inside anchor - or even some special characters. Does anyone have any experience doing this and how would I make this as user- friendly as possible, customizable from the admin?


Wordpress Recent Comments Widget exclude own comments

apologies I have searched either for a recently updated plugin or article and cannot find anything. I am using the standard Recent Comments widget in my sidebar. I like to respond to all comments but don't want my comments to appear in recent comments. For me the filter could work by role or user id (I am the only admin). Is this possible within say functions.php or is there a better way to achieve this - for an amateur :-) Would very much appreciate any guidance.


Customizing template menu output to fit zurb foundation markup

I want to have custom main menu markup in my Wordpress template. I want it to fit Zurb Foundation markup - to be specific - for submenus. I've figured out how to customize class & id if list items in navigation. But now I want to conditionally apply proper class to list item which contains submenu (so I can apply proper styling & behavior for dropdown). So I want to achieve this:
Some Link

Some Label

Some Link

      I want to be able to edit also the (multiple) label of (parts of) submenus etc. I understand what this may require is to create a custom Walker class, etc. How I may go about achieving this, what will I put (if) in that class, and where I may put that file/class and how to have it required/included/autoloaded in my template files.


Do I require the use of nonce?

Im creating a visit/page views counter with ajax,jquery and php, I have been reading a few articles that recommend the use of nonces for data manipulation through ajax, however i am not sure if i need to integrate the use of nonces for my simple counter? my code looks somewhat like this; **jquery**               jQuery.ajax({             type: 'POST',             url: ajaxurl,             data: {action: 'countHits', status: 'true'},             });      **php**               //ajax functions     add_action('wp_ajax_countHits', 'countHits');     add_action('wp_ajax_nopriv_countHits', 'countHits');     function countHits() {              if($_POST['status'] != "") {            $status= $_POST['status'];              if(!isset($_COOKIE['UNIQUEUSER'] && $status == 'true'){            $uniqueUser= get_option('stats');            $uniqueUser['uniqueUser']+=1;            update_option('stats', $uniqueUser);         }     die();      }      So as you can see it is very simple, do I need to use nonces for each ajax request?(i have two separate request in my jquery which return variables one for false one for true) furthermore, if I wanted to implement nonces how would i go about doing that?


menu_order not working with slugs that start with admin.php

I am filtering the menu_order hook (codex link -> http://codex.wordpress.org/Plugin_API/Filter_Reference/menu_order) to change the order of my links in the admin menu. Currently the ordering will not work on slugs that begin with admin.php, so a settings page with the slug "admin.php?page=custom_settings_page" will just go to the bottom of the list. Anyone know of a workaround for this?               //change admin menu order     add_filter('custom_menu_order', 'my_custom_menu_order'); // Activate custom_menu_order     add_filter('menu_order', 'my_custom_menu_order');          function my_custom_menu_order($menu_ord){          if(!$menu_ord) return true;     return array(         'index.php', //dashboard         'separator1', //first separator         'edit.php', //posts         'edit.php?post_type=custom_post_type1', //custom post type 1         'edit.php?post_type=custom_post_type2', //custom post type 2         'edit.php?post_type=custom_post_type3', //custom post type 3         'upload.php', //media         'separator2', //second separator         'admin.php?page=gf_edit_forms', //THIS GOES TO THE BOTTOM         'edit.php?post_type=page', //pages         'edit-comments.php', //comments         'separator-last', //last separator         'themes.php', //appearance         'admin.php?page=custom_settings_page', //THIS GOES TO THE BOTTOM         'plugins.php', //plugins         'users.php', //users         'tools.php', //tools         'options-general.php' //WordPress options     );          }


Is there an A/B testing plugin that lets you vary the heading, featured image, and content in a Wordpress post?

If not, are there alternate solutions that can let me accomplish this? Do I need to develop my own plugin?


Plugin to Consume a Web Service

I'm attempting to write a knowledge base plugin to consume the Salesforce API and pull in solutions in a RESTful style application path; however, some of the core plugin concepts escape me. For example, use of add_rewrite_tag from the Rewrite API produces the following argument error:               Missing argument 3 for WP_Rewrite::add_rewrite_tag()      Forgive my ignorance with the Wordpress core, but doesn't the documentation only describe two arguments? Rather than chase an argument error which probably won't help me much in the grand scheme of things, I would like to start simple and produce statically generated content at a custom URL. For example:               http://example.com/knowledge-base/      Where knowledge-base is handled by a rewrite rule via my custom plugin which in turn would output a simple "Hello World" message with the theme's header/footer wrapped around it. Does anyone know of an existing plugin I can review that demonstrates rewrite concepts a little more clearly than the codex documentation? It seems most examples I've run across append content to existing pages/posts whereas I'm looking to generate something entirely new based on external content.


Wordpress 3.2 query_posts and pagination, permalinks issue

My question is not new but it just does not work with all found solutions in my case. I am trying to display recent posts on single post using custom query_posts loop. The permalinks structure must be this one: /%category%/%postname%/ Wordpress version: 3.2.1 The page has 2 loops:               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>         <!--first content part-->     <?php endwhile; endif;?>          <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     query_posts('posts_per_page=3&paged='.$paged);          if (have_posts()) : while (have_posts()) : the_post(); ?>         <!--recent posts-->     <?php endwhile; endif; wp_reset_query();?>      So calling next page like http://www.domain.com/category/post-one/page/2/ simply strips off /page/2/ and does nothing else. I am desperate already for looking a working solution and not sure if its possible to fix. Thank you.


Numbers of new post since the last visit of user

I need to count the number of new post since the last visit of the user on my blog, is it possible? Thanks to all for your help!


Theme Customizer not loading JS for live preview

I am currently working on adding options to the theme customizer. For the last two hours I have been trying to get the live preview working and I am trying figure out why my theme isn't loading the `theme-customizer.js` file needed for the live preview. All of the options I have added to the theme-customizer work if I save it and then refresh the page. So I know it isn't an issue with the settings. I currently have the hook to call the JS file within the `customize.php` file along with all of the settings for the customizer. I also have a separate `theme-enqueue.php` where I enqueue the other JS files for my theme. Here is an example of the hook I am trying to call the JS file from within my `customize.php` file:               function mytheme_customize_preview_js() {     wp_enqueue_script( 'mytheme-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120187', true );     }     add_action( 'customize_preview_init', 'mytheme_customize_preview_js' );      When I check the loaded javascript files within chrome, it seems to load all of the ones I need except for this one. Can anyone shed some light on the situation?


Custom Post Type / Taxonomy Slug / Post Title with post type archive

I've tried plugins, read through stack and spent hours on this, and I just can't seem to find a way to achieve what I want. I can achieve the following permalink structure: `custom-post-type/taxonomy-term/post-title` for example, `our-work/interactive/some-project-title` which also allows `our-work/interactive` to correctly display all our-work posts with the taxonomy term interactive, but I can no longer get the archive page `our-work` to work, here is the code I'm using to achieve the above               function my_custom_post_work() {         $labels = array(             'name'               => _x( 'Work', 'post type general name' ),             'singular_name'      => _x( 'Work', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New Work' ),             'edit_item'          => __( 'Edit Work' ),             'new_item'           => __( 'New Work' ),             'all_items'          => __( 'All Work' ),             'view_item'          => __( 'View Work' ),             'search_items'       => __( 'Search Work' ),             'not_found'          => __( 'No work found' ),             'not_found_in_trash' => __( 'No work found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Our Work'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our works and work specific data',             'public'        => true,             'menu_position' => 5,             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),             'has_archive'   => true,             'rewrite'       => array( 'slug' => 'our-work/%work_category%')         );         register_post_type( 'work', $args );         }     add_action( 'init', 'my_custom_post_work' );          function mav_taxonomies_work() {         $labels = array(             'name'              => _x( 'Work Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Work Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Work Categories' ),             'all_items'         => __( 'All Work Categories' ),             'parent_item'       => __( 'Parent Work Category' ),             'parent_item_colon' => __( 'Parent Work Category:' ),             'edit_item'         => __( 'Edit Work Category' ),              'update_item'       => __( 'Update Work Category' ),             'add_new_item'      => __( 'Add New Work Category' ),             'new_item_name'     => __( 'New Work Category' ),             'menu_name'         => __( 'Work Categories' ),         );         $args = array(             'labels' => $labels,             'hierarchical' => true,             'has_archive'   => true,         );         register_taxonomy( 'work_category', 'work', $args );     }     add_action( 'init', 'mav_taxonomies_work', 0 );          function filter_post_type_link($link, $post) {         if ($post->post_type != 'work')             return $link;              if ($cats = get_the_terms($post->ID, 'work_category'))             $link = str_replace('%work_category%', array_pop($cats)->slug, $link);              return $link;     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);      Ideally I'd like the following to work:   * `/our-work/` => display all custom posts   * `/our-work/taxonomy-term/` => display all posts with that term selected   * `/our-work/taxonomy-term/post-title/` => the permalink whenever a specific post is clicked. Is there a better way / a way to do this?


Multisite new sites not found(404), main site still works

I followed wordpress guide to install multisite. My main site (mydomain.com) works well, my multisite is based on subdirectory i.e., (mydomain.com/test/), however it doesn't load at all (404 error). more details                $ cat .htaccess           RewriteEngine On      RewriteBase /wordpress/      RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin      RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]           RewriteCond %{REQUEST_FILENAME} -f [OR]      RewriteCond %{REQUEST_FILENAME} -d      RewriteRule ^ - [L]      RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]      RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]      RewriteRule . index.php [L]      * * *                $ cat wp-config.php          /* Multisite */      define( 'WP_ALLOW_MULTISITE', true );           define('MULTISITE', true);      define('SUBDOMAIN_INSTALL', false);      define('DOMAIN_CURRENT_SITE', 'mydomain.com');      define('PATH_CURRENT_SITE', '/wordpress/');      define('SITE_ID_CURRENT_SITE', 1);      define('BLOG_ID_CURRENT_SITE', 1);          /* That's all, stop editing! Happy blogging. */      * * * It will be great if you can help to fix it. thanks


SlideDeck 2, make back-end visible for admins only

I'd like to make the back-end of the SlideDeck 2 plugin visible for admin users only.   Also, I'd like to remove that "Insert SlideDeck" button from the editor. How can I do this?


How to allow user to select User ID in Formidable Pro form?

The goal of this formidable pro form requires three non-standard things to occur. I've written a custom plug-in with code that accomplishes two of the three goals, but I am unable to get the third requirement to work. REQUIREMENT #1: Make the normally hidden UserID field visible to all users of the form, even if they are not logged in to the site. THIS WORKS! REQUIREMENT #2: Filter the contents of this drop-down field so that it only displays a list of users whose role=author, instead of ALL users. THIS WORKS! REQUIREMENT #3: Once the user makes a selection, that value is passed to the UserID variable, such that once the form is submitted, it is treated as if the User selected from the drop-down was the author of the form. HERE IS WHERE I NEED HELP! Here is the code that works for #1 and #2, but fails at #3.               add_filter('frm_setup_new_fields_vars', 'show_user_dropdown', 15, 2);     add_filter('frm_setup_edit_fields_vars', 'show_user_dropdown', 15, 3);     function show_user_dropdown($values, $field, $entry_id=false){     if( $field->id == 898 ){     $values['type'] = 'select';     $values['use_key'] = true;     $values['custom_html'] = FrmFieldsHelper::get_default_html('select');     $wp_user_search = new WP_User_Query( array( 'role' => 'author', 'fields' => array('user_login', 'ID') ) );     $authors = $wp_user_search->get_results();     $values['options'] = array();     foreach ($authors as $a) {     $values['options'][$a->ID] = $a->user_login; } }     return $values; }      Notice that nothing has been assigned to the variable $values['value']. Every attempt I've made to assign something (i.e. ID) to that variable fails to work. Also, if I change this line:               $values['options'][$a->ID] = $a->user_login;      to:               $values['options'][$a->ID] = $a->ID;      Then Requirement #3 works, but #2 fails in part. The User ID WILL be correctly passed to the $values['value'] variable, and the submission will appear to have been authored by the selected user from the drop-down. However, the drop- down will display a list of integers (ID) rather than the user names (user_login). Any help would be greatly appreciated!


How to load shortcode sooner

I am trying to add a shortcode to my menu, the menu item shows up but not the shortcode output. I think the problem is that the shortcode runs after the menu has run and therefore the shortcode output is not present. Is there a way to load shortcode sooner? Thanks Edit: Sorry here it is:               //--Nav Menu     function add_profile_link_to_nav(){       if ( is_user_logged_in() ) { ?>

 All  Members

<?php echo custom_execute_shortcode(); ?>

         <?php }      }     add_action( "wp_nav_items","add_profile_link_to_nav" );          function custom_execute_shortcode() {      $myfunction= '[bc_user_groups amount="20"]';      $myfunction_parsed = do_shortcode($myfunction);      return $myfunction_parsed;     }      Edit: Hello Ralf912, thanks for the response, I am trying to use your suggestion and I am getting this error code: **php_code_error:1:/hsphere/local/home/c262876/mydevelepmentsites.com/maol_bp/wp- content/themes/CC-Child-Theme/functions.php:72:Call to undefined function do_bc_user_groups() Message:A fatal code error occurred.** I have:               //--Nav Menu     function profile_link_to_nav(){       if ( is_user_logged_in() ) { ?>

 All  Members

<?php echo custom_execute_shortcode(); ?>

         <?php }      }     add_action( "bp_menu","profile_link_to_nav",1 );          function custom_execute_shortcode() {     $atts = array( 'amount' => 20 );     $myfunction_parsed =bc_user_groups( $atts );     return $myfunction_parsed;     }      Thanks


Nest Next and Previous in a href with class that has a background image

How do I nest Next and Previous link in a href attribute that has a class and background image in a single post page? I want to make it something like the below which is not working.               <a class="next" href="<?php echo $prev; ?>">Previous     <a class="prev" href="<?php echo $next; ?>">Next      Here is the link to a sample site: http://ifunnypic.com/dad-i-m-gay_3317.html Thanks


Custom Permalinks for Custom Post Types and Taxonomies

I've been struggling with this for hours. I'm trying to get this URL structure:   `example.com/business/%custom-tax-name%/%custom-post-name%/`   By custom tax name I don't mean the name of the taxonomy ("Location"), I mean the value that is chosen for that particular post, which will be a city name. So,   `example.com/business/long-island-city/business-name`   or   `example.com/business/phoenix/business-name/` So far I've made a custom taxonomy:               $singular = 'Merchant Location';     $plural = 'Merchant Locations';     $taxonomy_args = array(         'rewrite' => array(             'slug' => 'business-location',             'with_front' => FALSE,             'hierarchical' => FALSE         )     );       // Register taxonomy ...      and have changed the links in the `post_type_link` filter               function filter_business_permalinks($post_link, $post, $leavename, $sample) {          if ($post->post_type == 'my_custom_post_type') {         $terms = get_the_terms($post->ID, 'my_custom_taxonomy');          foreach ($terms as $term) {              $post_link = str_replace('business/', 'business/'. $term->slug .'/', $post_link);              break;          }          return $post_link;     }     add_filter('post_type_link', 'filter_business_permalinks', 10, 4);      And the resulting URL is fine after that, just what I wanted, so the filter function is working perfectly. However when I click the URL, it goes to this:   `example.com/business/long-island-city/long-island-city/business-name`   which yields a 404. What could be causing this and how could I fix it? All help is greatly appreciated. **Note:**   What I don't want is a URL structure like this:   `example.com/business/location/long-island-city/business-name/`   having the taxonomy _name_ in the URL.


How to search for articles containing two words?

I'd like to serach my blog for articles that contain the two words `bash` and `variable`. There is an article that contains both words, but it is not found. It seems to me that the wordpress search only searches for a single string. If I search e.g. for `bash script`, it finds articles. If I search for `script bash` it doesn't find one, since the words have a different order in the article. Is it somehow possible to allow the search for multiple words irrespectively of their order?


Comment Nav versus jquery Tabs

I have a page full of comments. These comments have 3 custom_fields assigned to it (using get_comment_meta):   1. New    2. In Progress   3. Solved From my page I call the comments using:               wp_list_comments( array( 'callback' => 'service_comments', 'style' => 'ul', 'format' => 'html5','reverse_top_level'=>1,  ) );      In my service_comments function I have assigned the outcome of the custom fields (new, in progress, solved) to the class of each comment. On my page I have 3 (jQuery) tabs to filter the comments by ‘new’, ‘in progress’ or ‘solved’. The jQuery does this thanks to the class assign to the comment div. So far, everything works out. Until I noticed the comment_navigation > this is placed on every tab and counts ALL comments (not just the comments on that specific tab with that specific comment_meta assigned to it's class). This is my comments nav and it’s placed below the wp_list_comments:                <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :  ?>                              <?php                     $paginate_args = array(                         'prev_text' => '',                         'next_text' => ''                     );                     paginate_comments_links($paginate_args);                 ?>

                        <?php endif; // check for comment navigation ?>      So with comments_per_page set to 10, on the “New” tab which only holds 6 new comments, it also shows the page nav (it also counts the comments on the in progress and solved tab). How do I solve this? I need the comment nav to see the difference between new, in progress and solved issues and start counting per tab/comment_meta.


1 bit audio player

I have wordpress and I use 1 bit audio player (Wordpress Plugin) to add songs. When I try to download a song, it shows in the URL but it is not inserted in the description.


XML Sitemap Generator can't notify google and bing

I am using wordpress Version 2.9.2 and XML Sitemap Generator 3.2.3 I have registered with Google Webmaster Tools. But I get an error while notifying to Google and I really don't know what it means. Heres a screenshot : ![alt text](http://i.stack.imgur.com/T2dwe.png) And when I click on view result it show me the following message:               Ping Test          Trying to ping: http://www.google.com/webmasters/sitemaps/ping?sitemap=http%3A%2F%2Fsearock.bplaced.net%2Fsitemap.xml.gz. The sections below should give you an idea whats going on.     Errors, Warnings, Notices:     WP_DEBUG was set to false somewhere before. You might not see all debug information until you remove this declaration!     Result (text only):     Result (HTML):      If I want to debug the error where can I find WP_DEBUG ? Can someone tell me what's wrong here. Note : I have completed Google Webmaster verification process. Thanks.


User Access Manager plugin

I have updated the UAM plugin from 1.0Beta2 to 1.1.4 (latest at the moment) and it stopped working. When I select a group to have rights for an article - the selection is not saved. I checked with firebug - the info is present in HTTP POST content, but is not saved in the backend. How can I fix that?


How to specify or extend the CSS-class of a menu item?

is there a way to allow admin users to add classes to individual menu items in the back end? we have done some individual javascripting and CSS using the title tag, but that is not flexible as it is visible to the end user, so the method is not suited effects needed to be applied to multiple items.


Add static value between second & third menu value

How can I add a static value between second and third menu value? For example, like this: Menu value 1, Menu value 2, **STATIC VALUE HERE** , Menu value 3, Menu value 4 I know about the Walker_Nav_Menu and start_el/end_el. But this adds prefix to all menu values. I just want to add one - as stated - in between second and third value. How do I accomplish this?


I want to display Show subcategories with image only for selected category Code for subcategory :               <?php      if (is_category()) {          $this_category = get_category($cat);      }          if($this_category->category_parent)      $this_category =  wp_list_categories('orderby=id&title_li=&child_  of='.$this_category- >category_parent."&echo=0"); else      $this_category =  wp_list_categories('orderby=id&title_li=&child_ of='.$this_category->cat_ID."&echo=0");      if ($this_category) { ?>          <ul>       <?php echo $this_category; ?>     </ul>     <?php } ?>      It show only subcategory name, but I want to display images as well.


Local wordpress install only shows home page, all other pages Not Found

I am working on a local install of a live wordpress site, all links from the main page show Not Found errors. all .htaccess files are all present. The problem is that every page except for the home page is showing a Not Found error, I can't find any problems with permissions or anything else that would cause it to not work. Is there anything that I can try that I might be overlooking? I apologize for the vauge questions but I am having trouble figuring out where to start.


conditional statement for custom taxonomy

Struggling to find out how to achieve this, if it is at all possible. The equivalent of `is_category` but for a custom taxonomy I've set up. The taxonomy category if which being `Taxonomy Name` with 2 taxonomies: `Taxonomy One` and `Taxonomy Two`. But this:               <?php if ( has_term('taxonomy-one' ) ) {?>
<?php the_field('field_name'); ?>
     <?php } elseif ( has_term('taxonomy-two' ) ) {?>
<?php the_field('field_name'); ?>
     <?php } ?>      There doesn't seem to be any documentation for this either so I'm not at all sure if it's possible, I'm hoping so though, any suggestions would be greatly appreciated!


Display filesize of custom field value

I wanted to display the filesize of a document (pdf, word, excel etc) from a custom field. I already search and I found nothing. I got this code from other site but its in PHP. So I add it manually to my theme.               if($kpmFile !== get_post_custom_values("kpm_UploadFile")) {     $head = array_change_key_case(get_headers($kpmFile, TRUE));     echo $filesize = $head['content-length'];     }      I get this warning from above code:               Warning: get_headers() [function.get-headers]:      But if I make it like this:               if($kpmFile !== get_post_custom_values("kpm_UploadFile")) {     $head = array_change_key_case(get_headers("http://example.net/publications/Wellspring-of-Hope.pdf", TRUE));     echo $filesize = $head['content-length'];     }      The code will show the filesize in 44147474 which the file is actually 42.1MB I need help on how to display the correct file size of the document in kb, mb or gb from custom field value. Thanks in advance.


Nested loop called with shortcode duplicating the content above the main loop

I'm trying to use a shortcode to call one post from a custom post type and display it inside another page's content. (Basically, we have a custom post type called 'testimonials' and we want to display a random testimonial on each page, but inside the page's content.) I used this tutorial as my starting point. Here's my code:               function cd_random_testimonial($atts) {             // EXAMPLE USAGE:        //[loop the_query="showposts=1&post_type=testimonials&orderby=rand"]             // Defaults        extract(shortcode_atts(array(       "the_query" => ''        ), $atts));             // de-funkify query        $the_query = preg_replace('~&#x0*([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $the_query);        $the_query = preg_replace('~&#0*([0-9]+);~e', 'chr(\\1)', $the_query);             // query is made          query_posts($the_query);             // Reset and setup variables        $output = '';             // the loop        if (have_posts()) : while (have_posts()) : the_post();                $testimonial = the_content($post->ID);           $clientname = get_the_title($post->ID);                 // output all findings - CUSTOMIZE TO YOUR LIKING           $output .= '

';           $output .= get_the_content($post->ID);           $output .= '

~ ';           $output .= $clientname;           $output .= '

';             endwhile; else:                $output .= 'nothing found.';             endif;        wp_reset_query();        return $output;              }         add_shortcode("loop", "cd_random_testimonial");      It's working exactly as it should where the shortcode is entered, but it's also adding that same content above the page's content. How do I keep it from posting that extra content and just stay where it's supposed to? Thanks!


Browsing to permalink prefix results in 404

I have set my blog permalink as follows:               /news/%postname%      This works. Going to any post, such as `/news/test`, will serve the `single.php` as expected. I can also browse to a category such as `/news/category/uncategorized`, which brings up the `archive.php`. All good. However, when I browse to `/news` (which I was expecting to also bring up `archive.php`) I get a `404` and I don't understand why? I was at least expecting to be served the `index.php` not a `404`. Ideally I have the `archive.php` template served by browsing to `/news` but to solve the `404` issue first would be great. Any suggestions much appreciated. **PS** : I was hoping to prevent to create a dummy `/news` page. **PPS** : Yes, I always clear my permalinks by saving them from the Settings panel.


Create a User Role with permissions to only upload files to the media library?

Some of the employees at my organization need to be able to upload files to a folder and share a link with others. It’s primarily documents like pictures, pdf’s and Word documents. And instead of creating a completely new File Management System, I was thinking about just using the built-in Wordpress Media Library function for this task. But my problem is, that I want to create a User Role with permissions to **only** do that and nothing else. If possible, also hide all other option panels, custom post types, etc. I’ve been reading a bit about User Roles and Capabilities, and founded a Plugin but I think it is a bit much to install a large plugin when it is the only User Role I need to create. And more, I would like to learn some more about it and I think this is a good way to do it. Any help would appreciate. Sincere - Mestika


Ajax call does not work for this simple code

I have this ajax call which gets the value from a hidden input field
         <input type="hidden" name="GreetingAll" id="GreetingAll" value="Hello Everyone!" />           <input type="submit" id="PleasePushMe" />

            jQuery(document).ready(function() {           var GreetingAll = jQuery("#GreetingAll").val();          alert(GreetingAll);          jQuery("#PleasePushMe").click(function(){             jQuery.ajax({                   type: 'POST',                   url: 'http://www.yoursitename.com/wp-admin/admin-ajax.php',                   data: {                       action: 'MyAjaxFunction',                       GreetingAll: GreetingAll,                   },                   success: function(data, textStatus, XMLHttpRequest){                       jQuery("#test-div1").html('');                       jQuery("#test-div1").append(data);                   },                   error: function(MLHttpRequest, textStatus, errorThrown){                       alert(errorThrown);                   }                   });             });         });        the functions fails to return or do anything inspite of including these functions , in the function.php               function add_myjavascript(){           wp_enqueue_script( 'ajax-implementation.js', get_bloginfo('template_directory') . "/scripts/ajax-implementation.js", array( 'jquery' ) );       }       add_action( 'init', 'add_myjavascript' );     function MyAjaxFunction(){           //get the data from ajax() call           $GreetingAll = $_POST['GreetingAll '];           $results = "
".$GreetingAll."
";           // Return the String           die($results);       }       // creating Ajax call for WordPress       add_action( 'wp_ajax_nopriv_ MyAjaxFunction', 'MyAjaxFunction' );       add_action( 'wp_ajax_ MyAjaxFunction', 'MyAjaxFunction' );        Any idea why is this code not working?


Is there a plugin for feedback like Kissmetrics available?

Kissmetrics has a little widget thing that pops up from the bottom-right corner of the page, asking for comments or offering a short feedback survey. Is there anything like this available for Wordpress for free? I'm on a shoestring and need a free plugin. I don't mean a subscription-based service: just a plugin that can pop up a little form for feedback/ a survey, collecting and storing the data locally.


How do you put your own rules into .htaccess?

Is it possible to put your own rules in .htaccess but still give WordPress control over 'it's bit'?


Max Number of Post Versions Supported

We are running a news site based on WP 3.5.1. Some editors complain that the WYSIWYG editor on the post editing page is not working properly for some posts. The editing buttons are not shown. In some cases we need to update a post many times (like more than 500 times).   May it be the cause?   What will happen to these posts if I set `WP_POST_REVISIONS` to 10?   Will old versions be deleted automatically, or will they remain?


what file I need to create to work date archive links?

I am using my own theme. **my archive.php..**               <?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12, 'show_post_count' => 1 ) ); ?>     <?php wp_list_categories( array ( 'title_li'=> '' , 'show_count' => 1))?>     php wp_list_authors( array ('optioncount' => 1)); ?>      I have **author.php** and **category.php** so the linkes generated by `wp_list_categories` and `wp_list_authors` but if click on the links generated by `<?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12, 'show_post_count' => 1 ) ); ?>` it's just post back the archive.php. eg: If I click **dec/2013** from `www.mydomain.com/blog/archive` then the URL become `www.mydomain.com/blog/dec/2013/12` with same content of `www.mydomain.com/blog/archive` why? what I wanna do to solve this? * * * If I click **category1** on `www.mydomain.com/blog/archive`then the URL become `www.mydomain.com/blog/archive/category1` and content generated from **archive.php**


Can't change excerpt length and more tag

I tried to change the excerpt length and the more tag the way it is described in the codex:               function custom_excerpt_length( $length ) {         return 10;     }     add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );               function new_excerpt_more( $more ) {         return '[.....]';     }     add_filter('excerpt_more', 'new_excerpt_more');      this is how I call the excerpt from within the template:               <?php the_excerpt(); ?>      But it still has the same length and more tag as before. How can that be?


Show title when inserting single images

I just can't get how to do this. When inserting a gallery I have this output:                               But when inserting single images the title doesn't shows. How to fix that? It's not showing on default wp themes, which is strange.


Can I use the different settings sections over different pages using the save options group?

I registered one options group with few different options sections. Each section is meant for different page.               register_setting(                       // http://codex.wordpress.org/Function_Reference/register_setting             'mhp_options',                  // Options group             'mhp_plugin_options',           // Database option             'mhp_plugin_options_validate'   // The sanitization callback,     );          // Manage Menu section     add_settings_section(                   // http://codex.wordpress.org/Function_Reference/add_settings_section             $mhp_manage_menu_section,   // Unique identifier for the settings section             __('Manage Menu Settings', 'mhp'),  // Section title             '__return_false',               // Section callback (we don't want anything)             $mhp_manage_menu_section            // Menu slug     );     add_settings_section(                                $mhp_home_page_layout_settings_section,                  __('Home Page Layout Settings', 'mhp'),                  '__return_false',                            $mhp_home_page_layout_settings_section               );      Then each page is using               settings_fields( 'mhp_options' );      do_settings_sections( $mhp_manage_menu_section);      so the other page is using               settings_fields( 'mhp_options' );      do_settings_sections( $mhp_home_page_layout_settings_section);      but it looks like on save only current section is saved in the options table. What ever was already there is deleted. Do I have to create new options group for each page or is there any other solution?


How can I replace Email addresses with BitMessage Addresses througout wordpress?

BitMessage (bitmessage.org) is a peer-to-peer email system kind of based on BitTorrent. By itself, this software and its' messages are not compatible with email, so in order to send an email to a bitmessage address, a Gateway service has been created here: https://bitmessage.ch The gateway works by simply allowing anyone to send an email to **{bitmessage- address}@bitmessage.ch** This is a less secure way of using bitmessage of course, but I don't see any other way of setting wordpress up to natively use bitmessage. So my question is: How exactly do I change out the email address field of wordpress 3.9.1 to a Bitmessage address field, & what exactly do I need to change in which files to ensure that "@bitmessage.ch" is attached to the end of the bitmessage address at any & all email send requests? Thanks in advance! SYG