title: Platform/Website that Supports Crowd-Funded WordPress Projects?

text: There are a couple of plugins that I'd like to have developed however I am poor so I'd love it if there was a platform that allowed me to easily group with others that have the same need and pool our resources to pay a developer. I have seen a lot of freelance developer job boards and bidding platforms but I was wondering if there were any platforms out there that would specifically empower a group of users/designers to pool their money behind a project they like, and allow for developers to bid out the project? The way I would envision it working would be a hybrid between Freelancer.com (or elance.com) and Kickstarter.com. Actually, it would be similar to Area51 on the StackExchange. In case this doesn't exist, I'll elaborate on my idea for anyone that wants to make such a platform... Basically, someone could post a project, take bids, then open it up for crowd funding or before any project is even bid on it could be open to a vote in the sense that people have to commit to at least $5 and once it reaches a certain commitment level it goes out for bids.


title: List Category Posts - thumbnails

text: I'm trying to use the List Category Posts Plugin so that I can have different categories of posts show up at the bottom of different pages. I can't seem to get the thumbnails=yes option to work. It does display an image, but not thumbnail size. Does anyone use this and know the answer to this problem? Thanks Betsy S. Franz www.hbca-brevard.org


title: wp_editor on custom meta textarea field - images and html fails

text: So I have made some custom textareas on my frontpage template. This works fine and I can safe content and so on... But I am experiencing some issues. When I click "Upload/Insert" I can work with the dialogue - but when I type insert the dialogue closes but no image is inserted into the textarea... The other issue is with the to tabs "visuel" and "HTML". I cant click on the "HTML" tab... nothing happens... I get the following javascript error:               vta is null     anonymous()     anonymous()     onclick()     event = click clientX=1523, clientY=145     qtrans_save(vta.value);      I call the wp_editor with:               wp_editor( $meta, $field['id']);      The field ID's are unique and currently using _ like 'custom_frontpage_textarea3'. I have tried without the _ but that had no effect. Any ideas?


title: I have a page using a pretty url and a mod_rewrite rule matching it. I expected it to give an error but it's working. Why?

text: this may seem like a weird question but I have something working and I don't understand how. I have moved my wordpress install to a subdirectory and am using the .htaccess file to redirect anything that is not in another folder A to the blog folder B.               RewriteCond %{REQUEST_URI} !^/A/.*$     RewriteRule .* B/$0  [L]      I am also using the Webphysiology Portfolio plugin and am calling the shortcode for it in a page called Portfolio. The images displayed by the plugin have their path set in the form /portfolio/wp-content/rest-of-url-etc (which is not the actual physical path) and this was causing problems with displaying them in the lightbox which could not find the images. To fix this I added a rule before the other one:               RewriteCond %{REQUEST_URI} ^/portfolio/(.*)$     RewriteRule .* B/%1  [L]      This fixed the lightbox problem as expected but after fixing it I thought it will mess up my portfolio page display which has the path /portfolio/ and hence matches this rule. But it is working. Can anybody please explain why? AS


title: Add field registration form on Woocommerce

text:
i use Woocommerce with Dokan to create a multivendor shop online. In Dokan, i have this field (add as defoult registration form)               function dokan_seller_reg_form_fields() {         $role = isset( $_POST['role'] ) ? $_POST['role'] : 'customer';         $role_style = ( $role == 'customer' ) ? ' style="display:none"' : '';         ?>         <div class="show_if_seller"<?php echo $role_style; ?>>

                     <?php _e( 'Primo Nome', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="fname" id="first-name" value="<?php if ( ! empty( $_POST['fname'] ) ) echo esc_attr($_POST['fname']); ?>" required="required" />

                     <?php _e( 'Last Name', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="lname" id="last-name" value="<?php if ( ! empty( $_POST['lname'] ) ) echo esc_attr($_POST['lname']); ?>" required="required" />

                     <?php _e( 'Company Name', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="cname" id="company-name" value="<?php if ( ! empty( $_POST['cname'] ) ) echo esc_attr($_POST['cname']); ?>" required="required" />

                 <?php _e( 'Shop Name', 'dokan' ); ?> *                 <input type="text" class="input-text form-control" name="shopname" id="company-name" value="<?php if ( ! empty( $_POST['shopname'] ) ) echo esc_attr($_POST['shopname']); ?>" required="required" />

                 <?php _e( 'Shop URL', 'dokan' ); ?> *                                  <input type="text" class="input-text form-control" name="shopurl" id="seller-url" value="<?php if ( ! empty( $_POST['shopurl'] ) ) echo esc_attr($_POST['shopurl']); ?>" required="required" />                 <?php echo home_url(); ?>/store/

                 <?php _e( 'Address', 'dokan' ); ?>*                 <textarea type="text" id="seller-address" name="address" class="form-control input" required="required"><?php if ( ! empty( $_POST['address'] ) ) echo esc_textarea($_POST['address']); ?></textarea>

                 <?php _e( 'Business Phone', 'dokan' ); ?>*                 <input type="text" class="input-text form-control" name="phone" id="shop-phone" value="<?php if ( ! empty( $_POST['phone'] ) ) echo esc_attr($_POST['phone']); ?>" required="required" />

                 <?php _e( 'Phone', 'dokan' ); ?>*                 <input type="text" class="input-text form-control" name="phone" id="shop-phone" value="<?php if ( ! empty( $_POST['phone'] ) ) echo esc_attr($_POST['phone']); ?>" required="required" />

                              <input type="radio" name="role" value="customer"<?php checked( $role, 'customer' ); ?>>                 <?php _e( 'I am a customer', 'dokan' ); ?>                                                <input type="radio" name="role" value="seller"<?php checked( $role, 'seller' ); ?>>                 <?php _e( 'I am a seller', 'dokan' ); ?>
         <?php     }          add_action( 'register_form', 'dokan_seller_reg_form_fields' );          function dokan_seller_not_enabled_notice() {         ?>
                 <?php _e( 'Error!', 'dokan' ); ?>                 <?php _e( 'Your account is not enabled for selling, please contact the admin', 'dokan' ); ?>
       I like to add more field. I have not problem to create a field and show on front-end but how can i save on database and show on user area on backend? I try to add this at the end but not function                 add_action('user_register', 'dokan_seller_reg_form_fields');         function myplugin_user_register ($user_id) {             if ( isset( $_POST['cname'] ) )                 update_user_meta($user_id, 'cname', $_POST['cname']);         }          add_action('show_user_profile','show_the_new_meta_values'); // hook utilizzato quando un utente sta visualizzando il suo profilo     add_action('edit_user_profile','show_the_new_meta_values'); // hook utilizzato quando un utente sta visualizzando il profilo di un altro utente           function show_the_new_meta_values($user)      {              $hobby= get_user_meta($user->ID,'cname', true);         ?>
<?php _e('Informazioni aggiuntive','registrazione-utenti')?>

             <?php _e('Hobby principale','registrazione-utenti') ?>	             <input type="text" name="cname" id="company-name" value="<?php echo esc_attr($cname); ?>" class="regular-text" />

         <?php      }


title: Wordpress and Windows Live Writer

text: I've just been trying windows live writer with my WordPress blog. When I upload my posts from WLW to WordPress and then check them in the WordPress editor, they are a hideous mess of tags etc that describe the formatting (e.g. `<P>` and no line spacing etc), but aren't visible when I create and edit in the WordPress editor. Is there a way to avoid this as it makes the WordPress editor very hard to use if I need to make edits outside of WLW. Or do people using WLW just give up on using the WordPress editor. I have to say I find the mess very offputting!


title: Show selected value in a drop down menu

text: I have a multisite setup and I am adding some additional information fields in the profile edit screen in my theme's dashboard. I am primarily using text fields however I have a drop down selection menu for the author's country               <select name="country" class="mid2" id="country"  value="<?php echo $userdata->country ?>" style="width:150px;">      My problem is that if a user selects "Togo" for example it registers the change (I know this because it echoes it in the author's bio page) but the default value in the drop down menu (In this case the United States) always stays the same. Any ideas on how I can have it display whichever country the author has selected?


title: Adding a jQuery modal dialog to the admin area

text: I am writing a plugin for a customer and I need to use lightbox/thickbox/fancybox/etc in my admin piece. No matter what jquery plugin I use, and I'm using wp_enqueue_style and wp_enqueue_script, nothing seems to work. No errors or anything. I click a link to open a hidden DIV, and nothing happens. Anyone have an alternative or a solution? Thanks.


title: How to output the taxonomy term name in a widget

text: I have a taxonomy for example "country" and I want to simply display the term in the side bar eg. New Zealand. There is only one possible taxonomy per post so I don't need to create a list or anything. Any ideas?


title: Integrate Mailchimp to a Contact Form 7 contact form

text: Is there an elegant way (without hacking the plugin's code) to integrate a Contact Form 7 contact form to Mailchimp, so I can have a checkbox that when selected would register the email to a Mailchimp list? Thank you


title: 301 Redirects for Changed Permalink Structure & Category Base

text: I'm redeveloping a site on a fresh WP install. The old site had the following permalink structure: domain.com/CATEGORY/POSTNAME/ The new site has the following permalink structure: domain.com/YEAR/MONTH/POSTNAME/ I need to set up a 301 redirect in htaccess that correctly redirects the old posts. I've found a lot of rewrite rules for the opposite way (YEAR/MONTH/POSTNAME/ to CATEGORY/POSTNAME/) but none for the way I need. I prefer not to use a plugin. It appears that all the redirection plugins don't work. But, if Dean's Permalink Migration is recommended I'll use it.


title: Customise particular RSS permalink

text: From my old static website, I want to preserve some URLs like the RSS Feed one. My feed URL is http://traduction.bainslesbains.com/actualite-russe.xml and I want to redirect it to the category feed URL **WITHOUT** 301 redirect. So I tried it via .htaccess file first, what is not working. Then I tried via internal Wordpress URL rewrite system. So first I did this:               // Rewrite actulaite-russe.xml     function feed_dir_rewrite( $wp_rewrite ) {         $feed_rules = array(             'actualite-russe.xml' => 'index.php?cat=8&feed=rss2',             'actualite-russe.rdf' => 'index.php?cat=8&feed=rdf' . $wp_rewrite->preg_index(1)         );              $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;         return $wp_rewrite->rules;     }          // Hook in.     add_filter( 'generate_rewrite_rules', 'feed_dir_rewrite' );      That give me a 301 redirect from               mysite.com/actualite-russe.xml to mysite.com/actualite-russe.xml/feed/ I don't want any 301 redirect I want just been delivered my feed without redirect. So I tried this:               add_action('init','feed_dir_rewrite');     function feed_dir_rewrite(){             add_rewrite_rule('actualite-russe.xml','index.php?cat=8&feed=rss2','top');     }      That gives me exactly the same result as the previous code. So how can I disable the 301 redirect for these functions?


title: Wordpress redirecting connections on port 8080 to 80

text: I have a wordpress blog which is served by apache2(on port 80) and nginx(on port 8080) on Ubuntu 12.04. Now whenever a client connects via port 80 all is hunky dory, but when a client connects to 8080 to view the same blog, the connection is redirected to apache. Why is this happening? I searched around and found that this is a Wordpress limitation that it redirects all connections to the Site URL set in the dashboard(which is port 80 by default). Is there a way around this? that the connections to port 8080 would be served by nginx rather than apache Contents of /etc/nginx/sites-enabled/wordpress               server {     listen   8080;          root /var/www;     index index.php index.html index.htm;          server_name abc.com;          location / {             try_files $uri $uri/ /index.php?q=$uri&$args;     }          location /doc/ {             alias /usr/share/doc/;             autoindex on;             allow 127.0.0.1;             deny all;     }          error_page 404 /404.html;          error_page 500 502 503 504 /50x.html;     location = /50x.html {             root /usr/share/nginx/www;     }          location ~ \.php$ {                  try_files $uri =404;             fastcgi_pass unix:/var/run/php5-fpm.sock;             fastcgi_index index.php;             include fastcgi_params;             fastcgi_param   SERVER_PORT 8080;             port_in_redirect off;     }      Any help is appreciated.


title: Trying to set a cookie based on $_POST parameter

text: I'm doing a bit of language detection that first checks the `$_SERVER['HTTP_ACCEPT_LANGUAGE']`. If the user wants to override the choice of language, there's a select list, where they can choose whatever language they prefer. SO: I need to check first if the `$_POST` superglobal contains a value from the select list. If it does I want to set a cookie. If there's no `$_POST` value set then I check for a cookie and if there's no cookie I'll go ahead and use the `$_SERVER['HTTP_ACCEPT_LANGUAGE']` as the default language. The code looks like this:               function rps_set_language_preferences() {            global $language;            if( isset( $_POST['sprak'] ) ) {              $possible_langs = array( 'en', 'de', 'ko' );              $my_cookie = $_POST['sprak'];              if( in_array( $my_cookie, $possible_langs ) ) {                setcookie( 'sprak', $my_cookie, time() + 60*60*24*365, COOKIEPATH, COOKIE_DOMAIN );                $language = $my_cookie;              }            } else {              if( isset( $_COOKIE['sprak'] ) ) {                $language = $_COOKIE['sprak'];              } else {                /* This function checks the $_SERVER['HTTP_ACCEPT_LANGUAGE'] */           $language = rps_detectlanguage();              }            }          }     add_action( 'wp', 'rps_set_language_preferences' );      But... It doesn't work! If I try to set a cookie by hooking into `'wp'` I need to refresh my screen twice before the cookie appears. I guess it's not being set in time, but I don't know how to make sure that it will be! Any advice?


title: How to display some of images from media library?

text: i try to create a simple theme. I want display several images from media library(same concept of gallery), but i don't want use POST or PAGE, just directly from media library. (of course not use wordpress gallery function too) is that possible or it's wrong way to do it? the reason is there are several hundreds of images in library, if every image need put in a POST or a page, it's a big job. but it looks hard to manage all these images without POST or PAGE. Thanks


title: Plugin Development/ Stop CSS clashes.

text: I have searched all over and I am a little confused about my first plugin that I am developing. I created a shortcode that the user can use on any page they create. The issue is that on a lot of themes the plugin gets pushed out of container width. I think that most templates are 960px wide, and my plugin is 800px wide (I am not looking for advise on developing with em, percentages, etc. this is a fixed sized plugin). How can I stop css clashes? I want the container width to be 960px wide. There must be some default id's and classes that I can overwrite in my css. I would imagine themes use standard naming conventions in order to allow users to switch at anytime. EDIT: I would also like to remove any sidebar() that is showing on the page...help!? Anyway, does anyone have advice on this? thanks!


title: display most popular tags in two columns

text:
I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however I'm wondering how I can arrange them to appear in two columns - 10 on the left, and 10 on the right in alphabetical order. Here's what I'm using: functions.php               <?php     function top_tags() {             $tags = get_tags();             if (empty($tags))                     return;             $counts = $tag_links = array();             foreach ( (array) $tags as $tag ) {                     $counts[$tag->name] = $tag->count;                     $tag_links[$tag->name] = get_tag_link( $tag->term_id );             }             asort($counts);             $counts = array_reverse( $counts, true );             $i = 0;             foreach ( $counts as $tag => $count ) {                     $i++;                     $tag_link = clean_url($tag_links[$tag]);                     $tag = str_replace(' ', ' ', wp_specialchars( $tag ));                     if($i < 11){                             print "
$tag ($count)
";                     }             }     }     ?>      sidebar-r.php
#HASHTAG
             <? $tags = top_tags();             $tags_count = count($tags);             $number = ceil($tags_count / 2);             $args = array('number' => $number);             $tagsleft = get_tags($args);             $args = array('number' => $number, 'offset' => $number);             $tagsright = get_tags($args);                  $html = '
';                 foreach ($tagsleft as $tag){                     $tag_link = get_tag_link($tag->term_id);                          $html .= "
name} Tag' class='{$tag->slug}'>";                     $html .= "{$tag->name}
";                 }                 $html .= '
';                      $html .= '
';                 foreach ($tagsright as $tag){                     $tag_link = get_tag_link($tag->term_id);                          $html .= "
name} Tag' class='{$tag->slug}'>";                     $html .= "{$tag->name}
";                 }                 $html .= '
';                 echo $html;             ?>


title: Site Title and Tagline in Theme Options Page

text: I'm using the _Options Framework Theme_ to put together an options page. The user(s) I'm building this for would like to be able to edit a few settings directly from this page, including of which - the _Site Title_ and _Tagline_. **Concept:** ![enter image description here](http://i.stack.imgur.com/Eq5i9.png) **Options.php:**               $options[] = array(         'name' => __('Site Title', 'options_framework_theme'),         'desc' => __('The name of your site.', 'options_framework_theme'),         'id' => 'title',         'std' => 'PHP CODE FOR SITE TITLE HERE ...',         'class' => 'medium',         'type' => 'text');      Is there a way to do this (add their own _Site Title_ and _Taglines_ ) within a text-field for example, click the Save Options button to output it to the front-end of the site and display an updated version in the WP API Settings > General Settings sub-menu page?


title: WordPress Internal @ Mentions

text: I'm looking for a way to link to author pages within one WordPress install simply by putting the @ symbol in front of a person's username in a post.... just like on twitter. Example: If the username is "Bill256" and I write "@Bill256" it will be linked to his author page.


title: Using Facebook Og Meta Tags in loop

text: On my index page, I have added a facebook share link to the individual posts. I want the sharer to uses the data from the post with the og meta tags. Can I add the OG Meta Tag into the post loop, within a php maybe, to get them to work? Any help would be greatly appreciated! Facebook OG Meta Tag:               <!-- for Facebook -->               <meta property="og:title" content="<?php the_title(); ?>" />     <meta property="og:type" content="article" />     <meta property="og:image" content="img/default.jpg" />     <meta property="og:url" content="<?php the_permalink(); ?>" />     <meta property="og:description" content="<?php $bloginfo = get_bloginfo( $description, $filter ); ?>" />


title: more tag in the $post->content when get_pages were used

text: I used get_pages() to get the content of the child pages of a page. Although the excerpt can also be an answer but is there any other way to display the contents of the page before the more tag when I use the get_pages()?


title: Sorting Custom Posts on Archive page with pagination

text: I've got custom taxonomy archive pages with a drop down list that allows users to re-order/sort the posts. It basically waits for the user to select from the drop down then uses `array_merge( $wp_query->query.....` to create a new query and re-sort the posts. This works fine. I also use wp-pagination to display numbered pagination. This also works fine. The problem is, when a user re-sorts the list, and then clicks on the pagination to go to page 2 the new sort is lost and reverts back to the original. I can't work this out. Any ideas?


title: How to build new WP_Query using url

text: How to build a WP_Query using a url in **wp_ajax_nopriv** action. I have a following url for example: "http://example.com?paged=2 so I need to build a WP_Query which will retrieve a second page of posts. I was able to do it if I were using regular URLs like the one before, but when I switch to Pretty Permalink (http://example.com/page/2) - it does not see the page argument and always returns first page.


title: Send email from Wordpress

text:
What's the best way to send a email from Wordpress after a certain action. I'm working on a site where users can submit ideas and then other users can comment on them. I would like to send emails to a number of different addresses (moderators) when a post is made and when a comment is made. I have this code to add the posts with an attempt to send an email that doesn't work.

Submit idea
              <?php              if(isset($_POST['new_post']) == '1'){                  $post_title = $_POST['post_title'];             $post_content = $_POST['content'];                  $new_post = array(                 'ID' => '',                 'post-author' => $user->ID,                 'post_title' => $post_title,                 'post_content' => $post_content,                 'post_status' => 'publish'                 );                  $post_id = wp_insert_post($new_post);             $post = get_post($post_id);             wp_redirect($post->guid);             exit;                  // send email notifications                       wp_mail( 'test@ttmt.org.uk', 'New Idea', $post_content);         }              echo '<form method="post" action="" >';         echo 'Idea Title';         echo '<input type="text" name="post_title" class="title">';              $settings = array(             'quicktags' => false,             'textarea_name' => 'content',             'media_buttons' => true,             'textarea_rows' => 12,             'tinymce' => array(                 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .                 'bullist,blockquote,|,justifyleft,justifycenter' .                 ',justifyright,justifyfull,|,link,unlink,|' .                 ',spellchecker'                 )             );         wp_editor( '', 'content', $settings );              echo '<input type="hidden" name="new_post" value="1">';         echo '<input type="submit" class="submit" value="Submit Idea">';         ?>


title: local wordpress blog issues

text: i have recently started a local blog, installed wordpress 3.5 correctly, even posted on it, when i view it on my machine using the IP or localhost, i see the entire pages correctly, but when i view it on any other machine, the view is plain HTML, no CSS, no JS, just plain old HTML i have tried setting up the permissions, also i am using xubuntu 12.04 and have installed LAMP stack properly, there are no issues with it, as it is obvious because the site works properly on my localhost


title: set_post_thumbnail_size not cropping featured images

text: I'm developing a theme and while working on the featured images area I've noticed they aren't cropping even though I've set them to crop through set_post_thumbnail_size function.               /* Featured Image Thumbnails */     add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 460, 250, true);      Using xampp, phpinfo says GD is supported. I've cleared the thumbnails and regenerated them to no avail. The div that the featured image is in is also set to 460, 250. The image just scales down to 460 wide by whatever heigh and constrains its proportions. An imag showing the output: http://i.imgur.com/cDXkS49.png


title: Getting rewrite correct

text: I had the permalinks settings as `/%postname%/%post_id%/` but recently change it to `/%postname%/` and added the following to htaccess               RedirectMatch 301 ^/([^/]+)/(\d+)/$ http://www.site.com/$1/      It works for posts and tags/cat/cpts but I have problem with home page navigation where it forwards the urls like: > http://www.site.com/page/2/ /3/ ... etc to a custom page that I have with slug page if I remove it... it takes to another post which has page in slug and finally removing all I am getting 404 error. So how do I just use the above 301 redirect with posts and not navigation.


title: Auto Stock Update after Order cancel from Admin of Woocommerce?

text: I recently implemented Woocommerce and in trial session I found following issue: **1.** Initially, I provide 10qty for Product1. **2.** place a Dummy Order from front-end of 10qty of that Product1. **3.** Then After that I see Product1 is Out of Stock. **4.** From Admin of woocommerce, If I cancelled that dummy order or reduce the product qty on that order, It Doesn't Update the Stock Qty of that product1. And I still see the Out of stock label on that product even after that order has been cancelled which reserved this qty. Hence is their any way to Auto-Manage this Stock Updates between orders and Inventory.


title: wp_insert_post() or similar for custom post type

text: Need to insert custom post type objects from code. Haven't been able to add using the default method               $id = wp_insert_post(array('post_title'=>'random', 'post_type'=>'custom_post'));      creates a regular post instead.


title: Uploading flash flipbook to mu wordpress site

text: I have to upload a flash flipbook (swf file) on my wordpress site. The problem is that the flipbook generated has two subfolders along with the book.swf.. So what I need to uplaod to media is   * book.swf    * framework.swf   * js      * some files   * img      * page00     * page01     * page...     * page205 I tried the AddFromServer plugin but nothing works for subfolders. Any ideas ?


title: Title and post URL based on custom fields?

text: I have custom fields in my custom post type. They should serve as a title and post slug for URL. Basically, whenever I change the content of the custom fields, the title field should react accordingly. E.g. if the field NAME contains 'John' and the SURNAME 'Smith', the title should transform to 'John Smith'. The users of the site will be unexperienced so they won't understand the need of putting NAME and SURNAME and a separate title for that - that's why I need it. I know I can display custom field content instead of a title in my template, but that's not the same. I also need the permalink to be amended accordingly. So, to recap My input: custom field NAME = John custom field SURNAME = Smith What should happen: post title = John Smith permalink = john-smith (I presume it will process the title extracted from the custom fields as it would normally do) I hope it's clear now. Thanks indeed for any suggestions.


title: Use created page as search results page and custom template

text:
I want my client to have control over the look of the Search Results page by being able to select one of the templates I have created for them (page-two- column.php or page-three-column.php) so they can change elements like banner images etc. So I have created a new page in the WP Dashboard called Search-Results which returns the following mysite.com/search-results/ By default WordPress creates a URL like this mysite.com/?s=product Having looked through a number of examples and in the codex, I have come across this snippet of code I thought would do what I need it to do.               // Use the two column template as the search result.     add_action('template_include', 'new_search_tmpl');     function new_search_tmpl( $template ) {       if ( is_search() ) {          $t = locate_template('page-two-column.php', false);          if ( ! empty($t) ) $template = $t;       }       return $template;     }      Then, in the page-two-column.php I am checking to see if we're requesting search results like this...                    <?php if (is_search()): ?>         <a href="<?php echo get_permalink(); ?>"><?php the_title();  ?>     <?php else: ?>

<?php _e( "It looks like we couldn't find what you were looking for!", 'bonestheme' ); ?>

<?php _e( 'Try a different search.', 'bonestheme' ); ?>

<?php // _e( 'This is the error message in the page.php template.', 'bonestheme' ); ?>

     <?php endif ?>      Which comes from the original search.php page I am wanting to override. * * * **EDIT** Further testing shows that is does actually use the two-col template which is great, however, I still need it to pull the banner image from the search-results page I am creating. I have now been able to pull the search-results Featured Image into the search page with the following code:               <?php if (is_search()) {        echo get_the_post_thumbnail( '1711', '1920' );     }?>


title: Is it possible to install multi different versions of Wordpress on one domain and its addon domain?

text: Here's the story. I designed a wordpress site for a client that is running on Wordpress 3.9. It is for an event that his company is organizing and it it will be hosted on www.hisdomain/addon. However, his staff has informed me that it cannot be installed because his comapny's website (www.hisdomain.com) is also running wordpress but an older version Wordpress 3.4. Hence I'm told that it is impossible to install two different versions (one of main domain and one on subdomain) of wordpress on one server and will have to retest my site on 3.4.1 instead? So, is there any way to install two different versions of wordpress on one domain? Will it cause any conflicts? Many thanks for any advice that you guys might have.


title: Get email address of type Administrator

text: I am new wordpress, please help me. How can I get all the details of type Administrator. I have created 2 users with Role as Administrator, like `get_option( 'admin_email' );`. I want the Email address of users of type Administrator.


title: Duplicate WP3.0 menu php files?

text: He's my problem: I want to have a single page that a WP-admin can build by including different parts of the site by choosing posts. (I know the admin could add these posts to a category and then display the the category page but there are some issue around user roles etc - I am exploring this option too though) One idea is that the WP3.0 menu actually contains much of the functionality I need; elegant interface for selecting any post/page from the site and the ability to reorder these items. Is there anyway of replicating the core WP menu php files, warping it up in a plug in, and making some layout and label changes, and running this plugin along side the standard menu system? Any advice, suggestions or problems I might encounter? many thanks, Paul.


title: Display post category in foreach loop

text:
I am trying to display post category in a foreach loop. I have all the elements displaying properly except for the category. Here is my function:               function my_get_display_author_posts() {     global $authordata, $post;          $authors_posts = get_posts( array( 'author' => $authordata->ID,'posts_per_page' => 6, 'post__not_in' => array( $post->ID ) ) );          $output = '
';     foreach ( $authors_posts as $authors_post ) {         $image = wp_get_attachment_image_src( get_post_thumbnail_id( $authors_post->ID ), 'related-author' );         $output .= '
         ID ) . '">         ' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '                            '.get_the_time('m.d.y').''.the_category('', '', $authors_post->ID).'
';     }     $output .= '
';          return $output;}      Follow the following link to see the current output. https://www.evernote.com/shard/s250/sh/0e3c6bf9-5676-4d56-acdf- ee6f53285acf/fa43094ca54f018c0e517b4e678d4231 How can I wrap the_category function under html output?


title: How to get user id which is done by buddypress

text: I have integrated buddypress in my wordpress theme. i need to get user id when buddypress completes user registration successfully like what we usually do wp_insert_user( $userdata ) which returns user id when user information is successfully inserted..so how do i get user id? its urgent..pleas help. Thanks in advance.


title: Shortcodes that are created based on user input information

text: I am creating a plugin that users can create forms with. Then the user will be able to input a shortcode to display this form. The shortcode will be the form name, which is stored as a `meta_value` in the `wp_postmeta` table. When the user uses a shortcode, how do I refer back to the form name & display the form? When the user creates a form, should I automatically create a shortcode in the same script? How would you approach it?


title: Order get_users() by last login date. Is it possible?

text: I want to create a page that displays all the blog users ordered by the last login date. I've tried with the get_users() function and I can succesfully get the users' list, but not in the order I want:               $query = get_users('&offset='.$offset.'&orderby=login&order=DESC&number='.$number);       I think that the orderby=login is not what I'm looking for... Is there any other way to accomplish this?


title: Problem after upgrade to 3.6.1

text: Really wishing there was a role-back feature installed. I upgraded last night, now when I open the dashboard one of the javascript modules is causing an infinite loop by including the 'Welcome to Wordpress' screen into the 'Wordpress Blog' widget. Is there an easy way to role-back without data loss? Update: The problem stems from one of the plugins. None of the deactivate links worked so renamed each directory then re-enabled them one by one. The problem has gone but I can't risk this happening again on the live site. Currently I don't know which plugin caused the problem, but I have an inkling. What could cause the problem I experienced and what should I be looking for in the source? Also, Can't find a relevant tag for this question.


title: How to update billing_email when user_email is updated

text: I'm trying to achieve two way synchronization between `user_email` and `billing_email` (the key for woocommerce emails). So far, I have it working that when a customer edits/updates their billing email address their `user_email` gets updated with the following code:               add_action( 'woocommerce_customer_save_address','isa_customer_save_address', 10, 1);          function isa_customer_save_address() {          global $woocommerce;     $user_id = get_current_user_id();                  wp_update_user( array ( 'ID' => $user_id, 'user_email' =>    $_POST['billing_email'] ) ) ;          }      Now how do I update a customer's `billing_email` when they edit/updates their `user_email`?


title: How to align bold,italic and underline in wp-admin?

text: When Im in wp-admin and editing a page and whant to make underline, bold and italic it dont appear on the site. I understand therese something i have to define in the css or thru wp-admin ? NOTE: I want the user to easly edit and i know how to do it thru css. But what I want is to edit thru the edit-page.


title: Send email to user that his post has been rejected

text: I am searching for a solution for the following problem: I am using WP User Frontend, so that users can create posts in the frontend. After saving, the admin needs to review the post, and the publish (if approved), or reject (if not approved). If the post is approved, an email is automatically sent to the user, that his post has been approved (this I already found out how to do). But if the admin does not approve, how to send the user an email, with a possible custom text (why he did not approve) from the backend, per click on a button?


title: wp_unique_post_slug is not unique

text: I understand that the `post` post_type is not the same as `page` but when editing the permalink for a new post to be the same as the slug for an existing page, it's accepted. I now have a post and a page both with `wordpress/sample-page` set as the permalink. The link opens that of the page, I guess pages are looked for first. Surely this can't be normal behaviour. This is on 6.3.1 and 6.3 if anybody cares to test. Is this a bug in the core?


title: How to add .html to the end of the permalink

text: How do I add .html to the end of the permalink? I tried changing the permalink structure to `/%postname%.html` but this did not work.


title: How to update plugins with database updates if I use svn

text: I have my own SVN repository that has everything checked in from root of the htdocs directory. The repository includes (I do have some ignores set):   * Wordpress Core   * Plugins   * Themes My process is:   * update my repository on a development site first to test   * commit the changes   * svn up the production site My question is:   * If a plugin installed has database updates attached to the newer version how are those updates applied in my production instance? I do know that Wordpress core has checks in place to see if the db is updated to the newest version, but I'm unable to find the same information out regarding plugins.


title: How we make the filter for fornt end user

text: I develope a filter for posts so that when any user come to my site they can filter the posts on the base of `cities/state`. So when i store the posts i just store the cities name as a `post-meta` tag in the site. The code i am using for adding the `post-meta` tag is               add_post_meta($post_id, 'post_state' , $state, true);      The html which generating the names of the cities in the form of checkbox is here               for(x in state_arr){         jQuery('#state_div').append('<label><input type="checkbox" name="stateName['+ state_arr[x] +']" id="" value="'+ state_arr[x] +'" >' + state_arr[x] + '</label');     }      So i pass the name as `array`. And the code i am using for filter is here               <?php     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'sortbydestination' ) :     $stateName = $_POST['stateName'];     foreach($stateName as $key => $stN)      {        $citynames = $stN . ",";      }     unset($_POST);     endif;          ?>      And the argument which i pass to the query is look like this               $args = array(                 'posts_per_page' => 30,                 'paged' => $paged,                  'post_type' => 'post',                  'post_status' => 'publish',                 'meta_query' => array(                                 'key' => 'post_state',                                 'value' => array($citynames )                                      )                  );      I want to know one thing. Here i in query the `value` need one value but i have to pass multiple valuse to compare and find the result so how can i do that.


title: Photos do not show on SEO platform built into a wordpress plugin

text: I’m building an SEO application. I built a plugin from the folder with the application. So, the folder is called `body_call` and inside has the `body.php`, the `index.php` (in which I placed the plugin “header copyright”) and other functions like forms and so on. In this folder (`body_call`) I also have the image folder that has the images, the css folder that has the `style.css` and the js folder. So, I made the function to be called from the new plugin `platform ()` and I called it from a template that I made called keywords (since the platform is about SEO keywords). The images do not show! And the `style.css` is not accessible, but the content from the body is more or less there (its scramble). I used the path for the images like this: `images/image.jpg` and the style sheet is called the same way: `css/style.css`. All this inside the `body_call` folder (parent folder / plugin folder). Another problem is the plugin shows on `localhost/keywords` but when I click on a link it goes to `localhost/keywords/index.php` and gives a page not found


title: Is there a way to make custom fields only editable by administrators?

text:
I've found the following code that places custom fields into a user's profile:   function extra_user_profile_fields( $user ) {                ?>
<?php _e("Roof Asset Information", "blank"); ?>

     <?php _e("Facility"); ?>	          <input type="text" name="facility" id="facility" value="<?php echo esc_attr(             get_the_author_meta( 'facility', $user->ID ) ); ?>" class="regular-text" />
     <?php _e("Please enter the facility name."); ?>

     <?php _e("Roof Section"); ?>	          <input type="text" name="roofsection" id="roofsection" value="<?php echo esc_attr(          get_the_author_meta( 'roofsection', $user->ID ) ); ?>" class="regular-text" />
     <?php _e("Please enter the roof section."); ?>

     <?php _e("Sq. Feet"); ?>	          <input type="text" name="footage" id="footage" value="<?php echo esc_attr(         get_the_author_meta( 'footage', $user->ID ) ); ?>" class="regular-text" />
     <?php _e("Please enter the square footage."); ?>

     <?php }          add_action( 'personal_options_update', 'save_extra_user_profile_fields' );     add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' );          function save_extra_user_profile_fields( $user_id ) {          if ( !current_user_can( 'edit_user', $user_id ) ) { return false; }          update_user_meta( $user_id, 'facility', $_POST['facility'] );     update_user_meta( $user_id, 'roofsection', $_POST['roofsection'] );     update_user_meta( $user_id, 'footage', $_POST['footage'] );          }          Is there a way to add extra functionality to this code that makes it so only administrators can edit the custom fields?


title: search.php template not loading results

text:
This is really bizarre - this has never happened before :/    I have a search.php template which consists of this...                   <?php         /**         * @package WordPress         * @subpackage Example 2012         * @since Example 1.0         */              get_header(); ?>                   <?php if (have_posts()) : ?>              <?php while (have_posts()) : the_post(); ?>              <?php the_title(); ?>              <?php endwhile; ?>              <?php endif; wp_reset_query(); ?>                   <?php get_footer(); ?>         this is what is in my functions.php               // SEARCH FORM HEADER     function search_form_header( $form ) {         $form = '<form method="get" id="header-searchform" action="' . home_url( '/' ) . '" >

             <input class="searchform-mid clearit" type="text" name="search" id="search-header" value="Search" />

         </form>';         return $form;     }          add_filter( 'get_search_form', 'search_form_header' );         and this is how I'm calling my form...               <?php get_search_form('search_form_header'); ?>         And this is what my URL looks like when a search is performed (search query hello)...               http://www.example.co.uk/?search=hello         And all I get is the index.php? And ideas would be truly amazing thanks. If you need more info please let me know thanks.


title: How to avoid wp_nav_menu() ID conflict?

text: How do I avoid ID conflicts if I use the same menu TWICE on one page. FIRST               wp_nav_menu( array( 'sort_column' => 'menu_order',      'theme_location'=>'menu', 'menu_class'=>'menu', 'menu_id'=>'menu' ) );      SECOND:               wp_nav_menu( array( 'sort_column' => 'menu_order',      'theme_location'=>'menu', 'menu_class'=>'menu2', 'menu_id'=>'menu2' ) );      ID conflicts are like "Duplicate ID menu-item-2456"... Any solutions?


title: changing parent_id on post

text: I'm trying to change a post's parent via the wp_insert_post_data filter but I'm not having any luck. In the example below, I'm replacing any "parent" references with the id I want to set.               function my_insert_post_data($data, $postarr){              $data["post_parent"] = 123;         $postarr["parent_id"] = 123;         $postarr["post_parent"] = 123;              error_log(print_r($data,true));         error_log(print_r($postarr,true));          }     add_filter( 'wp_insert_post_data' , 'my_insert_post_data' , '99', 2 );      and when i log the objects, i see the properties have been set but that never gets written to the database.


title: Custom post type: check permissions and validate nonce

text: I have a custom post type with the following capabilities:               $capabilities = array(         'read_post' => 'administrator',         'read_private_posts' => 'administrator',         'publish_posts' => 'administrator',         'edit_post' => 'administrator',         'edit_posts' => 'administrator',         'edit_published_posts' => 'administrator',         'edit_others_posts' => 'administrator',         'edit_private_posts' => 'administrator',         'delete_post' => 'administrator',         'delete_posts' => 'administrator',         'delete_published_posts' => 'administrator',         'delete_others_posts' => 'administrator',         'delete_private_posts' => 'administrator'     );      Do I still need to use something like `current_user_can()` when saving (via `save_post`), to validate whether that user has permissions to add or edit a post, or does setting the capabilities take care of that? Since this is not a custom page in Wordpress, but rather a custom post type, do I need to verify the nonce or is this built-in when using a custom post type? I should note that I'm not using any Wordpress fields (such as title, body, etc) in that post type. There is one pair of fields that have been added using `add_meta_box()`.


title: WordPress Theme Options Import/Export

text:
I already have a theme options page that saves to wp_options > kittens_options. I'm looking for a simple way to incorporate an import/export textarea of those options on my options page. I've searched Google for several hours now and haven't been able to find any useful tutorials. If anyone knows off the top of their head let me know. Thanks **CODE I'M WORKING WITH SO FAR**               <?php     function kittens_transport_page() {     global $themename, $shortname;     $kittens = get_option( 'kittens_options' );     $currentsettings = "";     if ( isset( $_POST['import'] ) && trim($_POST['kittens_import_settings']) != "" ) {     $currentsettings = $_POST['kittens_import_settings'];     } elseif ( isset( $kittens ) && ( $kittens != "" ) ) {     $currentsettings = base64_encode( serialize( $kittens ) );     }     }     ?>

Import & Export Theme Options
     <form method="post" action="#">     Import Options     <textarea rows="8" cols="40" id="kittens_import_settings" name="kittens_import_settings" class="large-text"></textarea>
     <input type="submit" value="Import" id="import" name="import" class="button-primary" onClick="return confirm('Are you sure you want to import these settings?')" /> <?php if ( isset( $_POST['import'] ) && $_POST['kittens_import_settings'] != "" ) { echo "Settings Imported Successfully"; } ?>     </form>

     Export Options     <textarea rows="8" cols="40" id="kittens_export_settings" name="kittens_export_settings" class="large-text" readonly="readonly"><?php echo $currentsettings; ?></textarea>     <?php     function kittens_import_settings(){     global $shortname;     if ( isset( $_POST['import'] ) && trim($_POST['kittens_import_settings']) != "" ) {     if(isset($_POST['kittens_import_settings']) && current_user_can('edit_themes')){     $imported_settings = unserialize(base64_decode($_POST['kittens_import_settings']));     update_option($shortname . '_settings', $imported_settings);     }     }     }     ?>


title: wp-cli doesn't find and wordpress installation

text: I wanted to try wp-cli, downloaded the phar and installed it by moving it to ~/bin which is in my path. Then wp --info works, but maybe shows insufficient information. (e.g. no php path, though it is running, so php is there ...) Any other actions I tried so far were unsuccessful, alsways resulting in 'no wordpress installation found' Specifying --path or --url didn't change anything. The result is the same for a multisite or non-multisite installation. Any ideas what could be wrong?               PHP binary:     PHP version:    5.3.27     php.ini used:   /usr/local/lib/php.ini     WP-CLI root dir:        phar://wp-cli.phar     WP-CLI global config:     WP-CLI project config:     WP-CLI version: 0.14.0-alpha      (added `wp --info` output)


title: Allowing an email as the username?

text: Is it possible to allow people to utilize their email as their username?


title: How to include a file using get_template_part() in a plugin?

text: A very simple question may be, but I'm struggling. In theme development, I worked with `get_template_part()` many times, and I understand its basics. But when I's developing a plugin, I wondered using it showing me some errors: > **Notice: Use of undefined constant STYLESHEETPATH** - assumed > 'STYLESHEETPATH' in `...\wp-includes\template.php` on line 407 and > **Notice: Use of undefined constant TEMPLATEPATH** - assumed 'TEMPLATEPATH' > in `...\wp-includes\template.php` on line 410 Googling the problem showed a support fix:   * Use `get_template_part()` into a plugin - WordPress Support But that seems a huge workaround - I doubt it. I think that shouldn't be much complicated. I checked this WPSE Answer and found this line of code:               if ( '' === locate_template( 'loop-mycustomposttype.php', true, false ) )         include( 'loop-mycustomposttype.php' );      Where there is a PHP `include()` function. As per as my WordPress knowledge I learned to prefer `get_template_part()` over PHP `include()`. Then how exactly I can use a simple `get_template_part()` in my plugin. I'm not using any loop or something, I'm just separating (or you may say organizing) my plugin code into different files so that in some cases, I will simply comment them out to drop where they are not necessary. I tried:               get_template_part( 'my', 'special-admin' );      and then after the error, changed it to:               get_template_part( 'my', 'specialadmin' );      But you know that's not the issue. I'm on local server, using WAMP.


title: Migrating jQuery gallery to Wordpress

text: I'm moving my website to Wordpress and I'm trying to migrate my old gallery over. This uses Jquery and picasa. I've tried a few ways of loading the scripts, played with jquery versions, even toyed with an iframe, but seem to be drawing a blank. Literally. I think most likely is that the script that initialises the gallery is incorrect, I just don't know how. This script is below. FYI The new page is here http://www.talesfromthesaddle.com/newmap/photos/ Old page - so you can see the gallery - is here :http://www.talesfromthesaddle.com/picasa/photos.shtml If anyone has some pointers, I've been at it a long time.....Thanks to anyone who can help :)                <script type="text/javascript">            var $viewerSelected = "fancybox";       var $url=document.URL.split("?", 2);       if ($url.length == 2) {         var $queryParams = $url[1].split("&");         for ($queryParam in $queryParams) {           var $split = $queryParams[$queryParam].split("=", 2);           if ($split[0] === "viewer") {             $viewerSelected = $split[1];           }         }       }            jquery(document).ready(function() {              var $viewerShow, $viewerJs, $viewerName;        jquery('#FancyboxCode').hide();         switch($viewerSelected)         {         case "fancybox":           $viewerName = "FancyBox";           $viewerCss  = "js/jquery.fancybox/jquery.fancybox.css";           $viewerJs   = "js/jquery.fancybox/jquery.fancybox.pack.js";           $('#FancyboxCode').show();           break;         case "colorbox":           $viewerName = "ColorBox";           $viewerCss  = "js/jquery.colorbox/colorbox.css";           $viewerJs   = "js/jquery.colorbox/jquery.colorbox-min.js";           break;         default:           alert("Unknown viewer selected");           $viewerName = "unknown";           $viewerCss  = "unknown";           $viewerJs   = "unknown";           break;         }              $("#jqueryVersion").text($().jquery);         $("#viewername").text($viewerName);         $("#viewernameCss").text($viewerCss);         $("#viewernameJs").text($viewerJs);         $("a#inline").fancybox({closeClick: false});         var settings = {         removeAlbumTypes: ["ScrapBook", "ProfilePhotos","Blogger Pictures"],     showAlbumdate:false,         photoSize: 1024,         thumbSize : 144,         albumThumbSize :160,     showPhotoDate:false,         username: '103765176545098072691',         popupPlugin: $viewerSelected,         fancybox_config: {                     config_photos: {                           openSpeed: 500,                 openEffect: 'elastic',   //fade or elastic                 openEasing: 'swing',                      closeSpeed: 500,                     closeEffect: 'elastic',  //fade or elastic                     closeEasing: 'swing',                           nextSpeed  : 500,                 nextEffect : 'elastic', // 'fade' or 'elastic'                 nextEasing:  'swing', // More if easing plugin used                               prevSpeed:500,                     prevEffect: 'elastic',                     prevEasing: 'swing',                     photoSize: 1024                    }                  }           };         $("#pwicontainer").pwi(settings);       });          </script>


title: How to export 2 week's worth of posts

text: I need to export the last two week's worth of blog posts from one site into another site, including all meta data and post author info. Is there a good SQL statement to do this, or a plugin that will help me accomplish this?


title: custom taxonomy listing returns no posts

text: I had a issue with a custom taxonomy and a custom post type using the same url and that is now fixed but it has created another bug. not showing the posts tagged with the custom taxonomy. my url i am using for my post type is /news and then i have a taxonomy which i need to have /news/cars I can get a all the posts for the custom post type to output on the index template. I also have the single taxonomy page working but my query doesnt show the posts that are tagged with the custom taxonomy for example all posts that are cars. here is my code i have so far :                   function register_custom_post_types() {         $args = array(             'labels' => array(                 'name' => __( 'News' ),                 'singular_name' => __( 'News' )             ),             'menu_position' => 5,             'public' => true,         'query_var' => 'news',             'has_archive' => 'news',             'hierarchical' => true,             'taxonomies' => array('news_categories'),         'publicly_queryable' => true,             'capability_type' => 'post',             'rewrite' => array('with_front' => false, 'slug' => 'news/%news_categories%'),             'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'page-attributes')         );         register_post_type( 'news', $args);          }     add_action( 'init', 'register_custom_post_types' );          add_action( 'init', 'create_my_taxonomies', 0 );              function create_my_taxonomies() {             register_taxonomy(                 'news_categories',                 'news',                 array(                     'labels' => array(                         'name' => 'News Categories',                         'add_new_item' => 'Add New Category',                         'new_item_name' => "New Category"                     ),                     'query_var' => true,                     'show_ui' => true,                     'show_tagcloud' => false,                     'hierarchical' => true,                     'rewrite' => array(                         'with_front' => false,                         'slug' => 'news'                     )                 )             );         }              add_filter('post_type_link', 'news_term_permalink', 10, 4);         function news_term_permalink($post_link, $post, $leavename, $sample) {             if ( false !== strpos( $post_link, '%news_categories%' ) ) {                 $glossary_letter = get_the_terms( $post->ID, 'news_categories' );                 $post_link = str_replace( '%news_categories%', array_pop( $glossary_letter )->slug, $post_link );             }             return $post_link;


title: create function to call category name and slug

text: In several theme templates I have code to retrieve the category name and slug for the present post or category page. It is outside the loop. Here is the repeated code:               global $post;     $categories = get_the_category($post->ID);     if ( $categories ) {     foreach ($categories as $category) {         $dw_category_slug = $category->slug;         $dw_category_name = $category->name;     }       }else {         $dw_category_slug = 'utopia';     }       I would like to be able to include this in the functions file instead of writing it in several places. This is what I have tried in my functions file:                 add_action('wp_head', 'dw_get_category');       function dw_get_category() {         global $post;         $categories = get_the_category($post->ID);                if ( $categories ) {                    foreach ($categories as $category) {                    $dw_category_slug = $category->slug;                    $dw_category_name = $category->name;             }             } else {                 $dw_category_slug = 'utopia';             }                  $dw_category[] = array('name' => $dw_category_name, 'slug' =>    $dw_category_slug);         return $dw_category;              }                                                         I would like to be able to write something like `$dw_category['name']` in the template files to call the category name. I know this is the wrong way to do it. Do I need to divide this into 2 functions so there is only one value returned for the function? Or is there some other way to do this? Writing it as a class? If interested the url is http://lenoremalenblog.com Thanks for your time.


title: Yoast custom feed template as add_feed function?

text:
I'm trying to make Yoast's Custom RSS feeds post display in an add_feed function. Just putting Yoast's snippet inside add_feed results in: > ERROR: feedname is not a valid feed template. I have tried two rewrite functions, but to no avail. What could I be missing? ![enter image description here](http://i.stack.imgur.com/ZgAmz.png) Yoast's function untouched:               <?php     /*     Template Name: Custom Feed     */          $numposts = 5;          function yoast_rss_date( $timestamp = null ) {       $timestamp = ($timestamp==null) ? time() : $timestamp;       echo date(DATE_RSS, $timestamp);     }          function yoast_rss_text_limit($string, $length, $replacer = '...') {       $string = strip_tags($string);       if(strlen($string) > $length)         return (preg_match('/^(.*)\W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer;       return $string;     }          $posts = query_posts('showposts='.$numposts);          $lastpost = $numposts - 1;          header("Content-Type: application/rss+xml; charset=UTF-8");     echo '<?xml version="1.0"?>';     ?><rss version="2.0">     <channel>       <title>Yoast E-mail Update</title>       <link>http://yoast.com/</link>       <description>The latest blog posts from Yoast.com.</description>       <language>en-us</language>       <pubDate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></pubDate>       <lastBuildDate><?php yoast_rss_date( strtotime($ps[$lastpost]->post_date_gmt) ); ?></lastBuildDate>       <managingEditor>joost@yoast.com</managingEditor>     <?php foreach ($posts as $post) { ?>       <item>         <title><?php echo get_the_title($post->ID); ?></title>         <link><?php echo get_permalink($post->ID); ?></link>         <description><?php echo '<![CDATA['.yoast_rss_text_limit($post->post_content, 500).'

Keep on reading: ID).'">'.get_the_title($post->ID).''.']]>';  ?></description>         <pubDate><?php yoast_rss_date( strtotime($post->post_date_gmt) ); ?></pubDate>         <guid><?php echo get_permalink($post->ID); ?></guid>       </item>     <?php } ?>     </channel>     </rss>      Function one:               function myPlugin_add_feed(  ) {       global $wp_rewrite;       add_feed('feedname', 'my_feed');       add_action('generate_rewrite_rules', 'myPlugin_rewrite_rules');       $wp_rewrite->flush_rules();     }     add_action('init', 'myPlugin_add_feed');      and function two:               function custom_feed_rewrite($wp_rewrite) {     $feed_rules = array(     'feed/(.+)' => 'index.php?feed=' . $wp_rewrite->preg_index(1),     '(.+).xml' => 'index.php?feed='. $wp_rewrite->preg_index(1)     );     $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;     }     add_filter('generate_rewrite_rules', 'custom_feed_rewrite');


title: Wordpress Media URLs?

text: I just launched a Wordpress site after having done all of the standard procedures: moved the uploads folder, uploaded the database, and did a search and replace on all of the urls in the database. Everything is fine, except for all the media that is uploaded specifically in the content area of the posts. All of these URLs, when you click on the image, say the correct URL, but for some reason on the front end, and inside the post area the images are going to localhost instead. For example, the image URL clearly says http://curioquilt.com/path/to/image, But inside the post and on the front end they aren't being displayed and the server is looking for http://localhost.com/path/to/image. There are no instances of localhost anywhere in the database. If you do go to the site (http://curioquilt.com), you have to go into the archive and click on a deeper post to see this, as I have gone through and manually fixed the first 15-20, but would rather not have to do this for the other hundred. Thanks.


title: SQL Query to select post thumbnail, post title, post content from a category

text: I use the db of my wordpress blog to develop a mobile application in Java. For this, I need the SQL query to display the thumbnail of a post, the title and the content in a selected category. I think I have to start from:               SELECT post_title FROM wp_posts p     JOIN wp_term_relationships r ON r.object_id = p.ID     JOIN wp_term_taxonomy t ON r.term_taxonomy_id = t.term_taxonomy_id     JOIN wp_terms terms ON terms.term_id = t.term_id     WHERE t.taxonomy ='category'     AND terms.name = 'politique'     AND p.post_type = 'post'


title: Two emails being sent on user registration

text: I'm having a problem where visitors are receiving two emails when they register for an new account. One email has a welcome message that I have set, and one is empty. I want to disable the sending of the second, empty email. I need help in tracing which plugin or mechanism sends out the empty email in order to disable it. Background: When people register for an account, their account is not immediately activated. An admin needs to validate accounts by hand first. I'm using Gravity Forms with User Registration add-on for this. I'm using SB Welcome Email as a plugin to set a custom welcome message to people who have registered for an account. However as mentioned above, there are now two emails being sent to the user. One by SB Welcome Email (good) and one empty (bad). Any suggestions on how I can trace which plugin is sending the second one, and / or any help on disabling the empty email? Also helpful: which hook or action is called when a new user signs up for the site?


title: Add all products in a category to woocommerce cart

text: First time using woocommerce, say i have a category called VOLUME ONE with 12 (could be more) products each priced at $10, how would i go about creating a single button like GET VOLUME ONE to add all the 12 products in that in my cart or redirect straight to paypal for checkout.


title: How can I setup a relationship using categories in WordPress?

text: I am trying to setup a relationship between a "People" post type and a "Work" post type. For example, I want to have a structure like this               Person 1      - Work        - Work 1         - Work 2     Person 2      - Work        - Work 3         - Work 4      How would I setup a relationship so that when a user is making a "Work" post they can associate the "work" post with a "person"?


title: cannot drag and drop widgets since wordpress 3.2.1

text: I recently updated my site to wordpress 3.2.1 automatically. Now I tried to manage my sidebar widgets, and noticed I can no longer drag and drop the widgets around. If I look into my browser-console, I notice that the page is unable to load jQuery. Weird: it appends my root-url to the jquery- url, like so:               <script type="text/javascript" src="http://meanderend.dixis.com//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js?ver=3.2.1"></script>      So it is normal that it is not found. How can I fix this. Is there something wrong in my configuration? Or is this a bug? Then it should be general, for everybody, no?


title: Multiple templates for custom post type

text: This is my setup: I have one post type called "products" and a page (page X) where I use wp_query to list all products, the_permalink(); returns the link to single-products.php. The goal is to use wp_query on another page (page Y) and list all products but the permalink should now be linked to another template, single-products2.php for example. Basically I need two templates for the same custom post type.


title: How do I get a list of popular posts by views?

text: I am using the Jetpack plugin to get 'site stats' which shows the number of views for blog posts/pages. So I'm no expert or anything but I'm guessing there is a table that stores these views. Is there a way to manipulate this data to create a simple list of the most popular posts by views in the sidebar? Currently, I'm using a plugin for this but I'd prefer to hard code it straight into the theme. Any guidance would be massively appreciated. Thanks for reading!


title: featured post as div background

text:
Ok I didn't find an answer yet.. because my code is different.. I want to set the featured image as the div's background but I don't know how to do that.. html, php and css collide in one line.. This is the div..               <?php echo '

'; '

'; ?>      and this is the code I want..                <?php $src = wp_get_attachment_image_src ( get_post_thumbnail_id('thumbnail'));     ?>          <div id = "circ" style="background: url(<?php echo $src[0]; ?> ) !important;">test
      I could have inserted it in one line like this               <?php echo '<div id = "circ" style="background: url(<?php echo $src[0];>

'; '

'; ?>      but then they all collide which I don't know the workaround for it.. My apologies in advance.. am new to this community and wordpress too..


title: add_role() run only once?

text: I was surprised to discover that add_role() modifies the database and fails if the role already exists. There are two implications here, one first more serious than the other: 1) if you're in development and update your add_role code, you must first remove_role() 2) once you have it right, you should never have to run that code again. So typically I have been putting my add_role() inside a wp_loaded action hook. And since I'm in development, I've also added a remove_role() before my add_role so I can be sure that if I modify my list of caps, it will actually take effect. But clearly this is now being run every time a page of the blog is being accessed. Okay, I could put it in an admin-only action, or I could create a plugin page maybe under Users or Tools where this role can be created once. I guess I'm hoping there's a simpler, more elegant solution out there. I don't imagine there's a run_once kind of action is there? Or is the best practice just to add the role and then use add_cap() a bunch of times? And even then I imagine add_cap is accessing the db. Just thinking in terms of the best way to reduce unncessary db access. What are your best practices?


title: Search outside of the "loop"

text: I am creating a blog using only Wordpress's backend. I have found functions to get latest posts (wp_get_recent_posts) and all the required data I need. I do this by including wp-load so I have access to WP's functions. However I cannot find anything that allows me to perform a search outside of Wordpress's theming loops as I have for the rest of the data. I was hoping there was a search function where I can pass it a search query that could be in title, body content or tag name. Am I missing something blindingly obvious in the documentation, there seems to be a function for everything else I need outside of WP's "loop".


title: Hook for image edit popup

text: Is there a hook for the popup window which shows up when you click on the edit button on an image in a post?


title: Select custom post by meta value

text: Say I've got the custom post type `foo` with a meta box called `bar`. I've posted an entry with `bar` = `pineapple`. Now I want to check if there is a `foo` in the database with a `bar` set to `pineapple`. How would I do that? I've managed to get this working using a `wpdb` query but that doesn't feel right. Is there an elegant, maybe built-in way for me to do this?


title: PHP Wordpress optimization my loop code

text: I'm just learning PHP, and I'm using get_terms to get some text descriptions from the CMS, but i want to assign 3 variables to only 3 of my woocommerce tags. My code works well, but I just want to learn if there's a better way to filter by $tag_descrip->name than using if conditions. This is my code:               <?php     $tag_descrip = get_terms( 'product_tag', 'orderby=count&hide_empty=0' );     $count = count($tag_descrip);               if ( $count > 0 ){           foreach ( $tag_descrip as $tag_descrip ) {           if($tag_descrip->name == "parfum_bestof")        {$title_new1 = $tag_descrip->description ;}           if($tag_descrip->name == "tshirt_bestof")        {$title_new2 = $tag_descrip->description ;}           if($tag_descrip->name == "child_bestof")        {$title_new3 = $tag_descrip->description ;}                     }                    }          ?>       Thanks


title: Slow site initial load time

text: for some reason my website `www.gcprive.com` takes a very long time to respond initially but then loads all of a sudden. Any ideas why this happens? I am trying to optimize speed in general but this is a profound observation. thanks Andy


title: Create service similar to wordpress.com

text: I am looking to build a service for users where they can signup (using an online form such as Gravity or Ninja forms) for a website either as a sub domain or sub directory of the main website similar to wordpress.com. I am using wordpress multisite, but I cannot find anything online on how to accomplish this. Is there a special plugin or script/scripts that I can run?


title: Custom Post Type archive loop separated by term, in specific term order

text:
I have a custom post type registered (our-team) and I have a taxonomy (team- categories) with multiple terms. Each term has multiple posts assigned to it. On my custom post type archive (archive-our-team.php) I am using the code below to separate my loop by term, which is working great, but defaults to alphabetical ordering by term: A Term Name - all posts in this term B Term Name - all posts in this term C Term Name - all posts in this term I can't figure out how to customize the order of the terms so I can get something like (any order I want): C Term Name - all posts in this term A Term Name - all posts in this term B Term Name - all posts in this term Is there a way to set an order number for each term in a taxonomy, so when I `get_terms` and then output with `foreach` they are in the order I want?               <?php //for a given post type, return all     $post_type = 'our-team';     $tax = 'team-categories';     $tax_terms = get_terms($tax);     if ($tax_terms) {         foreach ($tax_terms  as $tax_term) {             $args=array(               'post_type' => $post_type,               "$tax" => $tax_term->slug,               'post_status' => 'publish',               'posts_per_page' => -1,                       );                  $my_query = null;             $my_query = new WP_Query($args);             if( $my_query->have_posts() ) {                      echo '
'.$tax_term->name.'
';                 while ($my_query->have_posts()) : $my_query->the_post();                   //set vars for custom fields                 $team_location = get_field('team_location');                 $team_position = get_field('team_position');                 $team_email = get_field('team_email');                 $team_name = get_the_title();                 $team_link = get_permalink();                      //get only first name. usage: echo $first_name[0];                 $team_first_name = $team_name;                 $first_name = explode(' ', trim($team_first_name));                 ?>
                         <?php if ( has_post_thumbnail()) { ?>                             <a class="thickbox" href="<?php echo $team_link; ?>"><?php the_post_thumbnail('medium'); ?>                                              <?php } else { ?>                             <img src="<? bloginfo('template_directory' );?>/library/images/no_pic.jpg" alt="no image provide" />                         <?php } ?>

<?php the_title();?>

<a class="thickbox" href="<?php echo $team_link; ?>">More info <?php// echo $first_name[0]; ?>
                             <?php if ($team_email) : ?>
<a href="mailto:<?php echo $team_email;?>">Email <?php echo $first_name[0]; ?>
<?php endif; ?>

 <?php                  endwhile;             }        }     }       ?>


title: How do I search an array stored in a custom-field using WP_Query?

text: I have a custom post type called "on-air" that included a custom-field called "daysonair". The form for this has checkboxes for each day of the week. When you add/update a post, the checked items are stored as an array in the custom-field. I can't figure out how to add that custom-field to my WP_Query() search:               array( 'key' => 'daysonair',            'value' => 'Thursday',            'compare' => 'IN' )      I've tried numerous types of comparisons with no luck. The data in the database is:               a:5:{s:6:"Monday";s:6:"Monday";s:7:"Tuesday";s:7:"Tuesday";s:9:"Wednesday";s:9:"Wednesday";s:8:"Thursday";s:8:"Thursday";s:6:"Friday";s:6:"Friday";}      Where all the weekdays have been checked. I'm just looking to see if Thursday is in the array.


title: Aspx/Rss feed - failed to open stream: Redirection limit reached

text:
I have this issue ive been stuck with now. Its when i load a page that have a feed. I put the feed in wp-admin , this usually work with other feeds but not sure why its not working with this kind of feed. When i load the feed i get this error: [function.file-get-contents]: failed to open stream: Redirection limit reached, aborting in /wp-content/themes/wp-jqm-01-skolledarna/functions.php on line 624. ![enter image description here](http://i.stack.imgur.com/B4Fz4.png) **NOTE:** _The feed work in the browser._ It might be a parser problem and if it is i still cant resolve it. Here is some code of the parser, from function.php :                   class rss_php {          public $document;     public $channel;     public $items;              /****************************     public load methods         ***/     # load RSS by URL         public function load($url=false, $unblock=true) {             if($url) {                 if($unblock) {         $this->loadParser(file_get_contents($url,         false,      $this->randomContext()));                 } else {                     $this->loadParser(file_get_contents($url));                 }             }         }     # load raw RSS data         public function loadRSS($rawxml=false) {             if($rawxml) {                 $this->loadParser($rawxml);             }         }                     /****************************     public load methods         @param $includeAttributes BOOLEAN         return array; ***/          # return full rss array         public function getRSS($includeAttributes=false) {             if($includeAttributes) {                 return $this->document;             }             return $this->valueReturner();         }     # return channel data         public function getChannel($includeAttributes=false) {             if($includeAttributes) {                 return $this->channel;             }             return $this->valueReturner($this->channel);         }     # return rss items         public function getItems($includeAttributes=false) {             if($includeAttributes) {                 return $this->items;             }             return $this->valueReturner($this->items);         }      **What could the problem be ?** **EDIT:** This is my rss function:                    function get_rss($url, $lang, $articles) {     $rss = new rss_php;     $rss->load($url);     $items = $rss->getItems();          // Sets the maximum items to be listed     $max_items = $articles;          $count = 0;          $html = '';     // Translates months to swedish     foreach($items as $index => $item) {     $pubdateForeignString = substr($item['pubDate'], 4);     $pubdateEnglishString = str_replace(array('maj', 'okt'), array('may', 'oct'), $pubdateForeignString);     $pubdate = date("Y-m-d", strtotime($pubdateEnglishString));          $html .= '

'.$item['title'].'

'.$item['description'].'

Läs merPublicerad: '.$pubdate.'

';     $count++; //Increase the value of the count by 1     if($count==$max_items) break; //Break the loop is count is equal to the max_loop     }         echo $html;      }


title: Is there an easy way of exporting posts with their category already asigned and pictures from localhost?

text: Every time I export a database using the Export Tool in wp-admin. There are two things left out: The category 'checked' (I have to do that all over again every time I export the posts). Also I can't download the pictures because I usually work in my localhost. How to export absolutely everything (100%) from the database of a Wordpress site?


title: Comment Form - E-mail Not Required!

text: I need to know how to make one of the fields on my comment not NOT required. How can I set the e-mail field in the comment field to not be required, but optional?


title: How to make a pulldown menu display custom meta terms in a theme?

text:
I have a pulldown menu in a custom write box that classification numbers. How can I populate a select box on the front end that will: a) be populated with all the possible values defined in the functions script b) have the value chosen in wp-admin be selected on page load in the pulldown menu? This question piggybacks on my how to add a select menu to a custom meta box that was answered (perfectly) by בניית אתרים. My cpt meta box code:               function inventory_information() {         global $post;              echo '<input type="hidden" name="inventorymeta_noncename" id="inventorymeta_noncename" value="' .         wp_create_nonce( plugin_basename(__FILE__) ) . '" />';              $stocknum = get_post_meta($post->ID, '_dappcf_i_stocknum', true);         $vin = get_post_meta($post->ID, '_dappcf_i_vin', true);         $my_dropdown = get_post_meta($post->ID, '_dappcf_i_dropdown', true);              echo '
Stock #: <input type="text" name="_dappcf_i_stocknum" value="' . $stocknum  . '" class="widefat" style="width:80px" />          VIN: <input type="text" name="_dappcf_i_vin" value="' . $vin  . '" class="widefat"  style="width:200px" />
';              echo '
Inventory class: <select name="_dappcf_i_dropdown" class="widefat">';         echo '<option value="1"'. $my_dropdown == "1" ? ' selected="selected"' : ''. '>' . 'Option 1'. '</option>';         echo '<option value="2"'. $my_dropdown == "2" ? ' selected="selected"' : ''. '>' . 'Option 2'. '</option>';          echo '<option value="3"'. $my_dropdown == "3" ? ' selected="selected"' : ''. '>' . 'Option 3'. '</option>';          echo '<option value="4"'. $my_dropdown == "4" ? ' selected="selected"' : ''. '>' . 'Option 4'. '</option>';          echo '</select>
';     }          function txpbs_save_events_meta($post_id, $post) {         if ( !wp_verify_nonce( $_POST['inventorymeta_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }         if ( !current_user_can( 'edit_post', $post->ID ))     return $post->ID;              $station_meta['_dappcf_i_stocknum'] = $_POST['_dappcf_i_stocknum'];         $station_meta['_dappcf_i_vin'] = $_POST['_dappcf_i_vin'];         $station_meta['_dappcf_i_dropdown'] = $_POST['_dappcf_i_dropdown'];              foreach ($station_meta as $key => $value) {     if( $post->post_type == 'revision' ) return;     $value = implode(',', (array)$value);      if(get_post_meta($post->ID, $key, FALSE)) {         update_post_meta($post->ID, $key, $value);     } else {         add_post_meta($post->ID, $key, $value);     }     if(!$value) delete_post_meta($post->ID, $key);         }          }      And I use this code to call my custom fields when displayed in an input field:               <?php echo get_post_meta($post->ID, '_dappcf_i_dropdown', true); ?>      Any direction is greatly appreciated.


title: Multiple Post Thumbnails plugin and attachment error

text: This question specifically deals with the Multiple Post Thumbnails plugin, though the problem may have to do with my installation of WP itself as nobody else seems to have had this problem. I am using WP 3.0.5, completely stock with the exception of the plugin. As per the instructions, I am initializing the plugin as such:               $video_thumb_secondary = new MultiPostThumbnails(array(             'label' => 'Thumbnail Image',             'id' => 'video-thumbnail',             'post_type' => 'video'     ));      The code above is called in a function run during the admin_menu hook. When attempting to upload/select an image and then clicking on 'Use as thumbnail image' I get the following error: "Could not set that as the thumbnail image. Try a different attachment." I have also tried initializing the plugin with the default 'post_type' of 'post' and have run into the same error. As I said, I have seen no other documented cases of this error with this plugin, and hardly any at all of this error in general with WP. Hoping somebody can shed some light on it... ** **EDIT** ** Resolved my own issue. The code above must be run outside of any function in your functions.php file. I naturally assumed that it should be defined in one of the admin menu hooks, but that is not the case.


title: How to get WP Customer Reviews average and aggregated reviews

text:
http://wordpress.org/plugins/wp-customer-reviews/ I am using this plugin but they don't support getting the average and the aggregated reviews at their current version, but probably by their next release 3.0 version. A programmer who studied their code was able to get **it**. The code below shows how he did it, sorry I forgot the name of the programmer. What I did I copy and pasted his code to my post and place it in the HTML editor.               global $wpdb;     $id = get_the_ID();     $pId = $post->$id; //if using in another page, use the ID of the post/page you want to show ratings for.     $row = $wpdb->get_results("SELECT COUNT(*) AS `total`,AVG(review_rating) AS `aggregate_rating`,MAX(review_rating) AS `max_rating` FROM wp_wpcreviews WHERE `page_id`= $pId AND `status`=1");     $max_rating = $row[0]->max_rating;     $aggregate_rating = $row[0]->aggregate_rating;     $total_reviews = $row[0]->total;     $totl = $aggregate_rating * 20;     $wpdb->flush();      This code I got it from my research: `get_the_ID()` where you can get the post's ID dynamically. This is how you display the result above:

<div style="width: <?php echo $totl;?>%">

<?php echo ' ' . $total_reviews;?> Reviews
      I am not sure where did I got wrong with this, having a little knowledge with php and wordpress. What I can see is just the php code being displayed as text inside my post.


title: Dynamically generated URL and Content page

text: I am in need of some advice. I have a section on my home page dynamically pulling in a list of terms from a custom table in the WP db. I have made a unique custom URL for each of these terms based on test code:               <a href="<?php bloginfo('url'); ?>/test-directory/test-code/<?php echo      $record->test_code; ?>"        This works fine. My next step is to have these URL's when clicked load the accompanying dynamic content into a template. I tried the code below to create rewrite rules to point to a template but it just isn't working. It doesn't load the template but the default blog template. I am using a child theme but this should work:               function my_add_query_vars( $qvars ) {          $qvars[] = 'test-directory';              $qvars[] = 'test-code';              return $qvars;          }          add_action('query_vars', 'my_add_query_vars');               function my_add_rewrite_rules( $wp_rewrite )    {              $newrules = array();              $new_rules['^test-directory/(.*)/(.*)'] = 'index.php?test-directory=$matches[1]test-code=$matches[2]';              $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;          }          add_action('generate_rewrite_rules', 'my_add_rewrite_rules');                    function my_template_redirect() {              if( get_query_var('test-code') ) {                  include_once(locate_template('template-faq-fullwidth.php', true));                  exit();              }          }          add_action('template_redirect','template_redirect');      Any help is appreciated as always.Thanks.


title: Terms from current post custom taxonomy -- excluding parent and only from a single parent term

text:
The title sounds complex but this is quite simple. Hopefully the code for it is too. I have this custom taxonomy we'll call "Filters".   * ParentTerm A      * ChildTerm 1A     * ChildTerm 2A   * Parent Term B      * Child Term 1B     * Child Term 2B On a page that has a listing of custom post types, I was easily able to display all the terms selected for the "Filters" taxonomy by putting this in my loop/query:               <?php     $terms = get_the_terms( $post->ID, 'filters' );                      if ( $terms && ! is_wp_error( $terms ) ) :          $listing_filters = array();         foreach ( $terms as $term ) {             $listing_filters[] = $term->name;         }                            $listing_filters = join( ", ", $listing_filters );     ?>
<?php echo $listing_filters; ?>
     <?php endif; ?>      The PROBLEM is for this page I only want to display the terms selected under **_ParentTerm A_**. So _ChildTerm 1A_ and _ChildTerm 2A_ would display if they were checked off. But no other terms would display, not ParentTerm A, nor of course any terms in Parent Term B. However as noted with the above code I of course get any and all selected terms for this custom taxonomy. Any ideas? Thanks!!


title: Can I change the "Home" text in the menu?

text: I’m pretty sure this can be done with a filter or some kind of find and replace, but I’m not sure how. I have a page called “Home” like so: ![Screenshot](http://i.stack.imgur.com/GHOmT.jpg) When the link is displayed in my template it says “Home”. I’d like it to say “About Us”. I want the user to know which page the homepage is in the Page Overview panel, but I’d like to be able to name it whatever I like in my template without displaying the word "Home". Any ideas?


title: Custom bulk actions in WP 3.7.1

text:
So I am trying to get a custom bulk action to work in Wordpress 3.7.1 and so far no luck. The basis I am using is http://www.skyverge.com/blog/add-custom- bulk-action, and it goes wrong here:               $wp_list_table = _get_list_table('WP_Posts_List_Table');     $action = $wp_list_table->current_action();      The action itself is added with jQuery and does show. When I use a prompt to show the `$action` value it is always empty, which means the rest of the script does not fire. Any idea here? The entire code:               <?php     /*     Plugin Name: FoxRunSoftware Custom Bulk Action Demo     Plugin URI: http://www.foxrunsoftware.net/articles/wordpress/add-custom-bulk-action/     Description: A working demonstration of a custom bulk action     Author: Justin Stern     Author URI: http://www.foxrunsoftware.net     Version: 0.1          Copyright: © 2012 Justin Stern (email : justin@foxrunsoftware.net)     License: GNU General Public License v3.0     License URI: http://www.gnu.org/licenses/gpl-3.0.html     */          if (!class_exists('FRS_Custom_Bulk_Action')) {              class FRS_Custom_Bulk_Action {                  public function __construct() {                      if(is_admin()) {                     // admin actions/filters                     add_action('admin_footer-edit.php', array(&$this, 'custom_bulk_admin_footer'));                     add_action('load-edit.php',         array(&$this,     'custom_bulk_action'));                 add_action('admin_notices',         array(&$this, 'custom_bulk_admin_notices'));             }         }                   /**          * Step 1: add the custom Bulk Action to the select menus          */         function custom_bulk_admin_footer() {             global $post_type;                  if($post_type == 'post') {                 ?>                                      <?php             }         }                   /**          * Step 2: handle the custom Bulk Action          *           * Based on the post http://wordpress.stackexchange.com/questions/29822/custom-bulk-action          */         function custom_bulk_action() {             global $typenow;             $post_type = $typenow;                  if($post_type == 'post') {                      // get the action                 $wp_list_table = _get_list_table('WP_Posts_List_Table');  // depending on your resource type this could be WP_Users_List_Table, WP_Comments_List_Table, etc                 $action = $wp_list_table->current_action();                      $allowed_actions = array("export");                 if(!in_array($action, $allowed_actions)) return;                      // security check                 check_admin_referer('bulk-posts');                      // make sure ids are submitted.  depending on the resource type, this may be 'media' or 'ids'                 if(isset($_REQUEST['post'])) {                     $post_ids = array_map('intval', $_REQUEST['post']);                 }                      if(empty($post_ids)) return;                      // this is based on wp-admin/edit.php                 $sendback = remove_query_arg( array('exported', 'untrashed', 'deleted', 'ids'), wp_get_referer() );                 if ( ! $sendback )                     $sendback = admin_url( "edit.php?post_type=$post_type" );                      $pagenum = $wp_list_table->get_pagenum();                 $sendback = add_query_arg( 'paged', $pagenum, $sendback );                      switch($action) {                     case 'export':                              // if we set up user permissions/capabilities, the code might look like:                         //if ( !current_user_can($post_type_object->cap->export_post, $post_id) )                         //  wp_die( __('You are not allowed to export this post.') );                              $exported = 0;                         foreach( $post_ids as $post_id ) {                                  if ( !$this->perform_export($post_id) )                                 wp_die( __('Error exporting post.') );                                  $exported++;                         }                              $sendback = add_query_arg( array('exported' => $exported, 'ids' => join(',', $post_ids) ), $sendback );                     break;                          default: return;                 }                      $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status',  'post', 'bulk_edit', 'post_view'), $sendback );                      wp_redirect($sendback);                 exit();             }         }                   /**          * Step 3: display an admin notice on the Posts page after exporting          */         function custom_bulk_admin_notices() {             global $post_type, $pagenow;                  if($pagenow == 'edit.php' && $post_type == 'post' && isset($_REQUEST['exported']) && (int) $_REQUEST['exported']) {                 $message = sprintf( _n( 'Post exported.', '%s posts exported.', $_REQUEST['exported'] ), number_format_i18n( $_REQUEST['exported'] ) );                 echo "

{$message}

";             }         }              function perform_export($post_id) {             // do whatever work needs to be done             return true;         }     }     }          new FRS_Custom_Bulk_Action();      Well there is some more info, it seems to me that WP_List_Table just returns empty values. The following is the content of $wp_list_table, any ideas?:               object(WP_Posts_List_Table)#8848 (10) {          ["hierarchical_display"]=> NULL          ["comment_pending_count"]=> NULL          ["user_posts_count"]=> NULL          ["sticky_posts_count"]=> int(0)          ["items"]=> NULL          ["_args"]=> array(4) {              ["plural"]=> string(5) "posts"              ["singular"]=> string(0) ""              ["ajax"]=> bool(false)              ["screen"]=> object(WP_Screen)#8846 (16) {                  ["action"]=> string(0) ""                  ["base"]=> string(4) "edit"                  ["columns":"WP_Screen":private]=> int(0)                  ["id"]=> string(15) "edit-shop_order"                  ["in_admin":protected]=> string(4) "site"                  ["is_network"]=> bool(false)                  ["is_user"]=> bool(false)                  ["parent_base"]=> NULL                  ["parent_file"]=> NULL                  ["post_type"]=> string(10) "shop_order"                  ["taxonomy"]=> string(0) ""                  ["_help_tabs":"WP_Screen":private]=> array(0) { }                  ["_help_sidebar":"WP_Screen":private]=> string(0) ""                  ["_options":"WP_Screen":private]=> array(0) { }                  ["_show_screen_options":"WP_Screen":private]=> NULL                  ["_screen_settings":"WP_Screen":private]=> NULL              }          }          ["_pagination_args"]=> array(0) { }          ["screen"]=> object(WP_Screen)#8846 (16) {              ["action"]=> string(0) ""              ["base"]=> string(4) "edit"              ["columns":"WP_Screen":private]=> int(0)              ["id"]=> string(15) "edit-shop_order"              ["in_admin":protected]=> string(4) "site"              ["is_network"]=> bool(false)              ["is_user"]=> bool(false)              ["parent_base"]=> NULL              ["parent_file"]=> NULL              ["post_type"]=> string(10) "shop_order"              ["taxonomy"]=> string(0) ""              ["_help_tabs":"WP_Screen":private]=> array(0) { }              ["_help_sidebar":"WP_Screen":private]=> string(0) ""              ["_options":"WP_Screen":private]=> array(0) { }              ["_show_screen_options":"WP_Screen":private]=> NULL              ["_screen_settings":"WP_Screen":private]=> NULL          }          ["_actions"]=> NULL ["_pagination"]=> NULL      }


title: I need to insert a captcha for all comments in word press

text: Hi I am new to word press. I need to insert captcha for all the comments wherever seen in word press theme. How can I do it. Please help me.


title: meta fields for the whole wordpress site

text: Is there a simple way to store additional information related to the whole website in a meta field? For users, comments or posts, I learned how to use meta fields to store their additional related information, but sometimes I need to have growing arrays that contain additional information about the whole website. Your clarifications are appreciated.


title: use more than one meta key in query using posts_where

text: Here I want to add query for more then one meta key as here:               $where .= " AND meta_key='order_assign_delivery_date' AND meta_value LIKE '0000%' And meta_key='order_assign_data' AND meta_value=0";      so now how to do this? above query not working and that's obvious Please guide me how to use more than one meta_key in same query in posts_where filter