title: $wpdb->wp_users returning empty value for

text: I have a code Example:               function custom_func(){         global $wpdb;         $wpdb->flush();     //tried with and without this line         $getTest = 'SELECT * FROM $wpdb->wp_users LIMIT 1';         $arrayReturned = $wpdb->get_results($wpdb->prepare($getTest));     }      From what I've read I thought that $wpdb->wp_users is meant to have returned the database name and table name like so dbName.tableName; but it just returns an empty value. I've tried:               $getTest = 'SELECT * FROM $wpdb->wp_users LIMIT 1';      which shows as the following to wordpress:               SELECT * FROM $wpdb->wp_users LIMIT 1      and               $getTest = 'SELECT * FROM '.$wpdb->wp_users.' LIMIT 1';      which shows as the following to wordpress:               SELECT * FROM  LIMIT 1      I can't fathom why this isn't working since this is all based on literature from the wordpress codex, any thoughts?


title: When an unregistered user submits a form for a custom post type, send an email that lets them delete their post

text: I want visitors to submit a form (created with CRED, but could use Gravity Forms or Formidable Pro if that helps) that submits a custom post type that's immediately published. I know how to do this. When the post is published, I want the unregistered visitor who submitted the form to receive an email with a link (I'm assuming with some kind of md5 code) that will allow them to delete the post they created. Just like how Craigslist sends unregistered users a link to edit/delete their post. But I just need it to delete the post. I've read through this thread (When a user creates a post (pending), send a confirmation link that allows them to publish) and see it going the other way, I'm just not sure how to adapt it to delete.


title: Sort Reviews/Ratings by date on Woocommerce

text: I would like to change the order the reviews are being displayed on the single product page, currently it's in Ascending order and we need it in Descending order.(Most recent to oldest) I've looked at the review.php file but it appear to not have a sort order. If you could point me in the right direction or give me an alternative solution i'd greatly appreciate it. Thanks.


title: Display All Products by Category with WooCommerce

text:
With WooCommerce, I want to display all the categories in a store as headings, with all of their products listed below in an unordered list. Is this possible to do? I've seen a few things that'll let me display a list of categories or a list of products for a specific category, but nothing that'll loop through everything the way I described. Here's what I'm currently using to list all categories:               <?php     $args = array(         'number'     => $number,         'orderby'    => $orderby,         'order'      => $order,         'hide_empty' => $hide_empty,         'include'    => $ids     );     $product_categories = get_terms( 'product_cat', $args );     $count = count($product_categories);     if ( $count > 0 ){         foreach ( $product_categories as $product_category ) {             echo '
' . $product_category->name . '
';         }     }     ?>


title: Custom Post Type Alerts

text: I setup a custom post type and everything works right. The user can submit for review and I see it's pending in the admin area. How can I have WordPress send me an Email Notification whenever a user submits a post?               add_action( 'init', 'artwork_feature');     function artwork_feature() {     register_post_type( 'artwork',         array(             'labels' => array(                 'name' => __( 'Artwork' ),                 'singular_name' => __( 'Artwork' )             ),         'public' => true,         'exclude_from_search'       => false,         'capability_type' => 'artwork',         'supports' => array('custom-fields', 'comments'),             'capabilities' => array(                 'publish_posts' => 'publish_artworks',                 'edit_posts' => 'edit_artworks',                 'edit_others_posts' => 'edit_others_artwork',                 'delete_posts' => 'delete_artworks',                 'delete_others_posts' => 'delete_others_artwork',                 'read_private_posts' => 'read_private_artwork',                 'edit_post' => 'edit_artwork',                 'delete_post' => 'delete_artwork',                 'read_post' => 'read_artwork',             ),         'map_meta_cap' => true,         'has_archive' => true,         'supports' => array('title', 'editor', 'thumbnail')              )     );     }


title: Using ACF to Link Images to Colour

text: I'm working on a website, where clicking a colour swatch will change the colour of the image displayed. Essentially I need to upload a series of images with a colour attached to each image. I figured I'd use the Image/Gallery field for my images and the Color Picker field to achieve something like this – would this work? Does anyone have any suggestions how best to go about something like this?


title: How do I return an image from a script

text: I have googled but must not be using the correct terms. I am trying to add a script to my WordPress plugin that takes a url and returns a reformatted image. I know this is frowned upon as hotlinking. The image in my case is supplied by a website imaging service. The image takes from 3 to 5 seconds to be generated. I have a java script that sets my preview image src tag once the website url is entered (onblur). I need a way to download the full sized image from the service and resize it as a thumbnail (I was resizing it in the browser but it looks horible). I tried accessing wordpress's `download_url()` function from my script but I get lots of unresolved references. I am sure I am doing something wrong. My existing code:               <?php     require_once('../../../wp-admin/includes/file.php');     $im = download_url('http://www.linux.org/images/logo/linuxorg.gif');      header('content-type: image/gif');      // resize and send image data here...      I get back the following error:               Fatal error: Call to undefined function __() in /homepages/5/d367772185/htdocs/rodandfly/wp-admin/includes/file.php on line 13


title: Determine category in taxonomy of current custom post type

text: Using a php statement - how can I determine the name of the category in a taxonomy of the current custom post type that a user is browsing?


title: Listing all custom post types using a specific term on the said term's template page, in groups

text:
I have a custom tag-like taxonomy called PEOPLE registered to all post types - both the default and custom ones. I have created a template for a single term named taxonomy-people.php and I'm intending to use it to describe a specific term and query each post type for instances of that term. I have almost managed to do that, there's a single issue left: I don't know how to get WP_Query to show only results for the current term WITHOUT having to make a specific template for each of the terms, as I will end up having a three-digit number of terms under PEOPLE. Here's the code that works if I specify a term. What should I replace **'people' => 'dave-lee'** with in order to use the same template for each of the terms under PEOPLE?               <?php get_header(); ?>

     <?php $termDescription = term_description( '', get_query_var( 'taxonomy' ) ); if($termDescription != '') : ?> <?php echo $termDescription; ?> <?php endif; ?>

News mentioning <?php $term =   $wp_query->queried_object; echo ''.$term->name.'';?>

     <?php $loop = new WP_Query( array( 'post_type' => 'post', 'people' => 'dave-lee', 'posts_per_page' => 20 ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php _e('Published on','jf'); ?> <?php the_time(get_option('date_format')); ?>
     <?php endwhile; ?>
          <?php wp_reset_query(); ?>
Releases <?php $term =  $wp_query->queried_object; echo ''.$term->name.'';?> contributed to:

     <?php $loop = new WP_Query( array( 'post_type' => 'release', 'people' => 'dave-lee', 'posts_per_page' => 20 ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php _e('Published on','jf'); ?> <?php the_time(get_option('date_format')); ?>
     <?php endwhile;?>
           <?php wp_reset_query(); ?>
Songs featuring <?php $term =  $wp_query->queried_object; echo ''.$term->name.'';?>:

     <?php $loop = new WP_Query( array( 'post_type' => 'song', 'people' => 'dave-lee', 'posts_per_page' => 20 ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php _e('Published on','jf'); ?> <?php the_time(get_option('date_format')); ?>
     <?php endwhile;?>
          <?php wp_reset_query(); ?>
Articles, reviews and other pages mentioning <?php $term =  $wp_query->queried_object; echo ''.$term->name.'';?>:

     <?php $loop = new WP_Query( array( 'post_type' => 'page', 'people' => 'dave-lee',     'posts_per_page' => 20 ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php _e('Published on','jf'); ?> <?php the_time(get_option('date_format')); ?>
     <?php endwhile;?>
          <?php wp_reset_query(); ?>
If you think <?php $term =   $wp_query->queried_object; echo ''.$term->name.'';?> was/were a part of something else that has not been listed here, drop a line.

     <?php get_sidebar(); ?>
     <?php get_footer(); ?>      Thank you.


title: WordPress in a Subdirectory

text: I am trying to install WordPress in a subdirectory. This is a new fresh install. Here is what I did: Assuming my site is `example.com`, and I wanted to install wordpress in `example.com/wordpress` A) I created a database on the server B) I copied all wordpress directories to `example.com/wordpress` C) I moved index.php from `example.com/wordpress` to `example.com/` D) I modified the last line of `index.php` from: `require( dirname( __FILE__ ) . '/wp-blog-header.php' );` and it got modified into: `require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );` E) I modified `wp-config.php` and updated it in accordance with the required DB name, user name, password, and server name Now, when I test hat locally, and when I go to `example.com`, I get redirected to the WordPress installation setup page. However, on the live server, I am redirected to `http://www.example.com/wp-admin/install.php` **(notice the missing wordpress folder, the redirect should be to`http://www.alwarkaa.com/wordpress/wp-admin/install.php`)**. I have done this before, but not sure what is causing the problem. Can you please help? I really ran out of ideas. I tested everything I can think off (including typos), but to no avail. Please help. Thanks.


title: Upload media to WordPress through a web service

text: I would like to create a plugin through which I could expose a web-service for the media in WordPress. This service would allow external applications to upload and delete medias. Of course, the user of the web service would have to be authenticated. I am not sure from where to start. I developed a few plugins in the past but none of them are exposing an external interface. Do you have a few pointers for me, or some code (or plugins) to look at? Thanks a lot for your help.


title: Check javascript file Proper way in functions.php

text: I am trying to convert html to wordpress. The code in the html was:               <script src="js/jquery.nicescroll.min.js"></script>     <script src="js/jquery.js"></script> ( jQuery v1.7.2 )      and The inline script               $(document).ready(            function() {               $("html").niceScroll();            }          ); and much more.      In wordpress functions.php , I added this               if ( ! function_exists( 'your_enqueue' ) ) :         function your_enqueue(){     wp_enqueue_script(' name ', get_template_directory_uri(). '/script.js' , array('jquery')), '1.0', false);     }     endif;     add_action('wp_enqueue_scripts', 'your_enqueue');      I created a new .js file named script.js and added the following code in it:               <script src="js/jquery.nicescroll.min.js"></script>     $(document).ready(            function() {               $("html").niceScroll();       }          );       Is it right way to do this? Will it work? and Wordpress by default uses jQuery v1.7.2 or have to do some coding again in functions.php


title: Social Media Links on homepage - within posts/post loop

text:
On my WordPress site I've got a social sharing bar that I created myself. Here's a picture of the social sharing bar: http://d.pr/i/ucSG - I have the social sharing links included within 'index.php' between:               <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

              Tweet

          <? } endwhile; else: ?>          <?php endif; ?>       When I go to share a link it gives me the URL off my website and not the permalink for the post. It works fine when I view the post and try this, but when I'm on the homepage it just gives me the permalink of my website. How do I get it to share the current post link that it's clicked on? I don't understand why it's not showing the permalink as it's within the posts loop.


title: post content includes and seo vs. duplicate content

text: Trying to find the answer here but can't seem to locate this specific scenario... We have products that include multiple, defined resources - for example, each has 3 distinct user guides for different situations, each has a few videos, etc. Well, we used to simply have a page for each product, and all of this information in accessible tabs. This worked well for SEO. But we have over 800 products, and started getting request to, for example, show all of a certain type of manual, or all of a certain type of video. So, we decided to make a resource section using posts, each post in a specific resource category (i.e. Manuals) and representing a single resource (such as, a manual) - and then tag them each for a specific product. When viewing each of these resources directly, they include a link to the actual product page. This allows the resources to be polled independently, and shown in user requested archives. On the product page side, we are then 'INCLUDING' these individual resources into the tabs for each product, shown in their entirety, using a plugin that lets us query our resources. Each resource is shown within these tabs in their entirety, with only the product links stripped, making the content look native to the page - and in fact our pages look exactly like they used to. But suddently, a question has come up - does this now create a duplicate content situation? We really want to leave our resources indexed but in the eyes of a search engine I could see where this might be a problem. I also should add, when a site search is performed (using standard WP search), only the individual resource posts come up - so it does not see that information as existing on the actual product pages, as one would expect - but I presume for visiting bots that is not the case, they are seeing each product page and all of it's included tab content, as well as the same content in their individual resource posts? Would really appreciate any thoughts on how to best deal with this from an SEO perspective. Thanks * * * ## CLARIFICATION I am adding this to clarify what I'm asking as it relates to Wordpress: 1) Am I correct that under this scenario and how wordpress works, the SE's will see the full product posts with all of the included content? 2) Since the Wordpress 'search' doesn't see it this way (presumably because it is searching the database, not the actual generated pages), then if we were to noindex the 'Individual Resource' posts, will Wordpress' inability to show the main product posts in a search have a negative effect on SE's for those pages? Would a better search plugin be required in this case? 3) Finally, if we don't have any menu items pointing to the individual resource pages, and the only time they would ever appear is via a search (which is the case currently), will the SE's still find these pages due to how Wordpress works, even if we don't include them in the site map? Thanks


title: Trying to display ads on only a third of posts in a loop. Keep getting Error 500?

text:
I'm thinking it's just a PHP code error, but for some reason the following code won't work, it just keeps giving me _Internal Server Error 500_               <?php       $ajfl_adLuck = rand(1,3);       if ($ajfl_adLuck == 2) {         echo "
";         echo "
";         echo "";         echo "
";         echo "
";       } else {         echo "";       }     ?>      Basically, my site is slightly different in that the sidebar is inside the WordPress Loop, because rather than a list of categories and metadata stuff it displays the post's information. I want an ad displayed down the sidebar, but not on every post, only on, let's say, a third of them. I was wondering why my current code won't work. Quite new to PHP so I'm guessing it's a syntax error, but I've been working on it fot over an hour and still can't find the fix. Any help is appreciated, whether it's a fix or a better way to do this.   Thanks.


title: Multiple Blog Pages

text: some Preview Sites of WP Premium Themes show Multiple Blog pages with different Templates as example. a Full Width Blog Page a Medium Image Blog Page a Pinterest Style Blog Page. Now how do they do that and have multiple "different" styled blog pages on one site? Thanks, Allan


title: wordpress multisite dashboard link in admin bar

text:
I have created a wordpress multisite setup. The main site shows post from all child sites now the problem is i have used switch_to_blog to change the blogs but because of that the admin bar shows link of child site's dashboard not the main site. The admin bar shows dashboard link of last added post's site here is my code:-               if(is_main_site()){                 global $wpdb;                 global $table_prefix;                 // get an array of the table names that our posts will be in                 // we do this by first getting all of our blog ids and then forming the name of the                  // table and putting it into an array                 $rows = $wpdb->get_results( "SELECT blog_id from $wpdb->blogs WHERE                     public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0';" );                 //print_r($rows);                 if ( $rows ) {                     $blogPostTableNames = array();                     foreach ( $rows as $row ) :                         $blogPostTableNames[$row->blog_id] = $wpdb->get_blog_prefix( $row->blog_id ) . 'postmeta';                     endforeach;                     //print_r($blogPostTableNames);                     // now we need to do a query to get all the posts from all our blogs                     // ordered by the number of comments and with limits applied                     if ( count( $blogPostTableNames ) > 0 ) {                     $query = '';                         $i = 0;                         foreach ( $blogPostTableNames as $blogId => $tableName ) :                             if ( $i > 0 ) :                                 $query.= ' UNION ';                             endif;                             $query.= " SELECT post_id,meta_key, $blogId as `blog_id` FROM $tableName WHERE `meta_key` = 'main_site_home_meta_box_check' and `meta_value`='true'";                             $i++;                         endforeach;                         $query.= "ORDER BY post_id DESC LIMIT 5 ";                         //echo $query;                              $rows = $wpdb->get_results( $query );                         //print_r($rows);                         // now we need to get each of our posts into an array and return them                         if ( $rows ) {                                  $posts = array();                             foreach ( $rows as $row ) :                             //print_r($row);                                 $posts[] = get_blog_post( $row->blog_id, $row->post_id );                                 switch_to_blog($row->blog_id);                                 ?>                                 <article id="post-<?php $row->post_id; ?>" <?php post_class(); ?>>
 <a href="<?php echo get_permalink( $row->post_id )?>target='_blank'"><?php echo get_the_title($row->post_id); ?>

                                         <?php $post_id = $row->post_id ;                                         $postdata = get_post( $post_id,ARRAY_A ); ?>                                         <?php  print_r($postdata);                                         echo $postdata['post_excerpt']; ?>                                         <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'twentytwelve' ), 'after' => '
' ) ); ?>

                             <?php                              restore_current_blog();                             endforeach;                            // print_r($posts);                                  //return $posts;                         }                     }


title: get_terms - name__like a number

text: Using Get Terms with the argument of 'name__like', how do i return all results that start with any number? I've tried:               $feats = get_terms( 'movies', array('name__like' => '1', 'name__like' => '2', 'name__like' => '3' ) );       and               $feats = get_terms( 'movies', array('name__like' => '1,2,3,4,5,6,') );       Neither work properly. The first method will return the last "name__like" value but ignore the rest. Any ideas?


title: Show only if x comments?

text: Is there any function that will show some content only if there are more than x comments ? For example show some banner only if more than 10 comments are in post ? Thanks :)


title: Why doesnt ONE of my links in the footer work properly?

text:
I have a products page with a couple child pages and in my footer I have the same product categories as links. All the words do work as links except one and there is no difference in paths and I can if I manually go to my site an into products I can still reach that page but not from clicking the link in the footer, why? I only get to a page doesnt exist although I have the page opened in another tab with the exact same url. This is my footer.php
             Meditationer, Guidade upplevelser, Energirening & Energidroppar, Clearings m.m.

     <?php wp_footer(); ?>      This is the line that doesnt work:               Energirening & Energidroppar      although its the same as the other and as I mentioend earlier its just the link in the footer that doesnt work (takes me to error page) but I can still go into Products and click the image for the same ur and come to the correct page without error?


title: How to show related posts by category

text: In my gallery site i want to show other pictures under the current picture (in single post). I seen more codes but it i asks to specify the category, but i dont want want specify the category manually in the code I want the code itself to get the category ID or name.It would be much easier for me if i get full posts instead of post title so that I can display it as in home and category


title: 2 orderby in wp_query with 2 custom fields

text: I'm triyng to display hotels (taxonomy which i have created) by two 'orderby' with wp_query but i'm not success. Results looks likes:               Hotel 1 :       2 persons          5 stars     Hotel 2 :       2 persons          4 stars     Hotel 3 :       2 persons          3 stars     Hotel 4 :       3 persons          5 stars     Hotel 5 :       5 persons          5 stars     Hotel 6:        10 persons         2 stars     Hotel 7:        10 persons         1 star      The first 'order by' is on the number of persons(the biggest in first) and the second 'order by' is on the rating in stars (so, if several hotels have the same number of persons, the hotel with the biggest stars rating would be in first). Below my code. I have tried to add an array inside an array with meta_query but it doesn't work.               $args=                 array(                                         'post_type' => 'hotel',                                         'Services' => $Services,                                         'Town' => $Town,                                          'meta_key' => 'Number_persons',                                         'orderby' => 'meta_value_num',                                         'order' => 'ASC',                                            'meta_query' => array(                                                                array(                                                                    'meta_key' => 'Rating',                                                                    'orderby' => 'meta_value',                                                                    'order' => 'DESC',                                                                   )                                                            )                      );               $the_query = new WP_Query( $args );      Thanks a lot :)


title: Display date and time in comments

text: I use wp_list_comments(); to display a list of comment in WordPress. But it does show the format characters instead of the correct datetime. How can I fix this bug? Thank you. ![enter image description here](http://i.stack.imgur.com/onrku.png)


title: the_content of template page

text:
When I use the_content in the page-template doesn't show anything. Loop to call the page-template in the index: `index.php`               <?php     /**      * Main template file      *      * This is the most generic template file in a WordPress theme      * and one of the two required files for a theme (the other being style.css).      * It is used to display a page when nothing more specific matches a query.      * E.g., it puts together the home page when no home.php file exists.      * Learn more: http://codex.wordpress.org/Template_Hierarchy      *      * @package WordPress      * @subpackage Twenty_Eleven      */          get_header();     $pages = get_pages();     foreach ($pages as $page_data) {         $title = $page_data->post_title;         $template =  get_post_meta( $page_data->ID, '_wp_page_template', true );         switch($template) {             case 'template-portfolio.php':             get_template_part( 'includes/portfolio' );             break;             case 'template-landing.php':             echo get_template_part( 'includes/landing' );             break;         }          }          get_footer();      `landing.php`:

                       <?php while ( have_posts() ) : the_post(); ?>
                 <?php the_content(); ?>
              <?php         endwhile; //resetting the page loop         wp_reset_query(); //resetting the page query         ?>

      `template-landing.php` :               <?php     /*     Template Name: Landing     */     get_header();     echo get_template_part( 'includes/landing' );     get_footer();      But it doesn't work, i can see only the div with the class "entry-content- page" but it's empty   I need to display only the content.   The strange thing is that if I click on "view page" in the admin panel, the preview show the content but in my site isn't there.   Any ideas?   Thanks! # EDIT:   PAGE VIA "VIEWPAGE":![via view-page](http://i.stack.imgur.com/cvpX0.png) PAGE IN THE HOME: ![enter image description here](http://i.stack.imgur.com/VsyiI.png) ## EDIT2: I tried to go to the "reading setting" and if I set that page (template- landing) like front page I can see the content


title: Redirect URL to a specific page

text: I am creating a plugin, in which I send newsletters to subscribed users. To do this, I first created a form, in which users enter their email-id, and been subscribed. After subscribing, they got an email for confirming their email- id. Here is the problem arise. To confirm, I send them a link for confirming their email id as following:               http://localhost/wordpress/wp-content/plugins/my-plugin-path/templates/subscribe.php?id=53cad9f23a6ec      While I have to send them the link as following:               http://localhost/wordpress/newsletter/confirmation/53cad9f23a6ec      So how it can be done. Please help me. Any help would be appreciated. Thank you.


title: Wordpress 3.5 + Foundation 5 not working on IE9

text: I'm using Wordpress with Foundation 5 to make a custom template. It works perfect on Chrome and Firefox, but grid attributes looks all broken on IE9 (styles and typography are working). Is there any workaround to solve this? I have already tried to alternate JS calls between wp_head and wp_footer hooks with no success at all. Foundation 5 index.php that comes with download package from Foundation website works properly on IE9.


title: Troubleshooting a Network site displaying a blank page

text: I have a Wordpress install in Network mode, with subdomains. sitex.example.com is displaying a white page, with nothing in the source code. Other network sites display fine. I renamed the theme the site was using, but it didn't pick up Twenty Twelve in response. A server response checker showed that the site is producing a 200 response code. I went into Network Admin, and renamed sitex to sitey, but sitey.example.com produced a blank page also. I checked .htaccess, and it contains the following code:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule . index.php [L]      I went into my hosting cPanel, and confirmed I still have my wildcard subdomain, and I don't have a manual subdomain for sitex in cPanel. I went back into Network Admin, and altered the settings of the site, and set Template & Stylesheet to twentytwelve, but this made no difference. I'm lost. I don't know what else could be causing this. Do you? **UPDATE** If I turn debugging on, I receive the following: > Warning: include(/.../wp-content/advanced-cache.php) [function.include]: > failed to open stream: No such file or directory in /wp-settings.php on line > 65 > > Warning: include() [function.include]: Failed opening '/.../wp- > content/advanced-cache.php' for inclusion > (include_path='.:/usr/lib/php:/usr/local/lib/php') in /wp-settings.php on > line 65 > > Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or > esc_sql() instead. in /.../wp-includes/functions.php on line 2913 > > Warning: session_start() [function.session-start]: Cannot send session cache > limiter - headers already sent (output started at /.../wp-settings.php:65) > in /.../wp-content/plugins/nivo-slider/nivo-slider.php on line 10


title: Customize category permalinks

text: How can I generate URLs like `http://example.com/blog/category/Test/`? Currently, I have `http://example.com/category/blog/Test/`.


title: How to temporarily redirect front page of a network to one of the sites/blogs?

text: After setting up a multisite wordpress, I'd like to be able to redirect the root (front page) to one of the blogs. To understand the context, I'm talking about an NGO that organises events, while active the homepage should redirect there. The solution I found on a couple of forums involved manually changing the ID of the intended target site. Is there a more elegant way to do this?


title: Check if there are posts with specific custom fields and then display only the custom field

text: Hope to find an answer or some directions in the following matter. I have a custom post type "listings" and for the listing entries I have set radio custom field called building (via wp-types plugin). The building field holds the name of each building in a residential project. For example when adding a new "listing" entry, this entry can be in the building: "Minerva, Apollo, Neptun etc" What I need is a function that will check if there are entries for each of the building name and then return the building name. To be more specific, I'm trying to build a live filter for all listing entries (filter is done and works with jquery). I have all the building names harcoded. You can see it in the attached screenshot. I need to pull out those building names (that have entries) dynamically. If there are listing entries with those custom field (building name) display the custom field value. But only once, don't want to display the custom field value for each listing entry. ![enter image description here](http://i.stack.imgur.com/ntdnQ.png) Any help is very appreciated and if possible for me to make a donation, I'd be happy to.


title: Does this function wp_get_nav_menu_object check if a nav menu exists or is supported?

text: function wp_get_nav_menu_object( $menu ) {     if ( ! $menu )         return false;          $menu_obj = get_term( $menu, 'nav_menu' );          if ( ! $menu_obj )         $menu_obj = get_term_by( 'slug', $menu, 'nav_menu' );          if ( ! $menu_obj )         $menu_obj = get_term_by( 'name', $menu, 'nav_menu' );          if ( ! $menu_obj )         $menu_obj = false;          return $menu_obj;     }      I know that has_nav_menu can be used to check if a nav menu has been assigned to a theme location however not sure what the code above does as the docs for this function are limited. I need to check if the nav menu exists and the theme location is supported by the theme. Code Source http://queryposts.com/function/wp_get_nav_menu_object/


title: AJAX search as you type?

text: I'm trying to implement a kind of "search as you type" feature with the Search bar. Essentially, I'd like to have the user begin to type, make some kind of ajax request after each key, and then populate a div with "Related searches" as they type. Any good plugins for this or should I bake it up from scratch?


title: Facebook Open Graph like search on Wordpress

text: I'm building a site that mainly relies on Search and its results. I just wanted to know if we could integrate Facebook Open Graph kind of search suggestions based on categories and tags in Wordpress. ![Something like this, for Wordpress](http://i.stack.imgur.com/GDG0D.png)


title: How to Rewrite Wordpress URL for a Plugin

text: I am trying to build a Wordpress plugin here with a custom user admin area. What I would like to do is when the user adds /edit at the end of the page, it should open a page from my plugin. So for example `example.com/page-1/edit` should load   `example.com/wp-content/plugins/custom-user-admin-area/index.php?u=page-1` I am trying to make use of WP_Rewrite but in vain.               class MyPlugin {         function create_rewrite_rules($rules) {             global $wp_rewrite;             $newRule = array('([A-Za-z0-9-].+)/edit/' => 'wp-content/plugins/custom-user-admin-area/index.php?u=' . $wp_rewrite->preg_index(1));             $newRules = $newRule + $rules;             return $newRules;         }              function flush_rewrite_rules() {             global $wp_rewrite;             $wp_rewrite->flush_rules();         }          }          $MyPluginCode = new MyPlugin();     add_filter('rewrite_rules_array', array($MyPluginCode, 'create_rewrite_rules'));     add_filter('init', array($MyPluginCode, 'flush_rewrite_rules'));


title: Plugin “virtual” page

text: > **Possible Duplicate:**   >  How to Rewrite Wordpress URL for a Plugin # Question I am trying to create a plugin that adds an additional page to a Wordpress public site and allows the plugin to control the pages content. I don't want the page to appear in the admin sites editable page list and I dont want it to be included in the menu generation function wp_page_menu();. The only way the page should be access is via a url. Example www.mysite.com/my-account/ # Example I have a site www.mysite.com, and I navigate to www.mysite.com/my-account/ I will get a 404 error page. If I activate my plugin then navigate to www.mysite.com/my-account/ I should see the content defined by my plugin and not a 404 error. I have currently implemented a not so elegant solution and was sondering if there is a better way to do this? # Not so elegant solution               $object = new MyPlugin()     add_action('template_redirect', array($object, 'override404'));     add_filter('wp_title', array($object, 'title'));          class MyPlugin {          public function override404() {         global $path;              switch ($path) {             case "/my-account/" :                 // Use this header instruction to fix 404 headers                 // produced by url rewriting...                 header('HTTP/1.1 200 OK');                 // Hook into wp_title filter hook                 include (get_template_directory() . '/my-account.php');                 exit;                 break;             case "/bla/" :                 // Use this header instruction to fix 404 headers                 // produced by url rewriting...                 header('HTTP/1.1 200 OK');                 // Hook into wp_title filter hook                 include (get_template_directory() . '/bla.php');                 exit;                 break;         }     }          public function title($title) {         if (is_404()) {             global $path;                  switch ($path) {                 case "/my-account/" :                     $title = 'My Account';                     break;                 case "/bal/" :                     $title = 'Bla';                     break;             }                  $title .= " | ";         }         // You can do other filtering here, or         // just return $title         return $title;     }     }


title: Why does my multisite blog doesn't show users?

text: I have a multisite install with about 40 blogs. All blogs but one (id=5) works fine. In this one blog, when trying to access the users list it shows an empty list (header & footer) with the text 6 items below the list footer. When trying to create a new user on this blog I can see that the roles dropdowns are empty (thus not allowing to create a new user).


title: Autoremove empty custom fields

text: The code you see below only works sometimes. I'm no pro on PHP so can anyone help me improve this code? I use it in my functions-php file in my wordpress mu setup. The biggest problem is that it wont remove duplicate fileds. i.e. if I have 2 custom fields named Image and one is empty I want this script to remove this empty field, but it doesnt work               add_action('save_post','my_cf_check');     function my_cf_check($post_id) {              // verify this is not an auto save routine.          if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;              //authentication checks         if (!current_user_can('edit_post', $post_id)) return;              //obtain custom field meta for this post          $custom_fields = get_post_custom($post_id);              if(!$custom_fields) return;              foreach($custom_fields as $key=>$custom_field):             //$custom_field is an array of values associated with $key - even if there is only one value.              //Filter to remove empty values.             //Be warned this will remove anything that casts as false, e.g. 0 or false              //- if you don't want this, specify a callback.             //See php documentation on array_filter             $values = array_filter($custom_field);                  //After removing 'empty' fields, is array empty?             if(empty($values)):                 delete_post_meta($post_id,$key); //Remove post's custom field             endif;         endforeach;          return;     }


title: post type slug vs page slug

text: I having and issue with my permalinks, I wonder if someone has solved this. Basically I have a page named **videos** and also a post-type name **videos** , so I try to access to /videos I doesnt not display the right content. Any change I can keep videos as my page slug and also keep videos/video-post- types-links as well??? Thanks in advanced.


title: Getting pages filtered by template assigned

text: I want to retrieve pages with determinate template assigned. Function `get_pages()` hasn´t any parameter to select by template. For exmaple if I created three pages: Home, Page 1 and Portfolio. After I asigned default template to Home and Page but asigned "portfolio template" to Portfolio Page. How can I get only the pages that are using "portfolio template" for example? If you know a function to push my in right direction, please advise me. Thanks.


title: Posts 2 Posts Plugin : error message everywhere

text: Just upgraded to the last version of Posts 2 Posts plugin (I have the last WP version too) and I have the following error message on every dashboard page : « Warning: Connection types without a 'name' parameter are deprecated. in /home/.../wp-content/plugins/posts-to-posts/core/api.php on line 59 » Plus my website layout is destroyed. How can I fix this ?


title: Network: retrieve a list of latest posts

text: I need to list all the latest x posts from the whole Network in my WordPress Network. I am already using the Sitewide Tags plugin to collect all posts in a separate blog, but I also need to list the latest posts elsewhere. Most scripts and plugins I have been looking at only list one post from each blog, but I need to list the latest X posts, sorted by date, and allow several posts from each blog site.


title: Submitting POST data to a custom page template triggers a 404, why?

text: I've got a simple custom page template with a form on it. This page can process the form itself, so the entered data gets submitted there as well, using POST. Submitting the form, however, results in a 404 in my blog's regular theme (default template). If I leave out all of the data entry elements in the form, so I'll be submitting an entry form, it somehow works. You can use this code to reproduce the error if you want to see for yourself. Any suggestions as to what could be wrong are much appreciated, thanks!


title: Bandwidth usage increased in WordPress 3.5

text: I am facing bandwidth issue, for last (2012) whole year bandwidth usage of my WordPress site was 11.66 GB, after updating WordPress to version 3.5 in early January 2013, bandwidth usage for my site in January 2013 is 38.76 GB. Does anyone have any idea about the cause of this issue?


title: child theme - moved files from twentyeleven theme to child them, now not working

text: I'm trying to create a child theme. I copied the files from my twenty eleven theme into my twenty eleven child theme folder, and now the webpage displays blank page. my dashboard settings changed after I created the child theme that is why I decided to copy all files from main theme to child theme folder. what should I do?


title: How to import data from another website using an API link?

text: I have an API link (`$content` bellow), and I need to display the content fetched from this link in the dashboard. I don't have slightest idea how to do this.               if( !class_exists( 'DevMind_DashboardWidget') ) {         class DevMind_DashboardWidget {             function devmind_dashboard_widget() {                 // External Iframe Widget                 echo '<script src="//www.gmodules.com/ig/ifr?url=http://widgets.getclicky.com/igdash/clicky.xml&up_siteName=www.ejobindia.com&up_siteID=100542361&up_siteKey=a16e8cf0a5a195e5&up_resultLimit=10&up_showKeywords=1&up_showEngines=1&up_initalSelection=0-summary&up_showPercent=1&synd=open&w=320&h=250&title=Clicky&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>';                      //$content contains the original xml which I need to transfer into data table                  $content= 'http://serpbook.com/serp/api/?viewkey=dw8628r&auth=678a498d500a203885191bdd16c70190';             }                  function devmind_add_dashboard_widget() {                 wp_add_dashboard_widget(                      'devmind-custom-widget',                      'Campaign Manager',                      array( 'DevMind_DashboardWidget', 'devmind_dashboard_widget' )                  );             }                }              add_action(              'wp_dashboard_setup',                  array(                      'DevMind_DashboardWidget',                      'devmind_add_dashboard_widget'                  )              );     }


title: Anyway to hide a Category in the Categories section when adding/editing a post in WP Admin?

text: I have a Category that I would like to hide in the WP Admin so the author can never check it when adding or editing a post. Is there anyway I can prevent it from showing up by modifying my function.php file?


title: WordPress not auto saving custom posts

text: I am custom post types in WordPress. I have also added several new input box other than the WordPress default ones. But the problem is WordPress is only auto-saving input box created by it and ignores all the fields created by me. When I refresh page all of them get cleared other than WP title box. So how can I add those fields to WP autosave too?


title: How can I remove page titles without removing the link in the navigation bar in twentyeleven?

text: I 'd like to remove the titles from every page in my blog. But the title in de navigation balk must stay of course. Any idea? Please explain as easy as possible :-) cause I 'm taking my first steps in the Wordpress world. Thanks.


title: How can I remove the title "leave a reply" in the comment box in twentyeleven?

text: I would like to remove "leave a reply" in the comment form in twenty eleven. How can I do this? Thanks in advance.


title: Creating an online account & ordering system

text: Is it possible to create an account & ordering system with online payment (via paypal) for WP? Are there any kind of plugins for this? We'd require some basket functionality so products can be added, an account area that could include order history and online payment to pay via paypal.


title: Admin taking a very long time to load

text: Logging into my site's Wordpress admin backend take several minutes. The site indicates that it is loading and then just hangs for many minutes before finally loading. It smells like something is timing out, I suspect a plugin, but I can't for the life of me figure out what. In order to troubleshoot this, what steps would you take if confronted with such a problem? Turn plugins on and off and see which is the culprit? The problem with this approach is that after the initial slow loading, everything loads normal. Check php max execution times in php.ini? Somehow monitor outgoing connections to see what's trying to reach something and timing out (how would you do this)? Any suggestions welcome.


title: How to remove wordpress admin bar in dashboard

text: I would like to rebrand wordpress. Can anyone tell me how to remove it from dashboard? Is there any hook available. Or I should edit core files. If i should edit core file can anyone tell me which file? I edited `wp-includes/admin-bar.php` and removed this action               add_action( 'admin_footer', 'wp_admin_bar_render', 1000 );      It actually removed the admin bar. But it doesn't remove admin bar style sheet. I see empty space instead of admin bar. I mean i see padding in the top. Can anyone point me in the right direction? Thanks


title: Creating your own widgets: using cache?

text: I'm in the process of making my own widget but I don't like it to fully generate the content each time since the process is quite lenghty. I can easily create my own caching mechanism but I'm wondering if there is something that already exists in the wordpress core when it come to caching widgets. Ideas? Thanks! Dennis


title: How to organize products by collections with collections description?

text: I have products in my store sorted by categories. (Braslets; Rings; Earrings) It was not difficult to adapt my theme for listing products by categories. But now I need to organize my products by collections. I have collections for example 'Spring surprise', 'Smoky winter' etc. First time I thought to assign tags to products, but I also need to show collections description, this means to show tag's description. How can you advice me to organize products by collections? Does wp-e-commerce allow to set up a tag description? PS. I'm newbie in wp-e-commerce and it seems to be hard for understanding.


title: 301 redirects in Headway based WordPress Site

text: I have a site built with Headway theme. Currently, URL of each of my blog posts is simply               http://example.com/blog-post-name      I'd like to add a folder so the URL would be:               http://example.com/blog/blog-post-name      If I add that folder, will the existing URLs automatically redirect to the new URLs which include that folder name, or would I have to manual create 301 redirects for each one?


title: Is there some way to refator this jQuery wrapper?

text: I have a script which looks like this                 $(function(){            ... Jquery Code in Here            });      and I want to wrap it to make it compatible with WordPress. Do I have to do ...               (function($){            $(function(){            ... Jquery Code in Here            });          })(this.jQuery);      It works but it seems like there might be a more concise version. Is there?


title: Custom Taxonomy Not Showing in Menu

text: Using Wordpress 3.7.1 and PHP 5.4.12 I am trying to create a Custom Post Type called "News" and an associated Taxonomy Called "Subject". I generate the code from Generate WP site as below: After running the code I figure out that the Taxonomy is not showing in the Menu! ![enter image description here](http://i.stack.imgur.com/ivDHD.png) after struggling with code Little bit I updated the code Hook action by removing the "0" parameter as: ![enter image description here](http://i.stack.imgur.com/fqOat.png) to: ![enter image description here](http://i.stack.imgur.com/tWLNx.png) Surprisingly , this time it worked! and the Subject Taxonomy appears in the Menu ![enter image description here](http://i.stack.imgur.com/EWfCd.png) BUT I can not add any Terms to the taxonomy as I am encountering with this red box error ![enter image description here](http://i.stack.imgur.com/huYCu.png) Can you please let me know what I am doing wrong here?               <?php     // Register Custom Post Type     function custom_post_type_news() {     $labels = array(         'name'                => 'News',         'singular_name'       => 'news',         'menu_name'           => 'News',         'parent_item_colon'   => 'Parent News:',         'all_items'           => 'All News',         'view_item'           => 'View News',         'add_new_item'        => 'Add New News',         'add_new'             => 'Add New News',         'edit_item'           => 'Edit News',         'update_item'         => 'Update News',         'search_items'        => 'Search News',         'not_found'           => 'No News Found',         'not_found_in_trash'  => 'No News Found in Trash',     );     $args = array(         'label'               => 'news',         'description'         => 'News Information Pages',         'labels'              => $labels,         'supports'            => array( 'title', 'editor', ),         'taxonomies'          => array( 'subject' ),         'hierarchical'        => false,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => true,         'show_in_admin_bar'   => true,         'menu_position'       => 5,         'menu_icon'           => '',         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'capability_type'     => 'post',     );     register_post_type( 'news', $args );          }          // Hook into the 'init' action     add_action( 'init', 'custom_post_type_news',0);          // Register Custom Taxonomy     function custom_taxonomy_subject()  {          $labels = array(         'name'                       => 'Subjects',         'singular_name'              => 'Subject',         'menu_name'                  => 'Subject',         'all_items'                  => 'All Subjects',         'parent_item'                => 'Parent Subject',         'parent_item_colon'          => 'Parent Subject:',         'new_item_name'              => 'New Subject Name',         'add_new_item'               => 'Add New Subject',         'edit_item'                  => 'Edit Subject',         'update_item'                => 'Update Subject',         'separate_items_with_commas' => 'Separate Subject with commas',         'search_items'               => 'Search Subjects',         'add_or_remove_items'        => 'Add or remove Subjects',         'choose_from_most_used'      => 'Choose from the most used Subjects',     );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,     );     register_taxonomy( 'subject', 'news', $args );          }     // Hook into the 'init' action     add_action( 'init', 'custom_taxonomy_subject', 0 );


title: "Theme without sidebar.php is deprecated"

text: I'm building a custom wordpress theme. When I turn on debug, I get this message: Notice: Theme without sidebar.php is deprecated since version 3.0 with no alternative available. Please include a sidebar.php template in your theme. in /var/www/wp2/wp-includes/functions.php on line 2968 However, I do have sidebar.php in my theme. It's copied and unedited, from wp- includes/theme-compat What am I doing wrong?


title: Sort post by category using HTML Select tag

text: Good day wordpress dev. Just want to ask if it is possible to sort, filter or query post using HTML Select tag? This is the design I am trying to develop. http://i255.photobucket.com/albums/hh140/testament1234/sort_post_zps7415de5e.png I have been searching for solutions on how to accomplish this and the closest thing i can find is the Select query solution. Sorry if i cannot provide any code right now since i'm still searching for a solution and this kind of feature is unknown to me


title: Clarify: Enqueueing scripts within shortcode only loads in footer?

text: Each time I enqueue scripts inside the shortcode handler, it ends up in the footer. It doesn't matter whether I register them first and set it to load in the header, if I enqueue inside the shortcode it goes in the footer. From what I understand this is the correct behavior - am I right? Is there any possibility to enqueue a script from within the shortcode handler that will go in the header? Typically I'd let it load in the footer but some JS's just refuse to work in the footer and I have to fall back on strpos or regex to look for the shortcode before enqueueing. I'm just trying to find a more efficient way. Thanks! --Update-- As requested, here were my methods.   1. Register script              add_action( 'wp_enqueue_scripts', 'ftrjs_admin_init' );     function ftrjs_admin_init() {     wp_register_script( 'lwtcountdown', get_stylesheet_directory_uri().'/lwt/js/jquery.lwtCountdown-1.0.js', array('jquery') );     }        2. Shortcode              add_shortcode( 'ftrjs', 'ftrjs_callback' );     function ftrjs_callback( $atts ) {     wp_enqueue_script('lwtcountdown');     wp_enqueue_script( 'lwtcounter' );     wp_enqueue_style( 'lwtstyle' );          $out = "";     $out .= "<script type='text/javascript'>     jQuery(document).ready(function($)     function set_by_date() {     $('#countdown_dashboard').stopCountDown();     $('#countdown_dashboard').setCountDown({         targetDate: {         'day':      15,         'month':    1,         'year':     2014,         'hour':     12,         'min':      0,         'sec':      0     }     });     $('#countdown_dashboard').startCountDown();     }     )};     </script>";     return $out;     }      In doing this exercise, I see now why it doesn't work because my shortcode outputs Javascript inline, before the plugin loads in the footer. Once I pulled that out and put it into a separate JS file and enqueue that file it works. So now, if I need to pass variables I have to use wp_localize_script.


title: What is wrong with my page.php?

text:
I hard coded the html from resources.php from a site into page I created the wordpress admin, which used the default page template. Then I entered the following code into the page.php template. The result is http://strategichospitalitysearch.com/blog/resources.
<?php the_title(); ?>
               <?php           $page_id = 98;           $page_data = get_page( $page_id );           $content = apply_filters('the_content', $page_data->post_content);           $title = $page_data->post_title; // Get title          echo $content; // Output Content          ?>

           My Problem is that it may not work for other pages in the future and the subpages for resources. What is the best approach to this?


title: MySQL Replication Latency Issues in wp-admin pages

text: I have an environment running WP 3.0.1 with a Master db and two slaves. I am using HyperDB to force all writes to go to the Master, and all reads to read from the two slaves. I am experiencing a variety of issues in wp-admin pages where data is being written to the master, and WordPress attempts to read from a slave, and the data has not reached the slave yet. An example of this is when I hook ' **dbx_post_advanced** ' to preset some category and custom taxonomy terms on new posts. I have verified that when I configure HyperDB to read and write from the Master alone, the ' **dbx_post_advanced** ' hook works fine. I'm currently looking into the following options to resolve this issue:   * Dedicate only one web server to all wp-admin traffic      * Configure that server to read and write to/from the Master db only     * Configure the load balancer to route all /wp-admin url's to that web server   * Configure HyperDB to read/write against the Master only for wp-admin pages   * Setup MySQL Semisynchronous Replication      * http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html     * This solution will most likely not work, however, because semisynchronous replication will only wait until ONE slave has completed its writes, not both slaves in my case Let me know if you have any advice for this issue. Thanks, Dave


title: Errors when using CDN Sync Tool plugin

text: Now that wp-supercache has some built in support for CDNs, I've tried using the CDN Sync Tool to do an initial upload of files to Cloudfront. But, I'm getting 2 sets of errors when syncing (I'm having to use force upload, as for some reason CDN Sync Tool thinks all my files have been uploaded already).   1. cURL error: Failed to open/read local data from file/application (26) This error isn't actually preventing the files from being uploaded though   2. [function.fopen]: failed to open stream: Too many open files in /var/www/xxxxx/wp-content/plugins/cdn-sync-tool/lib/awssdk/lib/requestcore/requestcore.class.php This error does stop files from being uploaded -> S3. So, the 2nd error occurs after a certain (changeable) number of files have been uploaded, and then affects all remaining uploads. Any ideas why or what can be done? [Update] After updating to version 0.9, am now getting the following errors repeatedly (after about 2000 files have been synced) > Warning: fclose(): supplied argument is not a valid stream resource in > [filepath]/lib/awssdk/lib/requestcore/requestcore.class.php on line 276 > > The stream size for the streaming upload cannot be determined. done > > Syncing [2411/4732] img2343435.jpg > > Warning: fopen(/var/www/xx/wp-content/uploads/2010/12/mg2343435.jpg) > [function.fopen]: failed to open stream: No such file or directory in > [filepath]/lib/awssdk/lib/requestcore/requestcore.class.php on line 527


title: Plugins not activated after update?

text: I recently noticed that after manually updating any plugin it is left deactivated. Is this the correct operation? Or might there be a problem with my install? Thanks


title: Attach File Funcion for Common people

text: How can i allow my visitors that they can attach files like word text pdf with their comments or can allow attach file to register users is their any plugin or any other way for achieving this task ?


title: Display only author posts in dashboard all posts panel

text: I would like to display only authors own posts in dashboard all posts section. As of now it displays everything. I found some code here which is written by @t31os Its working correctly.               function posts_for_current_author($query) {         global $user_level;              if($query->is_admin && $user_level < 5) {             global $user_ID;             $query->set('author',  $user_ID);             unset($user_ID);         }         unset($user_level);              return $query;     }     add_filter('pre_get_posts', 'posts_for_current_author');      But user_level is deprecated. So can anyone modify the code for new version? Thanks


title: get_users meta_query

text: I can't get meta_queries working correctly on get_users(). For the life of me can't figure out what I'm doing wrong.                   $args = array(             'meta_query'   =>                      array(                     'relation' => 'AND',                      array(                     'key' => 'minbeds',                     'value' => $rooms,                     'compare' => "<=",                     'type' => 'numeric'                 ),                 array(                     'key' => 'maxbeds',                     'value' =>  $rooms,                     'compare' => "=>",                     'type' => 'numeric'                 )                array(                     'key' => 'minprice',                     'value' => $price,                     'compare' => "<=",                     'type' => 'numeric'                 ),                 array(                     'key' => 'maxprice',                     'value' => $price,                     'compare' => "=>",                     'type' => 'numeric'                 )              )         );              $users = get_users( $args );


title: Trigger renewal order emails for WooCommerce subscriptions for testing

text: I have a WooCommerce site to sell subscription products. I customized the emails and want to test them out in my email client. Currently I have created a test subscription that renews every day (24 hours). This means I need to wait 24 hours to test my renewal emails. How can I trigger these emails so that I can speed up my development and testing process?


title: Jetpack Infinite Scrolling For Multiple Columns On Same Page?

text: Enabling infinite scrolling is as simple as adding this snippet to the theme's functions.php file (where 'content' is the `id` of the container that wraps the posts):               add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'content',         'footer' => false,     ) );      But what should I do if my website has a multiple column layout where, for instance, one column shows the latest posts, and the other column lists the latest posts from a tag (highlights)? i.e. essentially there are two containers. I tried these two snippets (see below), and either way, infinite scrolling is only enabled for one column/container.               add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'content',         'footer' => false,     ) );          add_theme_support( 'infinite-scroll', array(         'type' => 'scroll',         'container' => 'highlights',         'footer' => false,     ) );      and               add_theme_support( 'infinite-scroll', array(         'type' => 'click',         'container' => array( 'content', 'highlights' ),         'footer' => false,     ) );      What am I doing wrong? **NOTE:** If the fact that installing Jetpack requires a wordpress.com account is holding you back, please try Slim Jetpack. It even works on a local install of WP, and doesn't require a wp.com account.


title: Including categories in search results

text: I am trying to include categories in search results. I've been searching for hours now with no solution. By "including categories" I don't mean search in a certain category, I mean let's say I have a bicycle store and have many companies included in the site; a user searched for `BMX mountain cross` for example. It will return the category BMX first (by clicking you'll be sent to the category page) and the posts related to the search term like WordPress normally does. Does anyone have any clues or could point me to the right direction?


title: How to get the Date Format and Time Format settings for use in my template?

text: This is a strange question, but I want to know how I can access the Date and Time settings               Admin > Settings > General > Date Format     Admin > Settings > General > Time Format      I am using the Any+Time jQuery plugin as a date/time selector for the editor view for a custom post type. It allows you to specify a date and time format ~~using the same settings WordPress does~~. **Edit: Turns out it doesn't use the same Date part tokens that WordPress does. Lame.** http://www.ama3.com/anytime/#AnyTime.Converter.format Ideally I want to do something like this...               <?php        $wpDateFormat = get_admin_settings('DateFormat');       // $wpDateFormat now holds something like "F j, Y"     ?>          <script>         $("#datetime").AnyTime_picker({           format: '<?php echo $wpDateFormat ?>'         );     </script>      What I don't know is... is there such a function like `get_admin_settings()` ?


title: How do I make a custom field choose an image?

text: I need a way to create a custom field that will let me pick an image from the media gallery. How do I do that? The custom field should have a button that when clicked will take me to the media gallery and place the src destination url within a input text box. looking for a plugin or online tutorial and I'm having little luck.


title: Allowing Two Developers Access to a Plugin on the WordPress.org Plugin Repository?

text: The question is " ** _How to Allow Two Developers Access to a Plugin on the WordPress.org Plugin Repository?_** " This question was asked on the wp- hackers list and _@EAMann_ answered it nicely and it's a great question to have here so I'm posting it for Eric to answer here.


title: Is it possible to define the data type of a Custom Field?

text: I am adding a new "Custom Post Type" named "Seminar". I am defining three custom fields   1. Location   2. StartTime   3. EndTime StartTime and EndTime are going to store dates (surprise, surprise). I am wondering if there's any way to tell WordPress to treat these like dates so that I can sort by them and stuff. I am very new to WP, so forgive me if this is a dumb question.


title: Loop for custom-post-type comparing taxonomy terms for "related" posts?

text:
I have a custom-post-type named `my_projects` and a custom-taxonomy called `project_tags`. I want to write a function that is returning 5 posts of this post-type based on a given taxonomy term. So I want to call `<?php get_related_projects("Car"); ?>` and get 5 posts that also share the `tag` car returned. **This is my current attempt (that doesn't work)**               function get_related_projects( $term ) {         echo '
';              $args = array(             'post_type' => array('my_project'),             'order' => 'DSC',             'post_count' => 5,             'meta_key' => 'project_tags',             'meta_compare'   => $term,         );              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();             global $post;             ?>

                     <?php if ( has_post_thumbnail()) : ?>                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >                         <?php the_post_thumbnail(); ?>                                              <?php endif; ?>

<a href="<?php the_permalink(); ?>">a <?php the_title(); ?>

             <?php         endwhile;              wp_reset_postdata();         echo '
';     }      Since I'm not an expert when it comes to custom loops I wonder what I'm doing wrong here? Thank you for your help. **UPDATE:**               <?php if ( get_related_projects( "Car" ) ):  ?>             Related Projects             <?php get_related_projects("Car"); ?>     <?php endif; ?>


title: Walker gives additional taxonomy name?

text:
I'm a beginner at Wordpress, so I would appreciate it if any of you could nudge me in the right way. Anyway, what irks me is how wp_list_categories (and similar functions) produce a lot of unnecessary classes and stuff I don't need. I tried creating my own walker class based on Walker_Category, and I seem to get it working. All I need as a class is that a "current" class appears when it is the current category, but when it is not, I don't want any classes at all to show up. However, for some reason I'm getting an additional class by my taxonomy name. I've looked over my walker class a gazillion times but can't seem to be seeing where it is indicated that the taxonomy name should be stored in $class. I also looked in the original Walker class, but haven't gotten much out of it. Please help? :)                class Meow_Walker extends Walker_Category {              var $tree_type = 'category';         var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');         function start_lvl( &$output, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }         function end_lvl( &$output, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $indent = str_repeat("\t", $depth);             $output .= "$indent
\n";         }              function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {             extract($args);                  $cat_name = esc_attr( $category->name );             $cat_name = apply_filters( 'list_cats', $cat_name, $category );             $link = '';             $link .= $cat_name . '';                  if ( !empty($feed_image) || !empty($feed) ) {                 $link .= ' ';                      if ( empty($feed_image) )                     $link .= '(';                      $link .= 'term_id, $category->taxonomy, $feed_type ) ) . '"';                      $link .= '>';                      if ( empty($feed_image) )                     $link .= $name;                 else                     $link .= "';                      $link .= '';                      if ( empty($feed_image) )                     $link .= ')';             }                  if ( !empty($show_count) )                 $link .= ' (' . intval($category->count) . ')';                  if ( 'list' == $args['style'] ) {                 $output .= "\t
taxonomy );                     if ( $category->term_id == $current_category )                         $class .=  'current';                     elseif ( $category->term_id == $_current_category->parent )                         $class .=  'current-parent';                 }                 $output .=  ' class="' . $class . '"';                 $output .= ">$link\n";             } else {                 $output .= "\t$link
\n";             }         }              function end_el( &$output, $page, $depth = 0, $args = array() ) {             if ( 'list' != $args['style'] )                 return;                  $output .= "
\n";         }          }      **Edit:** I found a workaround, but I'd still like to know where $class gets its taxonomy name from...


title: Resizing thumbnails retrospectively

text: I have a Custom Post Type called `species` - fishkeeping species profiles. Each species profile can have as many media attachments as it needs, plus a separate `featured image`. I've dealt with this by storing it in the `postmeta` table under the key `attached_media` and it'll look something like this: `a:3:{i:0;i:10081;i:1;i:10082;i:2;i:10083;}`. This is an array of `post_ID`s of image files. This website is a redevelopment of an existing one and to pull the information across - including images - I've written a script which communicates with both old and new databases. **This has worked, to an extent**. The images are in place, but they're displaying at full size even when I've used the following code:               $size = "species-thumb";     wp_get_attachment_image( $attachment_id, $size, $icon, $attr );      The `species-thumb` size is set correctly as if you create a new species profile, any uploaded images are resized to the correct size. > If I create a new species profile, all of the image sizes are correct. > Having done my database import however, only the full size images appear. This is _presumably_ because WordPress hasn't created the new image sizes (200*x for `species-thumb`) for these images. I thought that I could simply run the AJAX Thumbnail Rebuild plugin, but it doesn't appear to work. The plugin works - it runs through all of the images (and displays each one on the screen), but then I can't find any images with names like `filename-200x78.jpg`. > **Q:** What's the best way to go about producing these images' thumbnails? > **It may be worth noting that there are over 4,000 images**. Thanks in advance,


title: link a custom page into menu

text: Ok i have a file which named,               page-allpost.php      now I have a menu item called "all post" and in that menu I want to call the page-allpost.php which will display all the post. how to do that? hope someone here could help, thanks.


title: How to create a custom url for a category

text: I took over a site that displays the category in the URL three different ways. For some categories it shows " **?category_name=blah** ". (Not ideal, but I can live with it) For newly created categories it show the " **?cat=####** " structure. (I don't want this) Yet for two categories displayed on the home page, it doesn't even show the word "category". It doesn't even show the category slug...it shows a completely different word. Specifically, the category is "first-column", but the URL shows "sitename.org/latestposts". The page title shows "first-column". The other category is "staff-blog" and the URL shows "staff-blog" as well. HOW DID THEY DO THIS? and How can I get the new categories to stop show the "?cat=####" format? I read all the notes about permalinks, and the htaccess file seems to be allowing me to make updates. I can't find any references to changing the category name in the php files. I'm over a week trying to figure this out on and off. The original guys won't respond to my emails, so I'm getting really frustrated. Any help is greatly appreciated!


title: Get post info inside modal window?

text:
**What I'm Trying To Do** I have set up a custom post type for 'movies' and below is how I set up the template. Basically, I am trying to get `a.thickbox` (in the code below) to open a modal window with more info on the movie. Notice the addition of `&pid=<?php echo $post->ID; ?>` at the end of the `href`.               <?php get_header();?>

Our Movies

                      <?php                     $c=0;                     $i=1;                          $temp = $wp_query;                     $wp_query = null;                     $wp_query = new WP_Query();                     $wp_query->query('post_type=movies' . '&paged=' . $paged . '&posts_per_page=6');                          while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;                          $custom = get_post_custom($post->ID);                     $movie_info = $custom["movie_info"][0];                      ?>                      <li id="movie-<?php the_ID(); ?>">                      <?php if (!empty($movie_info)) { echo $movie_info ?>                      <a class="thickbox" href="<?php bloginfo('url'); ?>/movies-modal?KeepThis=true&TB_iframe=true&height=820&width=610&pid=<?php echo $post->ID; ?>">View more info
                      <?php                     endwhile;                     my_paginate_links();                     $wp_query = null;                     $wp_query = $temp;                     wp_reset_query();                 ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      **My (Failed) Attempt** What I tried to do was create a separate template (below), create a page called "Movies Modal" in the dashboard, and attribute the template to the page. Then, I tried to grab the `POST ID` from the `a.thickbox` link from the template above (`&pid=<?php echo $post->ID; ?>`) so _only_ that post's info will show in the modal template below with this line: `$wp_query->query( 'post_type=movies&p=' . $_GET['pid']);`               <?php     /*     Template Name: Movies (Modal)     */     ?>          <?php get_header('thickbox'); ?>              <?php             $c=0;             $i=1;                  $temp = $wp_query;             $wp_query = null;             $wp_query = new WP_Query();             $wp_query->query( 'post_type=movies&p=' . $_GET['pid']);                  while ( $wp_query->have_posts() ) : $wp_query->the_post(); $c++;                  $custom = get_post_custom($post->ID);             $movie_info = $custom["movie_info"][0];             $actor_bio = $custom["actor_bio"][0];             $actor_info = $custom["actor_info"][0];              ?>
              <?php if (!empty($movie_info)) { echo $movie_info ?>              <?php if (!empty($actor_bio)) { echo $actor_bio ?>              <?php if (!empty($actor_info)) { echo $actor_info ?>
              <?php             endwhile;              $wp_query = null;             $wp_query = $temp;             wp_reset_query();         ?>                     All this did, however, was bring up a modal window with the info for all posts and not _just_ the info for the post the link is in, like this: ![modal window](http://i.stack.imgur.com/iowtN.gif) I can't figure out how to get the info for _only_ the post I clicked on. Can someone please help me out or push me in the right direction? **Updates**               pid is not set\ngettype: NULLpid intval: 0Array     (         [post] => post         [page] => page         [attachment] => attachment         [revision] => revision         [nav_menu_item] => nav_menu_item         [product] => product         [product_variation] => product_variation         [shop_order] => shop_order         [shop_coupon] => shop_coupon         [wpcf7_contact_form] => wpcf7_contact_form         [movies] => movies         [psdtv] => psdtv     )     Wordpress version: 3.5      Changed this block:               <li id="movie-<?php the_ID(); ?>">         <?php if (!empty($movie_info)) { echo 'Summary: '. $movie_info .''; } ?>         <a class="thickbox" href="<?php bloginfo('url'); ?>/movies-modal/?KeepThis=true&TB_iframe=true&height=820&width=610&pid=<?php the_ID(); ?>">View more info


title: Use quicktags toolbar on any textarea

text:
reading the quicktags.dev.js i see in the comments                * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties:      * settings = {      *   id : 'my_id',          the HTML ID of the textarea, required      *   buttons: ''            Comma separated list of the names of the default buttons to show. Optional.      *                          Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';      * }      *      * The settings can also be a string quicktags_id.      *      * quicktags_id string The ID of the textarea that will be the editor canvas      * buttons string Comma separated list of the default buttons names that will be shown in that instance.      which seems like i should be able to call the javascript functions quicktags(), pass it at least the ID of a text area and I should get the quicktags editor created just before any textarea. (i'm working in a metabox). however, if i put the following in my code:               try { quicktags( '_repeating_textareas_meta[repeating_textareas][0][textarea]'); } catch(e){}      which I essentially copied from bit of javascript that WP has it in the source and added my metabox's ID. it prints out the div where the quicktags toolbar _should_ be but doesn't make any buttons

       console.log doesn't show any errors. and i swear that this time i have undone all potential tampering to source code. **EDIT:** i've isolated the problem down to where the script appears in the source... using Fred Rocha's function works great (and much like i anticipated) if it runs on the admin_print_footer_scripts but not on after_wp_tiny_mce... it results in the same empty toolbar i was getting. other parts of my jquery plugin need to run after the tinymce settings are initialized (since i'm straight borrowing the existing settings), so why would it work properly on the one hook but not on a later hook?


title: Wordpress framework

text: It's not a question that can be answer wit a single BEST answer, but i like to know wich framework outthere could solve most of de problem of creating a site from PSD to html. What i am looking to is. HTML5, CSS3, jQuery, SEO build in, Drag and drop interface, Font replacement (cufont), microformat, responsive, mobile friendly, 960px wide, boilerplate. This list of next generation framework feature could be longer, but wich framework do you suggest me, that include the most of the request above... BTW, i code psd to wp theme from hand coding, or use headway.... both situation not perfect neither fast !. I have heard a lot of good thing about genesis... but never tried it ! -- As being said, it's not a clear question... here is what i like to know. What interface/addin you could install OVER wordpress basic installation to make it a nive platform to convert a PSD to a live site, with the lates technology like html5 and jquery.. that ca be view on mobile device without too much fuss


title: Echo Permalink in Attachment outside of loop?

text:
I have some code showing an image attached to a post, an image in a li list, works fine shows the image as its should. I need the image to link through its main single post though and have tried the code below.               <?php                 $args = array(                    'post_type' =>  'attachment',                    'numberposts' =>  -1,                    'post_status' =>  null,                    'post_parent' =>  $post->ID                   );                        $attachments = get_posts( $args );                      if ( $attachments ) {                         foreach ( $attachments as $attachment ) {                            echo '
  <a href="<?php the_permalink() ?>" title="Permanent Link to<?php the_title_attribute(); ?>">';                            echo wp_get_attachment_image( $attachment->ID, 'full' );                            echo '
';                           }                      }     ?>      Unfortunately this doesn't print the permalink into the link. :( Any ideas can it be done? Thanks for looking.


title: WordPress dashboard is slooow. Front end is fast

text: Every aspect of my dashboard is slow--it can take 30-60 seconds to get a list of pages, or to updated a post. Yet, the front end is fast. I checked all the plugins--no problem there. I deactivated all the features of JetPack--no problem there. I tried different browsers--no problem there. I checked with my ISP and they confirmed there was no down time. This problem is ongoing. What makes WordPress dashboard slow and how do I fix it? Thanks


title: whats happening with my index page?

text:
I'm working on my first wordpress blog site and I think I'm doing pretty good. This is my site so far but I need some help with a couple things as I'm not sure why this is happening. I've styled my blog the way I want to (with the clickable title and the dark red background for the "POSTED ON:" date stamp, however when I styled that, ALL my pages got that styling too (I only want that styling on the blog not).I want my pages to just look like regular pages. I understand CSS & HTML, and a SMALL bit of PHP but I'm not understanding why my index is picking up that styling. I do understand, through using firebug, that the styling class is the same as the blog posts but I don't want that. How do I change it is the only code on my index page is this...
             <?php while ( have_posts() ) : the_post(); ?>             <?php get_template_part( 'content', 'page' ); ?>             <?php endwhile; // end of the loop. ?>
      I don't understand where it's picking the styling up and which php page to change it on. If anyone can help me I'd appreciate it. @Brad Farleigh (or really anyone who can help me): I made a copy of the index.php page and called is page.php PAGE.PHP

 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                   <?php if (have_posts()) : ?>                    <?php while (have_posts()) : the_post(); ?>                        <?php the_content(); ?>                    <?php endwhile; ?>          <?php endif; ?>
      A referenced page in the index page like this.
                               <?php while ( have_posts() ) : the_post(); ?>                          <?php get_template_part( 'page' ); ?>                               <?php endwhile; // end of the loop. ?>
      So my pages seem to be working the way I want them to. Calling the content and titles, however now when I got to my blog it's all messed up. Understandably content-page.php has to be called from somewhere but where? I very much appreciate the help.


title: Redirecting all old links from previous EE site to new WP site in one go?

text: I'm about to migrate from an old Expression Engine website to a new WordPress site on the same domain. Is there anything I should be aware of with respects to redirecting old links? The old site is quite well indexed in Search engines and linked to from other sites, but because the domain name is the same, I'm unsure of how to redirect all those old links in EE to the homepage of my new WP site without having to copy-paste all the existing individual URLs in .htaccess 301 redirects. Any ideas? Thanks, osu


title: Extending xml rpc - best practice

text: I need to add custom methods to the Xml-Rpc file and have found the following:                           // Custom plugins     add_filter('xmlrpc_methods', 'custom_xmlrpc_methods');                              function custom_xmlrpc_methods($methods)     {         $methods['myMethod'] = 'my_function';         return $methods;     }      ` Questions:   * Is it possible to have the callback function in another file and if yes then how do you do that in the code?    * If I have lots of custom methods what is the best approach to handling this? Thanks Michael


title: How can I get more out of `$post` in an `add_action` callback?

text: I have the following action callback set up:               function abc_save_post($post_id, $post)     {         // do stuff              echo '<pre>'.print_r($post,true).'</pre>';     }     add_action('save_post', 'abc_save_post', 10, 2);      The thing is that `$post` is a very trimmed down version of `$_POST` and is missing lots of data that I want to get at. How can I get more data into `$post`?


Is there a browser plugin or method to find which php template an item is coming from?


title: ajax - why multiple calls to wp_create_nonce() return same value?

text: I've some trouble getting nonces working with my ajax submit form. First of all i create a nonce and pass it to my registered script, i'll later send it to ajax-handler packed with my form fields:               wp_localize_script( 'roll_script', 'Roll', array(                         'postRollNonce' => wp_create_nonce('nonce-roll')));      In my ajax-response handler i verify the nonce, do my stuff and try to create a new nonce to send back to js, for later submit:                       function on_ajax_roll(){                 if (!wp_verify_nonce($_POST['postRollNonce'], 'nonce-roll' )) die ('No allowed!');     // nonce is valid! do some stuff...                      $r = array('postRollNonce' => wp_create_nonce('nonce-roll'));                            $response = json_encode($r);                 header( "Content-Type: application/json" );                 echo $response;                 die();         }      ...but, back to my js, the new nonce is exactly the same as the old one! Since nonce is supposed to change with time, why a second call to wp_create_nonce return the same string?


title: Custom Post Type Archives by Date (stored as meta value) WP3.1

text: I would like to implement date-based archive functionality (similar to original WP Archives widget functionality) for custom post type (CPT). What makes it difficult is the fact that I need to group and **archive events** not by published date, but **by`event_date` stored as a meta value**. For example, I have `event` CPT registered as following:               $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'has_archive' => 'past-events',         'rewrite' => array('slug' => 'event','with_front' => false),         'query_var' => true,         'capability_type' => 'post',         'hierarchical' => false,         'show_in_nav_menus' => false,         'menu_position' => 15,         'supports' => array(           'title',           'editor',           'author',           'revisions'                )       );       register_post_type('event',$args);      I would like to generate archive links like `/past-events/2011/04`, similar to the functionality of WP Archives widget. However, my events should be archived by the `event_date` meta value. Also, if, say for April 2011, there are more events than my `Blog pages show at most` setting, I would like to have a correct pagination for pages. And ideally, when viewing a single event I would have correct previous and next event links within that archive page. Hope that makes sense. I'm using WP3.1 I've gone as far as specifing `has_archive` setting for the CPT. I did look around, but got confused how to proceed. Is that something I have to write myself or it could be done with WP functions or plugins? Would really appreciate any help and tips. Many thanks, Dasha


title: meta box & callback function

text:
### Situation I got a class where i add a meta box to the post edit screen. **EDIT:** This is the working version now               /**      * Calls the class on the post edit screen      */     function call_someClass()      {         return new someClass();     }     if ( is_admin() )         add_action( 'load-post.php', 'call_someClass' );          /**       * The Class      */     class someClass     {         public function __construct()         {             add_action( 'add_meta_boxes', array( &$this, 'add_meta_box' ) );         }              /**          * Adds the meta box container          */         public function add_meta_box( /* $args */ )         {             add_meta_box(                   'post_format_box'                 ,__( 'Post Format Content', self::LANG )                 ,array( &$this, 'render' )                 ,'post'                  ,'advanced'                 ,'high'             );         }                   /**          * Render Meta Box content          */         public function render( /* $args */ )          {             return '
TEST ME NOW
';         }     }      ### Problem The meta box is showing, and the meta box callback functions output get's rendered inside my meta box... but inside an error message. Seems that i'm too tired to get around this: **Error Message** (exact display as in the meta box) > Warning: call_user_func() expects parameter 1 to be a valid callback, > function ' TEST ME NOW ' not found or invalid function name in > R:\development\xampp\htdocs\wordpress\wp-admin\includes\template.php on line > 963


title: How can i get the last post from wp multisite?

text:
I have to get the last post from my Multisite network on WordPress. For now I use this code for display the last updated post after a cycle on each `blog_id`:               <?php          $blogs = get_last_updated(' ', 0, 1);     foreach ($blogs AS $blog);         switch_to_blog($blog["blog_id"]);             $lastposts = get_posts('numberposts=1&orderby=date');             foreach($lastposts as $post) : setup_postdata($post);?>      But if I want to get the last post -- not the last post updated -- how can I do that? Because if I change and refresh a post I get the post like the last on main page. But this is not the real last post. **Update** \- This is the full version, i have also used the restore_current_blog():               <?php              $blogs = get_last_updated(' ', 0, 1);         foreach ($blogs AS $blog);             switch_to_blog($blog["blog_id"]);                 $lastposts = get_posts('numberposts=1&orderby=date');                 foreach($lastposts as $post) : setup_postdata($post);?>
          <a class="anteprima_princ" href="<?php echo get_page_link($post->ID); ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_post_thumbnail('immagine-principale'); ?>

<a href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>"><?php the_title(); ?>

<?php the_content_rss('...', FALSE, '', 40); ?>

<a class="lt" href="<?php echo get_page_link($post->ID); ?>" title="<?php echo $post->post_title; ?>">LEGGI TUTTO

                   <?php endforeach ; ?>                                  <?php restore_current_blog(); //switched back to main site ?>


title: Where to put code to get custom taxonomy term id?

text: Let me preface this by saying that I am new to Wordpress customization and don't know how to write code, but I can stumble through customizations involving simple copy/paste instructions. So, this question is _very_ basic. Sorry. I'm using a plugin that asks for the term id for the custom taxonomy that I've created. I have found some posts that explain how to do this and give little php snippets (e.g. http://wordpress.org/support/topic/how-to-echo-custom- taxonomy-id). But I really have no idea where to put this code. Could you please help? UPDATE: I do know how to create php files via copy/paste and upload to my server, basic stuff like that...


title: Allow spiders to crawl my site (selectable option in wp)

text: I was creating a site for testing and i selected an option when setting up wp that essentially disallows my site from being indexed/crawled. I would now like it to be crawled like normal, but i cant find the option within wordpress. I am running wp 3.5WP Thanks in advanced.


title: Create subdomains for tags and categories

text: I'd like to find a way to make subdomain addresses work for some of my important tags and categories. For instance foo.thesite.com would show content for thesite.com/category/foo. I've been trying to make this working using my .htaccess file and the DNS but I can't get it to work properly. Making the subdomain forward to the right URL is just a matter of the right DNS settings, but then I also want to make sure the site shows it as foo.thesite.com. Can anyone provide some ideas on how to make this work? **Update - April 6:** I found one partial solution. If you have full domain DNS control and you have the CURL DNS option you can add a subdomain and point it to the category or tag page. The catch is that when I did this, clicking links leaves the URL as foo.thesite.com, and the title somehow doesn't work-- instead of a title I get the URL as the page title. Any thoughts on this, alternatives, or ideas on how to format the .htaccess rules?


title: Disable WooCommerce action

text: I'm customizing a WooCommerce theme and am going to be moving the title. There is an action in `content-single-product.php` called `do_action( 'woocommerce_single_product_summary' );` in the `woocommerce_hooks.php` file the title action is `add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );` I can easily comment this out and place the title function where I need to. I'd prefer to disable the title using a function in my themes functions file so I don't have to worry about modifying core files. What would the function be to disable this title action? Thanks


title: How to select posts from multiple categories and metavalues?

text: I need to select posts who are in multiple categories and have certain post metavalue. I can select multiple categories with               query_posts( array( 'category__and' => array(1,2,3) ) );      But also I need from those selected categories, select only those posts who have certain meta_value from wp_postmeta table. This task I can do with sql query:               SELECT DISTINCT (     p.ID     ), p . *     FROM wp_posts AS p     INNER JOIN wp_postmeta AS p1 ON ( p.ID = p1.post_id )     CROSS JOIN wp_postmeta AS p3     USING ( post_id )     WHERE p3.meta_key = 'length'     AND convert( p3.meta_value, signed )     BETWEEN '".$min_length."'     AND '".$max_length."'     AND post_status = 'publish'     $subSelect     ORDER BY p.ID DESC      I don't understand how can I select for example only those posts who has category 1 AND 2 AND 3 AND postmeta meta_key length is BETWEEN $min_length AND $max_length?