Custom WP_Query for WordPress Search Results with meta_query

I am using a custom query to generate my search results. The code I am using works perfectly without the meta_query variables in my arguments array. I am trying to compare multiple custom fields with 'LIKE'. References to `$per_page` & `$sort_by`               $paged = (get_query_var('page')) ? get_query_var('page') : 1;          $per_page = ($_REQUEST['per_page']) ? $_REQUEST['per_page'] : 15;     $sort_by = ($_REQUEST['sort_by']) ? $_REQUEST['sort_by'] : 'best';      Array for query arguments:               $default = array(         's' =>  $search,                 'paged'     =>  $paged,         'post_type' =>  'page',         'suppress_filters' => false,         'posts_per_page'    =>  $per_page,         'meta_key'  =>  '_wp_page_template',         'meta_value'    =>  'lois_product.php',         'meta_query'    =>  array(             'relation'  =>  'OR',             array(                 'key'       =>  'lois_prodpage_colour',                 'value'     =>  $search,                 'compare'   =>  'LIKE'             ),             array(                 'key'       =>  'lois_prodpage_brand',                 'value'     =>  $search,                 'compare'   =>  'LIKE'             )                                        )     );      Then I just call the arguments as you would expect..               $products = new WP_Query($default);      Loop through etc... So as you can see... pretty simple stuff to be honest. I just cannot work out why it is returning 0 results as I know I have data to match specific terms or a combination.. This is for a custom WP ecommerce website which is integrated with an external EPoS System (I know) Any help/pointers would be great!


Different views/roles for administrator

I know there are plugins that manage user roles. Is there any plugin that manage user roles/view for the administrators in Wordpress? There are some third party plugins that sometimes have their own menu. What i want to do is i want certain administrators cannot see these 3rd party menus. Is there such plugins?


write a post on user registration

Looking for a way to automatically write a new post everytime a new user is registered. For example if when user B completes a registration form then a new post is automatically submitted (either by them or by admin) with "User B has joined [site-name]". Is there a way to make a user account automatically post a post when the user registers?


Adding paged query to custom URL rewrite

I have set up the following to create 'pretty' post type and category permalinks:               function kdev_add_category_rules() {              $post_types = array(             'kdev_photos',             'kdev_videos',             'kdev_articles'           );              foreach($post_types as $post_type) {             $pt_obj = get_post_type_object($post_type);             $pt_rewrite = $pt_obj->rewrite;             $pt_slug = $pt_rewrite['slug'];                  add_rewrite_rule('^'.$pt_slug.'/category/([^/]*)/?','index.php?post_type='.$post_type.'&category_name=$matches[1]','top');              }          }          add_action( "init", "kdev_add_category_rules" );      This works great. When I visit sitename.com/photos/category/landscape/ I get all the 'photos' in the 'landscape' category. Unfortunately, my pagination on these pages is broken. I would like sitename.com/photos/category/landscape/page/2 to show the second page in this query. Currently it just refreshes the same page. On inspection of the query paged=1. I've tried the following, but my knowledge of regex is poor.               add_rewrite_rule('^'.$pt_slug.'/category/([^/]*)/page/([^/]*)/?','index.php?post_type='.$post_type.'&category_name=$matches[1]&paged=$matches[2]','top');      What is the correct rewrite rule? # Progress Interestingly, removing the first 'add_rewrite_rule' allows the new one to work (but obviuosly breaks all the other rewrites). I.e. /photos/category/test-category/page/2/ will work, but /photos/category/test- category/ won't. # EDIT: Additional info I have refreshed the permalinks loads! On sitename.com/photos/category/landscape/page/2/, `get_query_var('paged')` is returning `1`. /category/test-category/page/2/ and /photos/page/2/ both work. Post types being created using:               // Register Custom Post Type     function custom_post_type() {     $labels = array(         'name'                => _x( 'Photos', 'Post Type General Name', 'text_domain' ),         'singular_name'       => _x( 'Photo', 'Post Type Singular Name', 'text_domain' ),         'menu_name'           => __( 'Photos', 'text_domain' ),         'parent_item_colon'   => __( 'Parent Photo:', 'text_domain' ),         'all_items'           => __( 'All Photos', 'text_domain' ),         'view_item'           => __( 'View Photos', 'text_domain' ),         'add_new_item'        => __( 'Add New Photo', 'text_domain' ),         'add_new'             => __( 'New Photo', 'text_domain' ),         'edit_item'           => __( 'Edit Photo', 'text_domain' ),         'update_item'         => __( 'Update Photo', 'text_domain' ),         'search_items'        => __( 'Search photos', 'text_domain' ),         'not_found'           => __( 'No photos found', 'text_domain' ),         'not_found_in_trash'  => __( 'No photos found in Trash', 'text_domain' ),     );          $args = array(         'label'               => __( 'kdev_photos', 'text_domain' ),         'description'         => __( 'Shared photos', 'text_domain' ),         'labels'              => $labels,         'supports'            => array( 'title' ),         'taxonomies'          => array( 'category', 'post_tag' ),         '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,         'rewrite' => array( 'slug' => 'photos' ),         'exclude_from_search' => false,         'publicly_queryable'  => true,         'capability_type'     => 'page',     );          register_post_type( 'kdev_photos', $args );     }      The site is using the Roots theme which uses Scribu's theme wrapper technique. The first template called is base.php:               <?php if(is_front_page()) {     wp_redirect( get_bloginfo('url').'/photos/', 302 );     exit;     } ?>     <?php get_template_part('templates/head'); ?>     <?php     $post_type_query = get_query_var( 'post_type' );     if(!is_array($post_type_query)) $post_type = $post_type_query;     ?>     <body <?php body_class($post_type); ?>>            <?php         do_action('get_header');         // Use Bootstrap's navbar if enabled in config.php         if (current_theme_supports('bootstrap-top-navbar')) {           get_template_part('templates/header-top-navbar');         } else {           get_template_part('templates/header');         }       ?>

           <div class="main <?php echo roots_main_class(); ?>" role="main">             <?php include roots_template_path(); ?>
           <?php if (roots_display_sidebar()) : ?>           <aside class="sidebar <?php echo roots_sidebar_class(); ?>" role="complementary">
                 <?php include roots_sidebar_path(); ?>
                      <?php endif; ?>

            <?php get_template_part('templates/footer'); ?>                     Which then calls index.php:               <?php get_template_part('templates/page', 'header'); ?>          <?php  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;  ?>
Currently Browsing Page <?php echo $paged; ?>
          <?php if (!have_posts()) : ?>
         <?php _e('Sorry, no results were found.', 'roots'); ?>
       <?php get_search_form(); ?>     <?php endif; ?>     <?php      $post_type_query = get_query_var( 'post_type' );     if($post_type_query == 'kdev_photos') $use_grid = TRUE; else $use_grid = FALSE; ?>          <?php     if($use_grid) echo '
';      while (have_posts()) : the_post();       if($use_grid) get_template_part('templates/content', 'photo');       else get_template_part('templates/content', get_post_format());       endwhile;       if($use_grid) echo '
'; ?>          <?php     global $wp_query;          $big = 999999999; // need an unlikely integer          $pag_links = paginate_links( array(         'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),         'format' => '?paged=%#%',         'end_size' => 1,         'mid_size' => 1,         'current' => max( 1, get_query_var('paged') ),         'total' => $wp_query->max_num_pages,     ) );          echo '
'.$pag_links.'
';          ?>


Different Template based on HTTP Referer

He Guys, i've been looking for a way to show a different Page-Template based on HTTP Referer or maybe the User Agent or what ever. I'm planning an Image-Gallery which should be shown in a Fancybox. My Idea is to use a template which contains only the `loop` and all the stuff i need to build the gallery correctly (without any Header and Footer files) and load it in my Fancybox. But what about the Search Engines und Users with disabled JavaScript. They don't see anything or only a page without the Pagecontext like Navi etc. How can i prevent this issue? Any ideas


Remove password protection from all posts

So I messed up my blog (QBobble). I had an SQL backup, fortunately, so I reinstalled Wordpress, and imported my SQL database. Unfortunately, it password protected all of my posts. I know that I can manually unpassword protect them by going to Posts < Edit and edit the visibility to "public", but I don't want to do that to all of my posts, I want to do it to all of them at once. How can I do that? Someone said that you can do it in Bulk Actions > Edit, BUT changing the status to "public" in bulk actions doesn't work. Any ideas? It also got rid of the excerpts for each post. They now just read NULL. Is there a way that I can get it to add those back automatically? I'm running 3.3.1, by the way. Thanks all!


Millions of Rows -- Possible Solutions?

I have a custom CMS, that we're looking to port over into Wordpress. (I can see you asking yourself, why not just stick with the custom CMS? Well, it's outdated, clunky, and getting to be too much of a hassle to maintain; there are also many features of WP that we would really like to take advantage of). So here's the issue -- We have a main type of content (let's call them Tours). Each Tour has about 30 pieces of meta data associated with it (all currently different columns on the Tours table). We currently have about 600,000 Tours. Each Tour has several different types of images associated to it, from Interior Images, to Exterior, to Floor Plans, etc. Each Image has about 10 pieces of meta data associated with it (again, all currently columns on the Images table). We currently have about 7 million Images in our system. You can likely see our problem -- if we put all Tours and Images into the default wp_posts and wp_postmeta table, we're going to end up with millions of rows in wp_posts, and far more than that in the wp_postmeta table. I'm not sure how much mySQL can handle as far as numbers of rows, but it seems likely that we will reach a slowdown point, especially when querying the wp_postmeta table. My questions: 1) One possibility we've discussed is only holding "active" Tours in the wp_posts and archiving older Tours to a separate table. Is anyone aware of any plugins that do anything like this? 2) Another possibility is putting the Tours into the wp_posts table, and keeping the Images separate from that. One thing we would really like to use, though, is the Wordpress image uploader. Is there anyway to override where the image data is saved? 3) Any other suggestions of how we might best implement this much data into Wordpress?


rating articles for internal purposes

We have started with a lot of users who writes articles for the site. We want now rate every article internally for haveing an overview of the users with the best articles. Does someone know a plugin to rate articles internally, so they will not show up on the site, only in the dashboard of WP. Thanks, Tom


Static front page as parent of with child pages?

I am trying to produce a static front page that has child pages, so that the menu looks like the following: * * * About (static front page, parent page of "CV" and "Address")   -CV (child of "About")   -Address (child of "About")   Other page 1   Other page 2 (parent of "sub 1" and "sub 2")   -sub 1 (child of "Other page 2")   -sub 2 (child of "Other page 2") * * * What works is to use "About" as the parent. My problem is, that "CV" and "Address" are shown in the menu as separate items, not as children of "About", even though their parent-entry correctly says "About". Here's the menu: * * * About (static front page)   Other page 1   Other page 2 (parent of "sub 1" and "sub 2")   -sub 1 (child of "Other page 2")   -sub 2 (child of "Other page 2")   CV   Address * * * What am I overlooking here? Thanks ab bunch!   tef


Adding post_type to the query via pre_get_posts, with infinite scroll

I'm doing something wrong here. I'm trying to add a custom post type, external-videos, to the main blog query in all instances. It's working in the main blog page _for the first load of posts_ but the custom post type is ignored in subsequent posts loaded by infinite scroll. Only "regular" posts are loaded thereafter. I'm using the wp plugin version of infinite scroll. Here's my function:               // add external-videos to the loop          function add_external_videos_to_query( $query ) {              if ( is_main_query() && is_home() )             set_query_var ( 'post_type', array('post','external-videos') );     }     add_action( 'pre_get_posts', 'add_external_videos_to_query' );      Also, seemingly related - the custom post_type is being ignored by infinite scroll even on the archive page for that custom post type. In other words, on the archive page for "external videos," the first page of "external videos" posts loads, but no further posts of that type load via infinite scroll. Infinite scroll is working correctly for all other archives I've tested. Incidentally I've read Mike Schinkel's reply here and I think i'm using a similar technique, but I'm not sure if i need **`global $wp_the_query`** or not. For another situation, but also trying to get pre_get_posts to fire every query, he said: > Basically what you are looking for is the global $wp_the_query variable > which is set to the value of the main query. It may not be a perfect fit for > 100% of cases but will probably work fine in 99% of cases: >   >   >     add_action( 'pre_get_posts', 'custom_post_count' ); >     function custom_post_count( $query ){ >       global $wp_the_query; >       if ( $wp_the_query === $query ) { >         $query->set( 'posts_per_page', 5 ); >       } >       return $query; >     }; >


Combining post categories and link categories?

So as to get a single index of both internal posts and external links on the same or related topic/subject matter, is it possible to combine post categories and link categories? I would like to be able to drill down through a single hierarchy, and find all collected information on the topic, whether external or internal to the site. Thanks.


wp custom field date format compare

How do I possible to work with this code to work with date format Y-n-j Value               start_date = 2011-1-20     end_date   = 2011-1-30      Here are the original function came from this Query between two meta values?               function date_check_join( $join ) {         global $wpdb;         $join .= " JOIN ".$wpdb->postmeta." AS startdate ON              (".$wpdb->posts.".ID = startdate.post_id AND             startdate.meta_key = 'start_date')             JOIN ".$wpdb->postmeta." AS enddate ON              (".$wpdb->posts.".ID = enddate.post_id AND             enddate.meta_key = 'end_date')";         return $join;         }          function date_check_where( $where ) {         $today = date('Y-n-j'); /* I change this format to date('Y-n-j')*/         $where .= " AND startdate.meta_value <= $today         AND enddate.meta_value >= $today";         return $where;         }      This function is working with `UNIX TIME STAMP date('Ymd')` and when I change date format it doesn't work with `date('Y-n-j')` credit @goldenapples


Multiple auto-generated image slideshows/sliders on each (custom) post?

I'm working on a site for a client, which will have a custom post type (homes). I'd like the client to be able to add new posts, which would ideally include multiple pictures, in different 'categories', for each home (i.e. initial construction, finish work, completed home). Each different category would then get its own slider on that 'post'. I've considered using something like the Premium Slider plugin, which offers multiple sliders, and includes a metabox on each post, but it would definitely need to be modified to fit my requirements. Any ideas on the best way to go about doing this?


Display thumbnail only if requested size exists

When I use the functions that get and output the post thumbnail, they will display the requested thumbnail in the size you specify, but if this size doesn't exist they will display the thumbnail in the original size and force the browser to resize it. How can I force them to display a placeholder like "no image" in case the requested size doesn't exist?


Comment formatting with comment_content

I'm displaying a comment outside the comment template, getting it with `get_comments()` and echoing the `comment_content`. My problem is that the comment loses the formatting (paragraphs, line breaks, etc...). In my template I'm using TinyMCEComments (TinyMCE on comment form). Someone pointed me to this solution, but is not working for me.               <?php echo wpautop($comment->comment_content);?>


Custom Taxonomy as Dropdown in admin

I’ve created a custom post type (called Sponsors) with an additional taxonomy connected to it, called “Type”. Everything is essentially working perfectly but I would very much like to have my taxonomy “Type” to be a dropdown menu instead of the usual “type and search or create a new”. The reason is, that I’ve created six different “Types” in the taxonomy and the people which are going to create new “sponsors” should only need to select one of those six for each new Sponsor post. I’ve tried some tutorials and some guides found by Google but none which has yet to work. The custom post type and the custom taxonomy is created by the plugin “Custom Post Type UI”. What I tried so far is this:               add_action('restrict_manage_posts','my_restrict_manage_posts');                  function my_restrict_manage_posts() {                 global $typenow;                      if ($typenow=='sponsors'){                              $args = array(                                  'show_option_all' => "Show All Categories",                                  'taxonomy'        => 'type',                                  'name'               => 'type'                                   );                     wp_dropdown_categories($args);                             }             }     add_action( 'request', 'my_request' );     function my_request($request) {         if (is_admin() && $GLOBALS['PHP_SELF'] == '/wp-admin/edit.php' && isset($request['post_type']) && $request['post_type']=='sponsors') {             $request['term'] = get_term($request['type'],'type')->name;              }         return $request;     }       And this               add_action( 'restrict_manage_posts', 'my_restrict_manage_posts' );     function my_restrict_manage_posts() {              // only display these taxonomy filters on desired custom post_type listings         global $typenow;         if ($typenow == 'sponsors' || $typenow == 'type') {                  // create an array of taxonomy slugs you want to filter by - if you want to retrieve all taxonomies, could use get_taxonomies() to build the list             $filters = array('title_sponsor', 'platin-sponsor', 'guld-sponsor', 'diamant-sponsor');                  foreach ($filters as $tax_slug) {                 // retrieve the taxonomy object                 $tax_obj = get_taxonomy($tax_slug);                 $tax_name = $tax_obj->labels->name;                 // retrieve array of term objects per taxonomy                 $terms = get_terms($tax_slug);                      // output html for taxonomy dropdown filter                 echo "<select name='$tax_slug' id='$tax_slug' class='postform'>";                 echo "<option value=''>Show All $tax_name</option>";                 foreach ($terms as $term) {                     // output each select option line, check against the last $_GET to show the current option selected                     echo '<option value='. $term->slug, $_GET[$tax_slug] == $term->slug ? ' selected="selected"' : '','>' . $term->name .' (' . $term->count .')</option>';                 }                 echo "</select>";             }         }     }      But as I said, none which has worked. Any help or suggestions would be very much appreciated. Thanks   Sincere   \- Mestika


Custom loop off by one post

Within my loop I want to display 9 posts that exclude categories X, Y, Z and all sticky posts. Between post 3 and 5 I would like to place a sticky post with a custom template. The below works except that it treats the sticky post as the 4 post from the first loop which results in one regular post missing. I have to use WP 3.0.3               <?php if (have_posts()) : ?>         <?php $count = 0;?>         <?php           $sticky_posts = get_option('sticky_posts');           $arguments = array(               'posts_per_page' => 9,               'post__not_in'  => $sticky_posts,               'category__in'  => array(1,2,3,4,5)           );         ?>         <?php query_posts( $arguments );?>              <?php while (have_posts()) : the_post(); ?>                  <?php $count++; ?>                  <?php if ($count == 4) : ?>                      <?php                   $sticky = get_option('sticky_posts');                   $args = array(                       'posts_per_page' => 1,                       'post__in'  => $sticky                   );                   ?>                   <?php query_posts( $args );?>                        <?php while (have_posts()) : the_post(); ?>
Latest Sticky Post
                   <a href="<?php the_permalink(); ?>"><?php the_title(); ?>                   <?php the_excerpt(); ?>                        <?php endwhile; ?>                   <?php wp_reset_postdata(); ?>                  <?php else : ?>
Regular Post
                 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>                 <?php the_excerpt(); ?>                  <?php endif; ?>         <?php endwhile;  ?>     <?php endif; ?>


Show Message By Tag ID for custom post types

In single.php i need to have some conditionals that ask what Tag the post is in so i can display a message, not sure how to do this, but this is the idea: if post related to tag ID '2' say "hello dude elseif in Tag ID '3' say "proper bo" or else "nothing to say" **taxonomy = my_entries** **post_type= myposts** I need to check if post related to TAG ID "2" Then it show a certain message If post in TAG ID "3" then it show another certain message else Nothing


Change permalink based on post category

I am looking for a way to change the permalink structure based on the category a post is in. If the post is in the "blog" category I would like the permalink to be /blog/%postname%/ and if it is any other category just /%postname%/. There used to be a plugin called Advanced Permalinks that could do all of this for you but it is no longer supported. I have researched the topic and can't seem to find a good way to code this myself or any plugins that get the job done. Any help or suggestions would be appreciated.


Get threaded comments number

I'm using Greg's Threaded Comment Numbering plugin to number the comments. Actually I'm displaying a number beside of each parent comment (no threaded comments numbers). I have 2 problems that I have already tried to solve, but without results:   * I am displaying the top comment with a different layout, I need to start the numbering from #2. seems an easy task but I didn't find the way modifying the plugin code.   * Display the total number of threaded comments for each comment that has threads.  Example: COMMENT 1 \------------1.1 \------------1.2 \------------1.3 total threaded comments = 3 COMMENT 2 \------------2.1 \------------2.2 total threaded comments = 2 etc..... I am already using the code below to get the total number of parents. I can also get the children but it is the total, I need to display the number of each comment children as in the example               $number_of_parents = c_parent_comment_counter($post->ID);     $number_of_children = $post->comment_count - $number_of_parents;      Thanks! EDIT: as requested here is the wp_list_comments callback function. Sorry for the mess, I am not a programmer, will clean the code when the work is finished :)               ## Function: Basic Callback Function From WP Codex (http://codex.wordpress.org/Template_Tags/wp_list_comments), January 2009     function gtcn_basic_callback($comment, $args, $depth) {     // no changes here except that we have added in the call to gtcn_comment_numbering        $GLOBALS['comment'] = $comment;                   ?>        <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">        <?php   if( empty( $comment->comment_parent ) ) { //if the comment does not have a parent, then it is L1?>
<?php  echo gtcn_comment_numbering($comment->comment_ID, $args);                       ?>
                             <?php   }              ?>               <div id="comment-<?php comment_ID(); ?>">

                 <?php if( empty( $comment->comment_parent ) ) { ?><?php echo get_avatar($comment,$size='60'); ?><?php } else { ?><?php echo get_avatar($comment,$size='30'); ?><?php } ?>

<?php printf(('%s '), get_comment_author_link()) ?>
                     <?php if( empty( $comment->comment_parent ) ) { ?>

<img src="<?php bloginfo('template_url'); ?>/images/ico-points.png" />3333

<img src="<?php bloginfo('template_url'); ?>/images/ico-level.png" />livello

      <?php } else { ?><?php } ?>
                 <?php if ( is_user_logged_in() ) { if( empty( $comment->comment_parent ) ) {?>

Vota la risposta:
                      <?php    { //if the comment does not have a parent, then it is L1                         if(function_exists(ckrating_display_karma)) { ckrating_display_karma(); }                         }              ?>
                 <?php }} else {                           if( empty( $comment->comment_parent ) ) { ?>

Registrati per votare

                 <?php }}  ?>

           <?php if ($comment->comment_approved == '0') : ?>              <?php _e('Your comment is awaiting moderation.') ?>
           <?php endif; ?>                     <?php comment_text() ?>
              <?php comment_reply_link(array_merge( $args, array('reply_text' => 'COMMENTA LA RISPOSTA', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

<?php if( empty( $comment->comment_parent ) ) { ?>Risposta inserita<?php } else { ?> Commento inserito <?php } ?>                 <?php echo time_ago_comment(); ?><?php edit_comment_link(('- modifica'),'  ','') ?>

          <?php     } // end basic callback function


CPT Main Loop Pagination in single.php

I have a CPT single template (single-work.php) where I need to repeat the loop of posts found in the main loop (archive-work.php). I am using the same loop code in both templates (as well as front-page.php, all working except for single-work.php):               <?php              if ( get_query_var('paged') ) {             $paged = get_query_var('paged');         } else if ( get_query_var('page') ) {             $paged = get_query_var('page');         } else {             $paged = 1;         }              $args = array(             'post_type' => 'work',             'posts_per_page' => 8,             'paged' => $paged,             'orderby' => 'menu_order',             'order' => 'ASC'         );              $wp_query = new WP_Query($args);              if( $wp_query->have_posts() ) :                  while( $wp_query->have_posts() ) :                      $wp_query->the_post();                      get_template_part('assets/loops/loop', 'work');                  endwhile; // end while posts                  echo '
';                 next_posts_link('Older');             echo '
';              endif; // end if posts              wp_reset_query();          ?>      The reason for only a next_posts_link(); is because I'm intending to use infinite scroll to pull in the posts, eliminating the need for a previous_posts_link(); For testing purposes however, infinite scroll is disabled. The href for the "Older" link shows "http://example.com/work/the-newest- post/page/2/", but clicking the "Older" link simply refreshes the page. With infinite scroll enabled, the same 8 posts just keep getting repeated over and over. Is there any way that I can achieve proper pagination in a single template? Thanks, **Update:** I should also note that I have tried using:               $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;      but, sadly, this too does not work :(


Responsive Theme Design: how have slideshow on desktops/tablets and static photo on mobile using same template?

I am building my first responsive WP site with my own custom WP Theme. The primary templates are part fluid, part fixed. This enabled me to create only 3 "versions", a desktop, tablet and mobile version. All changes happen due to media queries. (Sizes are 768 to 1200 px for desktop, 530 to 767 for tablet, 300 to 529 for mobile.) The homepage (which has it's own template) will show a slideshow. The slideshow claims to be responsive (I haven't set it up yet) and I am anticipating it working through the tablet sizes. But when I get to the mobile size I just want to have a static photo. I don't want to just use "display:none" for the slideshow as it will still eat up space/power for the mobiles. I DO want to keep all the versions on the same templates, so I'm thinking I'm going to need some php or javascript to make this happen. (Unless there's some other way, which I'd be thrilled to hear about!) Can anyone help with the code? I have a slideshow div in the CSS:               #slideshow {      height: 296px;      margin: 20px 20px 10px 20px;      padding: 0;     background-color: #f00;     }/*by not setting a width the sshow box fills the space minus the margins*/      and in the template the slideshow shortcode or template code will go between the open and close slideshow div tags. But I would also want to place a photo there for the mobile version. So I think I would need some kind of "if 529px or more, get slideshow; if less, get photo" right? I'm not a php or javascript programmer, tho I'm great at cutting and pasting! The site is viewable at http://66.147.244.110/~rdbikeco/ \-- we are now at the stage of adding page content and the blog needs attention and the sidebars need work, etc. But shell pages are up and content is getting loaded as I write. Help greatly appreciated!


Cron jobs repeating themselves

If I have a function set to run every 5 minutes via a WP cron job, and I have only one visitor during a day, does his visit trigger just one run of that function or all the runs that have been amassed since the last visit? The cron job I have runs a function that fetches feeds from another site.


I have a custom post type with many posts. How do I split the list into multiple pages?

I have about 100 posts, and I want to create pages that only show 10 on each. How would I go about this?


Responsive Images - Generating multiple images from Theme Customizer control upload?

So, after poking around in the code it looks like the filter `image_make_intermediate_size` is not called by the various `WP_Customize_Control()` classes at either `WP_Customize_Image_Control()` or it's parent `WP_Customize_Upload_Control()`. I'm looking to auto-generate images of various sizes, for responsive image serving and I need to execute the `image_make_intermediate_size()` function with some custom sizes that are specific to my extended custom control. Just not sure how to ensure that the uploaded images call this function mainly because I haven't been able to track down where or how the upload functionality of `WP_Customize_Control()` is "unhooked" from the default upload behavior where the function is normally executed. Note that the way it works is obviously the best option, don't want every image uploaded through the theme customizer to auto-generate all the default image sizes, but for my use case, I prefer to use native functionality and just pass some unique size paramters to `image_make_intermediate_size()`.


load more posts by category

Well as you can see here im doing a load by category in every tab i have and show a total posts of 10 by each tab i want to setup once the 10 posts are done. i want to add a load more button to the bottom of the 10 posts i have done that but the viewer has to see the rest of the posts else where for a specific category so i want to show more posts by that category by staying in that same page loading more posts in that tab. this is what i do to display each tab by category & by total posts                <?php      $rightbox = get_posts('&cat=8&showposts=10');      foreach($rightbox as $post) :         setup_postdata($post); ?>      i hope someone can help me out Here's the entire code from a tab http://pastie.org/7731669 thanks


Post not showing up sometimes on website

I have a weird problem. A particular post is not showing up on my website sometimes. So If I clear cache then it shows up. It is happening only to one particular post. I am not able to figure out what the problem can be. **Off-topic** : That particular post is kind of controversial too. So I have a feeling that someone is trying to bring it down. Any help would be highly appreciated.


How to Separate CPT From Regular Posts?

I'm just starting to populate my CPT. I want to keep it separate from regular posts. But when I go look at regular posts (in the `single.php` template), the Prev/Next nav includes CPT posts. Interestingly, CPT posts do _not_ appear on the home page list. UPDATE: I'm using the `get_previous_post_join`, `get_previous_post_where`, `get_previous_post_sort` filters, and their next counterparts. These seem to be affecting all navigation. How do I constrain them to only affect the desired pages? UPDATE 2: So made code changes as described in my own answer below (encapsulated the get_previous/next_post_* filters in a function, which I called from the CPT single template, before the loop. This is the code in the plugin:                    function aaaConsultant_set_nav_filters() {             add_filter('get_previous_post_join', 'aaaConsultant_get_previous_post_join_custom_sort');             add_filter('get_previous_post_where', 'aaaConsultant_get_previous_post_where_custom_sort');             add_filter('get_previous_post_sort', 'aaaConsultant_get_previous_post_sort_custom_sort');                  add_filter('get_next_post_join', 'aaaConsultant_get_next_post_join_custom_sort');             add_filter('get_next_post_where', 'aaaConsultant_get_next_post_where_custom_sort');             add_filter('get_next_post_sort', 'aaaConsultant_get_next_post_sort_custom_sort');         }              function aaaConsultant_get_previous_post_join_custom_sort($join) {             global $wpdb;             return "INNER JOIN {$wpdb->prefix}postmeta ON (p.ID = {$wpdb->prefix}postmeta.post_id)";         }         function aaaConsultant_get_previous_post_where_custom_sort($where) {             global $wpdb, $post;             $meta_value = get_post_meta($post->ID, 'aaaConsultant_dateofletter', true);             return "WHERE 1=1  AND p.post_type = 'refletter' AND p.post_status = 'publish' AND {$wpdb->prefix}postmeta.meta_key = 'aaaConsultant_dateofletter' AND {$wpdb->prefix}postmeta.meta_value < '{$meta_value}'";         }         function aaaConsultant_get_previous_post_sort_custom_sort($sort) {             global $wpdb;             return "ORDER BY {$wpdb->prefix}postmeta.meta_value DESC LIMIT 1";         }              function aaaConsultant_get_next_post_join_custom_sort($join) {             global $wpdb;             return "INNER JOIN {$wpdb->prefix}postmeta ON (p.ID = {$wpdb->prefix}postmeta.post_id)";         }         function aaaConsultant_get_next_post_where_custom_sort($where) {             global $wpdb, $post;             $meta_value = get_post_meta($post->ID, 'aaaConsultant_dateofletter', true);             return "WHERE 1=1  AND p.post_type = 'refletter' AND p.post_status = 'publish' AND {$wpdb->prefix}postmeta.meta_key = 'aaaConsultant_dateofletter' AND {$wpdb->prefix}postmeta.meta_value > '{$meta_value}'";         }         function aaaConsultant_get_next_post_sort_custom_sort($sort) {             global $wpdb;             return "ORDER BY {$wpdb->prefix}postmeta.meta_value ASC LIMIT 1";         }      And this is the code in the template:               <?php      aaaConsultant_set_nav_filters();     if (have_posts()) : while (have_posts()) : the_post(); ?>      The problem is that regular posts show up in single.php, but the nav goes back to the beginning of the list of posts, and does not traverse the entire list. Not sure what this is caused by. Will try to deactivate plugin and see what gives. Also, in a quandary as to whether this should go in a new question, or get added to this one, as it's clearly an effect of the nav changes. (Well, "clearly" is yet to be proven, I suppose.) UPDATE 3: So, deactivated plugin, and still having issues with nav in regular posts. These were just generated through the Demo Data Creator. But then I made some manual changes to the wp_posts and wp_postmeta tables when I decided to rename the CPT. So these issues may be a result of that messing about. I'm thinking I'll strip out the generated posts and regenerate. UPDATE 4: Yes, regenerating the posts seems to have fixed the issue. We'll put it down to my own awkward database manipulations. Not sure whether we want to strip out updates 3 and 4 (and perhaps a bit off Update 2, as well). I'll leave that to the StackExchange sages.


Changing taxonomy term by slug (wp_update_term)

What I am trying to accomplish is to update a taxonomy term name using its slug rather than the $term_id Wordpress does this by:               <?php wp_update_term( $term_id, $taxonomy, $args )  ?>      Is it possible to do this via the slug instead?               <?php wp_update_term( get_term_by( 'slug', $value, $taxonomy, $output, $filter ) )  ?>      I've been stuck on this for a while - but no success. The default taxonomy terms are created by a plugin. I am creating a secondary plugin to change the taxonomy terms created by the 'parent' plugin. Thanks! Roc. \--- Edit --- Should mention that I am not able to update the term by id because the taxonomy id changes based on when the plugin is activated, and if other tags exists before it can be created.


How to show only today's post?

I want to show only today's or current date post in my blog.   Here is my code but it's not working.               <?php        $day = date('j');        query_posts('day='.$day);        if (have_posts()) :     while (have_posts()) : the_post();       ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="view: <?php the_title(); ?>"><?php the_title(); ?>

<?php the_content(); ?>
     <?php endwhile; ?>     <?php endif; ?>      How to solve this?


Plugin for "Was This Helpful" at end of post?

I'd like to use a Wordpress instance as a product help & faq platform. I'm wondering if there is a lightweight plugin that provides a "yes/no" voting option at the end of a post, to which I'd use the question "Was this post helpful to you?" I can then go into the admin panel to see the total number of yes's and no's per post. Does one like that exist? I've found a multitude of "Digg-like" up/down plugins, but they are far too complex for what I'm looking for. I've looked at Vote-It-Up and WP-Polls, which both seem like they can be hacked to accomplish what I want, but I wanted to first check to see if there was a ligher weight solution out there. Thanks in advance for the suggestions.


Ajax post filter by taxonomy

I want to make a filter width more than one tanonomy width ajax and jquery, The demo i want to code is: http://gycweb.org/resources/ I have tried to code with this demo: http://dinhkk.com/demo/ajaxfilter/ The problem is i can send in formation from two menu on right sidebar to the ajax data at the same time can any one help me the solution ??


Multiple custom post types on same admin page

Here's my situation.... I'm creating a plugin that will allow families to register on the site I'm working on. Each family will have 1 or more children that they need to add to their registration. My initial thought was to make 2 custom post types - Family and Child and relate them either through metadata or through a custom table (1 to many joins). My question is, is it possible in wordpress to create an admin page that would allow adding and/or editing of a family and all of the related children in one place (including adding, removing, and editing children as necessary)? If so, are there resources out there that can show me how to do it? Thanks, Jon


Gallery Only Displaying One Thumbnail

My image galleries are showing only one thumbnail in the post the gallery sits in. http://themeforward.com/demo2/2013/03/08/image-gallery/ **My single.php markup can be found here:** http://snippi.com/s/akm5jb7 Additionally, previous_image_link and next_image_link are not displaying when the image is clicked (these would lead to the other images in the gallery). **My entire image.php markup can be found here:** http://snippi.com/s/ajwa5yh **My gallery shortcode:** `[gallery link="post" ids="2245,2246,2247"]`


Revamping a Wordpress mirror site - and I don't know where to start!

I have taken on a job at a language school in Spain that has asked me to revamp their website for them. From what I know, the previous designer has done a runner with the details of everything but the wordpress login itself - server info gone,plus domain rules, so all I can access is the dashboard and other sections on this page. The boss has asked that I "play around with the design a bit", change to template etc to better fit the needs of the company. I know how to change things, but I'm afraid of doing that as it will change all of the live site dramatically, and I need to make a dummy run before publishing. Tomorrow I'm going to sit her down and tell her that I need to know what style she wants, but this is a pre-emptive strike against the boss. I have until the weekend to learn how to dramatically change and fix problems in wordpress? Where can I start? Any suggestions?


pagenavi issue on multi wordpress insall

Apologies in advance for my explanation of this problem. I've got one install of wordpress running several different websites. The actually problem is with the pagenavi function. It seems to work on the main site that is running the wordpress install but not the sub websites that are just pulling in the functions and wordpress files via PHP. The function for the main website generating the page-nav is the following               function wpld_pagenavi_search() {         global $wp_query, $wp_rewrite;         $pages = '';         $max = $wp_query->max_num_pages;         if (!$current = get_query_var('paged'))             $current = 1;              $a['base'] = ($wp_rewrite->using_permalinks()) ? user_trailingslashit(get_pagenum_link(1) . '&page=%#%', 'page') : @add_query_arg('page', '%#%');         if (!empty($wp_query->query_vars['s']))             $a['add_args'] = array('s' => get_query_var('s'));              $a['total'] = $max;         $a['current'] = $current;              $total = 1; //1 - display the text "Page N of N", 0 - not display         $a['mid_size'] = 5; //how many links to show on the left and right of the current         $a['end_size'] = 1; //how many links to show in the beginning and end         $a['prev_text'] = '« Previous'; //text of the "Previous page" link         $a['next_text'] = 'Next »'; //text of the "Next page" link              if ($max > 1)             echo '
';         if ($total == 1 && $max > 1)             $pages = 'Page ' . $current . ' of ' . $max . '' . "\r\n";         echo $pages . paginate_links($a);         if ($max > 1)             echo '
';     }      The subsites use the same function to generate the same layout of the pagenavi. It generates find but the pages it links through don't exist. I'm stuck as to why it doesn't pull in the correct pages as it works on the main site. Main Site Page with pagenavi at the bottom - This is page 2 that works fine. Subsite page with pagenavi at the bottom - This is page 2 that displays a broken page. Thanks for any help.


How do I query based on the modified date?

I would like to list posts by the "modified" date not the published date. Is there a way to do this?                       $documents = array('posts_per_page' => 10, 'post_type' => 'documents',);             query_posts( $documents );             get_template_part( 'loop', 'docid' );             wp_reset_query();


Check if meta key value already exists

Let's say that I have few posts with meta key "videoid". Value of that meta key is different for every post (and has to be different). When adding new post, how can I check if videoid with that exact value already exist for some older posts? I used this as a refference for adding custom meta box to admin area of WP: http://codex.wordpress.org/Function_Reference/add_meta_box


Buddypress: Load Ajax Without Template Pack

How can I load buddypress ajax without using the template pack plugi n? I had this in a non-buddypress compatible theme's functions.php.               include( BP_PLUGIN_DIR . '/bp-themes/bp-default/_inc/ajax.php' );               function mytheme_enqueue_bp_default_js() {     wp_enqueue_script( 'dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array( 'jquery' ), bp_get_version() );          $params = array(         'my_favs'           => __( 'My Favorites', 'buddypress' ),         'accepted'          => __( 'Accepted', 'buddypress' ),         'rejected'          => __( 'Rejected', 'buddypress' ),         'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ),         'show_all'          => __( 'Show all', 'buddypress' ),         'comments'          => __( 'comments', 'buddypress' ),         'close'             => __( 'Close', 'buddypress' ),         'view'              => __( 'View', 'buddypress' ),         'mark_as_fav'       => __( 'Favorite', 'buddypress' ),         'remove_fav'        => __( 'Remove Favorite', 'buddypress' )     );     wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params );     }     add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_bp_default_js' );


how can get database name in wordpress?

I want to get WordPress database name. I have also try to get database name from $wpdb but failed. When print the $wpdb it give an object array but i don't know how to get database name from object array.


Help me fix these crazy attachment page URLs (rewrite?)

On one of my sites if a post's permalink is as follows:               http://example.com/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates/      the attachment page for the thumbnail image (i.e. featured image) will be like this:               http://example.com/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates-2/      In other words, the attachment page URL is a repetition of the parent post's URL (sometimes with a '2' slapped on it at the end like in the example). I want to make the attachment page URLs like this:               http://example.com/post-url/artwork-detail/      I also pass GET parameters to the attachment pages like this:               http://example.com/post-url/post-url?size=400      I want this to become:               http://example.com/post-url/artwork-detail/size-400      The URL duplication is my big concern, the GET translation isn't a priority so long as the parameters aren't lost.


Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis

I've created a custom post type for employee Profiles. The one thing I can't (yet) figure out is how to make custom sidebars for each of the employee's profiles. I have figured out 2 ways to get custom sidebars, but they are not what I want. ( 1.Simple Sidebars plugin; 2.custom code applied to single- profile.php and functions.php) I'm trying to set it up so the site owner doesn't have to go into widgets to edit a sidebar, but rather can edit it within the Profile editor. I guess what I need to do is 'display custom fields outside the loop'? Then I can use the Advanced Custom Fields plugin to create the fields for the sidebar which will be editable within the editor for the profile CPT. I'm using Genesis. I'm not referring to metaboxes with dropdowns for sidebar widgets, or sidebar widgets at all, but a way to submit content and a profile image (using Advanced Custom Fields?) within the individual profile editor screen, then a way to output that information individually to the Profile CPT sidebars. Each profile should have a unique sidebar (unique to each employee.) Thanks!!


Plugin to load theme if mobile and specific page

I've been browsing some of the other questions and I haven't been able to find a solution. There was a great solution to part of my problem that I'm basing this code on. I need to detect if on mobile, and display the mobile theme with one exception. If a user is on mobile and on page ID 145 the normal theme needs to be used. This is the code I have that works, except does not display the normal theme on that specific page on mobile. I've tried some variations with no luck. Thanks for looking.               add_filter('template', 'change_theme');     add_filter('option_template', 'change_theme');     add_filter('option_stylesheet', 'change_theme');     function change_theme($theme) {         if ( wp_is_mobile() ) {             $theme = 'SelectThemeMobile';              }               elseif ( is_page( 145 ) && wp_is_mobile() ) {                  $theme = 'SelectThemeOne';         }              return $theme;     }


Show only the grandchildren (using get_terms)

I'm working with a hierarchical taxonomy (named "world") that has 3 levels to it (`Regions > Countries > Indigenous Peoples`). At the moment I'm using a modified version of this code to paginate all the results on a single page. Here's the important part               $page = ( get_query_var('paged') ) ? get_query_var( 'paged' ) : 1;     // number of tags to show per-page     $per_page = 24;     $offset = ( $page-1 ) * $per_page;     $args = array( 'number' => $per_page, 'offset' => $offset, 'hide_empty' => 1,'hierarchical ' => true     );      and               $taxonomy = 'world';     $tax_terms = get_terms( $taxonomy, $args );      As expected, this returns a paginated list of all the terms associated with my taxonomy. The problem is, I only actually need to show the grandchildren, in this case, `"Indigenous Peoples"`. I'm tempted do it manually, but I'd rather not serve up a list of 450+ terms to include (or 80 terms to exclude) unless it's absolutely necessary. Your help would be most appreciated.


Guest authors, sort of like Wikipedia, but more theme-able

My first post on WordPress SE. I'm bouncing around an idea of a new site. I want to allow for guest editing like wikipedia that someone can create articles if it doesn't exist already, existing articles can be edited, articles have edited history with IP address, allows for uploading of pictures from guest authors. Can this be done in WordPress? I've tried searching online, but all seems to point to having to create a login account. I want true guest editing, without account creation. But of course someone could create an account and do the same thing, but will have edits and contributions linked to their account name. Edit: I've decided against the complete guest editing option and going to opt to have them create an account. This seems to be the easiest route. Thanks.


W3 Cache plugin and Facebook sharing

_**_LATEST UPDATE (June 13th 2012)** I can't figure out what's wrong with my codes. When I want to share one of my blog posts and use either the Facebook share button or copy the link of the blog post directly into Facebook all that pops up is the URL itself, not the meta info such as description or featured image! I filled out the meta data for each and every post and I also added Open Graph to my code. Yet, when I try to share my blog post links on Facebook, neither the meta description nor a thumbnail would show up for the majority of my blog posts. It's like something is blocking the information. I've run out of ideas. I really hope you guys can help me figure out what's wrong! (obvioulsy I replaced the fillers above with my own data!) I also used the Facebook Debugger and all it tells me is: > Can't Download: Could not retrieve data from URL. **Updated Information:** I finally was able to figure out what was wrong thanks to Milo and MathSmath! The W3 Cache Plugin is interfering with the Facebook sharing progress, but it's quite easy to change that. Scroll down to see my answer! Works like a charm!


Wordpress CMS - hide content from public while in editing stages

I'm setting up a simple web site for a member of my family, using wordpress as a CMS. I've already registered a domain name and I'm about to set up wordpress. I want them to be able to edit the site content online (using wordpress's admin interface) and view the site, but I don't want the site to be available to the public while it's in the editing stages. Can anyone suggest a good way to prevent access to the public (for example a "coming soon" page, but access to the main site via a password; or perhaps put the wordpress installation in a subdirectory while the site is in the editing stages, and then use url rewriting to redirect the root directory to the subdirectory when the site goes live). I should mention that I'm relatively new to wordpress, so if this kind of functionality is built in I apologise for asking the question.


Password in wp-config. Dangerous?

I don't know a lot of Wordpress yet, and I'm just wondering: Before installation you have to fill in the correct data in `wp-config- sample.php` but this also includes the database password. Isn't that dangerous? I mean, can some one explain how this is protected from just reading the file and thus getting the password of your DB?


Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. ![enter image description here](http://i.stack.imgur.com/4vfuq.png) source: http://upload.wikimedia.org/wikipedia/commons/3/3d/Wordpress_Template_Hierarchy.png


What's a good strategy for planning WordPress DB growth?

Hoping for some feedback on the topic of optimizing and staying on top of performance as a WordPress database grows... to paint a picture.... let's say you have a WordPress / Buddypress MU site that begins at around 150kb (vanilla install)... over time users add blogs, forums, posts, and comments and the database grows to 5mb.... then 10mb the next year.... Also assuming that hosting controls are a standard colocated setup such as Cpanel or Plesk.   * At what point does the number of entries in the database impact performance of the front-end website?   * What can you do as a website manager to keep this running smoothly as your database grows?   * What can you expect in terms of performance after year 5 when your database is 500 - 600mb big? Thanks for any feedback you might have on keeping a tight ship. Regards, S.


Finding difference in days

I want to store the current time using the update_option and then compare it if the set time was 3 days ago. I want to know in what `format` I should store the time? and then how can I compare it with current time and find the difference in the days?


How to find meta entries with their posts missing via SQL?

I'm looking to write an SQL query to do the following: Select all postmeta rows where the meta_value = a post id that does not exist. For example, postmeta meta_value may equal 235. Usually this would relate to a post (attachment) with 235 as an ID, however, it has been deleted. I want to find any postmeta rows like this and remove them. Hope this makes sense! Thanks in advance. EDIT: I've just found the NOT EXISTS function. I have a feeling something like this would work:               SELECT m.*     FROM wp_postmeta m     WHERE m.meta_key = 'image'     AND NOT EXISTS (SELECT *         FROM wp_posts p         WHERE m.meta_value = p.ID)       Does this look right?


How to change the default class for the widget title?

I would like to change the default class of the widget title. Currently it is h2 and I would like it to be h3. I have seen there is the option of customizing css so that h2 looks like h3.               #sidebar h2 {     font-size: 24px;     }      But then, this may cause a problem if I modify h3 later, h2 will not follow the changes. And I also saw this discussion How to add class on Widget Title about how to create a register a new widget. But I would like to apply it to the default widget, not register a new one... Thanks for your help


Why are my comments closed?

I have a simple site with a few pages plus a blog. For some reason, the blog posts state **comments are closed** and I can't figure out why. I want to open the comments on all blog posts (and not offer comments on pages). In the "edit post" screen, the "Comments" section just states "No comments yet." but doesn't offer any way to turn them on. In settings>discussion, I have these: > ON Comment author must fill out name and e-mail   >  OFF Users must be registered and logged in to comment   >  OFF Automatically close comments on articles older than (14) days   >  ON Enable threaded (nested) comments levels (5) deep   >  ON Break comments into pages with (50) top level comments per page and ... > > OFF Before a comment appears An administrator must always approve the > comment   >  ON Comment author must have a previously approved comment > > ON Hold a comment in the queue if it contains (1) or more links.


Adding set of custom fields to Wordpress Post in Dashboard

I am working on a WordPress site and while creating a new posts we have certain number of custom attributes which are always part of the post, as of now we need to manually add those all custom fields while creating the post. I am looking a way so that when we click on the new post link the template should come with this set of default custom fields with default values and admin can change them if he/she want to change any default value. i know that there are few plugins, but i do not want to use those plugins in mean time i also have to take care that this new functionality should not break any thing as we already have thousands of published posts and i do not want them to get affected by this functionality. Any suggestion or pointer in this regard will really be helpful.


Print Cforms form as pdf

I have created a form using Cforms from Delicious. The client asked me for an option to print this form as a pdf. I tried some plugins such as Print Friendly and PDF Button that make it possible to add a pdf or print button, but this button is subsequently added to all pages and most of the time the form does not appear on the print preview /printout. Does anyone know how I can do this?


How do I add my PHP app to a Wordpress page whilst keeping semantic URLs?

I am rebuilding a static website for a client using Wordpress on the main domain- eg domain.com. There is also a directory of members website at directory.domain.com which I was hoping to migrate over to the main website- `domain.com/directory/` _(We want to do this, firstly to keep it on the same domain, but also so that we may be able to use the same layout and styles- preferably by using a page template.)_ The app has a main page, a list view and a member details view, and search queries are sent using `$_GET`. URLs are made to look nice (semantic URLs) by using mod_rewrite eg: `directory.domain.com/list/people/all/by- name/page-1/20-per-page/` example code from the .htaccess file could be: `RewriteRule ^list/([a-zA-Z0-9-\-]+)/([a-zA-Z0-9-\-]+)/([a-zA-Z0-9-\-]+)/$ /list.html?member-type=$1&area-name=$2&order-by=$3 [L]` I've thought of two possibilities in which to achieve the above... 1) If we kept the directory of members on the different subdomain then it might be possible to cache and use a copy of a blank page on the WP site and then use this as a template for the directory of members. 2) Somehow have the php code of the directory of members within a WP page. Ideally I want to go for (2), but I am not sure how to implement this. So what's the best way to achieve this? Specifically...   * How do I run the PHP for the app within a WP page?    * How do I access the $_GET variables and enable nice (semantic) urls using mod_rewrite? For example, if the directory is on `domain.com/directory/` how do I get it to pass `$_GET` variables by extending the url but keeping the same WP page, eg. `domain.com/directory/list/people/all/by-name/page-1/20-per-page/` ? Sorry if I haven't explained this very well, it's a little complicated!


Can't login to wordpress despite changing password to something known directly in MySQL or using "Password Reset by Email" feature

I'm unable to login to my wordpress site v3.1.3 even though I know the password. To be extra sure, I directly changed the password for the user account (ID=1) with               UPDATE wp_users SET user_pass="(MD5-hash-of-pwd)" WHERE ID = 1;      I've verified that:   1. ID=1 is my user account   2. Triple checked that the MD5 hash is correct for the password I am setting it for   3. Quadrupled checked that my user_login name is the one I'm using I then go to my wordpress login and am told that my username and password is incorrect. I also tried using the "forgot password" flow that allows me to reset by email. I succesfully changed the password using that flow but still can't login. Oddly enough, I noticed that when I look directly in MySQL, the hash value for is **different** when I generate it with and online MD5 tool vs. the password reset flow. I've verified on the wordpress site that they state they use MD5 for pwd hashes: http://codex.wordpress.org/Resetting_Your_Password What's going on?!


How do I display logged-in username IF logged-in?

I'm working on creating some text that says 'Login' to users that are not logged in, and the user's username or display name when logged in. It seems like it should be an easy problem to solve, and I've found the following two bits of code on the wordpress codex that each do half of what I am looking for, but I haven't figured out how to combine them (without breaking the site). Is this the correct direction, or way off base? **To check if the user is logged in and display something different depending:** `<?php if ( is_user_logged_in() ) { echo '{username code here}'; } else { echo 'Login'; } ?>` **To get and display the current user's information:** `<?php global $current_user; get_currentuserinfo(); echo 'Username: ' . $current_user->user_login . "\n"; echo 'User display name: ' . $current_user->display_name . "\n"; ?>`


How do you make a custom post type items automatically delete items 3 months after publication?

I'd like somer code that I can place in my `functions.php` file that will only modify the specified custom post type. I have already tried several plugins, but all of them have more features than I need. It's overkill to mess with things I don't want them to mess with. Ideally, the code will:   * Set up a daily cron job for 00:00 (at night)   * Fire a custom function that queries the database for the custom post type and compares its publication date with current date.    * If the custom post type is older than 3 months (the custom function returns true), then it will call `wp_delete_post()` for the post's ID. Unfortunately, I can't put it all together myself. Is there a good (simple) plugin that does this? A code snippet you have off the top of your head?


Setting custom cookies in Wordpress

I am trying to set cookies to re-route returning users to my a specific page within my Wordpress site. I'd like some advice with these 2 things:   1. Where in the Wordpress php files should cookies be checked before loading any content to handle a redirect? Is there a good file this should exist in over others?    2. How do I properly set a cookie within Wordpress? `setcookie('cookie_name', 'cookie_value', time()+4000);` doesn't seem to be saving any cookies to my system.


How to find a run away wordpress plugin causing performance problems

My shared hoster is continually disabling my site as it appears there is a run away plugin that is pegging mysql. In their logs, I'm seeing these:               # Wed Jun 29 00:00:33 2011     # Query_time: 22.923943  Lock_time: 4.941786 Rows_sent: 100  Rows_examined: 808400     use FOO_wrdp2;     SELECT * FROM wp_slimex_stats LIMIT 808300, 100          # Wed Jun 29 00:00:38 2011     # Query_time: 4.485267  Lock_time: 0.000093 Rows_sent: 100  Rows_examined: 808500     use FOO_wrdp2;     SELECT * FROM wp_slimex_stats LIMIT 808400, 100          # Wed Jun 29 00:00:39 2011     # Query_time: 1.409544  Lock_time: 0.023081 Rows_sent: 100  Rows_examined: 808600     use FOO_wrdp2;     SELECT * FROM wp_slimex_stats LIMIT 808500, 100      Notice the `wp_slimex_stats` mention and teh large query times. This is the part that's raising red flags for my shared hoster. `wp_slimex_stats` is indeed a table in my wordpress db but there is no such plugin installed or running on my wordpress blog. It also doesn't appear to be a part of other plugins I have installed. I've done a web search and can't find much info at all on this plugin but it appears to be a logging plugin based on the columns I see in the mentioned tables (remote_ip, langugage, country, domain, referer, etc). How in the world do I debug this to track down where the plugin actually is so I can disable it?


Using Zurb's Foundation Tabs as Wordpress Nav (Active Tab)

This is a question more geared towards those of you out there that have experience working with the popular SASS/JS Framework, Foundation by Zurb. I am trying to use it as my structural core to my new Wordpress theme and had a question... Built into Foundation are stylings for buttons, forms, and of course the famous 12-column grid. However, it also comes with jQuery Tabs that can be used to display tabbed content! Well, I wanted to use these to display my theme's navigation and have no clue as to where to start. Currently, I have the below in place:

                     Home

                     About

                     Contact

Home Page?

About Page?

Contact Page?

                    Again, I'm just beginning with the Foundation framework and as I can tell, this is correct to display the actual tabs... however, this is just for pure content within the tab - NOT a link to a new part of the site that will show an active tab for that section. How can I use this Foundation Tab logic and meld it with Wordpress so when a user clicks on it, it loads that part of the site and show the correct "active" tab per page. Examples:   * User clicks on "News" > An Article and is on single.php. The "News" tab should remain "active" while in the News section of the site.   * User clicks on "Contact" which loads a Wordpress page containing a contact form. "Contact" tab is active.   * etc Any and all help would be greatly appreciated. If you're unclear on what the Foundation Framework is, click here to be taken to their Documentation center and the section on Tabs. I'm honestly at a lose and it's probably in front of me... figured I'd open a conversion to see if someone sees it. LOL Thanks all!


Register page in admin area

Ok, so I have a table in my admin area for my plugin. Each row as an edit button, which should post to the edit page. I don't know how to add my php edit page to the registered wordpress page, though, so I don't know what to put for action in the form.                       <td><form action="[edit.php]" method="post">                     <input type="hidden" id="<?php echo $issue->id?>" name="id" value="1">                     <input type="submit" value="Edit">                 </form>             </td>      So what should I put inside the brackets (and yes, I will remove the brackets), and where/how do I add edit.php so wordpress knows it exists? UPDATE: So apparently I just add edit.php normally, but specify null for its parent. Stil no idea what to put in those brackets. UPDATE 2: Apparently the function I was looking for was menu_page_url...


How do you Permanently Delete Sidebars

I'm developing a custom theme and I added some widgetized sidebars like so:               register_sidebars(2, array('name'=>'Foobar %d'));      I then recreated them so that I could give them semantic names. Like so:               register_sidebar(register_sidebar(         array(             'name' => 'Sidebar'         )     ));     register_sidebar(register_sidebar(         array(             'name' => 'Sub Menu'         )     ));      But now in my admin area I see 4 sidebars. How do I delete the two older sidebars? I can unregister them using `unregister_sidebar` but I don't want to keep those 2 lines of code in my theme forever. I found this in the DB under `wp_options` under `sidebars_widgets`. It looks like they are indeed saved in the DB. Do you have any idea which bits to delete?               a:6:{s:19:"wp_inactive_widgets";a:0:{}s:9:"sidebar-1";a:3:{i:0;s:14:"recent-posts-2";i:1;s:10:"archives-2";i:2;s:12:"categories-2";}s:9:"sidebar-2";a:0:{}s:9:"sidebar-3";a:1:{i:0;s:21:"subpages-in-context-2";}s:9:"sidebar-4";a:0:{}s:13:"array_version";i:3;}      Thanks,


Add additional Network constants to wp-config.php dynamically

When starting with a fresh Network install, the first step is a single site install that has one additional line in the `wp-config.php` file:               define( 'WP_ALLOW_MULTISITE', true );      After that we have to go to `Tools > Network Setup`, enter some details like network name and super admin email and finally hit the button to run the setup. The next step the pops up is actually two steps:   1. Add _additional_ constants to your `wp-config.php` file              define( 'MULTISITE', true );     define( 'SUBDOMAIN_INSTALL', true );     define( 'DOMAIN_CURRENT_SITE', 'example.com' );     define( 'PATH_CURRENT_SITE', '/' );     define( 'SITE_ID_CURRENT_SITE', true );     define( 'BLOG_ID_CURRENT_SITE', true );        2. Add some rules to your `.htaccess` file. As I don't do single site installs (no reason for that anymore), I'd like to add those constants dynamically to my `wp-config.php` file:               define( 'WP_ALLOW_MULTISITE', true );     if ( SOME_CHECK_IF_STEP-1_WAS_PASSED )     {         define( 'MULTISITE', true );         define( 'SUBDOMAIN_INSTALL', true );         define( 'DOMAIN_CURRENT_SITE', 'example.com' );         define( 'PATH_CURRENT_SITE', '/' );         define( 'SITE_ID_CURRENT_SITE', true );         define( 'BLOG_ID_CURRENT_SITE', true );     }      So I don't have to go to the `wp-config.php` each time and edit it again. The _1st_ thing that came into my mind was to check the DB for the `{$wpdb->prefix}sitemeta` table, but I don't want to do an additional query on each site load. The _2nd_ thing I thought of was to check if the `blogs.dir` already exists, but that's not the case. > **Question:** How can I indicate that I already passed the first step of the > network setup in way that doesn't has a massive overhead or decreases > performance.


password_reset hook is not working

I am developing a plugin where a MySQL user is created with username same as WP-username and password is entered by user using form . Now If the user resets its password in WordPress then the same password should be set in MySQL user. for that purpose I tried to use password_reset hook but it is not working Code: I use this code in init               add_action('password_reset',array(&$this,'my_reset_password'),10,2);      and define the function as:               function my_reset_password($user, $new_password)     {              $data=array('slave_name'=>$new_password);         $where=array('site_user_id'=>$this->user_id);         $res=$this->update_data(TABLE_PREFIX.'slaves',$data, $where);         //return $res;         //var_dump($new_pass);         //$this->flag=$new_pass;          }      The above code runs successfully as individual but when hooked with password_reset it is not working. suggestions with code samples will be appreciated.


Change My Basket text in the header of WooCommerce Artificer theme

I'm using WooCommerce with free Artificer theme and I'm trying to change the text for **My Basket** and **Checkout** shown on image below: ![enter image description here](http://i.stack.imgur.com/CvA0S.png) Now, I've searched the localization files for any string matching My Basket (all possible variations) and came to conclude that this isn't possible to translate using language file. Since this basket information is visible on every page I went to look into the **header.php** file in the **themes/artificer** folder and comparing to the HTML output (using Dev tools in Chrome) I came to believe the output is controlled by this line:               <?php woo_nav_before(); ?>      But, now I've spent some reasonable amount of time googling and searching the template files for where this function is defined but I can't find it for the life of me, so can someone please point me in the right direction.


How do I set up the defualt page icon for admin menu?

What do i Change this to So its shows the default page icon?`', plugins_url( 'myplugin/images/icon.png' )`                add_menu_page( 'Info', 'Info', 'manage_options', 'LINK', '', plugins_url( 'myplugin/images/icon.png' ), 10 );      I find out how to do this. Step 1. Screenshot or find the image you like. Step 2. Name it icon.png step 3. Create a folder myplugin inside the plugin folder and then create inside that folder images folder and then put the icon.png image inside the image folder and thats it. in short plugin > myplugin > image > icon.png


Custom Login Page -- wp_signon Headers Already Sent?

As the title suggests, I'm building a custom front-end login page for users of my site. I'm using wp_signon to log the user in after their credentials have been validated, but I'm getting this error:               Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\wordpress\wp-content\themes\twentyeleven\header.php:13) in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php on line 737      twentyeleven\header.php:13 shows this (lines above and below included):               <!--[if IE 6]>     <html id="ie6" <?php language_attribute(); ?>>     <![endif]-->      I've read a thing or two that said wp_signon must occur before any page content is created because it alters the headers, but I guess I'm not really sure how I'd use it then. Where should wp_signon go? Here's the structure of my code as it is:               //Retrieve submitted $_POST values.     //Check if this is the first time the form has been displayed (there is a hidden input at the end of the form that changes a boolean to false for all future submits)     //If it's not the first time, do form validation and create an array with error ID's to be displayed in the form. One of these possible errors is wrong username/password combo:     if (!get_userdatabylogin( $submitted['email'] ))          $errors['emailIsValid'] = false;     else     {          $user_data = get_userdatabylogin( $submitted['email'] );          $password_hashed = $user_data->user_pass;          if (wp_check_password($submitted['password'], $password_hashed, $user_data->ID))          {               $credentials = array();               $credentials['user_login'] = $submitted['email'];               $credentials['user_password'] = $submitted['password'];               if (empty($submitted['rememberme']))                    $credentials['remember'] = false;               else                    $credentials['remember'] = true;               wp_signon($credentials, true);          }          else               errors['passwordMatchesEmail'] = false;     }     //Check to see if the errors array has any flags, if so flag a variable to say errors exist     //Form code: form submits to itself     //Check error flags and display error message accordingly     //Display body of form      Everything works perfectly except for that `wp_signon` line. Entering the correct credentials yields the error I mentioned above.


Search page results conflicting logic - Search result caching?

I recently stylized my search page results from the base template _S, and got everything to work quite nicely. I've developed it to return false/positive header/body. It should only return a positive header if there are actual results found, and then the positive body should contain those results, otherwise, it should return the false versions of the two of them. However, with some queries (which should be getting search results) somehow return a "positive" header, and for whatever reason, a "negative" body (telling the user that there are no search results). Strangely enough, I've tested other words, and those words act as they should, with the proper false/positive responses being returned. You can check it out here. On my site, you can try searching for something like "Shortcodes", and will return up with a positive header which says something along the lines of "Search Results for: Shortcodes" and will then list the results that it found, whereas if you search for something like "Search", it will return that positive header for there being posts there, but it won't render out any posts, and instead render out the negative body, which tells you that there are no search results. (Even though I have made a post about "searching" recently... which is perplexing. My search.php is:               <?php     /**      * The template for displaying Search Results pages.      *      * @package League Of Legends: Rift      */          get_header();           if ( have_posts() && $pco_rift['opt-search-sidebar']['2'] || !have_posts() && $pco_rift['opt-search-sidebar']['1']){         $sidebar_active = true;     }      ?>         <?php if ( have_posts() ) : ?>             <?php if ( have_posts() ) : the_post(); ?>
<?php printf( __( ' Search Results for: %s', 'league-of-legends-rift' ), '' . get_search_query() . '' ); ?>
                                  <?php endif; ?>         <?php else : ?>
<?php _e('Nothing Found', 'league-of-legends-rift')?>
                      <?php endif; ?>
             <main id="main" class="site-main" <?php if(!$sidebar_active){ echo 'style="margin: 0" '; } ?>role="main">                  <?php if ( have_posts() ) : ?>                      <?php /* Start the Loop */ ?>                 <?php while ( have_posts() ) : the_post(); ?>                          <?php                     /**                      * Run the loop for the search to output the results.                      * If you want to overload this in a child theme then include a file                      * called content-search.php and that will be used instead.                      */                     get_template_part( 'content', 'search' );                     ?>                 <?php endwhile; ?>                 <?php league_of_legends_rift_paging_nav(); ?>             <?php else : ?>
<?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'league-of-legends-rift' ); ?>
                 <?php get_search_form(); ?>             <?php endif; ?>
     <?php      if($sidebar_active){     get_sidebar();     }      get_footer();     ?>      I've setup a sidebar active thing at the top, and what it does is it will not render the sidebar if there are no search results (because this code will render out a nice long search bar, which I don't want to cause the duplication of the one in the sidebar). Interestingly enough, my other random queries like "gaspdiojfapsoidfjasdf" will return everything correctly (negative header, negative body). Thanks, Adam


Sorting by meta_key different to search criteria?

I've created an admin only page simply to view more information about subscribers to my website. The subscriptions are stored as Custom Post Types. All I want to do is make a condition that looks up a list of cancelled subscribers and orders them by the expiry of the subscription. The subscription expiry is stored as yyyymmdd as a meta tag on the post. There are a few pages about this, but I cannot get any solution to work in my instance and it's probably because I'm doing something stupid. The two I have tried are:                    $args=array(                 'post_type' => 'subscription',                 'post_status' => 'publish',                 'meta_key' => 'expiry',                 'orderby' => 'meta_value_num',                 'order' => 'DESC',                 'posts_per_page' => -1,                 'caller_get_posts'=> 1,                 'meta_query' => array(                                       array(                                             'key' => 'paypal_recur_profile_status',                                             'value' => get_post_meta(get_the_ID(),'cancelled',true),                                             'compare' => '='                                             )                                            ),                 );      and                $args=array(             'post_type' => 'subscription',             'post_status' => 'publish',             'meta_key' => array('paypal_recur_profile_status', 'expiry'),             'meta_value' => 'Cancelled',             'orderby' => 'expiry'             'order' => 'DESC',             'posts_per_page' => -1,             'caller_get_posts'=> 1,             );      The first returns nothing, the second seems to do ok but has some anomalies in it so assume it ends up ordering it by post number and the other correct order results are coincidental. Can anybody spot the un-deliberate mistake in here or is this simply the wrong way to achieve what I'm trying to do?


using next-page and previous page inside a wp_query

I'm using a wp_query on my website to display a list of child pages from a parent page. It works fine and my pages are sorted by a meta_key using a custom field. Now I would like to add a next page (when there is one) and a previous page (when there is one) on my pages using the same arguments, children page from 22, order ASC and orderby and meta_key. Here is my wp-query :               <?php                      $args = array(                 'post_type'      => 'page',                 'posts_per_page' => -1,                 'post_parent'    => '22',                 'order'          => 'ASC',                 'orderby'=>'meta_value',                 'meta_key'=>'nom_de_loeuvre'                 );                      $parent = new WP_Query( $args );                      if ( $parent->have_posts() ) : ?>                      <span class="styled-select">                          <select name="" onchange="location = this.options[this.selectedIndex].value;">                          <option>A - Z</option>                               <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>                                       <option value="<?php the_permalink(); ?>" title="<?php the_title(); ?>">                             <?php the_field('nom_de_loeuvre'); ?>                             , de                              <?php if(get_field('prenom_artiste')): ?>                             <?php the_field('prenom_artiste'); ?>                             <?php endif ;?>                             <?php the_field('nom_artiste'); ?> | Galerie                              <?php if(get_field('prenom_galerie')): ?>                             <?php the_field('prenom_galerie'); ?>                             <?php endif ;?>                             <?php the_field('nom_galerie'); ?>                                  </option>                                    <?php endwhile; ?>                               </select>                      </span>                                <?php endif; wp_reset_query(); ?>      I can't find how to do it, depending on what I tried I get the previous and next link working, but not sorted depending of my meta_key, or I get all the kinks displayed on my page... Can anybody help me with this? I don't want to display the next or previous page title but I'll use custom text "next" & "previous" Thanks a lot for your help.


Open wordpress gallery onclick

I'm using Fancybox with wordpress' built in gallery to display the images on my site. This is working great. However - due to the layout of my site, it's not very clear that the one image displayed is a gallery. To make it clear I want to put a 'open gallery' link beside the image. For example - ![enter image description here](http://i.stack.imgur.com/EbHPz.png) My question is - is it possible to open the gallery through a link, not a thumbnail? This is the code I have been playing around with - HTML               [gallery link="file" columns="4" ids="174,175,176,173"]
open gallery
      JS               $("#launcher").on("click", function(){     $(".fancybox").eq(0).trigger("click");     });      Here is my site


How to add an admin notice upon post save/update

I have a post type the uses post_save to take the address from the post-meta and retrieve the lat/lng coordinates from the Google API. I need a way of notifying the user if there was an issue with retrieving the coordintes. I tried using admin_notices, but nothing displayed:               public static function update_notice() {       echo "

Failed to retrieve coordinates. Please check key and address.

";       remove_action('admin_notices', 'update_notice');     }          add_action('admin_notices', array('GeoPost', 'update_notice'));      I'm not sure if I'm using it incorrectly or in the wrong context. To be clear, in the actual code the add_action is in another function in the same class. That's working fine.


Instance not inserting data for widget

I am trying to create a widget for my website. This is my first instance of widget creation and I am really unsure as to what the issue is Here is my code as it stands:               add_action( 'widgets_init', 'wy_rss_widget' );          function wy_rss_widget() {         register_widget( 'WY_rss_widget' );     }          class WY_rss_widget extends WP_Widget {              function WY_rss_widget() {             $widget_ops = array( 'classname' => 'wy-rss', 'description' => __('A widget for displaying RSS feed', 'wy-rss') );             $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'wy-rss-widget' );             $this->WP_Widget( 'wy-rss-widget', __('RSS Widget', 'wy-rss'), $widget_ops, $control_ops );         }              function widget( $args, $instance ) {             extract( $args );                  //Our variables from the widget settings.             $title = apply_filters('widget_title', $instance['title'] );             $wy_rssURL = $instance['wy_rssURL'];             $wy_rssLimit = $instance['wy_rssLimit'];                  echo $before_widget;                  // Display the widget title              if ( $title ) {                 echo $before_title . $title . $after_title;             }                  //Display the name              if ( ( $wy_rssURL != " " || $wy_rssURL != "FEED URL" ) && ( $wy_rssLimit != " " ) ) {                 $rss = new DOMDocument();                 $rss->load($wy_rssURL);                 $feed = array();                 foreach ($rss->getElementsByTagName('item') as $node) {                     $item = array (                          'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,                         'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,                         'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,                         'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue,                     );                     array_push($feed, $item);                 }                 $limit = $wy_rssLimit;                      echo '
';                 echo '
'.$wy_rssURL.' ('.$limit.')
';                 for($x=0;$x<$limit;$x++) {                     $title = str_replace(' & ', ' & ', $feed[$x]['title']);                     $link = $feed[$x]['link'];                     $description = $feed[$x]['desc'];                     $date = date('l F d, Y', strtotime($feed[$x]['date']));                          echo '
';                     echo '
'.$title.'
';                     echo 'Posted on '.$date.'
';                     echo '
'.$description.'
';                     echo '
';                 }                 echo '
';             }                  echo $after_widget;         }              //Update the widget               function update( $new_instance, $old_instance ) {             $instance = $old_instance;                  //Strip tags from title and name to remove HTML              $instance['title'] = strip_tags( $new_instance['title'] );             $instance['wy_rssURL'] = strip_tags( $new_instance['wy_rssURL'] );             $instance['wy_rssLimit'] = strip_tags( $new_instance['wy_rssLimit'] );                  return $instance;         }                   function form( $instance ) {                  //Set up some default widget settings.             $defaults = array( 'title' => __('Title', 'wy-rss'), 'wy_rssURL' => __('FEED URL', 'wy-rss'), 'wy_rssLimit' => __('5','wy-rss') );             $instance = wp_parse_args( (array) $instance, $defaults ); ?>
                 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'wp-rss'); ?>                 <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" style="width:100%;" />

                 <label for="<?php echo $this->get_field_id( 'wy_rssURL' ); ?>"><?php _e('URL:', 'wp-rss'); ?>                 <input id="<?php echo $this->get_field_id( 'wy_rssURL' ); ?>" name="<?php echo $this->get_field_name( 'wy_rssURL' ); ?>" value="<?php echo $instance['wy_rssURL']; ?>" style="width:100%;" />

                 <label for"<?php echo $this->get_field_id( 'wy_rssLimit' ); ?>"><?php _e('Number of items:', 'wp-rss'); ?>                 <input id="<?php echo $this->get_field_id( 'wy_rssLimit' ); ?>" name="<?php echo $this->get_field_id( 'wy_rssLimit' ); ?>" value="<?php echo $instance['wy_rssLimit']; ?>" />
              <?php         }     }      The value for 'wy_rssLimit' is not being stored, where the values for 'title' and 'wy_rssURL' are. I am really not sure where to look. Could someone please help?


Cron job to delete post by title

I've searched a lot and I didn't find nothing that could help me. So, I want a cron job to automatically delete posts that have no title. Why I want that? I have a IFTTT recipe that automatically post from facebook on my wordpress website. But there are to many posts that I don't want in my site, and these posts are published without title. Sorry about my english, and I don't uderstand wp-cron very well, if the answer could be well specified I thank.


WordPress Plug-in Development In MVC Architecture, How?

I think, the wordpress plug-in architecture is not MVC. So I want to use/do the MVC architecture in WordPress plug-in development (like cakephp, codeIgniter ). How can I use them in plguin development. Does WordPress support CakePHP, or other frameworks?


Peer Review Plugin for Posts?

Is there a plugin that allows for peer review of articles before you post them? IE, like a professional writer would send their work to a friend or editor to review and comment on their work before publishing it. http://jmo.me/ideas/peer-review-wordpress-plugin a pretty good explanation of what I'm trying to explain.


Wordpress membership site for a sports club

I am currently building a webpage for a local sports club with 800 members. The features I need in a potential membership plugin is:   1. Member database with name, address, email, phone etc   2. Able to sort the members in different sport categories (football, athletics etc) and subcategories (youth, senior etc).   3. Online payment of annual membership fee.  There are a lot of plugins available, but with slightly different features, so I would appreciate if someone has some insight in plugins that could match my requirements. Or do I really have to learn how to create custom posts? :)


How to Move the Author Metabox into the "Publish" metabox?

About a year ago I remember seeing a plugin or some code which allowed you to add an author dropdown menu to the post "publishing" metabox instead of it being on its own. I can't seem to find this code anymore and was wondering if anyone knows how to easily do this? In an ideal situation I would like to essentially add an additional row under the "Visibility:" row within the Publish metabox stating "Author:" along with the current authors name and an edit link after the name. Upon clicking on the edit link a drop down would show up with the same information as is available in author metabox. In any case, I would greatly appreciate to know how this can be done.


How do I add Bootstrap and LESS to my migrated WordPress site?

I'm migrating a website to WordPress - it uses both Bootstrap and LESS. I found a snippet online for enabling Bootstrap and the outputted CSS via functions.php:               function theme_add_bootstrap() {       wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/third_party/bootstrap/css/bootstrap.min.css' );       wp_enqueue_style( 'style-css', get_template_directory_uri() . '/css/custom.css' );       wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/third_party/bootstrap/js/bootstrap.min.js', array(), '3.0.0', true );     }      This worked successfully on its own. That said, it only accounts for the final CSS that's outputted by my LESS precompiler, which is a pain because I can't see my LESS style changes locally (using MAMP) unless I compile the CSS first. I would like to have the CSS file used in production, and the LESS file used when I'm developing locally. I attempted to do this by adding the following functions underneath the Bootstrap function above:               function less_enqueue_scripts() {       $current_user = wp_get_current_user();            if ( $current_user--->ID == '1' )         wp_enqueue_script( 'lesscss', get_stylesheet_directory_uri() . '/third_party/less-1.5.0.min.js' );     }          add_action( 'wp_enqueue_scripts', 'less_enqueue_scripts' );          function less_filter_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri ) {       $current_user = wp_get_current_user();            if ( $current_user--->ID == '1' )         $src = $stylesheet_dir_uri . '/css/custom.less';       else         $src = $stylesheet_dir_uri . '/css/custom.css';       return $src;     }          add_filter( 'stylesheet_uri', 'less_filter_stylesheet_uri', 10, 2 );      But it's causing the site to break. I'm not sure if it's because the second statement in the Bootstrap function is interfering with these functions, or if another issue is the culprit. Would appreciate any insights.