How can we set up a solid test site with Network mode (sub-domains) enabled?

**Update:** I came by a reasonable alternative to the approach explained below, instead using a GIT repo and a WordPress Multisite plugin: Deploymint: a staging and deployment system for WordPress. Sites:   * jmonkeyengine.org   * test.jmonkeyengine.org We have created a separate folder on our server, like `/root/sitetest/wwworg/`, for the test.jmonkeyengine.org sub-domain (not multisite, just a custom created sub-domain). We've also set up Webmin on the dedicated server hosting our sites. One of our developers has constructed a really handy script in Webmin's "Custom Commands"; at the click of a button an exact copy is made of our live site and moved over to test.jmonkeyengine.org where we can play around in a live environment at no risk. We'd like to enable WordPress Network, but it seems very likely that doing so would make it difficult, if not impossible, to maintain this method of site testing. I'm not a very technical guy, but I'm seeing two possible options:   1. We do a sub-directory install. This should hopefully enable the cloning script to go about its business as usual, as there's no tricky domain changes involved. If we still wanted to apply sub-domains, I suppose maybe we could still do that by using the MU Domain Mapping plugin, or by setting up our own masks(?). I don't know how well that would go over with various SEO plugins though, e.g. analytics & sitemaps. Furthermore, our site is not "new", which apparently is required in order to make a sub-directory install possible.   2. We do a sub-domain install (preferred). However instead of reassembling the cloned sites on test.jmonkeyengine.org (I assume we couldn't easily copy `jobs.jmonkeyengine.org` to `jobs.test.jmonkeyengine.org`) we'd point it to some new top level domain like jmonkeytest.org, that could handle sub-domains. Maybe some changes would have to be made in .htaccess and so forth either in the script or by hand. Whether or not it'd be worth the otherwise convenient test setup remains to be seen. Does anyone have any experience with this type of setup?


Function to echo (or display?) wordpress tags in the head section

I can't figure this out but I'm trying to echo the post Tags of the post in the `<head>` section. This code resides in the `<head>` section of the site. Basically I want the post tags to appear between the quotes.               ados_setKeywords('');      I've tried using `wp_get_post_tags()`:               ados_setKeywords('<?php echo wp_get_post_tags() ?>');       However this only gives me 'Array'. I need to either display the post tags or nothing.


Add URL field to wordpress taxonomy

Like the title states I'm trying to add a URL field to taxamony.               function create_post_type() {       register_post_type( 'brands',           array(               'labels' => array(                   'name' => __( 'Brands' ),                   'singular_name' => __( 'Brands' )               ),           'public' => true,           'menu_position' => 5,           'supports' => array('title', 'editor', 'thumbnail'),         'rewrite' => array('slug' => 'brands')           )       );       }           add_action( 'init', 'create_post_type' );           function partner_taxonomy() {          register_taxonomy(           'partners',           'brands',           array(               'hierarchical' => true,               'label' => 'Partners',               'query_var' => true,               'show_ui' => true,             'rewrite' => array('slug' => 'partners')           )       );       }       add_action( 'init', 'partner_taxonomy' );      From here how do I add an URL field to "Partners" taxonomy? Also code to be added to the taxonomy.php page for display. Thanks


Custom taxonomy huge list not loading properly in select box

I have custom post type "Book" and custom taxonomy "Author" associated with books. I have used remove_meta_box to hide default UI for taxonomy, because it was like tags where you can add multiple tags and select multiple tags for post. What i want was that only one author is associated with book. So i used add_meta_box to create select box for authors where admin can select one author from list. Now authors list has grown beyond 3000 authors and select box does not seems to load it properly..... I don't want to go back to original UI like tags.... Is there any thing where i could give search, pagination and add functionality(add only one taxonomy) in meta box.... This is code i am using..               remove_meta_box('tagsdiv-book_author', 'book', 'normal');          add_meta_box('custom-taxonomy-author-dropdown','Author','author_dropdowns_box','book','side','high');          function author_dropdowns_box( $post ) {         wp_nonce_field('custom-author-dropdown', 'author-dropdown-nonce');         $terms = get_terms( 'book_author', 'hide_empty=0');         $object_terms = wp_get_object_terms( $post->ID, 'book_author', array('fields'=>'ids'));               echo "Author:";         echo "<select id='bauthor' name='bauthor[]'>";         echo "<option value='0'>None</option>";         foreach ( $terms as $term ) {                      if ( in_array($term->term_id, $object_terms) ) {                     $parent_id = $term->term_id;                     echo "<option value='{$term->term_id}' selected='selected'>{$term->name}</option>";                 } else {                     echo "<option value='{$term->term_id}'>{$term->name}</option>";                 }              }         echo "</select><br />";          }          add_action('save_post','save_my_custom_taxonomy');


Custom Post Type Slug prefix that includes the path of a post from another custom post type

Let's say I have the following post types:   * secondary   * episode I have a post named "Episodes" in post type "secondary" (to talk about and list recent episodes), its url would be: http://www.example.com/secondary/episodes/ **Now, the problem is** I want posts of type "episode", e.g. "First Episode", to have the following URL; http://www.example.com/secondary/episodes/first-episode/ Specifying /secondary/episodes/ as the custom post type slug doesn't work and returns a 404, probably because WordPress at that level is expecting only /page/1/ or subposts of post "episodes". How would I override this or reverse the priority so that it follows the "episode" post type rule before worrying about the default "secondary" subpost rules? Let me know if I didn't explain myself well and there are any doubts. (I know I could use a custom post type archive to list custom posts and get the same URL slug prefix, but due to the navigation structure in this site I must stick to one physical post for post archives, to show it on a menu automatically).


Wordpress search page doesn't work with either $_GET or $_POST

I'm trying to create a general search page. I've created a search page template and a new search page, and set the form's action to the URL of this page. When I access the search page directly it fetches the right template, but when I try to send a form to this URL, be it via $_GET or $_POST, I am directed to the default index.php template. Form code:               <form action="<?php echo get_permalink(359); ?>" method="GET">                    <input name="s" type="text" id="search_box">                    <input type="submit" value="submit" style="visibility:hidden;">                      </form>      Search page code:               <?php // Template Name: חיפוש      get_header(); ?>
     <?php          $search = new WP_Query(array('s'=>$_GET['s']));          if ($search->have_posts() ) : while ( $search->have_posts() ) : $search->the_post(); ?>
<?php the_title(); ?>
     <?php the_excerpt();     endwhile; ?>          <?php else: ?>          <?php endif; ?>     ?>
     <?php     get_footer();


Translation-readiness of Koi theme

I am migrating a (non-English-language) blog using the Koi theme on WordPress.com to a self-hosted environment, but see that certain strings are no longer being translated. For example, if my wp-config.php file contains `define ('WPLANG', 'de_DE')`, then _most of the theme is indeed translated to German, but "Leave a Comment" remains in English. After downloading the 'koi-wpcom-1-1.zip' file from WordPress.com, and digging around in the theme's code, I have the following questions:   * On one hand, the theme's code shows evidence of translation-readiness in that all strings are wrapped by the `'__()'` function. For example: `__( 'Leave a Comment', 'ndesignthemes' )`.  On the other hand, nowhere do I see any use of `'load_theme_textdomain()'`! Might that mean that parts of the theme are getting translated because the corresponding strings have already been translated for the WordPress core, but no theme-specific translations are being performed due to "missing pieces" at the theme level?   * I have tried fixing/completing the translation by doing the following, but so far no success:     * Explicitly added `load_theme_textdomain( 'ndesignthemes', get_template_directory() . '/languages' );` to functions.php     * Visited WordPress.com's German translation project for the Koi theme (GlotPress), and downloaded the corresponding 'wpcom-themes-koi-de.po' and 'wpcom-themes-koi-de.mo' files. Also verified that the *.po file explictly contains a translation for "Leave a comment" ("Hinterlasse einen Kommentar").     * Per my understanding, renamed the above files to 'ndesignthemes-de_DE.po' and 'ndesignthemes-de_DE.mo', and copied them into 'wp-content/languages/themes' directory.     * After the following failed to cause "Leave a comment" to get translated, tried all variations of renaming the *.mo/*.po files to 'koi-wpcom-de_DE.*', 'koi-de_DE.*', 'wpcom-themes-koi-de_DE.*', and 'de_DE.*'; and/or to copying them instead to their 'wp-content/themes/koi-wpcom/languages' theme-installation directory.  ... but nothing helps. Can anyone help me understand what is the problem and how to fix it?


update_post_meta() not working in save_post

I have added some text input fields to metabox in my custom post. Now whenever I put some data in those text fields in admin panel and click 'save', all data vanishes. Here is the code:               <?php     function swpd_render_info_fields()     {         ?>         <label for="swpd_comany_addr">Company Address</label>         <input type="text" name="swpd_company_addr" id="swpd_company_addr" />         <?php     }     /* * Process the custom metabox fields */     add_action( 'save_post', 'swpd_save_info_fields',99 );     function swpd_save_info_fields($post_id) {         global $post;         if(isset($_POST['post_type']) && ($_POST['post_type'] == "swpd_directory")){             update_post_meta( $post->ID, 'swpd_company_addr', $_POST['swpd_company_addr'] );         }     }     ?>      I have checked the data passed to update_post_meta() and it seems o be fine, $post->ID containes the post ID and $_POST['swpd_company_addr'] containes the string I want to save to meta. I really did a thorough search and none of the solutions fixes my problem. What can be wrong?


Should I install blog on subdomain or subdirectory?

Which is better? If I install it on a subdirectory how do I go about doing that? Create a subfolder named blog and install a new copy of wordpress to that? My site currently uses wordpress, so I am not sure how this would work out.


single.php not pulling in any data from database

My single.php doesnt seem to be fulling any information through from the database for the current post. here is my single.php code:               <?php get_header(); ?>

          <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Stats for <?php echo get_the_id();?><?php the_title(); ?>
                   <?php endwhile; else: ?>
 <?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>
                            <?php get_sidebar();?>

                <?php get_footer();?>      Any ideas what the issue could be?


Merge two custom post types into one admin page?

I am building a site with 4 custom post types. To make things easier for our client/admin, I'm wondering if there is a way to merge those custom post types into one list in the backend? Like if you look at normal backend admin page with the list and columns of posts, can a page like that pull in 3 other post types for easy sorting/searching? I can't combine the CPTs into one, they must remain seperate outside of one 'viewing' page in the admin area if possible. Any thoughts on how to do this?? Or even where to start looking/thinkging of how to develop this?


Custom Content Slider stop duplicate

I have been working on this now for little while, I have four post displaying in the carousel, this is fine. when you click the next slide in the carousel the same four posts are displaying Any ideas what I did wrong? Thanks

                  <?php $query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => -1,)); while ( $query->have_posts() ) : $query->the_post(); ?>                  <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

           <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

          <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

           <div class="item" id="<?php echo $post->ID;?>" >
                             <?php the_post_thumbnail('large'); ?>

<?php the_title() ;?>

<?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . '...'; ?>
                             Read More

             <?php endwhile; wp_reset_postdata(); ?>

                                                          R                L
          <?php get_sidebar(  ); // right ?>


Work-around for fatal memory error in BackupBuddy job to Dropbox on shared host?

I am trying to configure BackupBuddy to transfer a 250MB backup set to Dropbox on a shared host (DreamHost). DreamHost runs a process monitor that automatically kills any process that exceeds a certain threshold (seems to be somewhere between 128MB and 256MB, from my tests). BackupBuddy uses a PHP oAuth Dropbox API call that requires the entire backup set zip file to be held in memory and transferred in a single call. Below are the configuration and results of one test case run for two blogs (both failed). A similar test case after increasing memory_limit to 256MB also fails - I believe in that case the host's monitor kills the process. Any advice on how to get these three vendors (BackupBuddy, DreamHost, Dropbox) to "play nice" together would be much appreciated. Aside from a limited amount of leeway I seem to have in adjusting the memory_limit, I don't think I have anything else I can configure to resolve the failure. The simple answer would be to get a refund of the $100 BackupBuddy purchase, but at least so far that refund request is being denied. BackupBuddy techs are confident that there is a solution within the given constraints but I can't find it. **Configured in phprc (php.ini):**               max_execution_time = 60     memory_limit = 128M      **Size of backup file:** about 35MB **From the BackupBuddy debug log:** > [Feb 20, 2012 10:34:52 -5-all] Setting greedy script limits.   >  [Feb 20, 2012 10:34:52 -5-all] Launching remote send.   >  [Feb 20, 2012 10:34:52 -5-all] Starting Dropbox transfer.   >  [Feb 20, 2012 10:34:52 -5-all] About to put object (the file) to Dropbox > cron. **From the PHP error log:** > [20-Feb-2012 15:34:53] PHP Fatal error: Allowed memory size of 134217728 > bytes exhausted (tried to allocate 35834605 bytes) in /home/xxxx/wp- > content/plugins/backupbuddy/lib/dropbuddy/pear_includes/HTTP/Request2/Response.php > on line 210 **Size of backup file:** about 252MB **From the BackupBuddy debug log:** > [Feb 20, 2012 10:34:52 -5-all] Setting greedy script limits.   >  [Feb 20, 2012 10:34:52 -5-all] Launching remote send.   >  [Feb 20, 2012 10:34:52 -5-all] Starting Dropbox transfer.   >  [Feb 20, 2012 10:34:52 -5-all] About to put object (the file) to Dropbox > cron. **From the PHP error log:** > [20-Feb-2012 15:40:35] PHP Fatal error: Allowed memory size of 134217728 > bytes exhausted (tried to allocate 253171937 bytes) in /home/xxxx/wp- > content/plugins/backupbuddy/lib/dropbuddy/dropbox_api/API.php on line 336


Get array of posts based on custom field values

I'm looking to pull up an array of posts based on custom field values:               function GetPrimaryLinks($product){     echo '
';     $args = array(                    'product' => $product,                    'meta_key' => 'primary_link',                    'meta_value' => array(                                         'home',                                          'obj_handling',                                          'standalone_doc',                                          'advantages',                                          'weaknesses',                                          'top_comments') );     $primarylinks = get_posts( $args );     foreach ($primarylinks as $post) :  setup_postdata($post);     echo '
'.the_title().'
';     endforeach;     echo '
';     }      Therefore, I can reuse the function on various products to pull up the pages for 'Home', "Obj. Handling", etc. and only use one SQL query each time. This script obviously doesn't work because it's looking for posts with an array of meta_values, but I'm wondering if there's a way to write the function in one SQL query, rather than breaking up the meta_values into individual queries.


Get the number of comments awaiting moderation

Is there any 'official' way to get the number of comments, awaiting moderation? I've taken a look at get_comments_status \- is it what I need or are there other methods?


How to synchronize user profile fields in multisite?

I'm using wordpress multisite. I installed Multisite user management plugin. If a user register in my main sites then that user automatically added in all my sites. My problem it doesn't copy the profile datas. I don't want my users to fill the same data in all 50 sites. So is there any code available to sync the datas? I mean if a user fill the profile fields in main sites all sub sites should be updated with the same value. Likewise if the user edit the profile in `site10.example.com` it should be synced and updated in all sites. Is it possible? Thanks


How to include editable PDF in wordpress

I need to include a Existing PDF in website, where user can either fill or download it. I tried to use visual form generator, but it doesn't like actual form and I need to allow a user signature. Consider form is Similar to passport application. Any suggestions or Idea would be useful.


Update Old Links To Pretty Permalinks Custom Post Type

I'm looking for a plug-in or bit of php that will go through about 300 posts that use hyperlinks in the old p format:                     and automatically replace them with their %postname% pretty permalink. Eg:                     For whatever reason, these posts don't auto-magically do this when we changed Permalink structure so we're currently going through one by one. Thousands of links. I -think- the problem is that we originally imported them from static HTML pages. I'm wondering if the fact that they don't automatically re-write is because we're using a Custom Post Type? OR, is there a problem with the way we set up the taxonomy that prevents the automatic rewrite? If so, can someone provide some suggestions. Here's our taxonomy for this Custom Post Type (docs)               //helpdocs taxonomy     add_action( 'init', 'create_docs_post_type' );     function create_docs_post_type() {     $labels = array(         'name' => __( 'Documentation' ),         'singular_name' => __( 'Documentation' )       );         $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'show_in_menu' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'page',         'has_archive' => true,         'hierarchical' => true,         'menu_position' => 50,         'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt',         'comments',     'custom-fields', 'revisions','page-attributes','post-formats' )       );              register_post_type( 'docs', $args);     }     function docs_init() {     // create a new taxonomy     register_taxonomy(         'docs_tax',         'docs',         array(             'label' => __( 'Documentation_Tax' ),             'sort' => true,             'args' => array( 'orderby' => 'term_order' ),         'hierarchical' => true,             'rewrite' => array( 'slug' => 'docs' )              )     );     }     add_action( 'init', 'docs_init' );      TIA, \---JC


Can WP give a value a post ID?

So I have queried out some data from another DB and obviously they're not a `post` which means I can't use the standard `permalink` to link them to an existing page with it's `post type`. So I thought that if WP could just generate an let's say "artificial" post ID to link to a certain generated page like any other `custom post type`. So basically a generated page like when you do `the_permalink` but for data from another database that is and will not go into the Wordpress DB as a `post` or whatsoever, the question would be if this is possible? My code so far:               $result    = $newdb->get_results("SELECT ".$column1.",".$column2."  FROM ... LIMIT 1 ");         <?php                foreach ($result as $results) {                  echo '
' ;?>             <?php echo $results->member_name; ?>           <?php                 echo '
' ;             } ?>      EDIT: I think I got a little further the link now updates into `localhost/wordpress?1` . It refreshes the page but I need it to go to it's unique page(for ex and empty page with only the css) This is the code now:               $result    = $newdb->get_results("SELECT ".$column1.",".$column2."  FROM ... LIMIT 1 ");             foreach ($result as $results) {                  echo '
' ;?>                 <a href="<?php echo '?id='.$results->memberID.'';  ?>"><?php echo $results->member_name; ?>               <?php                 echo '
' ;             }


How to pass multiple checkbox values to wordpress query?

I am working on a website that has multiple check boxes and I want to show results based on what user has selected. There are about 16 check boxes for music, 8 check boxes for venues and 6 radio buttons for area. The user can check a maximum of 3 check boxes from Music category, a maximum of 3 from Venues and 1 from Area. How do I accomplish this wordpress query that would show posts only from categories that are selected. For example, If a user has selected House, Techno and Dubstep in Music, Miami as Area, and they want to search for events, music festivals, and live venues, How can I get that using wordpress query?               if(!empty($_POST)){                 global $names;                 $names  = $_POST['music'];                 $music = implode(",", $names);                 $echo $music;       }      That will echo out all the selected checkboxes as house, dubstep, Miami, music festivals. Now I want to show posts that are in caegories of house, dubstep and are in music festivals category, and in miami area. What I've used is                $args = array (           'category_name' => $music,           'posts_per_page' => 12,           'orderby' => 'title',           'order' => 'ASC',          );     $posts = query_posts($args);      But this will show all the posts from house, dubstep which is fine but it also shows all posts from music festivals that are not even in house and dubstep category. Here is my `HTML` code for `checkboxes`

Area:

All of London<input type="radio" name="area" value="london" checked="london"/>

North<input type="radio" name="area" value="north" />

East<input type="radio" name="area" value="east" />

South<input type="radio" name="area" value="south" />

West<input type="radio" name="area" value="west" />

Central<input type="radio" name="area" value="central" />

Music:

House<input type="checkbox" name="music[]" value="house" />

Techno<input type="checkbox" name="music[]" value="techno" />

Trance<input type="checkbox" name="music[]" value="trance" />

Electronica<input type="checkbox" name="music[]" value="electronica" />

Drum and Bass<input type="checkbox" name="music[]" value="drum-and-bass" />

Garage<input type="checkbox" name="music[]" value="garage" />

Dubstep<input type="checkbox" name="music[]" value="dubstep" />

Trap<input type="checkbox" name="music[]" value="trap" />

Hip-Hop<input type="checkbox" id="music" name="music[]" value="hiphop" />

R'n'B<input type="checkbox" name="music[]" value="rnb" />

Rock<input type="checkbox" name="music[]" value="rock" />

Indie<input type="checkbox" name="music[]" value="indie" />

Reggae<input type="checkbox" name="music[]" value="reggae" />

Retro 80's/90's<input type="checkbox" name="music[]" value="retro" />

Party Bangers<input type="checkbox" name="music[]" value="party-bangers" />

Chart Hits<input type="checkbox" name="music[]" value="chart-hits" />

Search Type:

Nightclubs<input type="checkbox" name="occasion[]" id="nightclub" value="nightclub" checked="checked" />

Events & Tickets<input type="checkbox" name="occasion[]" value="club-guide" checked="checked" />

Live Venues<input type="checkbox" name="occasion[]" value="festivals" checked="checked" />

Artist Interviews<input type="checkbox" name="occasion[]" value="artist" checked="checked" />

                              </form>       Thanks in advance for your help.


How to reorder meta box position?

I have a custom post type which have a lot of custom field that categories in meta box. The problem is how do I sorting the meta box in the order that I desired? As I know there is only 'high','core','normal' and 'side' for positioning the meta box, which is not a practical way to sorting the meta box. Let's say if I set 'high' position for two meta boxes, how do I know which one is on the top?? Thanks


Conference website with ticket-sales + sponsorship sales with WordPress?

I am considering moving away from Drupal and drupal-cod due to the lack of good themes. The two major features I am looking for are:   1. Ticket sales (PayPal), with receipts sent to attendee   2. Sponsorship sales (PayPal with different options: Gold, Silver, Bronze by price-range) Secondary features:   * StackOverflow style forum accessible by users within a specific role   * Facility to send newsletter to all attendees **Can you recommend a good set of free plugins, preferably built into one project for WordPress?**


Buddypress Full documentation

I have searched alot for finding the list of Full documentation for buddypress Hooks (action, filtrs) and functions but not satisfied with that limited documentation provided by Buddypress. Like if i want to find the detail about **bp_directory_groups_search_form()** there is no specific detail about this mehtod and same for buddypress hook also... So anybody know the exact location of full documentation available.


Displaying year once in category.php

I want to be able to make my category.php display like this:               2013     Title 3     Title 2     Title 1          2012     Title 3     Title 2     Title 1      It's already been done for displaying ALL posts but how do I get it to display only the category being viewed? Any assistance would be appreciated. Thank you!


How To Only Allow Users To View Their Own Buddypress Profiles?

I am currently developing a social-network sort of site using Wordpress + Buddypress and the client has asked that profile pages not be publicly visible for the time being. Basically the client is okay with logged in users viewing their own profiles, but if they try viewing a profile page of another user it should redirect to the homepage. I found the function: bp_is_my_profile() and tried using the following code at the top of the members/single/profile.php file to redirect users away, but it doesn't appear to be working. Any pointers?               <?php     if ( !bp_is_my_profile() )     {         wp_redirect(site_url(), 302);     }     ?>


get author in blog posts?

What do I need to do in order to have the author name in the blog posts on my wordpress blog? currently when I view a post it doesn't have the author that wrote the post.


How navigation works in custom loop within shortcode?

I am using a shortcode to display a custom query. The shortcode is use in page. Everything is fine, only the navigation that I can't get it working correctly. Here is the function that I use to display the query calling by the shortcode:               $the_query = my_custom_query();     if($the_query){     if ($the_query->have_posts()) :       while ($the_query->have_posts()) : $the_query->the_post();         echo ''.get_the_title().'
';            endwhile;            next_posts_link(); previous_posts_link(); //here I can't get it right.            else : $return_string =  'no result';             endif;      }else{ echo 'ordinary page';}      The `previous_posts_link()` and `next_posts_link()` not showing up. Is it because the shortcode been inside the page main loop? **Update** this is the function to get the custom query               function my_custom_query(){              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                  $args = array(             'post_type'=>any,             'posts_per_page'=> 1,             'max_num_pages'=> 10,             'paged'=>$paged,             'meta_query' => array('relation'=>'OR',array(                         'taxonomy' => 'tax1',                     'field' => 'slug',                     'terms' => 'tax1term'                     )),             'tax_query' => array('relation'=>'OR',array(                     'key' => 'metakey',                     'value' => array(5,30),                     'compare' => 'compare'                        ))               );                 $custom_query = new WP_Query( $args);             return $custom_query;          }      **UPDATE 2** Now I can get the `next_posts_link(); previous_posts_link();` to display. But the problem is, it linked to a wrong page. The query results remain same posts on every page (regardless if it is Next or Previous page).               $the_query = my_custom_query();     if($the_query){     if ($the_query->have_posts()) :       while ($the_query->have_posts()) : $the_query->the_post();         echo ''.get_the_title().'
';            endwhile;            previous_posts_link('Previous',$the_query->max_num_pages); next_posts_link('Next',$the_query->max_num_pages);  //here I added $the_query->max_num_pages,and they shows up.        else : $return_string =  'no result';             endif;      }else{ echo 'ordinary page';}


separate home page into separate pages

I was recently asked to help out with a site where, as you can see, all the content is on one page. As it's less than elegant, I'd like to separate things out but I've looked around the menus and settings, I can't find anything obvious. If I click the "pages" link on the left side, I'm taken to a list of seemingly separate pages. When I click the "edit" button that appears after I roll over the page, I can edit just the content associated with that page (tho again, it's all on one page on the site - maybe I'm misunderstanding terminology). However, if I click "view" I get a server error. In fact, I get a lot of server/404 errors when clicking around the dashboard/other menu items. For example, if I click "Page Order" and then reorder pages and then click "Click to Reorder Pages" I'm taken to the site but with a "Four Oh Four Error". Another error - if I change the Settings > Reading Settings setting `Front Page Displays` from `Your Latest Posts` to `a static page` I get another server error. I could go on, but I'll leave it at that for now. (I can always add more to the comments.) Any help or pointers would be much appreciated. And if you feel like throwing in a link that will help me understand WordPress's structure, that'd be great. I come from an Programming background which should hopefully help.


Conditional Display of Links in Widgets

I want the links widget in my sidebar to display links based on the page the user is on. For example, if the user is on the home page I want it to display link1, link2 and link3. But if the user goes to the 'About' page I want the links widget to display link4 and link5. Is there a way to specify conditional display of links depending on the page id? Thanks


WP_Query with the "offset" argument

I'm making a custom query for posts using something like:               $p = new WP_Query();      $p->query(array('offset' => 30, 'posts_per_page' => 10));      If I have 36 posts on the entire blog, `$p->post_count` will return the number of posts that were retrieved, 6 in this case. I need to get the post count just like I would if I omitted this 2 arguments (so I can calculate the remaining post count). How can I do that, without making another query?


Display price range on woocommerce product variations

I am working on an online store using Woocommerce, many products have variations in size and price. Is there a way to have the range of prices (highest to lowest) of the variations on the product page?


How to edit caption for images and exclude it from excerption query?

I have 2 questions for caption for images: \- how to edti them with bold, italics and so on? I do it, but it doesn't work. \- if the image is first, how to exclude caption from excerpt in query especially for frontpage?


Steps for Moving Multiple WordPress Installs to a Multisite Install?

_( **Moderator's Note:** Original title was: "Steps to move multiple wordpress installations to a WP MU installation")_ Any tips on moving multiple WordPress installations to a single Multisite[1] installation? [1] _Multisite is the new name for WPMU._


Display All Sticky Post Before Regular Post

I would like to display all of my sticky post and then regular post thereafter. I am new to WordPress and not sure how to do this. Any help would be greatly appreciated.               ---------                    Sticky 1                     ---------      ---------                    Sticky 2                    ---------       ---------                    Sticky 3...                     ---------       ---------                    Normal 1                     ---------     ---------                    Normal 2....                     ---------


List posts with same tag?

Is there any way to list my posts by tags ? i need to alter the URL too... like **mysite.com/tags/mytag** will list all the posts having ' **mytag** ' as tag.


Permalinks on post is working, on pages 404 error

I am having troublle with setting my permalink in wordpress site. I changed the permalink from default to custome : `%postname%`. In this case my posts are working perfectly, but the pages are not. They generates a error 404 page not found. I've changed the .htaccess file permission, did everything, but nothing is working. Any suggestion to solve this?


Any kind of custom post type in the front page and in the archive listing

I have a custom post type:products to have my post from my custom post type i have changeed these codes               <?php         $post_count = 1;     ?>     <?php if (have_posts()) : while ( have_posts() ) : the_post() ?>      to               ?php         $post_count = 1;        $args = array(          'post_type' => 'products'       );      $products = new WP_Query( $args );     ?>     <?php if ($products->have_posts()) : while ( $products->have_posts() ) : $products->the_post() ?>      I have done same things for the archive.php also. But Now what i want to do i wont to get posts from different post types on my front page. Not any. And when i chose a category to get posts i want to get from different post types. Not any thispart inside of archive.php How we can do that.


Shortcut to widget/sidebar editing on the admin menu?

We have a sidebar consisting of some text. The client/owner will want to change the sidebar text occasionally. Out of the box he'll have to do this by navigating: -> Admin menu   -> Appearance   -> Widgets   -> look past the "Available Widgets" (all of which are irrelevant to him) to **Primary Sidebar** on the right hand side   -> Dropdown   -> _now he can edit the content_ He's going to be baffled that he can't edit this type of content as quickly and easily as he can a "Page". Or he'll forget where to find it. Is there a way to add a link to our Primary sidebar to the main admin menu?


How can I upload to wp media library by foundation zurb ajax

I am using zurb ajax image uploader. it works fine to upload to specific folder in FTP. but I can't really find how to add on wordpress media library. I have to get the thumbnail ids. Where I can find how to upload wp upload folder and add in database(wp-post, wp-post-meta) as attachment post. Basically, this is for users photos such as "my more pictures". I believe it should be in wp-user-meta table. any tips, tutorial? Thanks,


sidebar hierarchical menu category & custom post type

I'm working on a site with courses. I've created a custom post type "Course" and need to create a sidebar menu with the list of courses under the active category and then with anchor links to the custom fields within the course. The easiest way to see what I'm trying to achieve is to have a look at the mock up the designer created here: http://sharebucketapp.com/mMTk2YjRhNjNlMTAyNTk ![enter image description here](http://i.stack.imgur.com/jz9Kq.png) I'm at a complete loss as to how to go about this. I'm proficient in php but Wordpress is new to me and I'm having difficulty getting my head around it. Any help on this would be greatly appreciated. Thanks, Rob.


updated plugin 'plugin-list-category-post' is adding a non-linked item

> **Possible Duplicate:**   >  First item in each category list is not a link I did the update to the 'list-category-post' plugin, and now every page that I have this working on is showing a non-linked post title (seems to be randomly chosen) at the top of each of these pages. The item does seem to be a part of the category, but it is out of order, and doesn't have the list bullet and doesn't have a link. When I inspect the area I see the item thrown in before the li /li posts but after the ul As I said, this started with the update. Wordpress is the latest. Theme is Platform Pro


Getting post meta data, while editing a post in wp-admin panel

is there any chance of getting post meta data while editing post in wp-admin? For example -               $price = get_post_meta($post->ID, 'price', true);      isn't working, and it won't return post meta data, while editing post. I tried entering value and saving everything, but still it returned nothing.


Using WordPress functions on other sites

I have WordPress, set to multisite with subdirectories, installed at /, and a phpBB forum at /forum. Both sites are visually integrated, and share a common login process. I'd now like to integrate them further, for my ease of administratio; I want to use WordPress' header image, menu, footer and a few other theme related functions on my phpBB forum.   1. Is it even possible to embed WordPress in other pages?   2. How would one use them in the phpBB template files? (bonus question) (this question isn't fully tagged, since I don't have enough rep to make new ones yet).


How can I remove the comment form on one or more specific pages in twenty eleven?

I would like to remove the comment form on one specific page. Is this possible?


query_posts and sub pages?

I have a Page layout like this               Parent Page     - Sub page 1     -- sub sub 1     -- sub sub 2     -- sub sub 4     - Sub page 2     -- sub sub 1     -- sub sub 2     -- sub sub 4      I want to query every single child page, regardless of how deep I go. This is my query but it only returns direct children(sub page 1 and 2)               query_posts('post_type=page&order=ASC&orderby=menu_order&depth=4&post_parent='.$post->ID);      How can I do this?


Is file_exists() compatible with timthumb.php?

I'm using the latest timthumb script to generate my post thumbnails and include them along with the excerpt. Though I only want the thumbnails to load if their files actually exist, otherwise I don't even want the image placeholder to load. I'm going to be using this on a multi-user network, which is still in the early stages of development. And I want to test if the posts author has neglected to properly add the "thumb" custom field, which if they have, would normally return a 404 not found error. So I've put the following code in my loop which first determines if the post has any images then using the file path for the first image listed in the post checks if the file exists.               <?php     $content = $post->post_content;     $searchimages = '~]* />~';     preg_match_all($searchimages, $content, $pics);     $iNumberOfPics = count($pics[0]);     if($iNumberOfPics > 0){         $blogTemplate = get_bloginfo('template_directory');         $imgSrc = get_post_meta($post->ID, "thumb", $single = true);         $imgSrc = $blogTemplate . "/scripts/timthumb.php?src=" . $imgSrc . "&w=300&zc=1";              if(file_exists($imgSrc)){ ?>             <a href="<?php the_permalink(); ?>" class="thumb" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php echo $imgSrc; ?>" alt="<?php the_title(); ?>" /><?php                       }     }     ?>      I've tested the $imgSrc string that's outputted which is valid, it is an existing file though the my file_exists($imgSrc) function always returns false. I'm left wondering if the timthumb script is compatible with the file_exists() function?


Custom admin menu for a selection of pages

I have a site with 30-35 pages. The customer only needs to edit 3 of them on a regular basis. So to make it simpler and easier for them in the backend, I would like to create a new admin menu item and place those 3 pages under it. How do I do that? Been thinking on custom post types but don't want to make it more complicated than necessary.


Migrating data from ACF to WordPress custom meta boxes

I’m currently re-developing a theme for WordPress Multisite. The homepage and gallery template both use the Advanced Custom Fields plugin. So I can fully maintain the theme moving forward, I would like to replace ACF with native WordPress custom meta boxes. For those already using the theme on Multisite, is it possible to migrate the data from ACF to my new custom meta boxes? I'm not looking for quick a solution, just any advice you can give me on migrations of this type.


Using a page as a custom post type's parent

My site is set up to have a landing page for each section of the site. Each section of the site uses a separate CPT. Is it possible to designate a parent page of a custom post type? For instance, I have a page 'Executive Events' and a cpt 'event'. When I view an individual 'event' the url is "www.website.com/event/event-single" where I want "www.website.com/executive-events/event-single" In short, for certain CPTs, I want the base of the permalink to be a page, not the archive as it is by default.


How to get a list of post types that "support" various things such as page-attributes?

When you register a post type you can pass an array of arguments that it "supports." (For example, "page-attributes," "author," "editor," etc.) I see that get_post_types has some args you can filter by, but how can I filter those that "support" specific features such as "page-attributes" or "author"? I realize I could run a loop to filter after the fact, but can this be done without an extra step? Thanks.


remove_action or remove_filter with external classes?

In a situation where a plugin has encapsulated its methods within a class and then registered a filter or action against one of those methods, how do you remove the action or the filter if you no longer have access to that class' instance? For example, suppose you have a plugin that does this:               class MyClass {         function __construct() {            add_action( "plugins_loaded", array( $this, 'my_action' ) );         }              function my_action() {            // do stuff...         }     }          new MyClass();      Noting that I now have no way of accessing the instance, how do I unregister the class? This: `remove_action( "plugins_loaded", array( MyClass, 'my_action' ) );` doesn't seem to be the right approach - at least, didn't seem to work in my case.


Is it too late to use a CDN?

I've got several blogs and a couple of them are pretty visited, with around 1,5 million uniques per month. I've never used a CDN on them, but I'm considering trying to set up an account on some of the platforms available that have good support in WordPress through plugins and a nice user community. I wonder though if this is a good moment to do this, because until now all the images are hosted on the server, and I guess after setting up the CDN all the images should be loaded on the CDN servers through the adequate plugin. I guess that from that moment on, all the articles and posts we publish would benefit from the images loaded through the CDN, but the past articles would not benefit from that. I wonder if:   1. Is there some easy way to use the CDN for the old posts too?    2. What happens if I decide I want to run my blog again from my own server (for any reason)? Would I have to re-publish everything with the images I already had in the CDN servers? Is there an easy way to recover all the images and make them load "locally"? The main problem for me is knowing that if something goes wrong I can have avoid big problems if a I switch off the CDN and decide to run everything back from my servers. What happens with al the content I was serving from the CDN? I hope you understand the question.


Sync comments between two WP installs

Either with a SQL script or a plugin, I'm looking to create a copy of a site and to syncronize the comments between both sites. One of the sites will have certain comments that are private so they will not be synced. I was deciding whether to go with Intense Debate so that I could somehow configure a comments template to sync across pages. Can this be done across separate sites? Or would a third-party plugin be a better choice? * * * Updated Question: How can you use:               comments_template($file)      Where ($file) lives on a different server? Obviously I'm going to run into security problems but is there a way you can access a different WP database?


How to remove CSS file in the header using Wordpress functions?

I want to remove a CSS from loading in the header, this is the code that appears:               <link rel='stylesheet' id='my-css'  href='http://test.tld/wp-content/themes/mytheme/my.css?ver=3.5' type='text/css' media='all' />      I tried using these functions but it didn't work:               wp_dequeue_style('my-css');     wp_deregister_style('my-css');      Is there other ways that the above CSS line can be removed without manually editing it in the template? Thanks.


cannot access subsites in wordpress multisite

Hi I installed wordpress multisite using instructions given on codex and created a site. But I cannot access any other than base site. As you can see in the screenshot below multisite is installed and I have created multilang/de/ but it is not accessible. ![enter image description here](http://i.stack.imgur.com/zkWCv.png)


Plugin could not be deleted due to an error: Unable to locate WordPress Plugin directory

I have moved my Wordpress site to a new host, because of performance problems on the old host. I have updated wp-config.php with the new host's values, but when I try to delete a plugin from wp-admin, I receive > "Plugin could not be deleted due to an error: Unable to locate WordPress > Plugin directory." I have defined FTP_BASE correctly in wp-config.php. Where else would I need to set the value of local file system root folder?


Adding Custom Fields to Search

I'm trying to add custom fields to my search so that it can be refined by meta values. Currently I have added some select lists to my normal search:               <form role="search" action="<?php echo site_url('/'); ?>" method="get" id="searchform">         <input type="hidden" name="s" value="carcpt" /> <!-- // hidden 'products' value -->              <select name="price">             <option value="">Nothing</option>             <option value="500.00">500.00</option>             <option value="100.00">100.00</option>             <option value="50.00">50.00</option>         </select>              <select name="year">             <option value="">Nothing</option>             <option value="2011">2011</option>             <option value="2007">2007</option>             <option value="1991">1991</option>         </select>              <input type="submit" alt="Search" value="Search" />     </form>      and at the top of my `search.php` I have this conditional:               $q = get_search_query();     if($q = 'carcpt'){              $price = $_GET['price'];         $year = $_GET['year'];              $search = new WP_Query(             array(                 'post_type' => 'carcpt',                 'meta_query' => array(                     array(                         'key' => '_price',                         'value' => $price                     ),                     array(                         'key' => '_year',                         'value' => $year                     )                 )             )         );     }      That's the scenario - I have 2 questions: **1)** This seems like a very 'hacky' way to add and refine my search results by custom fields - is there a better / more widely accepted way to do this? **2)** The problem with the query above is that if the user does not enter a price or year - it will run the query and return only post with empty price/year meta. In my query is there a way to determine if a meta is empty and modify my query accordingly - not including a switch?


User's Comments Number: Storing it in a meta field for different uses

As I am building a new website where tracking users' information is key to engage, etc..., I found it important to be able to store users' number of counts as a meta. The main reason for storing the information in users' meta is to allow for **smoother integration** with external services. In my case, I already have a plugin that pushes users' meta to an external e-mail marketing service. There, I plan to run automated campaigns that include sending thank you and other gifts or perks based on the number of published comments for a user. Here is the code I am currently using to store the number of comments made by users. This is based on this other post. I am no coder and I know there are areas for improvement, but I thought I would post this code here incase others are interested in doing this. Therefore, this could be their starting code. **If anyone have optimized/improved versions of the code, please do share :).** Thanks!


Number/ Position of a Comment

Does anyone know a good way to get the count number or position of a comment under a post? In the known comment array there is only the `related_post_ID` not the relative number in the affected post. Of course within a comment loop I can make some `$i++` stuff, but if i only got the ID of a comment - how do i get the "position" in all comments of its related posting? Is there a WordPress function for this?


Multi-page posts do not get indexed by Google due to canonical URLs

I've just noticed that on my paginated posts, only the main page gets indexed in Google. The paginated posts "post-title/2" and "post-title/3" for example, do not get indexed. On closer inspection, it appears that Wordpress creates the same canonical URL for all pages in a paginated sequence. So, the canonical for page 2 is the same for page 1, etc. So when google crawls page 2+, the canonical directs them back to the first page. Any clues how to go about resolving this to get a more intelligent canonical url on paginated posts and pages?


Multiple parameters in a custom post type url rewrite

I have a custom post type called `venues` currently they display through the url format:               http://mywebsite.com/venue/{venue-name}      I would like to have the format:               http://mywebsite.com/venue/{venue-suburb}/{venue-name}      But the suburb doesn't actually have any relation to pulling the `venue` custom post type. Names are always unique. What would need to happen is at the time of rewrite, it pulls the `{venue- suburb}` based on the `{venue-name}` or id and rewrites the url with that information in it. Is this something that is possible and if so how might I go about starting it? **Update:** Here's the code I've been able to put together after some research. The result: `http://mywebsite.com/my-venues/{venue-suburb}/{venue- name}/{post_id}`               add_action('init', 'myposttype_rewrite');     function myposttype_rewrite() {         global $wp_rewrite;         $queryarg = 'post_type=venue&p=';         $wp_rewrite->add_rewrite_tag('%cpt_id%', '([^/]+)', $queryarg);         $wp_rewrite->add_rewrite_tag('%suburb%', '([^/]+)', $queryarg);         $wp_rewrite->add_rewrite_tag('%title%', '([^/]+)', $queryarg);         $wp_rewrite->add_permastruct('venue', '/my-venues/%suburb%/%title%/%cpt_id%', false);     }          add_filter('post_type_link', 'venue_permalink', 1, 3);     function venue_permalink($post_link, $id = 0, $leavename) {         global $wp_rewrite;         global $wpdb;              $post = &get_post($id);         if ( is_wp_error( $post ) )             return $post;              $newlink = $wp_rewrite->get_extra_permastruct('venue');              $sql = "             SELECT meta_value              FROM " . $wpdb->postmeta . "              WHERE post_id = " . $post->ID . " AND meta_key = 'address'";         $address = $wpdb->get_var( $sql );         $address = unserialize( $address );         $suburb = str_replace(" ", "-", strtolower($address['suburb']));         $title = str_replace(" ", "-", strtolower(get_the_title( $post->ID )));              $newlink = str_replace("%suburb%", $suburb, $newlink);         $newlink = str_replace("%title%", $title, $newlink);         $newlink = str_replace("%cpt_id%", $post->ID, $newlink);         $newlink = home_url(user_trailingslashit($newlink));         return $newlink;     }      Removing the section for %cpt_id% makes the page come up as a 404. Rewriting %cpt_id% to "" also makes the page come up as a 404. Anyone know how to remove the post_id?


Update wordpress Core Remotely

Im doing a project that needs to update the wordpress blog remotely like:   1. updating wordpress core   2. updating plugins   3. and updating themes any help would be appreciated thanks!


I would like my posts to pull my custom cropped thumbnail instead of creating its own thumbnail from Featured Image

Firstly, I'm not a developer, mostly a website designer and CSS hacker. I'll try to explain better: I'm using a grid theme that creates a thumbnail out of the featured image to display as a post teaser. My previous theme would do the same, but would use the custom thumbnail that I created in the Thumbnail Setttings in the Media Library. I imagine this is a simple change, maybe in the functions.php file? I looked in the existing posts, but could not find a suitable answer. Feel free to link me to an existing thread discussing this.


Homepage custom recent news

Is there anyway of telling wordpress, by some plugin or whatever, not to show Recent news from Category X, on my home page? Or I may do it only by modifying the `home.php` code?


get images attached to post

I want to have the ability to use pictures from the media library in a jquery slider on the home page so that it's easy for someone else to update the pictures without having to hardcode it. I have attached a bunch of photos to a post and tried this               <?php     $image_query = new WP_Query(array('name'=>'slider-images'));     while ( $image_query->have_posts() ) : $image_query->the_post();         $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );          $attachments = get_posts($args);         if ($attachments) {             foreach ( $attachments as $attachment ) {                 echo '
';                 echo 'ID).'" />';                 echo '
';             }         }     endwhile;     wp_reset_postdata();     ?>      but it doesn't display anything. Is there something wrong with my code or is there an easier/better way to group images together rather than put them in a post? EDIT: If I use the_content() in my $image_query loop it outputs the images like

      but what I need is something like


How do I get a meta value from WP_Query?

I've got the custom post type `foo` with meta fields called `bar` and `baz`. Now I get the `WP_Query` object using:               $args = array(             'post_type'      => 'foo',             'meta_key'       => 'bar',             'meta_value'     => $bar_value,            'posts_per_page' => 10,     );     $res = new WP_Query($args);      Now I want to check if the value `baz` of the selected post is equal to `$baz_value`. How can I do that?


How to parse without changing the characters case (lower and upper) in wordpress the_content?

I made a custom parse function for my plugin and this one works great. I just have a little problem ! Here is my function :               public function ys_glossary_parse( $text )         {             // Get all the items in the database             $terms = $this->get_all_termes();                  // Get the id of the glossary page             $glossary_page_id = get_option('ys_glossary_PageID');             if(!$glossary_page_id OR $glossary_page_id == 0)             {                 return $this->admin_message('You don\'t have a Glossary page yet. Go in the option page !');             }                  // Get the permalink of the page             $permalink = get_permalink($glossary_page_id);                  $text_to_link    = apply_filters( 'ys_glossary_text', $terms );                  //$preg_flags      = $case_sensitive ? 's' : 'si'; // TODO: add an option for that             $preg_flags      = 'si';                  $text = ' ' . $text . ' ';             if ( ! empty( $text_to_link ) ) {                 foreach ( $text_to_link as $old_text ) {                          // TODO: modify this to use the upper/lower case of each words without modifying them                          $new_text = '' . $old_text . '';                     $new_text = apply_filters( 'ys_glossary_text_linked_text', $new_text, $old_text, $permalink );                     $text = preg_replace( "|(?!<.*?)\b$old_text\b(?![^<>]*?>)|$preg_flags", $new_text, $text );                 }                 // Remove links within links                 $text = preg_replace( "#(]+>)(.*)]+>([^<]*)([^>]*)#iU", "$1$2$3$4" , $text );             }             return trim( $text );         }      The $terms are in a simple array like :               array(     [0] => 'item1',      [1] => 'item2',      [2] => 'item3'     );       (they are with uppercase on the first letter). What i want is : How do i make the link on the words without changing the words case ? **Blocking** will stay as **Blocking** but **blocking** will be **blocking**. (So the uppercase and lowercase of the words stay as they are !) I use the case insensitive but my function change all the words with a uppercase for the first letter because the terms are like that. But if i use lowercase on the terms, it change all to lowercase the_content. So i need help on this. Thank you very much ^^ Yann


Rotating image does not work for custom image sizes

When rotating an image with the WordPress image editor it creates new images and renames all of the images for the thumbnail, medium and large image sizes that are default for WordPress. My problem is that I have registered new image sizes using add_image_size(); Is there anyway to make WordPress rename/rotate these custom image sizes? If there is a way to just have it replace the original image names that would be great. So we don't end up with strange image names like My_Image-e13232345234234-200x600.jpg. **EDIT** Below is a test plugin that shows this happening. Paste the code in a file in your plugins folder, then upload an image such as my_image.jpg. You should now have my_image-30xY.jpg. Now if your rotate the image you will get only 4 new images such as my_image-e1343232354234.jpg, but there will not be a new image for the "test" image size.               <?php          /*     Plugin Name: Test     Description: this is a test     Author: Mike     Version: .1     */          class test{              function __construct(){         add_action( 'after_setup_theme', array($this, 'add_image_sizes') );         }              function add_image_sizes(){         add_image_size( 'test', '30', '30' );         }     }          new test();          ?>


Wordpress is adding <!— page-who-we-are.php --> above html

Wordpress is adding this comment above all HTML on my site which is causing problems in IE in which the site won't render properly at all. How do I stop WP adding this? Tried disabling all plugins but nothing


How to load a css file in one page only?

I have a javascript file and a corresponding css file. Both files should be embedded at a single wordpress page. I managed to load the javascript file, but how can a css file be loaded from/at a page?


Creating multiple functions for front-end forms

I have the following situation (which I simplified for didactical purposes): page-books.php:               <form>         <input type="text" name="title" />         <input type="text" name="sinopsis" />         [...]     </form>      page-cars.php:               <form>         <input type="text" name="name" />         <input type="text" name="model" />         <input type="text" name="year" />         [...]     </form>      page-movies.php:               <form>         <input type="text" name="title" />         <input type="text" name="director" />         [...]     </form>      functions.php:               function insert_custom_post()     {         // Treating $_POST variables sent from above forms         // Executing wp_insert_post(...) according to post type         // Redirecting to Home         [...]     }     add_action( 'template_redirect', 'insert_custom_post' );      In the above case, both forms, of three pages, are using the same function on `functions.php` to treat the submitted data. How can I make three separate functions, one for each form on each page? Note: I do not want to put the PHP code to treat the submitted data on the same page of the form 'cause it is confusing to manage, lacks security and I cannot use wp_redirect properly. So, I'm trying to transfer all processing steps to `functions.php`.


dynamically get post attachment while editing

I want to show a meta box on the post edit screen, that contains a list of the images attached to the post. I need the meta box to work for new posts as they are being created. It should update dynamically when images are added to or removed from the post ( when images are added/removed as featured image, or using the "insert media" picker as single image or as part of a gallery in the content) . I need the metabox to 'see' these events and update accordingly, before the post is published or even (manually) saved as a draft. Is this possible? If it is, I'd be happy to know (roughly) how to achieve it. Links to plugins already doing this, or an explanation of the overall way of doing it. Is there a JavaScript event I can listen to, and do I need to fire an ajax request to get the updated list of attachments, or can I get it all from the JS environment available in the post edit page?


Only display latest custom taxonomy post

I have a custom taxonomy set as a "splash" on my front page, I would like to only display the latest one of these taxonomies as a splash, and any older ones to be returned to the loop and displayed as normal. My code atm below displays the splash fine, but reproduces the splash again in the loop for some reason:               $args = array(         'post_type' => 'post',         'posts_per_page' => '1',         'order_by' => 'date',         'order' => 'DESC',         'tax_query' => array(             array(                 'taxonomy' => 'theme',                 'field' => 'slug',                 'terms' => array ('text-image', 'just-image', 'just-text')             )         )     );          $query = new WP_Query( $args );     if (have_posts()) :         while( $query->have_posts() ) :             $query->the_post();      Any help would be appreciated!


Using the "Latest posts" feature on a different site

I want to display the "latest x posts", like you see per default on the index- page, but on a completely different site. E.g. `/blog/` Installing WP into the directory `/blog/` is not an option, as the other pages will be managed with WP. Currently I'm using the `NuRelm Get Posts` plugin to get the content of the latest 10 posts, but the styling is really hard to recreate with it. So, is there any simple solution to use the "Show latest posts" on other sites? **Edit** : I'm using the `twentyten` theme as basis


"Order" doesn't work in custom loop?

I have a custom loop (used in a shortcode) that lists items from custom post type. Everything works fine but "order" for posts doesn't work, no matter what I type as order attribute on post page - items are always displayed the same way (the most recent first and the oldest last). Why doesn't "order" work in my case? The loop looks like:                 $loop = new WP_Query( array(              'post_type' => 'images',                'paged' => get_query_var('paged') ? get_query_var('paged') : 1,             'posts_per_page' => $per_page,              ) );          while ( $loop->have_posts() ) : $loop->the_post();     (my code)     php endwhile;


Find Posts based on Child Post value

I am creating a plugin that adds two custom post types, one of which will always be a child of the other. The parent post type is for Events, the child for Performances. Before entering the Loop, I'd like to be able to find a set of Events that have Performances on a specific date. Performance date is stored as a meta field on the Performance post. The Loop would then list each Event matched, like in a standard post archive loop. My preference is to query the Event post type, since that strikes me as easier to manage for pagination, but if there's a better implementation that simply involves querying performances, I am open to that, but I'd like to see if there's a facility for limiting a query based on a field in the child post.


remove sanitize_title() for register_taxonomy()

**Update**   From reading the answers, i think i didn't make myself clear, so i try to post it again. I register taxonomies from data from parsed xml files. The arguments passed _should_ be absolutely correct. What i wanted to know is on which of the arguments of the `register_taxonomy()` function the `sanitize_title()` function get's called. I currently got an error and need to figure out which of the parameters is wrong.


What is the best way to figure out which template file that a "pretty permalink" is using?

I'm new at wordpress, so maybe this question is very basic, but I looked at Google and I searched for tutorials and I didn't find anything... The question is simple. I have a "page", and this page is show as a friendly url. Example http://www.example.com/seleccion/2011/03/24/abuso-sexual-el-secreto-y-la- verguenza-por-jose-andres-murillo/ How I coul find the php file where this "page" is render? When you don't have friendly url, thats is easy : http://www.example.com/page_file.php?id=3&cat=8 but the friendly url hide all this information :( Thanks in advance...


Supersize plugin error in internet explorer 7 and 8

Supersize plug in works great in firefox and safari but won't load in ie at all and brings up the following error line: 13 Char: 1152 'd.options.slides[…].thumb' is null or not an object any help much appreciated Site is http://ac-design.no


Can't add external rewrites

I've got the following code in my functions.php               function add_custom_rewrite_rules(){             add_rewrite_tag('%gallery%','([^/]+)', 'gallery=');        add_rewrite_tag('%album%','([^/]+)', 'album=');             add_rewrite_rule('galleries/(.+)/?$' , 'index.php?pagename=galleries&album=1&gallery=$matches[1]');     }          add_action('init', 'flush_rewrite_rules');     add_action('init', 'add_custom_rewrite_rules');      But the rewrite rule is not getting added, and it doesn't show up in my list of rewrites in the admin.


Disable TinyMCE Drag and Drop

I would very much like to disable the drag and drop upload feature for tinyMCE (both the default one and the `wp_editor()` one) because it interacts with my custom pop up menus - (WP Trac). Right now I'm trying to just disable the one with the actual `WP_Editor()` function. For some reason it doesn't seem to actually disable any drag and drop functionality and was wondering if I was doing something wrong. My function call looks like this:               wp_editor($meta_content, 'additionalTab', array(         'wpautop'           =>  true,         'media_buttons'     =>  false,         'textarea_name'     =>  '_additional_content',         'textarea_rows'     =>  15,         'teeny'             =>  true,         'drag_drop_upload'  =>  false     ));      **The Expected Output** is that it should completely disable drag and drop uploads directly to the tinyMCE. **The Actual Output** is that it doesn't do anything, it still allows you to drag and drop upload into the tinymce. Is there something wrong with what I'm doing or is there something inherieitnly wrong with `wp_editor()`?


Fatal error, is this because of host?

Suddenly I am getting the following error on my website, I don't know why, but I think this is because of shortage of RAM or Memory in the host? Is it true? Error: > Fatal error: Out of memory (allocated 12845056) (tried to allocate 311296 > bytes) in /wp-content/plugins/WPRobot3/wprobot.php(1239) : eval()'d code(1) > : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) > : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) : eval()'d code(1) > : eval()'d code on line 335 > > Fatal error: Out of memory (allocated 18874368) (tried to allocate 35 bytes) > in /wp-includes/wp-db.php on line 1140 Is this because of insufficient memory with the host? or is it because of wp? Notices               Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: register_sidebar_widget is deprecated since version 2.8! Use wp_register_sidebar_widget() instead. in wp-includes/functions.php on line 3237          Notice: register_widget_control is deprecated since version 2.8! Use wp_register_widget_control() instead. in wp-includes/functions.php on line 3237          Notice: Undefined index: page in wp-content/plugins/seo-booster-lite/seo-booster.php on line 980          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: Undefined index: page in wp-content/plugins/autoblogged/autoblogged.php on line 164          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in wp-includes/functions.php on line 3321          Notice: Undefined index: page in wp-content/plugins/seo-booster-lite/seo-booster.php on line 990


Indenting (tabbing) WP_head

Right now all the stuff that gets included in wp_head are left justified all the way in the code view. Whereas all my other code that is around the wp_head is indented (tabbed) two times. Is it possible to add an indent/tabs to all the wp_head info? Thanks


Adding if statement to content for homepage

I have an if statement already in my loop to display content based on post type. I was wondering if there was a way that I could say to ignore that section if it is the front page/homepage. Here's a sample of my code:                   <?php if( get_post_type() == 'reviews' ) { ?>

                      other div stuff
          <?php } ?>


Metabox does not show in custom post type

I am trying to create a metabox input field in a custom post type and it does not work even if I followed the instructions the best I could. I am not a PHP dev so I guess it could be just a small thing that is missing or it is wrong. By not working I mean, I does not show at all in the WP UI. Here is the code:               <?php          function add_post_type($name, $args = array()) {         add_action('init', function() use($name, $args) {                      $upper = ucwords($name);                 $name = strtolower(str_replace(' ','_',$name));                      $args = array_merge(                      array(                 'public'=> true,                 'label' => "All $upper" . 's',                 'labels' => array('add_new_item' => "Add New $upper"),                 'support' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),                 'taxonomies' => array('post_tag','category')                 ),                      $args                      );                      register_post_type('$name', $args);             });          }               //now we create and register a taxonomy     function add_taxonomy($name, $post_type, $args = array()) {         $name = strtolower($name);              add_action('init', function() use($name, $post_type, $args) {                 $args = array_merge(                     array(                     'label' => ucwords($name),                          ),                     $args                 );                     register_taxonomy($name, $post_type, $args);         });      }          /************************************************************       Now we add the names of the custom post type and taxonomies     *************************************************************/               add_post_type('snippet', array(                 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),                 'taxonomies' => array('post_tag')     ));               add_taxonomy('language', 'snippet');          /************************************************************       Creating Metaboxes     *************************************************************/          add_action('add_meta_boxes', function() {         add_meta_box(             'er_snippet_info',             'Snippet Info',             'er_snippet_info_cb',             'snippet',             'normal',             'high'         );     });          function er_snippet_info_cb() {         global $post;         $url = get_post_custom($post->ID);               ?>              <label for="er_associated_url">Associated URL: </label>         <input type="text" name="er_associated_url" id="er_associated_url" value="<?php echo $url; ?>" />              <?php     }         add_action('save_post', function () {             global $post;              if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;             //security check              if ($_POST && !wp_verify_nonce($_POST['er_nonce'], _FILE_)) {                     if ( isset ($_POST['er_associated_url']) ) {                 update_post_meta($post->ID, 'er_associated_url', $_POST['er_associated_url']);                   }            }              });     ?>      The other issue is that the Tag is not named even if the function is there.


Featured Image inserted through custom query, does not show up

I need to transfer all my records from OpenCart to WooCommerce powered WordPress site. I used custom query to insert the image urls from opencart db to wp_posts as attachment and guid as the URL of the image, along with post_parent being the product id for that particular image. While the listings show in Media, it still does not load show images and also does not appear on Featured Image box of related products. But if I copy the url from Media manager and open it in new tab. The image shows up just fine. What could be the reason? Also is there any other way to transfer OpenCart data to WooCommerce? Any help would be appreciated. Regards


Multisite permalinks for subfolder wordpress installation

I have WordPress installed in a subfolder of the main site: `http://www.example.com/blog/` Now I need to add second blog on `http://www.example.com/blog/second/` So 2 blogs should work on the following URLs:   1. `www.example.com/blog/`   2. `www.example.com/blog/second/` I configures WordPress and almost everything works fine, but I have a little issue with the main blog (`www.example.com/blog/`), the post URLs look like **/blog/blog/hello-world/** rather than **/blog/hello-world/**. Second blog URLs work properly. I tried to change permalink structure in site settings to /%postname%/, and all URLs look good after that, but all they cause 404 error. How can I get rid of double /blog mention in this case? Thanks in advance! wp-config settings:               /* Multisite */     define( 'WP_ALLOW_MULTISITE', true );     define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     define('DOMAIN_CURRENT_SITE', 'www.mysite.com');     define('PATH_CURRENT_SITE', '/blog/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);      htaccess:               RewriteEngine On          RewriteBase /blog/     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]


How to retrieve the date on which a post was moved to trash?

I need to retrieve a list of posts that are in trash based on the date on which they were trashed. The following code allows me to retrieve posts that are in trash, but how to filter them by date?                   $options = array(             'post_status' => 'trash',             'post_type'   => 'post',             'nopaging'    => TRUE         );              $wp_query = new WP_Query();         $posts    = $wp_query->query( $options );


3 Step registration Process in Wordpress

I Developed my site with wordpress 3.9.2 and now i want to Implement User Sign up and profile in my website. I would like to create a 3 step registration. For example: I would like to set up a registration process in 3 different steps: (i) user fillups the account info with username, password, email address, (ii) in second step user select their account type, fill some field based on account type (iii) define your personal profile, i googling this topic but not find any solution, Does anyone know how to do that in wordpress?, Thank you all…


Determing number the query ran by core wordpress

I wanted to find out, how many queries does wordpress core run, and how many queries the theme run. Is there any way to get they number of both of them separately ? As i run               `echo get_num_queries();     queries in     timer_stop(1);`      It gives me total of queries, but i want to have the number separate, of how many does theme run, and wordpress core alone.


Change password from admin panel

while updating password from admin panel of wordpress dashboard, I am facing this unique issue. when I am typing password which is very weak, and updating it. I am getting message, profile updated successfully. But when I am trying to log into my ID using new password, I am not able to do it, its still accepting old password. How can I make wordpress accept weak password.


How to make previous versions available for users?

I am new to using subversion, trac and do not clearly understand how the wordpress plugin repository works. When committing WP Responder I put all the files in a directory called "trunk" and committed it to the server. It worked. It may be useful to make previous versions of the plugin available for download. So I copied all the files from a previous version (4.9) as well as the current version (4.9.5.1) and placed it in the "tags" directory of the repository. So tags had two directories: 4.9 and 4.9.5.1. The 4.9.5.1 had the same content as the trunk directory. When I did this the downloadable archive had only the php files directly under the trunk directory and not the sub directories that are part of plugin. So I had to removed all the directories within the tags directory to restore it to the previous state. What am I doing wrong? How can I make previous versions available for download?


WPML Plugin Not displaying multilingual Menus

I'm using WordPress 3.0 Menus, which the WPML (wordpress multilingual) plugin claims to have added support for in a recent release. I am using the most current version of the plugin. My problem is that using the following to call my nav menus               <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu-header', 'menu_id' => 'menu-primary-navigation' ) ); ?>      is pulling up only the English translation of the menu. Here is an image of the WPML admin panel and how the menus are setup multilingual: [link to image] http://cl.ly/42RW [link to image] http://cl.ly/42o0 You can see the site currently in development: http://anasmadance.com.s66112.gridserver.com/ The problem is that when you go to the French translated page, the menu is still in English (despite the fact that I've already set up the French menu) http://anasmadance.com.s66112.gridserver.com/fr/


Plugin that inserts favicon next to links

I, like many others, have numerous links all over my website. Some are in the body, some are in the sidebars, some are in comments. When links go to an external site, I would very much like to have that website's favicon appear to the left of the link. I have seen this in many places. E.g a link to Wikipedia page, should have that wikipedia favicon. The plugin File Icons appears to do that, but for file types (you link to a PDF, you get a PDF icon). But the question is, how do you do this for general types of links? You could add URLS to the File Icons plugin by hand, but that is a pain, and I have heard of Google's S2 which should find most fav icons automatically. So my question is; is there a plugin that will auto find any links on a post/page/etc. and insert the URL's fav icon to the left of the text?


syntax highlighting for theme-editor.php?

Is there any syntax highlighter for wordpress. This is not to post code snippets on posts but for the backend/theme editor of wordpress. If not do you think it will be implemented in sometime future?


Authors posts on a author created page

Any suggestions/ideas on how to get posts made by certain author to be displayed on a page that same author has created without using author.php? To clear this up a bit, I have a site where author can create one page and multiple posts. Using normal author archives/pages do not offer the flexibility I need, so I'm looking for a way to have the authors' posts to be displayed on a page the author have created. So "Matthew" creates a page named "Matthew" and every post he has made will be shown there. Everybody should be able to see the page as well. Hopefully I made at least some sense with this.


Custom Taxonomy Navigation, with current menu items for children?

Is it possible to have a custom taxonomy navigation, with added active/current-menu classes if the post your on is within that category/custom tax? e.g you have a custom taxonomy called... Weather. Within that you have Sunny,Windy, Raining. Whenever you appear on a Sunny page, whether its the archive of the custom taxonomy, or a single.php or most importantly a child post of a post in the sunny page, the Sunny button is highlighted? Is the only way to manually list then categories then apply if in echo active? I tried added a custom menu and adding via the admin, but it just had the usual menu item, it didn’t indicate have children or anything. Unsure if this is possible at all.


Random Image Script Working but Want to Avoid Duplicates

I'm using the following to display random images:               <?php $new_query = new WP_Query('&showposts=24'); ?>              <?php while ($new_query->have_posts()) : $new_query->the_post(); ?>              <?php $args = array (                 'post_type' => 'attachment',                 'numberposts' => 1,                 'orderby' => rand,                 'status' => 'publish',                 'post_mime_type' => 'image',                 'parent' => $post->ID              ); ?>              <?php $attachments = get_posts($args);                 if ($attachments) {                     foreach ($attachments as $attachment) {                         echo '<li>';                         echo wp_get_attachment_link($attachment->ID, 'thumbnail', true, '');                         echo '</li>';                     }                 };                      endwhile;      But I'm trying to avoid duplicates. Any ideas? Thanks!


saving custom post type data to different table in wordpress

As the title says, is there any option to save the data in different table in wordpress. I have around 10000+ data in my site in a different table. I have moved this table inside wordpress database and i have created custom post and now I want to show the data from my own table not from wp_posts. Any ideas, suggestion or example.


my excerpts lack the 'more' link

on a site am writing, on the home page i want to achieve the following   * Posts should appear as excerpts with links to full article   * Editors should have the power to explicitly control excerpt length I tried the following solution:   * create template file called home.php   * use the_excerpt() in the loop The problem   'read more' link is missing if user specifies explicit 'more' `<!--more-->` when creating a post but strangely if explicit 'more' is not specified in post, the link to full article is available. What the hell is going on? ![enter image description here](http://i.stack.imgur.com/zxEWa.jpg)![enter image description here](http://i.stack.imgur.com/cGPVZ.jpg)![enter image description here](http://i.stack.imgur.com/tUwuA.jpg)


Any good desktop client for wordpress with support for google syntax highliter?

I'm using Google Syntax Highlighter for WordPress and I have to go to the html view where I have to manually type the tags for pasting code and formatting gets messed up when I switch back to the WYSIWYG view. Is there a desktop client like windows live writer that has support for Google Syntax Highlighter and allows us to paste code and format the post in the same view?


Settings API no update status? (refering to the yellow bar when you save settings)

I just created some settings for my theme ... not perfect, still learning ... http://pastie.org/1988772 I am expecting the "Settings Saved" yellow box ![](http://i.stack.imgur.com/f3tTa.png) Do I need to do something on my part?


update = remove code

i updated my wordpress in 3.1 (i'm using twenty ten) and some of my code has been deleted, i'd like to understand it : is it only because i'm using the "twenty theme", that the "code" was replaced with the new version? does a "new version" remove also the code if i use my own theme? and so : to have a code safe, the "plugin" folder is the only safe area? I'd like to be confident the next time i update my version of wordpress. Thanks


Confirmation before deleting plugin options via uninstall.php

I'm creating a WordPress plugin and have the uninstall.php file ready. It deletes the options used by the plugin on deletion. What I'd like to do is to popup a dialog box asking whether to delete or keep these options when the user decides to delete the plugin. How can I do this?               <?php     // If uninstall not called from WordPress exit     if( !defined( 'WP_UNINSTALL_PLUGIN' ) )     exit ();     // Delete option from options table     delete_option( 'my_options' );     //     ?>


Using wp_trim_excerpt to get the_excerpt() outside the loop

I'm building a theme that is going to show excerpts on the homepage for potentially dozens of posts. I don't have manual excerpts on all of my posts, so `$post->post_excerpt` is empty for many posts. In the event that there isn't a manual excerpt, I would like to use the built-in get_the_excerpt() function, but it isn't available outside the loop. Tracking down the function, it looks like it uses wp_trim_excerpt from wp- includes/formatting.php to create excerpts on the fly. I am calling it in my code like `wp_trim_excerpt( $item->post_content )`, but it is simply returning the full content. Am I doing something wrong? I know that I can create my own function to create an excerpt, but I like to use built-in functions where possible, keeping my code compatible with other potential plugins / filters. http://adambrown.info/p/wp_hooks/hook/wp_trim_excerpt?version=3.0&file=wp- includes/formatting.php


Change Posts per page count

In the wordpress **settings** => **Reading** => **Blog pages show at most** [input field] **posts** I have it set to 3 posts at the moment. On my index, date archives, tag archives, category archives, search results, etc... All pages that use the loop and paging, it shows 3 posts per page now. My goal is to be able to have different number of results for different pages. ON my index maybe have 3 posts but on search results or archives, show a different number of results per page. Any ideas how to do this?


WYSIWYG clear:both

How to clear floats in WYSIWYG editor? Not everyone know how to add `<div style="clear:both>"` in HTML mode. Is there any way to add extra button to WYSIWYG or plugin. TineMCE doesn't have that option.


How to Hard Code Custom menu items

Is there any way that i can hard code the custom menu items when first theme installed? I am creating a theme which will automatically make some common pages when installed. So I need to know if I can also add them to Wordpress custom menu so client don't need to add them manually? In other words: how to insert/create custom menu item programmatically? Let me know if anything unclear. Guide to the appropriate codex page is welcome. Thanks! * * * **update:** tried code from here Targeting specific menu with wp_nav_menu_items **Menu registration:**               function register_my_menus() {       register_nav_menus(         array('main-menu' => __( 'Main Menu' ) )       );     }          add_action( 'init', 'register_my_menus' );      **Template use:**               <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>      **Code for adding new items:**               function new_nav_menu_items($items) {         if( $args->theme_location == 'main-menu' ){         $homelink = '
' . __('Home') . '
';         $items = $homelink . $items;         return $items;         }     }     add_filter( 'wp_nav_menu_items', 'new_nav_menu_items', 10, 2 );      when adding the code for adding new items in nav menu in `functions.php` file nothings happens in menu page in admin panel but the current menu items are gone in site!


Does the switch_theme action run when you're upgrading a theme?

Did anyone test if this action is being executed on theme upgrade? Are there any other actions I could use to attach a theme uninstall function?


Wordpress for a club website -- Members page

I'm making a website for a student activity and have a wordpress page for each member under a common parent group. Each page contains some member info (currently unstructured) and a profile picture. I would like to list all these members under a member page with perhaps a grid of profile pictures and names. Is there a plugin that can accomplish this? Note that each member does not have a wordpress account. I already found plugins that can do that, but it's not what I am looking for.


how do you create an admin interface in plugin for your theme

I'm creating a theme that would need some settings on the client side. So I need a admin interface where they can set some values. (like, source of image, title, or numbers) so in my theme, I can just set some variables like `<img src="IMAGE_SOURCE" title="TITLE" size="NUMBER" />` If you can point me to a tutorial that would be great. Thanks!