title: Pretty links for PHP pages above WP /blog directory?

text: I've made a new WP installation in a subfolder /blog, set up with "Post name" permalinks. I'm ready to make several other non-WP website PHP pages which would reside above the /blog directory. I was wondering - is there a way (1) to make these non-blog pages above the /blog directory have "pretty" (aka "search engine friendly") links (like the /blog pages would have), and (2) if that _is_ possible, is there also a way in WP to somehow disallow using the 'above the blog page' names for WP pages or posts, so that they won't conflict?


title: Add information to HTTP Header in WordPress Plugin

text: I am working on developing a plugin for a tool called Supportify. It is a REST API that is authenticated through a key and token added to the HTTP header of a HTTP request to their servers. Their API reference is here. I know you can add things to the header with `wp-config.php` but for a publicly released plugin this is not feasible. Is there any way to do this through a plugin?


title: CPT Archive with parent page

text: Is it possible to set a parent page to a CPT Archive? I used a plugin to add archives to the `nav_menu` section. That works. But I also want the link to be `/parent/archive`. Is there a plugin or programmatic way to achieve this?


title: How to Change MU/BuddyPress Group Blog New Installation Defaults

text: I am trying to work with a Multisite install of WordPress and modify the default "child" blogs in the network. The details are: -I have a main site built on Commons in a Box (CBOX) which is a modified version of BuddyPress which allows users to register and then create groups. -If a user creates a group, he/she has the option of creating a "group blog" (It is a BuddyPress orientated plugin) that is tied to the group and is essentially a new WordPress blog within the the main site.  * * * !!!The Problem!!! -I want the default installation to be different than the normal WordPress "hello world" post, sample page, etc.  Mainly, I would like to minimize most of the admin menu options so that users do not see them, i.e. more user friendly and less work if something goes wrong. * * * I already have the ability to set the default theme for the new installations and so I was wondering if I should use a plugin for this or a child theme or something else? I saw this plugin, Adminimize, and was wondering if I could use it some way as a default plugin for a new install, with all of the options set and the plugin menu hidden. I am also trying to use CommentPress for the new sites which has a built-in theme as well as other quirks. Any help would be appreciated. Thanks.


title: How to have more post in a page than in your home page

text: I am new to the world of WordPress. I own a new site and I'd like my home page to display the latest news and articles (which I accomplished to set in Settings > Reading), but I'd like another page to display all posts (not the whole post but a summary) without the need to press "previous page". e.x. If I have 8 posts and I set maximum posts to be 4 in the settings menu, my home will have 4 posts. But I'd like the other page to have all 8 posts in summary without the need to press previous page to read other posts. How can that be done?


title: How to associate more than one user to a post?

text: I have a website we're building with 1600 'Business Listings' which are made as custom post types. Our problem is that, while there only needs to be one 'editor' of each post/company, there are sometimes more than one user(employees) associated with the post/company. The biggest reason for this is grouping users with certain businesses, which in turn gets used for email newsletters, and just overall contact info (only seen in the backend by the admins). SO. Is there a way to associate more than one user to a post? Basically out client wants to be able to go into a company's profile (aka custom post) and see all of the employees attached to that company. Thoughts? Multiple author-to-post plugin or hack we can do?


title: Changing Domain Renders Site Unusable

text: So I've been following the guide for Moving WordPress and I've been running into problems. I changed the domain on my site, and I performed a search and replace on the database for all occurrences of the domain name, but still the site refuses to load unless I go back into `wp_options` and change `siteurl` and `home` fields back the old domain. I'm not sure what to provide for information, so please ask for anything I can give to help, but what could possibly be causing this disaster?


title: Installed successfully; home page still redirects to install.php

text: I've done WP installs in the past and haven't had issues, so I'm a little stumped here. I've correctly created wp-config.php. I ran the install script, and everything appeared to be successful. I have all the tables in MySQL and am able to log into the dashboard with the admin account I created. However, the home page is still redirected to install.php. Clicking the button to install brings up a message that WP is already installed (which is what I would expect to see), but the home page doesn't want to load the blog. I can, however, open the test post that comes with the install just fine. It's only the home page that isn't working. If it helps any, this is an installation I've set up for a project on Sourceforge.


title: problem in uploading attachment to custom directory

text: i have been trying to upload the attachments to the custom directory without affecting the old uploads. so i use this bellow code to achieve that               add_filter('wp_handle_upload_prefilter', 'cust_pre_upload');     add_filter('wp_handle_upload', 'cust_post_upload');          function cust_pre_upload($file){     add_filter('upload_dir', 'cust_dir');     return $file;     }          function cust_post_upload($fileinfo){     remove_filter('upload_dir', 'cust_dir');     return $fileinfo;     }               function cust_dir( $args ) {     $customdir ="/mars";     $args['path'] = "C:/wamp/www/web1/wp-content";     $args['url']  = "http://localhost/web1/wp-content";          $args['subdir']  = $customdir;     $args['path']   .= $customdir;      $args['url']    .= $customdir;          return $args;     }      i use the wp_handle_upload_prefilter to assign the new directory only for the attachment i upload now or in future and wp_handle_upload to prevent the old attacmments. this code perfectly uploading to the folder where it supposed to [http://localhost/web1/wp-content/mars/file.jpg but the attachment get this wrong and show an invalid url of the attachment something like this [http://localhost/web1/wp-content/uploads/C:/wamp/www/web1/wp- content/mars/file.jpg] any help or idea would be appreciated :) tried different types of codes nothing worked out.


title: CPT archive page - show one post from each taxonomy term

text: Basic loop question: I have a custom post type with a custom taxonomy and 3 terms. On the archive page (archive-custom_post_type.php), I would like to display one post from each taxonomy term. Is this possible within the standard `if (have_posts()) : while (have_posts()) : the_post();` loop, or do I have to make separate loops for each one?


title: How to order custom post type by multiple custom fields?

text: How to display posts with 'Event' custom type ordered by 'Start_Hour' and then by 'Start_Minute'? 'Start_Hour' and 'Start_Minute' are numeric custom fields. I tried this, but it doesn't work:               $args = array(       'post_type'=>'Events',       'orderby' => 'meta_value',       'meta_key' => 'Start_Hour Start_Minute',       'order' => 'ASC'     );     $loop = new WP_Query( $args );


title: Two exact templates, sidebar showing in one but not the other

text: I'm using the Roots WP Theme and for some reason when copy pasting the page- custom.php to create a home page template. The new homepage template is showing the sidebar but not the original page-custom template even though the two template files are exactly the same at this moment. Can anyone explain why this might be?


title: WP-E Commerce: How to let user leave a personal message/instruction with each product from the products page

text: This is my first question here. I've Googled and searched here but didn't find the answer or any useful instruction. I'm using `wp-e commerce plugin` for the first time. My question is: How can I let a user add a personal message/instruction from the product page in `wp-e commerce plugin` using a textarea. Like this site, I want to let the user the ability to add `Add special instruction` with every products from the home/products page. Hope someone can help me out. Thanks in advance.


title: how to make separate category term archives by post type

text: I've searched around, and many others are struggling with similar questions that don't seem to have been answered well. So please help reduce this misery! Suppose you've got an off-the-shelf WordPress blog with posts of local news, organized under the standard WordPress taxonomy "category" with terms "crime", "politics", "entertainment" etc. The category term archive URLs /category/crime/ , /category/politics/ , etc. exist automatically. You've set up a custom post type "national" for national news. It uses the same categories as the (default) post type local news. What's a simple way to set up similar category term archives for the national news custom post type? In other words, URLs something like /national/category/crime/ , /national/category/politics/ , etc. These URLs should produce only posts with post type national.


title: wp_query for events & posts filtered by category

text: I need to perform a wp_query to return events and posts. The events need to be in a specific category (stub = 'novita') and the posts in cat 15. I feel like I've tried every conceivable permutation of this code but haven't managed to return what I need. This returns nothing. Any help greatly appreciated. I've been on this for 2 days and am losing the will to live. Many thanks.                   $args = array(         'post_type' => array( 'event', 'post' ),         'orderby' => 'date',         'order' => 'DESC',         'posts_per_page' => 12,         'meta_query'             => array(             'relation' => 'OR',             array(                 'key'       => 'cat',                 'value'     => '15',                 'compare'   => '='             ),             array(                 'key'       => 'event-categories',                 'value'     => 'novita',                 'compare'   => '='             )         )     );


title: Get thumbnail using wpdb from external wordpress database

text:
I'm trying to get thumbnails from posts using a wpdb query where the wordpress database I'm querying is _not_ the one from which the wpdb query is being called. That may be a little unclear, so here is a bit of my code: The query:               $gcdb = new wpdb(<user>, <password>, <database>, <host>);     if ( is_object( $gcdb ) && !isset($gcdb->error) ) {     $results = $gcdb->get_results(           "           SELECT              p.ID,             p.post_author,             p.post_title,             p.post_date,             p.post_content,             p.post_excerpt,             p.guid,             meta2.meta_value           FROM              wp_posts p           LEFT JOIN             wp_postmeta meta1             ON (               meta1.post_id = p.ID               AND meta1.meta_value IS NOT NULL               AND meta1.meta_key = '_thumbnail_id'             )           LEFT JOIN             wp_postmeta meta2             ON (               meta1.meta_value = meta2.post_id               AND meta2.meta_value IS NOT NULL                AND meta2.meta_key = '_wp_attached_file'             )           WHERE             p.post_status = 'publish'             AND p.post_type = 'article'           ORDER BY             p.post_date DESC           "         );       if ($results) {         global $post;         foreach ($results as $post) {           setup_postdata($post);         ?>

                   <a href="<?php echo $post->guid; ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">                     <?php the_title(); ?>

               <?php                 the_post_thumbnail();                 the_excerpt();                ?>

         <?php         }       }       wp_reset_postdata();     }      So, just to be clear, the database for the wpdb is not the same database that would be queried if I used `WP_QUERY`. The database is on the same server, but it is a different wordpress installation. Now, I noticed that if I call, for example `the_permalink()`, it actually gets the permalink _relative to_ the wordpress installation from which this code is being called (i.e. instead of domain2.com/post-link/, I get domain1.com/post-link/). I think it is for this same reason that `the_post_thumbnail()` doesn't work. If there is some way I can use `the_post_thumbnail()`, that would be ideal. However, if that doesn't work, I could always just pull from the 'meta_value' field from my query. However, this gives me the full thumbnail instead of the cropped one. How could I either get the URL for the cropped thumbnail, or the size of the thumbnail?


title: Which Meta Query Compare Method Should I use?

text: How do I do a 'like' comparison on a numeric value with meta_query? I have some code that does an autocomplete search for product sku's in WooCommmerce. It works fine for non numeric skus, but I can't get it working with numeric skus. I'm using compare => 'like' because my autocomplete script is setup to start searching after 2 characters have been entered (so that skus 10 characters long can be searched instead of entered exactly). Here's what I'm working with now:               $products1 = array(         'post_type' => array ('product', 'product_variation'),         'post_status' => 'publish',         'posts_per_page' => -1,         'meta_query' => array(             array(             'key' => '_sku',             'value' => $_REQUEST['term'],             'compare' => 'LIKE'             )         ),         'fields' => 'ids'     );


title: How to use "Add link" pop up for a WordPress widget

text: In the WYSIWYG editor of WordPress you get pop up if you want to add a link for a text. Is there a possibility to access this functionality? Because I want to use this pop up for a WordPress widget that I created so that you can add links to a widget if you configure it in the backend. Here is a screenshot of what I mean: ![enter image description here](http://i.stack.imgur.com/j36g1.png)


title: Use of check_admin_referer with theme options and options.php

text: If I set up a theme options page in the way suggested by the codex (http://codex.wordpress.org/Creating_Options_Pages) then my form submits to 'option.php'. `settings_fields` creates a nonce, which if I was creating my own submission page would be checked with `check_admin_referer`. My question then.... if I use options.php as my 'form processor' does this mean I cannot use `check_admin_referer`? Thanks, Nick


title: Better way to enforce category hierarchy in post_categories_metabox?

text: The objective is to ensure that when editing a post, the metabox that lists a hierarchical taxonomy doesn't reorder itself upon Update to put checked items on top. Right now, `edit-form-advanced.php` calls `add_meta_box()`, passing a callback of `post_categories_meta_box`, which is defined in `meta-boxes.php`. `post_categories_meta_box()` invokes `wp_terms_checklist()`, leaving the `checked_ontop` parameter undefined. `wp_terms_checklist()` defaults that parameter to `true`, which is the root cause of all this hooplah. Nary a filter hook to be found anywhere along the chain until we back out and discover `add_meta_boxes` and `add_meta_boxes_{$post_type}`. The only solution I was able to come up with myself was to hook onto one of these actions, globalize `$wp_meta_boxes`, and replace occurrences of the `post_categories_meta_box` callback with a callback of my own, where I completely duplicate all of `post_categories_meta_box()` and simply add the parameter `'checked_ontop' => false`. Works. But fugly. This seems ridiculous - is there no more elegant way to simply let your hierarchical taxonomies keep their order in metaboxes?


title: Additional class for.sub-menu UL?

text: This code returns my WordPress menu:                <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'header-menu') ); ?>      What's the easiest (non-JS) way of adding additional class to all .sub-menu ul dropdowns of this menu? I was thinking about add_filter() for wp_nav_menu but I'm afraid it will point all wp_nav_menus and I want to add these classes only to this particular one. Also, custom walker sounds a bit like an overkill. What would you recommend?


title: Static Website No Titles But Still Nav

text: So I have a static paged website and I want to make pages without title, but I still need the titles for the navigation to pick it up. How can I get rid of the Page.php (the_post()) from displaying the page title?


title: WP Calendar Shortcode not working on my theme

text: I'm using WP Calendar plugin on my development site. The documentation says that I can use the tag `{event_calendar}` on my template to render the calendar. This is the code am using on my template page.               <?php echo do_shortcode('[event_calendar]') ?>      When I look at the Chrome Console, There is no error. There is a Javascript file that is loaded: `fullcalendar.min.js`. jQuery 1.9 loads up in the header. Appreciate any help.


title: How to Link External jQuery/Javascript files with WordPress

text: So I'm using Starkers to base my next WP theme on and I've run into a small issue, I was including my own version of jQuery in the `header.php` file but when inspecting my site using Firebug I noticed jquery was being downloaded twice, I did a bit of digging and noticed that not only was I including the file but so was the `wp_head()` function. In trying to fix the problem I noticed a comment in the header file, of which originated came from the Twenty Ten theme:               /* Always have wp_head() just before the closing </head>      * tag of your theme, or you will break many plugins, which      * generally use this hook to add elements to <head>, such       * as styles, scripts, and meta tags      */      So here's my problem, I am under the impression that the jQuery file has to be set before any other file that wants to use it and that `wp_head()` should be the last thing in the `<head>` element, I'm slightly confused now as I'm wondering should I put `wp_head()` at the top so the WP included jQuery file will be used for all my plugins, even though it says not to do so. I did comment out the jQuery line in the `wp_head()` function but it's required for the admin page so I had to put it back. I'd also like to use (at least experiment) with using the Google CDN version of jQuery, but don't want to include it twice! I hope you understand what I'm trying to explain, any suggestions on how I can solve this problem would be most appreciated. I'd also appreciate any advice on how you handle your JavaScript files with the header file. Thanks!


title: WP in Subdirectory -- Multiple robots.txt and .htaccess files?

text: Assume you have a static HTML site with its own `robots.txt` and `sitemap.xml` at `www.mysite.com`. Now you add WordPress blog as an adjunct to the site at: `www.mysite.com/blog`   1. Do you need to have a second `robots.txt`? One for the root html site and one for WP blog?   2. Do you need to have a second `.htaccess`? One for the root html site and one for the WP blog?   3. Do you need a separate `sitemap.xml`? One for the root html site and one for the WP blog?


title: Taxonomy.php error appearing in the header of my site

text:
It references line 231 of the taxonomy.php file (See image) and all it says on that line is:                * Checks that the taxonomy name exists.      *      * Formerly is_taxonomy(), introduced in 2.3.0.      *      * @package WordPress      * @subpackage Taxonomy      * @since 3.0.0      *      * @uses $wp_taxonomies      *      * @param string $taxonomy Name of taxonomy object      * @return bool Whether the taxonomy exists.      */     function taxonomy_exists( $taxonomy ) {         global $wp_taxonomies;         return isset( $wp_taxonomies[(string)$taxonomy] );     }      It's on a general page that lists Neighborhoods. I'm using the ACF plugin but haven't encountered this error before. Any ideas would be most helpful. Thanks. ![enter image description here](http://i.stack.imgur.com/8SUXD.png) UPDATED CODE ----- Here is the code i'm using in the internal header which happens to be the case for this particular header:               <!DOCTYPE html>                                          <title>                  <?php                echo wp_title();                         bloginfo( 'name' );                  ?>                </title>           <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />           <meta name="robots" content="index, nofollow" />           <?php wp_head(); ?>
                                       <a class="logo" href="<?php ( 'home' ) ?>" alt="Return Home" title="Return Home">                                          <?php                        $args = array(                     'menu' => 'main-menu'                     );                        wp_nav_menu( $args );                      ?>
<?php wp_title($echo); ?>

           Here is the code for the body portion of the page which all i'm doing is using the query to get all the permalinks from the custom post types and creating a LI's within a UL to list all the neighborhoods.               <?php          /*            Template Name: Neighborhoods Main Page          */          get_header( 'internal' );?>

          <?php            $args = array(         'post_type' => 'neighborhood'       );            $the_query = new WP_Query( $args );          ?>
            <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_field( 'neighborhood_name' ); ?>
            <?php endwhile; else: ?>

There are no posts or pages here.
          <?php endif; ?>
          <?php get_footer(); ?>      UPDATED 3-22-2014 ------- Here is a snippet from my functions.php file where I enable custom menus:               //Enable custom menus     add_theme_support( 'menus' );          //Register Navigations     add_action( 'init', 'my_custom_menus' );     function my_custom_menus() {         register_nav_menus(             array(                 'primary-menu' => __( 'Primary Menu' ),                 'neighborhood-menu' => __( 'Neighborhood Menu' ),                 'place-menu' => __( 'Place Menu' )             )         );     }      ENTIRE FUNCTIONS.PHP FILE -------               <?php          // Load the Theme CSS          function theme_styles() {            wp_enqueue_style( 'normalize', get_template_directory_uri() . '/css/normalize.min.css' );       wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' );       wp_enqueue_style( 'googlefonts', 'http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz');       wp_enqueue_style( 'googlefonts2', 'http://fonts.googleapis.com/css?family=Open+Sans');       wp_enqueue_style( 'googlefonts3', 'http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300');       wp_enqueue_style( 'main', get_template_directory_uri() . '/style.css' );       wp_enqueue_style( 'iconset', get_template_directory_uri() . '/css/mfglabs_iconset.css' );       wp_enqueue_style( 'icon_fonts', get_template_directory_uri() . '/css/font/' );            wp_register_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css' );       if( is_page( 'home' ) ) {           wp_enqueue_style( 'flexslider' );       }          }          // Load the Theme JS          function theme_js() {            wp_register_script( 'flexslider', get_template_directory_uri() . '/js/flexslider.js', array('jquery'), '', true );       if( is_page( 'home' ) ) {           wp_enqueue_script( 'flexslider' );       }       wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery'), '', true );       wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true );          }          add_action( 'wp_enqueue_scripts', 'theme_js' );          add_action( 'wp_enqueue_scripts', 'theme_styles' );          //Enable custom menus     add_theme_support( 'menus' );          //Register Navigations     add_action( 'init', 'my_custom_menus' );     function my_custom_menus() {         register_nav_menus(             array(                 'primary-menu' => __( 'Primary Menu' ),                 'neighborhood-menu' => __( 'Neighborhood Menu' ),                 'place-menu' => __( 'Place Menu' )             )         );     }          // Widget Function     function create_widget( $name, $id, $description ) {              $args = array(           'name'          => __( $name ),           'id'            => $id,           'description'   => $description,           'before_widget' => '
',           'after_widget'  => '
',           'before_title'  => '',           'after_title'   => ''         );              register_sidebar( $args );     }          create_widget( 'First Icon', 'first_icon', 'Displays as the first icon' );     create_widget( 'Second Icon', 'second_icon', 'Displays as the second icon' );     create_widget( 'Third Icon', 'third_icon', 'Displays as the third icon' );     create_widget( 'Fourth Icon', 'fourth_icon', 'Displays as the fourth icon' );          // Background Color               function color_header_bg() {         global $post;         // set this to the handle of one of your stylesheets         $handle = '/css/style.css';         // set this to the meta key you've used         $meta_key = 'background_color';         $bg_color = get_post_meta( $post->ID, $meta_key, $single = true );         $css = "header { background-color: $bg_color; }";         wp_add_inline_style( $handle, $css );     }          add_action(  'wp_enqueue_scripts', 'color_header_bg' );          // // Added Parent meta box in Places custom post type, created parent/child relationship neighborhood and places     // add_action( 'add_meta_boxes_place', 'my_add_meta_boxes' );          // function my_add_meta_boxes( $post ) {          //   add_meta_box(     //     'place-parent',     //     __( 'Parent', 'example' ),     //     'my_parent_meta_box',     //     $post->post_type,     //     'side',     //     'core'     //   );     // }          // function my_parent_meta_box( $post ) {          //   $parents = get_posts( array( 'post_type' => 'neighborhood', 'numberposts' => -1 ) );          //   if ( !empty( $parents ) ) {          //     echo '<select name="parent_id">';          //     foreach ( $parents as $parent ) {     //       printf( '<option value="%s"%s>%s</option>', esc_attr( $parent->ID ), selected( $parent->ID, $post->post_parent, false ), esc_html( $parent->post_title ) );     //     }          //     echo '</select>';     //   }     // }     function when_rewrite_rules( $wp_rewrite ) {       $newrules = array();            $new_rules['place/(.*)/(.*)$'] = 'index.php?place=$matches[2]';         $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;         //echo '
'; print_r($wp_rewrite->rules);die;     }     add_filter('generate_rewrite_rules','when_rewrite_rules');     ?>      ![enter image description here](http://i.stack.imgur.com/9o2cQ.png)


title: Custom page Template and Script as a Plugin

text: I want to Build a custom Page Template. But as far as I know we should not at all touch Core PHP files. let say our Custom Page template is custom.php, then where will this custom.php sit I mean in which folder in wordpress or it will go some where in the inner directories of theme? Because Finally while creating a new page it should be available as drop down in WordPress admin.


title: How do I save metadata for a specific custom post type only?

text: I'm trying to set up a custom post type following this tutorial. However, I'm a bit confused as how/where to implement `update_post_meta()`. The tutorial suggests this pattern:               add_action('save_post', 'save_my_metadata');          function save_my_metadata()     {         global $post;         update_post_meta($post->ID, 'my_metadata', $_POST['my_metadata']);     }      Which does work, but has the unfortunate effect of adding that metadata to each and every post, whether it belongs to this custom type or not. I've put the above in `functions.php` and am guessing that might be part of the problem. I'm guessing I need to restrict the 'save_post' action to only trigger for posts of my custom type.


title: get parameter from url rewrite

text: I have a problem : Example : `http://domain/hotel` Now I set value: `http://domain/hotel/?tour=hawaii` How i can get value of variable "tour".


title: Trigger a function during onload

text: I recently added Javascript and CSS files into the wordpress. All the files are being registered through `functions.php`. One of the files is `my_worldmap.js` as shown below               $(function() {         $('#world-map').vectorMap();     });      The issue here, the above function is called as soon as I visit the homepage. My expectation that the code is only called when I visit `www.mydomain.com/global-network`. How can I do this in WordPress ?


title: WP Function still having effect after being deleted

text: I wanted to hide the add to cart buttons in Woocommerce so I created a custom plugin and added the following code to it:               function remove_loop_button(){     remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );     remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );     }     add_action('init','remove_loop_button');      It worked, but I changed my mind so I deleted the code from the plugin file and yet the buttons are still gone. Since then I have deleted the custom plugin, deleted and reinstalled woo commerce plugin, deleted and reinstalled my theme and restarted my server. Nothing has worked. Is there some kind of Wordpress cache for functions? Any ideas?


title: How to give capability (publish contributors posts) to author role?

text: I am not a PHP programmer, just a simple WordPress user.   * How can I allow author role to allow publication of contributors posts?   * What's the technical name for this?


title: Confusion on WP Nonce usage in my Plugin

text:
I created a small plugin where users can set multiple featured image by clicking `Add New` link from the meta box and remove them as well. The user can use `Set featured image` link to select featured image from media library. The `Add New` link clones (using javascript) previous meta box (with appropriate filters) to create a new meta box whereas the remove button removes the meta box. ![Metabox snapshot](http://i.stack.imgur.com/4nfHp.jpg) **Problem and Questions**   1. I am currently using only single nonce field for every meta box generated. Many previous threads suggest that new nonce field should be added for every meta box. How can i create different nonce field if the box is being cloned using javascript? Should i use AJAX? or is it even necessary to use nonce field in this case as user can only select image from media library?   2. The hidden input field in meta box is used as an array (see the html for meta box) and is saved using `update_post_meta`. If the nonce field is added for every dynamically added meta box how can i check it while saving the post? `if ( !wp_verify_nonce( noncefields..., plugin_basename(__FILE__) ) ) { return; }` The html for the meta box looks like this.               <?php wp_nonce_field( plugin_basename(__FILE__), 'dfi_fimageplug'); //this is generated only once for all meta box ?>     <?php _e('Set featured image', 'ap_dfi_dynamic-featured-image') ?>
           <img src="<?php if( !empty($featuredImgTrimmed) ) echo site_url() . $featuredImgTrimmed ?>" class='dfiImg <?php if( is_null($featuredImgTrimmed) ) echo 'dfiImgEmpty' ?>'/>
         <a href="javascript:void(0)" data-id='<?php echo $featuredId ?>' class='dfiAddNew'><?php _e('Add New', 'ap_dfi_dynamic-featured-image') ?>      <?php _e('Remove', 'ap_dfi_dynamic-featured-image') ?>

     <input type='hidden' name="dfiFeatured[]" value="<?php echo $featuredImg ?>" />      I am not very experienced in plugin development and am really confused on this matter. Please suggest.


title: Different logo on homepage

text: I have uploaded a file as my main logo within the theme settings but would like a different logo on the main page. The theme I am using has a custom css option within the theme settings, can I use custom css to only change it on the front page and not the rest of the site? Theme: http://demo.ghostpool.com/?theme=bounce-bp


title: Best approach to fetch data from wp options to js file or php file

text:
I am creating my first ever plugin, as I am not a programmer, I have been following tutorials and reading the codex, etc. My plugin consist in showing a notice to users when certain conditions are met, I have written it in jQuery and placed it in a js file which is enqueued by the plugin along with styles. I have followed a tutorial that simply ads a settings page and a form with a simple text box to save data in the wp options table, I tested and it worked, the data was stored successfully. How do I now transfer the data from the wp options to my js file, the line where the notice is display is;               jQuery('.notice_container').wrap(<'div id="custom_notice">Hello World....
')      Thank you for your time.


title: Update to older wordpress version from admin?

text: I have a Wordpress 2.7.x setup that I would like to migrate to the latest version 3.2.1, however I need to make a stepped-upgrade as some plugins need an older version first (3.0.6 IIRC). However Wordpress is only offering me the latest and greatest version to upgrade to. Is there a way - prefereably within the admin - to update core to a specific version? Or am I bound to manual upgrades? Is there probably a way to tell the wordpress core upgrader which version to pick? It was downloading a zip only recently, right?


title: How to disable edit post option after period of time?

text: How to disable edit post option for post one day after publication?


title: Giving Multiple Authors Access to a Plugin's WP.org Repo

text: A plugin I've released has a collaborator. So I put them into the readme.txt file and they show up on the plugin page and all that. Does doing this automagically give them access to the SVN repository for the plugin? Or is there some other process to go through to get them access? Or is only one user allowed per repo? Thanks!


title: custom types taxonomy hide_empty

text: I have a custom type, which uses custom taxonomy to create categories. I can add 'products' and assign them to the category structure that I have created. There is a top level menu which displays the parent categories, clicking each takes the user into the category hierarchy. If there are no products in any sub-category of a parent category, then that listitem shouldn't display in the top level nav. If I set hide_empty=1 _all_ the parent categories disappear, not just the one with no products. Can anyone advise?


title: How to do a particular wp_query taxonomy search

text: I have added a custom taxonomy called _experience_ to the _page_ post-type, and the taxonomy has terms " _vfds_ " and " _plcs_ " I am trying to create a search where a user can select one or more _experience_ taxonomy terms from a select list, press the submit button, and see the results of a wp_query. I need the query result to show pages with 1) the _experience_ taxonomy has no (zero) terms selected 2) one or more terms selected I have an html select list with an array `experience[]` to capture multiple selections:               <select name="experience[]" multiple="multiple">     <option value="vfds">VFDs</option>     <option value="plcs">PLCs</option>     </select>       Then I feed this array into a wp_query:                   <?php                  $_GET['submit'];             $experience = $_GET['experience'];             $args = array             (                        'post_type' => 'page',                           'tax_query' => array(                         array(                             'taxonomy' => 'experience1',                             'field' => 'slug',                             'terms' => $experience                         )                      )             );         $query = new WP_Query( $args );      The query works fine in the sense that it will show pages that have one or more terms selected under the experience category. The problem I am having is this: IF a page has empty (no) values for the experience category, then it is not shown in the result list. Is there a way where wp_query will show pages with   1. no terms selected   2. one or more terms selected Thank you * * * **EDIT #1** Please let me add that in general I am trying to move away from using Drupal with Views. I am trying to replicate Views capability of being able to search using select fields with multiple values. I have tried to use `wp_query` with a custom select field with multiple values, and failed miserably so far. Hence I switched to using categories with multiple terms and am close to replicating a Views type search result. If anyone knows any other way of doing what I would like to do in WP, I would very much appreciate it. Thanks again! * * * **EDIT #2** I realize maybe my question does not make full sense. Let me try and explain further. The reason I need to search result to show pages with ZERO or more terms instead of ONE or more terms, is that I would like to combine the taxonomy search with a another field search, eg City. If a user fills in only a value for city, and no value(s) for experience terms, the search results will be zero because he did not fill in terms. Instead I need to show all pages with the city that was selected, whether or not any experience terms are selected


title: after_setup_theme always runs

text: I am setting up a child theme for some of my faculty members, and as a part of the theme, I would like a handful of plugins to be activated at the time that the theme is activated. So, naturally, I used the after_setup_theme action and called my setup function. It works great, except it runs on EVERY request (admin and otherwise). I proved this by adding this to the end of the setup function: `echo '<script type="text/javascript">alert("This action was run")</script>';` And as a result get a javascript alert on every admin request and every front- end request (I have a network setup, so obviously on sites where this theme is not active, it's not running the function) So the question is, is this a bug? Am I somehow doing something wrong? Here is the complete code that I am using:               add_action( 'after_setup_theme', 'fwp_setup' );     function fwp_setup(){         // -- Unrelated code remove for the sake of brevity          require_once($_SERVER['DOCUMENT_ROOT'].'/wp-admin/includes/plugin.php');         activate_plugin('enable-media-replace/enable-media-replace.php');         activate_plugin('seo-image/seo-friendly-images.php');         activate_plugin('w3-total-cache/w3-total-cache.php');         echo '<script type="text/javascript">alert("This action was run")</script>';     }      Any insight would be much appreciated!


title: Duplicate posts and change category (frontend)

text: I am trying to create a button inside a post and, when the user clicks on it, I'd like the post to be duplicated and this new post goes to another category, is it possible? For example: I have "post 1" in "category1". When the user clicks on the button "duplicate", it should duplicate the "post1" inside the "category2". Thank you!


title: How can I delete all my existing trackbacks?

text: I'm sorting out a long-neglected wordpress.org blog. It has over 100,000 pieces of trackback spam. How can I remove them all?


title: Visual editor broken after upgrade

text: Yesterday a colleague updated WordPress and a number of plugins on our site. Since then, the visual editor displays the contents of pages and posts as HTML, it is also white, whereby we first thought that it wasn't displaying the contents as well. I have been able to switch to HTML-mode which displays as expected, but when I switched back, the Visual/HTML tabs stopped working. Going through a few troubleshooting ideas offerd on a number of fora, like re- uploading the wp-admin and wp-includes folders, deactivating plugins one by one to single out the culprit... all to no avail. The fact that the text is white is annoying, but on top of that, most of my colleagues have no idea what HTML is. Any help would be greatly appreciated.


title: How can I make different page templates for one category?

text: I need this for menu "red car", "blue car", "green car". Information is retrieving from a single category (cars). But the output on pages depending on the values in the metaboxes (colors). On the page with blue cars shouldn't be a green cars. Cars and colors for illustrative purposes only. How can I do this?


title: Using categories as multilingual mechanism

text: Is there something wrong with the following approach. I dislike installing plugins (with database access) on my wordpress. But I want my wordpress to be multilingual . What do you think about the option using the categories as the Language differentiation.   When some user creates a new post, he choose the language (Category).   In the theme Ill identify the language by the category. Do you think it might work? Thanks


title: BuddyPress Xprofile check if user can view field

text:
I use the following code to get a custom BuddyPress Xprofile field:               <?php if($field = bp_get_profile_field_data('field=field_name')) : ?>
<?php echo $field; ?>
     <?php endif; ?>      But how can I check if the current viewer has the permission to view the field (from the visibility setting who the user can set)?


title: show image in mail contact form 7

text: I am using contact form 7.   I have a file field to upload images. Code of file field in contact form 7               [file* image filetypes:jpg|png|gif]      I need to display the uploaded image in mail using contact form 7. How can i do that?


title: Linking from a list of custom post type items to a single - get_post_permalink not working correctly

text:
I have created a custom post type of Case Studies, and created a list page which gives an overview of each. Some have a link straight to the case study in PDF form and some have a link to a single case study view, where full text and a full size image can be seen. The problem is with the link to the single view. When you hover over the link it shows a URL which is correct for the name of the case study, and when you click on it, the correct URL is brought up, but the content on the page is the content of a different case study. Hope someone can help, it's driving me mad now! This is the list page code:
     <?php if(have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>     <?php the_title('
' , '
'); ?>     <?php the_content(); ?>     <?php endwhile; ?>     <?php endif; ?>     <?php $loop = new WP_Query( array( 'post_type' => 'case-study', 'category_name' => 'construction-case', 'posts_per_page' => -1 ) ); ?>     <?php while ( $loop->have_posts('post_type=case-study') ) : $loop->the_post(); ?>     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title(); ?>

     <?php if (has_post_thumbnail() ) { ?>
     <?php the_post_thumbnail(); ?>

     <?php the_excerpt(); ?>     <?php } else { ?>
     <a href="<?php the_field('upload_case_study'); ?>">

     <?php the_excerpt(); ?>     <?php } ?>     <?php if (get_field('upload_case_study')) { ?>
<a href="<?php the_field('upload_case_study'); ?>">Download <?php the_title(); ?>
     <?php } else { ?>
<a href="<?php echo get_post_permalink(); ?>">Read more >
     <?php } ?>
     <?php wp_link_pages('before=
' . __( 'Pages:', 'blankslate' ) . '&after=
') ?>     <?php edit_post_link( __( 'Edit', 'blankslate' ), '
', '
' ) ?>

     <?php comments_template( '', true ); ?>     <?php endwhile; ?>
      And this is the single case study page code:
     <?php query_posts( 'post_type=case-study' ); ?>     <?php the_post(); ?>     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_title(); ?>

     <?php the_content(); ?>
     <?php      if ( has_post_thumbnail() ) {     the_post_thumbnail();     }      ?>     <?php edit_post_link( __( 'Edit', 'blankslate' ), '
', '
' ) ?>

     <?php comments_template( '', true ); ?>
      The actual development site can be viewed here: http://wp.perfect-image.co.uk/construction/construction-case-studies/


title: wpdb update multiple row?

text: I need to change the meta value of all users at once. Seem there are no api for this,except using custom database query. This is my code:               $matches = array('meta_key' => 'user_token');     $data = array('meta_value' => '100');     $wpdb->update( "$wpdb->usermeta", $data, $matches);      The problem is this only update one user meta value, not all users meta value with the meta key of 'user_token'.   Does $wpdb->update limited to update single row only? Or I did something wrong?


title: list child pages as slug

text: I have a section on my site that needs a list of pages that are descendents of a particular ID. I need them listed on the child and grandchildren pages. But the page titles are too long, so I need to use the slugs as the titles. I thought I could just use wp_list_pages and specifically call descendents of this ID BUT there doesn't seem to be a way for wp_list_pages to list the slugs instead of page titles. furthermore, i have to use a str_replace for the dashes in the slugs. can someone tell me where i can even start with this? i ended up using the below, which isn't working any better... any insights?               function is_tree($pid) {           global $post;              $anc = get_post_ancestors( $post->ID );          foreach($newanc as $ancestor)      {         if(is_page() && $ancestor == $pid) {         return true;         }     }     if(is_page()&&(is_page($pid)))      return true; // we're at the page or at a sub page else return false; // we're elsewhere };


title: Return one of user's post from a category in user's profile

text:
I'm working on a site which requires requires users to submit a custom profile of sorts, and then one post in a specific category (all of that is being done through Gravity Forms and their User Registration add on). I then need to display that post with the user's profile which is being displayed at the top of single posts and archives (because that one post is being used in conjunction with a voting plugin...so whenever someone views any post written by that author, they're also viewing that author's profile and entry post, which includes the voting button). First, I've got this on customizing the author box: http://www.billerickson.net/code/customize-author-box/ and this is the entirety of what I need to display with the author profile (here it in pastie, I keep trying to get it all in correctly here: http://pastie.org/5379532 ):                    <?php     $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) :    get_userdata(intval($author));     ?>
           <?php query_posts('category_name=contestants&posts_per_page=1'); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php echo $curauth->user_nicename; ?>
     <?php the_post_thumbnail('medium', array('class' => 'alignleft')); ?>     <?php act_last_connect($author) ?>
     <?php if(function_exists('getvote5')) getvote5('get'); ?>

About Me
     Posted: <?php the_time('M. d, Y'); ?>          <?php the_content(); ?>          <?php endwhile; else: ?>
<?php _e('This contestant has not created his/her entry.'); ?>
     <?php endif; ?>
      But from here, I don't really know how to merge the example from Bill and what I have. Can someone help me understand?


title: Tabs in post of a wordpress?

text: I want to add tabs on a post of my wordpress website. But i am a new user of wordpress and don't know how to do it. Can anybody tell me how to do it. I will be very grateful.


title: WooCommerce Checkout page customization

text: I'd like some help with customizing the functionality of my WooCommerce driven site. The link can be found here: http://seekoften.com/eCommerce/checkout How can I customize the output so that it shows the product images that you have in your cart, but on the checkout page ? Also, as a side note to this question, what files / lines of code might I want to look at if I'd like to add another drop-down to the checkout form. Also, if I'd like to change the wording of "select a state" to be "select a province" ? Thanks in advance for your help, as you guys have always aided me in my web- ventures. Sincerely, Chris Coffin.


title: Best practices - Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)

text: I have built quite a number of wordpress sites and have worked frequently with the HTML5 reset theme. My workflow has been to simply edit the files in the theme because I often use quite a bit of custom CSS, php and custom wp_query loops etc. In the end, the theme is really quite drastically different from the original HTML5 reset theme. However, I am wondering if there is a particular reason I should be creating a child theme instead? I find that I am doing so much customization that to me, I only really use the HTML5 reset for its basic header, footer and html structure overall. I'm not entirely sure how I could really implement a child theme and manage enough customization. Thus my question is – as a best practice, should I still be using a child theme and basically have so many of the same files overriding the parent that it's not even really necessary? To me, I can only see child themes as a way to customize the parent but still keep the majority of the look/function the same. Is this an inaccurate perception? Many thanks in advance!


title: How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms

text: I want to export all Wordpress categories (no posts, just categories) from one blog to another. How can I do that ?


title: Where to place custom functions?

text: Straight to the question: It seems that there are only so many places to place custom code: functions.php, plugin, template, shortcode. Having too many plugins slows down your load times, inflating the functions.php file can get unmanageable, same with a template, and shortcodes really depend on the situation. I have a homepage with a lot of custom code and queries on it: Latest comments, most popular content, most liked content, featured content, custom slider of featured content, newest posts, etc. This makes for a cluttered homepage when I'm trying to make edits to the code. I've used shortcodes for a lot of the queries but I'm still left with a cluttered page. My plugins is maxed out (39 active) and my functions is quite full as well. I am packing a lot of custom code into my site but I'm curious as to what your thoughts on the best way to organize all of your custom functions. How do you choose between placing your code into functions.php vs making it a plugin? Are there ways of extending functions.php so that you don't have to run-up your plugin count and you can better organize your custom functions?


title: How to Pass External Variables to Filters/Actions

text: I find myself needing to pass custom data to a filter provided by a 3rd party plugin. All of the ways I've seen to do this are really complicated and hard to wrap my head around. Take this example:               $score = 42; //Some crazy calculation I don't want to repeat.          function add_score_to_title($title) {         return 'Quiz Results (' . $score . '/') - ' . $title;     }          add_filter( 'aioseop_title_single', 'add_score_to_title');      How can I pass the `$score` variable to `add_score_to_title()`? What I ended up doing was adding my variable onto the global `$wp` object. So you end up with this:               global $wp;     $score = 42; //Some crazy calculation I don't want to repeat.     $wp->some_random_name_for_score = $score;          function add_score_to_title($title) {         global $wp;         $score = $wp->some_random_name_for_score;         return 'Quiz Results (' . $score . '/') - ' . $title;     }          add_filter( 'aioseop_title_single', 'add_score_to_title');      Dirty? Maybe. Simple? Yup! Any downsides to this technique? Please discuss. **UPDATE** Here is the complete code in question -> http://pastebin.com/fkSXY04m


title: Transposh Japanese language transaltion not showing up

text: If you go to this site and click on japanese in the top left corner, it shows the japanese page with this showing up: `<!--[if gt IE 8]><!--> <html class="no-js" lang="ja" dir="ltr"> <!--<![endif]-->` but the actual content remains in English, other non-latin languages like हिन्दी work fine but Japanese doesnt. I have no idea why this is happening. If you need anymore info i'll be happy to provide it. P.S. QTranslate is also enabled on this site, disabling it had no effect. Using WP 3.4.2 and the latest Transposh. **EDIT:** DEBUG SHOWS THIS:               Notice: Undefined variable: cache_wptouch in /home/content/34/8802234/html/sarvatma/wp-content/plugins/wp-super-cache/plugins/wptouch.php on line 109          Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/34/8802234/html/sarvatma/wp-content/plugins/wp-super-cache/plugins/wptouch.php:109) in /home/content/34/8802234/html/sarvatma/wp-content/plugins/transposh-translation-filter-for-wordpress/transposh.php on line 513          Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/34/8802234/html/sarvatma/wp-content/plugins/wp-super-cache/plugins/wptouch.php:109) in /home/content/34/8802234/html/sarvatma/wp-content/plugins/transposh-translation-filter-for-wordpress/transposh.php on line 513          Notice: Undefined variable: google_font_link in /home/content/34/8802234/html/sarvatma/wp-content/themes/sarva/header.php on line 42          Notice: Undefined variable: before_widget in /home/content/34/8802234/html/sarvatma/wp-content/plugins/transposh-translation-filter-for-wordpress/wp/transposh_widget.php on line 266               Notice: Undefined variable: after_widget in /home/content/34/8802234/html/sarvatma/wp-content/plugins/transposh-translation-filter-for-wordpress/wp/transposh_widget.php on line 342


title: Add more widget areas to a theme

text: what's the best approach to add more widget areas to a theme? currently, my theme has 2 columns that display the widgets, but I'd like to extend it to 4 for example. It currently looks like this: ![enter image description here](http://i.stack.imgur.com/GL3io.jpg) And I'd like it to look like this: ![enter image description here](http://i.stack.imgur.com/QgiWM.jpg) All the widgets of this theme are located above the footer. The theme is called Time by s5themes.com. The widget initializer is not located in the functions.php as far as I know. Is this a simple fix at all? thanks! Edit: Now that the sidebar is displaying in the theme, I think the rest of how each sidebar is shown is located in the style.css. Thanks.


title: Auto create pages on WordPress multi site register

text: I'm creating a multi site and would like to have:   1. A few pages that are automatically created with the new site (at the moment only the default home and sample page are created with a new site, anyone know how that is being done?)   2. Even better but maby separate, a way to create pages in a form (on the register form or otherwise) so that means optimally i want 4 pages (with content) made when a site is registered, and then a form asking them for the titles of 2 more pages that get created. answers or ideas for either much appreciated!


title: Exclude Private, Draft pages from Primary Nav when using custom menu

text: I'm looking for ways to prevent "private" and "draft" pages from appearing (to non-logged-in admins) in a site's Primary Navigation menu which is based on a custom menu - other than manually removing such pages from the WP custom menu and then dragging them back when they are published, that is. FWIW, I'm surprised the behavior I'm looking for isn't the default. Using: WP 3.4.2


title: Keep post's draft date after publishing?

text: I let users add posts in draft status. After I check and see that everything is ok, I publish them. I noticed that drafts created two days ago change date after being published. Is there any way of keeping that original date?


title: Add 'title' attribute to stylesheets with wp_enqueue_style()

text: Read below if you want to start from where I left off in core. But the basic question is: I need to add a "title" attribute to my stylesheets and wp_enqueue_style() doesn't allow for that parameter, as far as I can tell. Other than a hard embed, are there any ways WordPress allows us to add the title to a stylesheet? In digging around core I notice that there's a `$title` variable that can be set using `$style->extra['title']`.               $title = isset($this->registered[$handle]->extra['title']) ? "title='" . esc_attr( $this->registered[$handle]->extra['title'] ) . "'" : '';      (class.wp-styles.php) And $title also figures in the filter that is applied when you enqueue a stylesheet. So how can you set that 'extra' array within the style object?


title: Why am i getting this error? WordPress database error: [Query was empty]

text:
I am using Wordpress 3.4.2, latest version! I have no plugins installed except the one that I am writing. So Here's the deal, I'm reading a json feed and i'm trying to import its content into a table that i created in my wordpress database. I've used a similar set of code in another plugin that I wrote and it works fine there. I do not understand why it does not work here. When i run this different plugin that i am writing i am get the dreaded and oh so clear "WordPress database error: [Query was empty]". Here is my code...               // Setup the array     $values = array();          foreach ($bugs as $bug) {      $status_text = $bug['text'];      $tContent = htmlSpecialChars(html_entity_decode($status_text));      $imported = 2;           [ shortened to keep this post short, but other values are listed here. ]                 // for the values insert part       $values[] = '("'.$tContent. '", "'.$imported.'")';     }          if(is_array($values)) {        echo "
WHAT TO IMPORT?
";        var_dump(implode(',', $values));     }      This output all of the values as expected. Everything is wrapped in parentheses and seperate by a comma. Then i do this...               global $wpdb;     $table_name = $wpdb->prefix . "bugtbl_temp";          $sql = $wpdb->prepare (         "INSERT INTO $table_name         (`post_content`, `imported`)         VALUES ". implode(',', $values) . " ON DUPLICATE KEY UPDATE imported = 1"     );     $wpdb->query($sql); // execute query               $wpdb->print_error(); // any errors?     $wpdb->last_query; // show the qry     $wpdb->flush(); // cleanup      And then when i run this function I get the "WordPress database error: [Query was empty]" and nothing is imported into my table. I saw on here one other guy was having problems with $wpdb->prepare. Am I using it incorrectly?


title: Drop down list in user profile page

text: I am having problems finding an answer to this. I need to have a custom user meta field. I can create them which is fine but I need to create a drop down one. For example I want the user meta to be Unit type and the drop down values to be Residential and Commercial Any help on this would be great. Thanks.


title: Is there a PressThis that doesn't hotlink?

text: What are some plugins or alternatives to the PressThis function? I want to use the PressThis bookmarklet to quickly blog about what I see online, but every time I do and include an image, it hotlinks to the image from the site I'm blogging about. That's bad, because I don't want to tax the site I'm writing about. I don't want to use a full-sized image. And I don't want the image to be broken on my site if the site I'm writing about to goes down.


title: Image Upload from URL

text: I really like the way SE uploads an image from a URL (I'm sure many do!). I've been searching, but can't find, **is there a plugin or a method similar to this available for WordPress?** I know an image can be uploaded and crunched directly from a URL by entering the image URL into the File Name box after you click Upload/Insert Media >> From Computer >> Choose File ![enter image description here](http://i.stack.imgur.com/RHQWJ.png) This is a great feature, but not very widely known (I actually just discovered it). I would like something a little more like SE, where there is an option that let the user know to add the image URL. How can I go about adding simply the upload file field to a new tab in the media uploader? Here is a tutorial for How to add a new tab in Media Upload page in wordpress, but I want to add only some text and the file upload field to that tab. Any ideas? I couldn't find anything in the WordPress Codex that deals with this feature or the file upload field directly. Thanks.


title: Function to get thumbnail img source

text:
I have this function call that displays an entire img tag with the correct url for that post.. the thumbnail img...               ?php the_post_thumbnail('blog-page'); ?>      What I need is just the source address for that img. How can I get that source dynamically? * * * Here is a little more explanation of what it is exaclty that I'm doing... This is the code that displays the thumbnail for a page in my wordpress:
     <a rel="lightbox" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('blog-page'); ?>
       I need that a tag's href to use the img's source instead of linking to the blog post it's self to get lightbox to work properly.


title: Woocommerce Cart Going toAdmin Login Page

text: When I try and add/remove something from the cart, it sends me to the admin login page. However, when I go back to the shop page, it shows that the item has been added to the cart. I can't get past this to see my cart and continue to buy the product(s). What can I do to fix this problem?


title: Wordpress show bad the php hour and date

text: For my surprise today i see wordpress put bad the hour In settings i have the hour of my country , France and City Paris And today i try for create one function the php date function for show the date               <?php     echo date("dmY");     ?>      For my surprise as i tell until , see wordpress change my php time and put day 19 and change the hour and no show the real time actually If the same code insert in other site - no use wordpress - and the date show right , day 20 How it´s possible wordpress change native function of php and show when runnning this thedate of php , by other side in settings of wordpress i se utc different hour to local time , utc show 19 and local time show 20 I don´t understan all this ..... Thank´s for the help


title: Total number of authors with more than one post

text: <?php      $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");     echo '(', count( get_users( array( 'role' => 'author' ) ) ); echo ')'      ?>      code by Jan Beck I need to know what is my best option for displaying the total number of authors who have at least posted and/or published something on my blog. Currently the code is counting all the authors even if they haven't posted anything. Please let me know if there is a simple solution to this. I have looked throughout the wordpress codex and have not found a solution to this yet.


title: Variable Not Working Inside is_author() Array

text: I'm using a plugin (User Groups) to separate out users into, well, groups, and I need to figure out a way to create a conditional to check if an author is in a certain group. So, using get_term_by and get_objects_in_term, I was able to build a string of author IDs. See below:               $taxonomy = 'user-group';     $taxonomy_group_name = 'author-group';     $taxonomy_group_id = get_term_by('slug' , $taxonomy_group_name, $taxonomy, 'OBJECT');     $taxonomy_group_ids = get_objects_in_term($taxonomy_group_id->term_id, $taxonomy);     $taxonomy_id_list = implode(',', $taxonomy_group_ids);      So, I can take the list stored in $taxonomy_id_list and echo it out and get a string that looks like the below:               1,2,3,4,5,6,7      For the conditional, I should then be able to say:               if(is_author(array($taxonomy_id_list))) { }      But that doesn't work. If I paste the raw list into the array, it works as it should, but if I try to use the variable inside the array, the conditional does not work. What am I missing? Why wouldn't that variable work?


title: Can plugin2 uninstall plugin1 at the very beginning of plugin2's installation?

text: As per the title. I have a new version of a plugin. It installs fine on a clean WordPress. When a user tries to install it when they have a previous version installed, the plugin does not function. It does not matter if the previous version was active or not. Ideally, I would like to ensure that the new version uninstalls the previous version before writing any files itself. Is this possible? Alternatively, if anybody has any idea why we are encountering this issue, I would not be opposed to just fixing it. :)


title: Mass Mail Plugin to Email Specified User Roles

text: I'm not looking to spam anyone, but I am looking for a mass mail plugin so I can select the User Roles (whether core or custom) by check box or comma separated entries of the roles, then type my message and send. The reason: I have a multi-author website with active contributors, authors and editors. I am looking for a simple way to email these groups. I don't care if it is a free or premium plugin. # UPDATE I tried the solution provided below, Emu2 - Email Users 2, but after using it for a few days, I found there is a conflict with the WordPress media uploader, causing http errors on upload with the new WordPress uploader and timeouts using the classic WordPress uploader.


title: Time Issue xx hours ago

text: I'm facing a strange issue, first time in my life :) After publishing a post/page/custom post type, it's tell that published 10 hours ago. It's happening always, for all posts. As I've deployed a VPS for hosting my websit


title: What should I write in hostname when I try to install a theme?

text: I am a beginner with WordPress and I have no idea what hostname I should specify when I try to install a theme. Thank you for a help! ![enter image description here](http://i.stack.imgur.com/WG9Ph.png)


title: Custom Search results page based on search

text: I am trying to find a way to create custom search results pages based on what the user searched for. I don't think it's possible with a global search since multiple posts may be pulled in but I wanted to narrow it down some and have the user do the following: Visitor choose a category drop down then when they enter in the search terms in the text filed it pulls in a custom search results page based on category 5. I have something like this already so when a user views a post or tags related to food it automatically pulls in a custom page. The code I use starts off like this:               <?php     $post = $wp_query->post;     if ( in_category( array('restaurants')) ) {include_once( $theme_path . 'single-restaurants.php' );}      How would I do something close to this but by telling search.php to redirect to search-restaurants.php if category 5 is selected?


title: wp_head() not including styles and javascripts after a template redirect

text:
I am using the template_redirect action to redirect a user to a custom template which has no header, sidebar or footer (the intent is for it to be in an iframe as a dialog box). After I done the redirect though, I could not seem to get all the enqueued JS and CSS to list. Here's the code:                   <?php         /**          * This theme file is accessed by template redirect          * No header, sidebar or footer          */              ?>         <!DOCTYPE html>                  <title>Customize Product</title>              <?php wp_head()?>

                          <?php                     /**                      * Output the content of the template                       */                     do_action('product_customize_display_customization_content');                     ?>

                    Edit: Here's how I am including the JS               // bootstrap code, will refactor later as necessary     if (is_admin())     {         global $admin_class;         $admin_class = new product_customize_admin();         $admin_class->init_admin_actions();         $admin_class->init_ajax_actions();              add_action('admin_menu', 'init_admin_menu');         add_action('admin_print_scripts', 'my_admin_scripts');         add_action('admin_print_styles', 'my_admin_styles');               }     else     {         add_action('wp_head', 'include_frontend_scripts');                   // setup frontend         global $frontend_class;         $frontend_class = new product_customize();               }          function include_frontend_scripts()     {                      // preset scripts         wp_register_script('product-customize-preset', plugin_dir_url(__FILE__).'js/preset.js');         wp_enqueue_script('product-customize-preset');     }      Here's the code for the template redirect               function theme_redirect()     {         global $wp;         $plugin_dir = dirname(__FILE__);              //echo '
'.print_r($_GET, true).'
';              // if we are doing product customization         if ($_GET['prod_cust_do_customize'] == 1)         {             $return_template = $plugin_dir.'/themefiles/customize_preset_page.php';             echo "template = $return_template";             $this->do_theme_redirect($return_template);              }          }          function do_theme_redirect($url)     {         include ($url);         exit();     }


title: Problems with cron

text: I have a this code that delete some post meta at al 7:55 hour of the server:               if ( !wp_next_scheduled('borra_meta_datos') ) {        wp_schedule_event( mktime(7, 55, 0, date('n'), date('j')), 'daily', 'borra_meta_datos' );     }          function borra_todos_los_meta_datos() {        $args = array(        'meta_key' => 'destacados',        'post_status' => 'publish',        'numberposts' => -1,        'category' => -14     );     $allposts = get_posts($args);          foreach( $allposts as $postinfo) {        delete_post_meta($postinfo->ID, 'destacados');     }          $args = array(        'meta_key' => 'portada',        'post_status' => 'publish',        'numberposts' => -1     );     $allposts = get_posts($args);          foreach( $allposts as $postinfo) {        delete_post_meta($postinfo->ID, 'portada');     }          $args = array(         'meta_key' => 'slider',         'post_status' => 'publish',         'numberposts' => -1     );     $allposts = get_posts($args);          foreach( $allposts as $postinfo) {        delete_post_meta($postinfo->ID, 'slider');     }     }     add_action('borra_meta_datos', 'borra_todos_los_meta_datos');      All the week the code works fine, but today the code executed early that the hour, i dont know if i am doing something wrong. Additionally i have another code that program all the post of specific user at 3 am of the local hour but today all the posts appear like lost schedule.               function programa_post($data, $postarr){         $hora_de_publicacion = 3;         if( $data['post_type'] == 'page' ){             return $data;         }         global $current_user;         get_currentuserinfo();         if($current_user->user_login == 'luis' or $current_user->user_login == 'jorge'){             $hora_actual = date('H', current_time('timestamp', 0));             //Forget this if :S             if($hora_actual >= 3 && $hora_actual <= 23){                 $time_3am = mktime($hora_de_publicacion, 0, 0, date('n'), date('j'));                 $data['post_date'] = date('Y-m-d H:i:s', $time_3am);                 $data['post_date_gmt'] = date('Y-m-d H:i:s', $time_3am - ( get_option( 'gmt_offset' ) * 3600 ));             }elseif($hora_actual >= 0 && $hora_actual < 3){                 $time_3am = mktime($hora_de_publicacion, 0, 0, date('n'), date('j'));                 $data['post_date'] = date('Y-m-d H:i:s', $time_3am);                 $data['post_date_gmt'] = date('Y-m-d H:i:s', $time_3am  - ( get_option( 'gmt_offset' ) * 3600));             }         }              if(trim($data['post_excerpt']) == ""){             $data['post_excerpt'] = ' ';             return $data;         }else{             return $data;         }              return $data;     }     add_filter('wp_insert_post_data', 'programa_post');      i dont know if is problem of code or error of cron, i am lost :(


title: customize continue reading

text: This is the code of continue reading in function.php               <?php the_content( __( 'Continue reading →', 'twentyten' ) ); ?>      It has a class which named **meta-nav** I tried to find the class and change it but I couldn't find that. Where is that? Thanks in advance


title: Stop wordpress from "correcting" my code?

text: I'm starting to lose my patience with Wordpress. I've downloaded a raw html plugin that should stop wordpress from converting some characters to their entities, I won't use the visual editor but still, every once and a while, it messes up my code. It converts `<` and `>` to `<` and `>` from some parts of the code and leaves me wondering where the problem is. I'm using 3.4.2, and I'm wondering if there's a way to **COMPLETELY** stop wordpress from editing my stuff. I mean no automatic paragraphs, no character converting, etc.


title: Change Featured Image direcly in the Page

text:
In Doing an Image Gallery with Fancybox( lightbox ) using a wordpress loop, take a look at the code inside the loop:

             <a rel="gallery_fancybox" href="<?php echo $image_attributes_large[0]; ?>" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>">                 <img style="width:187px; height:124px;" alt="" title="<?php echo get_post_meta( $attachment->ID, $key, true ); ?>" src="<?php echo $image_attributes[0]; ?>" />                 <?php the_time("Y"); ?>                 <?php the_time("j"); ?> de <?php the_time("F"); ?>                 Access

      There is in Another page an Image that the source is the Featured Image of this Gallery, and all of this is working without problems. However I want to do a fast change of that Featured Image, so, inside each image box loop add a button that just the admin will see ( with `<?php global $user_ID; if( $user_ID ) : ?> <?php if( current_user_can('level_10') ) : ?>` )that when it is clicked, the Featured Image of this Gallery change to the image that is inside that div. Is it Possible? Thanks a lot in Advance. Sorry for the bad English, and sorry for the weird Question.


title: wordpress paginate_links url

text: my code looks like this:               paginate_links(        array(        'next_text' => __('>'),         'prev_text' => __('<'),         'base' => @add_query_arg('page', '%#%'),         'format' => '?page=%#%&a='.$a,         'total' => ceil($count/$per_page),         'current' => $page)     )      Everything works perfectly but if I click on for example second page my url goes to `www.domain.com/something/2/?a=5` instead of `www.domain.com/something/?page=2&a=5` Is it possible to change it into `www.domain.com/something/?page=2&a=5`?


title: image path error in wordpress multisite

text: I have a WordPress multisite and I can upload and display images in the main site, but not in the others. When I upload an image, it doesn't show any error, but the image doesn`t display, like when a path is wrong. If I use it in a post, the same occurs. The image display with wrong path. This is the path: `http://www.codetocode- developments.com/personal/files/2014/01/scottwills_building11-450x250.jpg`


title: Get term slug of current post

text:
I am working on a single post type template where I show a navigation menu with links to all the posts from the same term. Now I want to use this template for all the different terms so $term_slug needs to hold the term slug of the current post so they can correspond to the other posts. I have found many times over the internet this code to do the job but it doesn't work for me:               $terms = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );     $term_slug = $term->slug;      This article says that this would do the job: http://www.wpbeginner.com/wp- themes/how-to-show-the-current-taxonomy-title-url-and-more-in-wordpress/ What am I doing wrong?               $args = array(         'post_type'     => 'myposttype',         'mytaxonomy'    => $term_slug,         'order'         => 'ASC'     );                        $current_id = get_the_ID();     $the_query = new WP_Query( $args );     if($the_query->have_posts() ) {         while ($the_query->have_posts()) { $the_query->the_post();                  echo '
ID ? ' class="current"' : '') . ' href=" ' . get_permalink() . ' ">' . get_the_title() . '
';               }      }


title: How to correctly escape query variables to be used in WP_Query

text: I've got custom query variables that are added via `query_vars`. For example, 'industry'. In `pre_get_posts` action I construct and add taxonomy query if there is a value for the 'industry' parameter, like so:               add_action( 'pre_get_posts', 'alter_posts');     function alter_posts( $q ) {         $tax_query = array();              // industry taxonomy         if ( get_query_var( 'industry' ) ) {             $tax_query[] = array(                 'taxonomy' => $my_taxonomy,                 'field' => 'slug',                  'terms' => get_query_var( 'industry' )             );         }              // set all previously determined values to the query         $q->set( "tax_query", $tax_query );     }      How do I correctly escape query variable that I get via `get_query_var( 'industry' )`? Do I use esc_sql function, like so `esc_sql( get_query_var( 'industry' ) )` ? What's the correct way to handle the escaping of query variables? Many thanks, Dasha


title: wp_enqueue_script vs. wp_register_script

text: Trying to do the right thing here, and tying myself in a knot! So, in my header.php before `wp_admin`, I have:               wp_enqueue_script('commonfunctions', child_template_directory . '/script/commonfunctions.js', array('jquery', 'jquery-ui-draggable'), '1.0', true);      which works. Basically, I have a custom js file which needs jquery and jqueryui as dependencies. I since took 'jquery' out as it seems to be loaded twice irrespectively. I also had a function hooked into 'init' in functions.php, but that didn't seem to have any advantage? I want to include the validate script from CDN as this will also be a dependency of my custom script. I thought I would register the script like so:               wp_register_script('validate', 'http://ajax.microsoft.com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js', true);      and then add 'validate' to the dependencies array in enqueue, like so:               wp_enqueue_script('commonfunctions', child_template_directory . '/script/commonfunctions.js', array('jquery', 'jquery-ui-draggable', 'validate'), '1.0', true);      in that order, as jquery is also a dependency of validate. Phew! That doesn't work, I'm obviously misunderstanding something - please help me uncurl what I'm trying to do here...


title: Oauth user Authorisation

text: I work with Oauth 1. I want when the user enters the admin page of my plugin, it is redirected to the site should perform authorization and come back on my page but it does not work `get_user_authorization();` do not work.                 session_unset();            $OAUTH->set_site("http://www.site.com/fr/", $key, $secret);       $OAUTH->set_callback($callback_url);            $OAUTH->get_request_token()           ->get_user_authorization();


title: How can I edit pages from my local environment?

text: Is there any to edit and/or create wordpress pages from my local environment? Or shall I use the wordpress editor no matter what?


title: do_shortcode() within Admin Page

text: I'm using a few plugins that have shortcodes ... however, instead of creating a public page for the content, I've created some new pages within the admin using `add_menu_page` and I need to know how to utilize `do_shortcode()` within this context. As it stands, all the function does it spit out the string. I'm assuming it's because the shortcode API isn't available within an admin page. How do I get around this? There is no documentation that I can find that explains how to utilize shortcodes within the WP Admin... or if it's even possible. * * * Specifically I'm trying to utilize WooCommerce shortcodes within the WP Admin. I hate the fact that plugins don't utilize the WP Backend for account/user management.


title: Trying to load content of a post via AJAX

text: OK I'm trying to load content of a post via AJAX. So here is the functions.php part                   wp_localize_script('ajax-script', 'ajax_object', array('url' => $blogurl,'path' => $path,'ajaxurl' => admin_url( 'admin-ajax.php' )));         add_action('wp_enqueue_scripts', 'javascripts');         add_action('wp_ajax_ajax_action', 'ajaxify'); // ajax for logged in users         add_action('wp_ajax_nopriv_ajax_action', 'ajaxify'); // ajax for not logged in users         function ajaxify() {             $post_id = $_POST['post_id'];             $post_data = get_post($post_id);             setup_postdata( $post );             echo json_encode($post_data);         }      and here is the jQuery part               $("a.ajaxed").click(function(event) {         event.preventDefault();         doAjaxRequest();     });     function doAjaxRequest(){         jQuery.ajax({             type: 'POST',             url: ajax_object.ajaxurl,             data: ({action : 'ajaxify',                 post_id: $(this).attr('id')                 }),             dataType: 'JSON',             success:function(data){                 console.log(data.post_title);             }         });     }      But when I look at the console it outputs 0, I don't see the content. What am I missing?


title: populate select options from extra mysql table data

text: hi guys i am trying to populate a select element with options from the data in one of my sql tables heres what i have so far:                <?     $SQL = "SELECT * FROM pt_country ORDER BY name";         $rs = $wpdb->query($SQL);         $nr = mysql_num_rows($rs);             for ($i=0; $i<$nr; $i++) {             $r = mysql_fetch_array($rs);             echo "<OPTION VALUE=\"".$r["countrycode"]."\">".$r["country"]."</OPTION>";            }     ?>      im guessing quite a bit of this is wrong but to start with i cant get wordpress to return the data i just get false what am i missing here ?


title: How do I fix my static page

text: I have tried a few option with static pages. First i created a template called homepage.php and had it designed a certain way, and also on that template were the post. Then i created another template called news.php and this is the regular blog set up with the news post and navigation. When i set the front page to the homepage template the post didn't show up. Next i created home.php and then created a page called News and everything in the index.php template i pllaced in the news.php, for the News page i selected the news.php template but nothing showed up


title: Remove specific shortcode from get_the_content()

text: I have a variable like this:               $post_content = get_the_content();      Here i want to remove some specific shortcode from the $post_content variable e.g i want to remove only this `[video height="300" width="300" mp4="localhost.com/video.mp4"]` all other shortcodes and content formatting should be leaved intact. How could this be done? **UPDATE:** I'm able to remove some specific shortcode by using code something like this ...               <?php echo do_shortcode( str_replace('[video height="300" width="300" mp4="localhost.com/video.mp4"]', '', get_the_content()) ); ?>      But it is also removing all html tags/formatting of get_the_content(). How to avoid it?


title: How does admin-ajax.php work?

text: we are having some issues with an external developer. i am not a wp person so i turn to the masses to help out. we want to limit access to the wp-admin site to internal access only (via vpn). simply so it will not be attacked by external people. we can enumerate the admins from the site and do not want them to be phished. the developer is saying we cant do that because the site needs to have the admin page accessible externally so the page will function. specifically the admin-ajax page. what does the admin-ajax.php page do? it is located in the admin section of wp.. is it accessed unauthenticated by end users? is it an unsafe practice to have this available to external users?


title: Handling complex multi-level architecture / menu for large site

text: I am trying to get feedback and ideas for solving an information architecture / content management problem using wordpress. I have a large site ( 1,000+ pages, hundreds of posts ) made up of sections. Each section needs its own secondary navigation menu that contains both pages and custom links. This is easily done, but not necessarily easy to manage ( for non-programmers ). Imagine this structure: Parent 1   * Page 1a   * Page 1b   * Page 1c   * Custom Link 1d  Parent 2   * Page 2a   * Page 2b   * Parent 3      * Page 3a     * Page 3b     * Custom Link 3c    * Page 2d   * Custom Link 2e  Here are the solutions I have come up with ( and noted problems ):   1. Create menus using the normal WP 3 + navigation system. Associate each parent page with a menu ( through a custom meta tag / taxonomy / slug / other ), then on each page grab it's parent ( if it does not have children itself ) and display the correct menu     * Problems? Plenty! Since this is a large site, it will contain many menus making maintenance confusing.      * Adding pages becomes a hassle - add the page, declare the correct parent page, then add the page again to the correct menu ( could be simplified by attaching this last piece programmatically to the save_page hook ).      * What if a user adds a page and declares a parent page that does not have a menu associated with it?      * Keeping track of the parent page - menu association will be tedious and not intuitive   2. Use multisite - each site gets its own menu that is shown on all of the pages contained within.      * Many issues with multisite ( plugins, server resources, etc )     * This is really only one large site, not a network of different but interconnected sites   3. Forgo the WP 3+ navigation system, instead create pages for ALL menu items ( including custom links ) and use a plugin / forwarding / redirect to change certain dummy pages into custom links. Use wp_list_pages to programmatically create menus based on page parent relationship      * There will be a lot of actual pages already, adding fluff ( pages which just redirect ) to the pages list is probably not a good idea     * Use custom post types for each section of the site, with a menu for each custom post type     * How do we replicate the nesting shown above ( Parent 3 nested in Parent 2 )?     * Many of the same issues as #1 above I hope my explanation of the problem and possible solutions are clear - if not, please ask away. Otherwise, any feedback or ideas as to how to accomplish this are very welcome.


title: How to add an "or" instead of and "and" (&) in a Wordpress query?

text:
I would like to accomplish something like this:                       <?php $custom_posts = new WP_Query(); ?>             <?php $custom_posts->query('category_name=Business OR category_name=Technology OR category_name= Lifestyle'); ?>             <?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
                     <?php the_content(); ?>
             <?php endwhile; ?>      So that if the post belongs to only one of those categories it should be listed in that loop. Any suggestions?


title: PHP logging framework to be used with WordPress

text: There are different PHP logging frameworks out there e.g. Log4php, KLogger. I want to choose one based on its experience with WordPress. Please suggest me one.


title: get_the_author_meta not working

text: So I have this website that I am building and I am using get_the_author_meta to display various information about the user / author including user image. I added a function in my functions.php which allows to add more options to the author profile such as: facebook profile, twitter, image etc etc.. this is the basic function which display the value in the theme files:               <?php echo esc_attr( get_the_author_meta( 'slider_pic', $user->ID ) ); ?>      Now - it works fine throughout the whole site and all templates: single.php, page.php etc etc but in my homepage (in my case index.php) there is a problem: I included a slider which contains the images of the authors + link to their respective profile pages and beneath that slider I am showing the 9 latest blog posts of the site and next to the name of the author should be the image using the code above. for some reason the slider preventing the images to display in the 9 boxes. when I use this code:               <?php echo esc_attr( get_the_author_meta( 'slider_pic', $user->ID ) ); ?>      in the slider it works fine but beneath that in the another loop the image dont appear at all. when I remove the include that calls the slider the images in the 9 boxes show.... This is the code Im using for the slider: https://dl.dropbox.com/u/4405634/slider.php and this is the code I am using for the homepage which include the slider in it: https://dl.dropbox.com/u/4405634/index.php I am assuming it is either a conflict or something that has to do with loops or whatever would love to have a solution Thanks, Gil


title: How to get media objects

text: I am busy with a loop to return all media in the medialibrary in objects. I figured out how to get the images ( with `wp_get_attachment_image('$mediaID')` where the $mediaID is the id of the image ) But I want to loop all media, not just the images, is there a function that I can use for video's and audio that is also from the medialibrary. I tried `get_attached_media` but this will only work if the media is actually attached and I want to loop all media. Is there a way to do this and to get it as objects? Thanks in advance. P.S. The code I am using is:                           <?php                 $query_images_args = array(                     'post_type' => 'attachment', 'post_mime_type' =>'', 'post_status' => 'inherit', 'posts_per_page' => -1,                 );                      $query_images = new WP_Query( $query_images_args );                      foreach ( $query_images->posts as $media) {                     //save the url in a variable to test with                     $media_url = wp_get_attachment_url( $media->ID );                          $mediaID = $media->ID;                     echo wp_get_attachment_image( $mediaID );                 }                ?>      P.P.S. I do this because I want to show the media in some sort of library on the front end. Later there will be categories like 'video', 'audio' and 'img'


title: Twenty Eleven home page show only excerpt

text:
I am using the brand new twenty eleven theme, my home page is set to show latest posts, but it displays the entire posts, I want to only show the excerpts, not the entire content, Here is the index.php code
                      <?php if ( have_posts() ) : ?>                          <?php twentyeleven_content_nav( 'nav-above' ); ?>                          <?php /* Start the Loop */ ?>                     <?php while ( have_posts() ) : the_post(); ?>                              <?php get_template_part( 'content', get_post_format() ); ?>                          <?php endwhile; ?>                          <?php twentyeleven_content_nav( 'nav-below' ); ?>                      <?php else : ?>

<?php _e( 'Nothing Found', 'twentyeleven' ); ?>

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?>
                             <?php get_search_form(); ?>

                      <?php endif; ?>


title: Creating custom AJAX requests

text: My question pertains to where I should create an ajax function that I'd like to call from my page view. I am using a jQuery validator on a custom form that should check the inputted zipcode against my database of valid zipcodes. I just need to know where this function should exist. Normally when using a non wordpress site I'd create a PHP file with my ajax functions and call them by referencing the URL to this page and passing some parameters. How can I achieve this with wordpress? Where can i explicitly call a php file and pass it arguments? Note: I'd like to call the ajax function like so:               $.post('http://mysite.com/ajax-functions.php?fxn=zipcodes',         {zipCode:00000},         function(response){           // do stuff         });      Thanks


title: Latest 5 post excerpts from 5 different authors in Sidebar

text:
I'm attempting to display the latest 5 post excerpts from 5 different authors in my blog sidebar. Below is the code I'm using which I tweaked from this thread: Find most recent authors So far, I've gotten it to work however rather than display each individual author's most recent post, it's showing the author's earliest post. Any ideas on what I'm doing wrong? I've been struggling w/ this for a few days so appreciate any direction you can give. I'm a newbie to PHP but can understand enough to tweak code. Thanks!! You can see it working on my site: wearestd.com               <?php     global $wpdb;          $post_IDs = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY post_author ORDER BY post_date DESC LIMIT 5" );          $my_query = new WP_Query( array( 'post__in' => $post_IDs) );          if( $my_query->have_posts() ) {       while ($my_query->have_posts()) : $my_query->the_post(); ?>     <?php userphoto_the_author_thumbnail() ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>

     <?php the_advanced_excerpt('length=50'); ?>     <?     endwhile;     }     ?>


title: How to remove plugin-specific custom taxonomy terms when plugin is uninstalled?

text: I'm trying to write a class that would allow for easy removal of all plugin- related data when the plugin is uninstalled. Specifically, I want it to remove plugin options, custom post type entries, and custom taxonomies and their terms. What I have written mostly works, but the get_terms function returns an 'invalid_taxonomy' error. Looking into it further, I found that the global $wp_taxonomies does not recognize the custom taxonomies created by the plugin during the uninstall.php process. So my question is: How does one remove custom taxonomy terms when a plugin is uninstalled? Here is my code: http://pastebin.com/geH1wzRC Bonus points if you can tell me how to avoid loading this class twice if two plugins contain it. I tried just wrapping the class in `if( !class_exists( 'WP_Plugin_Janitor' ) ) { ... }` but then the class never loaded. **EDIT** I was able to prevent the class from loading more than once by putting the class in a separate file and wrapping the `include_once` statement in the `if( !class_exists(` statement. Thanks in advance!


title: How to activate flash cards

text: I have been blogging at wordpress for the past 6 months and very recently i came to know about the flash cards. Can anyone let me know as to how to activate flash cards in wordpress. I tried going to the "extras" option but then i can't see anything regarding flash cards over there.


title: Problem the_permalink

text:
Morning everyone, I'm sorry to disturb, but I need help if possible. The code below I need to publish part of the contents of some pages. Firstly I have a problem with "the_permalink" despite write the correct address, this is where he wants (see image). Puts for example before H2 and however outside the tag A. ![problem the_permalink](http://i.stack.imgur.com/oFjkM.jpg) Secondly I would like to filter out and ONLY a few pages with specific ID but have not been able to find a solution. I tried to put it but it does not work.               new WP_Query( 'post_type=page&include=30,60' );      Code that I used                   <?php     // Lista Pagine con the_excerpt e the_post_thumbnail          // Query Pages        $my_query = new WP_Query( 'post_type=page' );          // The Loop        while ( $my_query->have_posts() ) :        $my_query->the_post();        echo '
' . get_the_title() . '

' . get_the_excerpt() . '

' . get_the_post_thumbnail() . '
           ' . get_the_title() . '';        endwhile;             wp_reset_query();     ?>      Thanks in advance.