How to add a post without assigning to a category?

Can any one please explain how to add a post in WordPress without assigning it to any category. Actually I want to display some news or some quick information. So, it does not come to any category in my blog. In this type of time, I do not want to assign to any category. for example, http://www.someSiteURL.com/this-is-news-about-something-awesome/ http://www.someSiteURL.com/wordpress-themes/Anan-wordpress-theme-review/ The first url is what i want to have. But by default, it automatically add "uncategorized". My permalink structure is "/%category%/%postname%/" and I use Yoast to hide the word "category" in the urls. Any one can help on this situation please? And kindly i would like to let you know that, I do not want to add page for such things. Also, I do not want to add categories like "news" or "info" for this. Thanks for your time,


detect the language a post is written in

Is there any way to evaluate the language a post/page is written in? I am building a multilingual site and am almost pulling my hair out trying to get the front-end navigation to take the chosen language into account. So far the polylang plugin http://wordpress.org/extend/plugins/polylang/ has worked fine for everything else.


Unable to pass variable on theme cusomizer add_settings()

I have theme options saved as serialized data. And I have named the option name by getting theme name.               $theme = wp_get_theme();     $settings = sanitize_title($theme).'-options'; // do not change!      But when I am trying to pass the $settings variable with or without concatenation. It ends up with this fatal error.               Fatal error: Call to a member function check_capabilities() on a non-object in C:\Users\SISIR\Dropbox\wamp\www\l\wp-includes\class-wp-customize-control.php on line 160      Check the `$settings.'[skin']` section which doesn't work but when I replace that part of the code with `'lead_capture_theme_option[skin]'`, it works. The fatal error itself is also puzzling.                   add_action( 'customize_register', 'lead_capture_theme_customize_register', 11 );              function lead_capture_theme_customize_register($wp_customize) {                  $theme = wp_get_theme();             $settings = sanitize_title($theme).'-options'; // do not change!         //  var_dump($settings);                  $wp_customize->add_section( 'lead_cap_color_scheme', array(                                             'title'          => __( 'Color Scheme', 'themename' ),             'priority'       => 35             )         );                  $wp_customize->add_setting( $settings.'[skin]', array(                                              'default'        => 'light',             'type'           => 'theme_mod',             'capability'     => 'edit_theme_options'                                            )         );                  $wp_customize->add_control( 'lead_capture_theme_option[skin]', array(                                               'label'        => 'Select a Color Scheme',             'type'           => 'select',             'choices' => array('default', 'custom'),             'section' => 'lead_cap_color_scheme',             'settings' => 'lead_capture_theme_option[skin]'         )     );                                                     $wp_customize->add_setting( 'lead_capture_theme_option[logo]', array(                     'type'           => 'theme_mod',                     'capability'     => 'edit_theme_options'                     )             );              $wp_customize->add_control(                                                                      new WP_Customize_Image_Control( $wp_customize, 'lead_capture_theme_option[logo]', array(                         'label'   => 'Upload Logo',                         'section' => 'lead_cap_color_scheme'                         )                         )                                                         );                                                   }


Echo the featured image of page assigned to blog in index.php

I have my posts page set to a page named Blog. This is set to use the Template: Default template. So index.php is rendering this page. I want to be able to set the Featured image of this page I've called Blog and have this output at the top of the blog posts page on my site. For every other page on my site I am able to acheive this with               <div style="background-image: url('<?php echo $featured_src[0]; ?>');">      Does anyone have any idea why the featued image would work for page.php but not index.php?


twenty thirteen header size

I am new to wordpress so I am really sorry for asking such silly question. I just want to know that where is the css of header image. I checked in style.css but there is no css of header image. Please help. Thanks


What's the policy for building a theme that doesn't support widgets/menus?

I'm developing a minimalistic theme, and my plan is not to include menus or widgets in it. The Theme Review page on wordpress.org states: > Whether implementing required, recommended, or optional features, Themes are > required to support proper WordPress core implementation of all included > features. This is quite fuzzy for me. Does this mean I have to include all WordPress core features? What's considered a core feature? Are Widgets and Menus core features?


Count all comments of a custom post type

I know how to count comment per post, user and in total but i am   having problems getting **the total amount of comments post in a specific post type**. I guess i can loop trough all the posts and count each one   comments but i am looking for something faster and less   resource expensive Appreciate your help **I got this so far (i think this is a bad way but i might be wrong):**               /*** ALL COMMENTS COUNT BY POST TYPE ***/     function countCptCommentsTotal() {              // FAQ ARGS         $faqStatsArgs = array(             'post_type'         =>  'some_post_type',             'post_status'       =>  'publish',             'posts_per_page'    =>  -1         );         $faqstats_query = new WP_Query($faqStatsArgs);              // THE LOOP         $allAnswers = 0;         while ($faqstats_query->have_posts()) {             $faqstats_query->the_post();                  $curfaqid       =   get_the_ID();             $allAnswers =   $allAnswers + countPostComments($curfaqid);              }              wp_reset_query();         return $allAnswers;     }


Pagination on custom post type not working if permalinks set to rewrite url

When rewriting the url like this: .../%postname%/ This is the relevant part of my post type registration arguments:               'rewrite' => array( 'slug' => 'haendler', 'with_front' => false )      My pagination on the custom post type does not work. The pagination is there but when I click on page two the link `http://www.example.com/%postname%/page/2` always changes back to `http://www.example.com/%postname%/` If I disable permalinks to the default querystring style pagination is fine. What can be the reason for the url automatically removing the `page/2` value? Thanks in advance


No subfolder for posts on Multi Sites

I suspect the answer is no, but I thought I'd double check. I'm in the process of converting a WordPress blog into a string of Multi Sites where each site represents a category of posts in the original blog. I know you have to have a subfolder or subdomain for each Multi Site, e.g. www.domain.com/multisite, but is it possible to remove this for posts so that all posts on all Multi Sites have the format www.domain.com/this-is-a-post- could-be-on-any-multi-site I need the posts to still technically belong to their respective Multi Site because I'm using plugins for each to tweet to their own separate Twitter account and display that feed as a widget.


How to create manually a fancybox gallery?

premise i don't really know anything about wordpress framework, i only know how to use it. I need to change an already exists gallery with loooots of images, with a simple gallery like fancybox (the plugin..). The older programmer built a page with wp native functions, but i really don't know how to move there. I've installed the plugin (fancybox) by adding it with the tools "add plugin" in the backend, but now i need to edit an existing page called "taxonomy-lookbook-cat.php", and here's the source code of it:               <?php     /*     Template Name: Lookbook     */     ?>          <?php get_header(); ?>

                             <?php $cat = get_query_var('lookbook-cat'); ?>                                   <?php $catargs = array(                                      'orderby'            => 'name',                                 'order'              => 'ASC',                                 'style'              => 'list',                                 'show_count'         => 0,                                 'hide_empty'         => 0,                                 'use_desc_for_title' => 0,                                 'title_li'           => __( '' ),                                 'echo'               => 0,                                 'taxonomy'           => 'lookbook-cat',                                 'walker'             => null                             ); ?>

<?php echo wp_list_categories( $catargs ); ?>

                             <?php                                      $args = array(                                     'post_type' => 'lookbook',                                     'order'     => 'ASC',                                     'lookbook-cat'      => $cat,                                  );                                      $items_small = new WP_Query($args);                             ?>                             <?php   if( $items_small->have_posts()): ?>

                             <?php while( $items_small->have_posts() ) : $items_small->the_post(); ?>                                 <li id="small-<?php the_ID(); ?>">                                     <?php the_post_thumbnail( 'carousel-small' ); ?>
                             <?php endwhile; ?>

                                  <?php else: ?>                                     Oh ohm no products!                             <?php endif; ?>                             <?php wp_reset_query(); ?>                                       <?php                                      $items_big = new WP_Query( $args );                             ?>                             <?php   if( $items_big->have_posts() ): ?>

                             <?php $counter = -1; ?>                                  <?php while( $items_big->have_posts() ) : $items_big->the_post(); ?>                                 <?php $counter++; ?>                                     <li id="big-<?php the_ID(); ?>">                                     <?php                                           $attributes = array(                                             'id'    => 'img-' . $counter,                                         );                                     ?>                                     <?php the_post_thumbnail( 'carousel-big', $attributes); ?>
<?php the_content(); ?>

                             <?php endwhile; ?>

                                                               <?php else: ?>                                     Oh ohm no products!                             <?php endif; ?>

                              <div class="fb-like" data-href="<?php echo bloginfo('url') . $_SERVER["REQUEST_URI"]; ?>" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false">

           <?php get_footer(); ?>      it is divided in "two gallery" a big and a small. I need to rewrite that page and in a while or a foreach cicle it should show something like this:

      Thanks for the support, i need it!


Why does Wordpress redirect when I separate wp-core and wp-content?

I'm trying to setup my Wordpress projects so that I can have `http://www.example.com/` as my site URL, say mapped to `/var/www/vhosts/www.example.com/` and in there, I would like to use the following structure:               /var/www/vhosts/www.example.com/wp-core/     /var/www/vhosts/www.example.com/wp-content/     /var/www/vhosts/www.example.com/wp-config.php      I would like `wp-core/` to contain the Wordpress core installation as an `svn:external` and with `wp-content` and `wp-config.php` stored in my SVN repo, containing themes, config, etc. for each site. The following article appears to explain how to go about setting the above structure up: http://codex.wordpress.org/Installing_WordPress_With_Clean_Subversion_Repositories However, I'm hitting an issue where the site loads up correctly, reads it's config from the `wp-config.php` file above `wp-core` as intended, however when I attempt to log in, Wordpress redirects the request from `http://www.example.com/wp-login.php` to `http://www.example.com/wp- login.php/` - note the trailing slash. Here's a confirmation of the extra lines in `wp-config.php` I've added for this:               define('WP_CONTENT_DIR', dirname(__FILE__) . '/wp-content');     define('WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/wp-content' );      Here's the relevant rows from `wp_options` in my DB:               SELECT option_name,option_value FROM wp_options WHERE option_name = 'home';     home,http://www.example.com          SELECT option_name,option_value FROM wp_options WHERE option_name = 'site url';     siteurl,http://www.example.com      Here's my .htaccess:               # BEGIN WordPress     <IfModule mod_rewrite.c>         # Hey-ho let's go!         RewriteEngine On         # Base is the URL path of the home directory         RewriteBase /         # Base goes to WordPress         RewriteRule ^$ /wp-core/index.php [L]         # Skip real files and directories         RewriteCond %{REQUEST_FILENAME} !-f         RewriteCond %{REQUEST_FILENAME} !-d         # Otherwise send it to WordPress         RewriteRule .* /wp-core/index.php [L]     </IfModule>     # END WordPress      Tracing this in Chrome, I can see that a `HTTP 301` from the correct address to the address with the trailing slash is returned by the server, so it would point to the `.htaccess` above, however the first line of the following excerpt contradicts this somewhat:               127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (2) init rewrite engine with requested uri /wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (1) pass through /wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] add path info postfix: /Users/joe/tmp/example.com/trunk-new/wp-login.php -> /Users/joe/tmp/example.com/trunk-new/wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] strip per-dir prefix: /Users/joe/tmp/example.com/trunk-new/wp-login.php/ -> wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] applying pattern '^$' to uri 'wp-login.php/'     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] add path info postfix: /Users/joe/tmp/example.com/trunk-new/wp-login.php -> /Users/joe/tmp/example.com/trunk-new/wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] strip per-dir prefix: /Users/joe/tmp/example.com/trunk-new/wp-login.php/ -> wp-login.php/     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (3) [perdir /Users/joe/tmp/example.com/trunk-new/] applying pattern '.*' to uri 'wp-login.php/'     127.0.0.1 - - [06/Feb/2014:21:02:59 +0000] [www.example.com/sid#7ffb79860180][rid#7ffb7b8020a0/initial] (2) [perdir /Users/joe/tmp/example.com/trunk-new/] rewrite 'wp-login.php/' -> '/wp-core/index.php'      Specifically: `requested uri /wp-login.php/` indicates that Apache receives a request for `/wp-login.php/` and not `wp-login.php` and `mod_rewrite` passes through the request. Can anyone offer any suggestions on how I can set this up so that I can have WP core files in one directory in the doc root and `wp-config/` alongside the WP core directory?


Custom Download Link

How can I set up wordpress to recognize               www.example.com/wp-content/uploads/2010/12/history.pdf      as something like               www.example.com/about/pdf-download/      I also want the user not to see the actual link but the new one.


Are page/post IDs unique across a whole network?

If I have a page with ID 123, I know my template file `page-123.php` will be called to render it, but if my theme is used across a network, could a page in a different site _also_ have ID 123? I assume, if so, that I'll need to sniff `$current_site` and requiring an alternate template file if it's not the site I'm targeting. I already assume slugs aren't unique across a network.


Make blogroll links no-follow?

How can I add a nofollow option to my blogroll links editor? Attempted to just type "nofollow" into the "rel" input box, but its auto deleted onblur. If I turn javascript off (thanks to Matt's suggestion below), It works, but when I check the source on my site, the rel attribute looks like this... rel="nofollow"onclick="javascript:pageTracker._trackPageview('/outbound/blogroll/www.site.com');


Jquery based image accordian plugin

I found a image accorian menu plugin based on mootools farework. Please suggest if any based on jquery framework.


Load custom post type in a different WordPress installation

I am trying to display a list of posts (custom post types) coming from a different WordPress installation (to make things more clear, my client wants has two separate sites, and they want to list their listings on both sites, but only add them once). I have tried to implement this with PHP/MySQL and I am able to grab the post title, content, ID and date from specific custom post type, however all the added fields are stored in *wp_postmeta* under the field '*meta_key*', so as you can imagine this will be nightmare to sort out. I was hoping someone has a quicker and easier solution to displaying full date of any given post on a different WordPress installation.


How to paginate a list of child pages

I am using the following code to list the child pages of the current page being viewed. But it only outputs the last 5 child pages; i want it to list all pages in blocks of 5 with "next" and "previous" links. Such as it works on normal posts. The code I am using is the following:               <?php      $ancestors = array();     $ancestors = get_ancestors($post->ID,'page');     $parent = (!empty($ancestors)) ? array_pop($ancestors) : $post->ID;     if (!empty($parent)) {       $kids = new WP_Query(         array(           'post_parent'=>$parent,           'post_type' => 'page',           'ignore_sticky_posts' => true         )       );       if ($kids->have_posts()) {         while ($kids->have_posts()) {           $kids->the_post();           echo '
' . '
' . '' . get_the_post_thumbnail() . '' . '' . '' . get_the_title() . '' . '
';           echo '
';           echo the_field("info_add");             echo '
';           echo '

';         }       }     }     ?>      The page in question is this one: http://dedos.info/flavioc/trabalhos/ Now I'm wondering if I should have used Custom Post Types to manage this but now it's too late. Any help will be appreciated, thanks.


BuddyPress | How to merge the "setting" & "profile" pages into one page?

In BuddyPress I would like to merge the _register.php_ and _setting.php_ files into one " _register.php_ ".   Is that possible? I don't want to change my Name, City and Address then go to the _setting page_ to change email and password again.   Thanks for your answers :)


Is there a WordPress widget for my webpage?

I'd like to show a summary of my recent posts on my homepage. (Like the headlines and perhaps a few lines of text.) My site is _not_ running on WordPress. Is there a code snippet for that? **Edit:** When I said "widget", I didn't mean it in the WordPress sense. I meant a code snippet.


Allow user to select a theme to install when they signup

Is it possible to allow a user to select which theme they would like installed from the new site signup page? And once the site is created, it obviously installs whichever theme they chose. I found wp_get_themes. Is this how you would go about pre-populating a dropdown menu with all the available themes? How do you pass the theme's information to the actual signup process so the site is created with the correct theme? If someone knows how to do this with Gravity Forms, that would be great also. _**Update:_** Here's what I have so far, it doesn't take into account child themes, will work on that after This function will output a list of themes with radio buttons, storing the selected theme in $_POST['custom_theme']               /**     * Show list of themes at bottom of wp-signup.php (multisite)     */     function 70169_add_signup_extra_fields() { ?>          Themes<br />     <?php     $themes = wp_get_themes();          foreach ( $themes as $theme ) {         $theme_name = $theme['Name'];         $theme_stylesheet = $theme->stylesheet;     ?>         <label>             <input id="<?php echo $theme_stylesheet; ?>" type="radio" <?php if ( isset( $_POST['custom_theme'] ) ) checked( $_POST['custom_theme'], $theme_stylesheet ); ?> name="custom_theme" value="<?php echo $theme_stylesheet; ?>" ><?php echo $theme_name; ?>         </label>          <?php } ?>          <?php }     add_action( 'signup_extra_fields', '70169_add_signup_extra_fields' );      I thought I'd add a hidden field as a way to pass the theme's value onto the site creation. There's something wrong with this though - at the last step it loses it's value, not sure why yet.               /**      * Add a hidden field with the theme's value      */     function 70169_theme_hidden_fields() { ?>          <?php         $theme = isset( $_POST['custom_theme'] ) ? $_POST['custom_theme'] : null;     ?>     <input type="hidden" name="user_theme" value="<?php echo $theme; ?>" />     <?php }     add_action( 'signup_hidden_fields', '70169_theme_hidden_fields' );      And finally a function to pass the theme name to the newly created site. This works if I hardcode the variables, but I'm unable to pass the value of the custom_theme yet. The site gets created fine but the template and stylesheet options are blank. It's just not getting the value no matter what I try. I guess I have to use $_GET to access the hidden field I created earlier. Again, all I want to do at this point is pass the same theme name to the template and stylesheet options, I'll figure out how to differentiate them after I get it working.               /**           * Create the new site with the theme name     */     function 70169_wpmu_new_blog( $blog_id ) {          // need to get this working, use $_GET?     //    $theme = ???              update_blog_option( $blog_id, 'template', $theme );  // $theme works if I hardcode it with a theme name         update_blog_option( $blog_id, 'stylesheet', $theme );     }          add_action( 'wpmu_new_blog', '70169_wpmu_new_blog' );


Run a php function if a predefined page is visited

I use the CubePoints plugin that rewards users with 1000 points via the following function:               if( function_exists(‘cp_alterPoints’) && is_user_logged_in() ){         cp_alterPoints(cp_currentUser(), 1000);     }      Now, I would like to reward a user 1000 points for viewing one specific custom page that I created with with a page template.   Lets call it landingpage.php and the post ID of this page is 24122. Is there any way to accomplish this?   Something like "if is page landingpage" (or "if is post=24122"), then perform the above function.


404 Issue w/ Custom Post Type - using Meta for Permalink rewrite

I'm trying to rewrite my permalinks using meta data from my post. The permalink rewrite works- but I'm getting the 404 issue when I try to view the post. I've flushed by visiting the permalink settings page, and still no dice. Could someone offer a clue as to why this wouldn't work?               add_filter('post_type_link','calendar_link_filter',1,3);          function calendar_link_filter( $post_link, $id = 0, $leavename = FALSE ) {         $post = get_post($id);         if($post->post_type != 'super_duper') {                 return $post_link;         }         $date = get_post_meta($post->ID,'event_start_date',true);         $date = strtotime($date);         $str = $post_link;         $str = str_replace('%cal_year%',date("Y",$date),$str);         $str = str_replace('%cal_month%',date("m",$date),$str);         $str = str_replace('%cal_day%',date("d",$date),$str);         return $str;          }               add_action( 'init', 'create_my_post_types' );          function create_my_post_types() {     register_post_type( 'super_duper',         array(             'labels' => array(                 'name' => __( 'Super Dupers' ),                 'singular_name' => __( 'Super Duper' )             ),             'hierarchical' => false,             'show_ui' => true, // UI in admin panel             'publicly_queryable' => true,             'rewrite' => true,             'public' => true,             'rewrite' => array('slug' => 'events8/%cal_year%/%cal_month%/%cal_day%'),                   )     );     flush_rewrite_rules();     }


WordPress Custom Post Type Navigation + Children

UPDATED: 5/08/2010 WordPress has now added an additional technique to display the items from a custom post-type if the post-type is set to Hierarchical. What I would like to do though is make it so the post items have the .current_page_item class when selected in the navigation. Does anyone know of a function to achieve this?                   <?php          $args = array(           'post_type'=>'testimonials',           'title_li'=> __('Testimonials')         );         wp_list_pages( $args );          ?>       Thanks, George


Seperating custom post type comments from regular blog posts comments

I have a custom post type (gs_index) with commments enabled, and would like to display a list of recent comments only from that particular post type (outside of the loop) I would also like to display the standard blog posts' comments without the comments from the custom post type. Here is the code I am currently using
       <?php         $comments = get_comments('number=10&status=approve');         $true_comment_count = 0;         foreach($comments as $comment) :       ?>            <?php $comment_type = get_comment_type(); ?>       <?php if($comment_type == 'comment') { ?>         <?php $true_comment_count = $true_comment_count +1; ?>         <?php $comm_title = get_the_title($comment->comment_post_ID);?>       <?php $comm_link = get_comment_link($comment->comment_ID);?>       <?php $comm_comm_temp = get_comment($comment->comment_ID,ARRAY_A);?>       <?php $comm_content = $comm_comm_temp['comment_content'];?>
                        <?php echo($comment->comment_author)?>            on            <a href="<?php echo($comm_link)?>" title="<?php echo $comm_title?>">             <?php echo $comm_title?>
             <?php } ?>       <?php if($true_comment_count == 5) {break;} ?>       <?php endforeach;?>


How to query two meta fields and display results between them

I am making a search form that searches for posts within two meta box values and display results between them. I have this set               $prefix = 'ghes_'; // start with an underscore to hide fields from custom fields list     add_filter( 'ghes_meta_boxes', 'ghes_sample_metaboxes' );     function ghes_sample_metaboxes( $meta_boxes ) {         global $prefix;         $meta_boxes[] = array(             'id' => 'event_meta',             'title' => 'Event Metabox',             'pages' => array('event'), // post type             'context' => 'normal',             'priority' => 'high',             'show_names' => true, // Show field names on the left             'fields' => array(                  array(                     'name' => 'Event Start Date',                     'desc' => 'field description (optional)',                     'id' => $prefix . 'event_start_timestamp',                     'type' => 'text_date_timestamp'                 ),                                   array(                     'name' => 'Event End Date',                     'desc' => 'field description (optional)',                     'id' => $prefix . 'event_end_timestamp',                     'type' => 'text_date_timestamp'                 )                         How will the query look like if I want to search for posts between the "Event Start Date" and the "Event End Date". Thanks.


preg_replace not removed "class"

Use this code to remove the label "class" of the images, but does not work. The label does not disappear in the new post.               function the_post_thumbnail_remove_class($output) {             $output = preg_replace('/class=".*?"/', '', $output);             return $output;     }     add_filter('post_thumbnail_html', 'the_post_thumbnail_remove_class');      It only works on the main page with highlighted images(thumbnail).


str_replace not responding in functions.php

I'm tring to use `str_replace` within a wordpress function but its not working. My code:               function fields($content) {         if(is_feed()) {           $post_id = get_the_ID();         $url = str_replace('http://', '', '' . get_post_meta($post_id, 'book-author', true) . '');          $output = '<div>';         $output .= '' .url. '';         $output .= '</div>';         $content = $content.$output;           }           return $content;       }     add_filter('the_content','fields');      What I'm getting in result of `' .url. '` is just "url" printed in my feed. Please help. Thank you.


Fast way to copy a Blog x to another domain/server without deleting it

Let's say I have a Wordpress blog named **X** , and I want another blog **Y** What is the best way to have the exact same copy of **X** on another domain, so I can create my **Y** blog with the same plugins, themes, without having to download them again from the WordPress admin panel. What I've found is :   * Either copying the whole wp folder and upload it to the other domains server.   * Or using some plugins, but I don't really know which one and if it's a good practice. So is there a good practice to copy a Blog **X** to another domain/server without deleting it.It's not really a migration as I don't want to migrate, just copying it **X** and it's themes, plugins on **Y**


Why does get_post_status display published when attachment is in trash?

Is there a reason why using get_post_status() on an attachment page returns 'published' when the media item is actually in the trash? I'm trying to figure out if this is a bug or if not how to display the status of the attachment. Thanks!


get_option() fails to return binary result

For some reason, `get_option()` started to fail when returning binary results when I moved my website from localhost to the web server. I migrated my WordPress using an upload of the files on the FTP Everything else works perfectly however. Even the `wp-admin` works right: I can edit, post, etc. It's just a single line of code that is giving me the blues. It comes from a theme I'm using, but there is no theme-specific behavior: it crashes way before that. That line of code tries to do this:               $sqbtn_1 = unserialize(get_option('magaling_ads_468060_1')); //returns null.     $sqbtn_1 = $sqbtn_1->is_empty() ? $ad_def : $sqbtn_1;  //CRASHES: is_empty on a non-object.      If I create a simple PHP file, I can prove myself that the data comes correctly from MySQL. I have the 'magaling_ads_468060_1' field in my WordPress options table and here is what it contains:               mysql_query('SET NAMES utf8');     $result = mysql_query("select * from wp_options WHERE option_name = 'magaling_ads_468060_1'");     //prints out the following value of the option_value field:     s:376:"O:18:"Padd_Advertisement":5:{s:27:"Padd_Advertisementimg_url";s:88:"http://www.echysttas.org/wp-content/themes/magaling/images/advertisement-468x060_1.jpg";s:28:"Padd_Advertisementalt_desc";s:15:"Axonn Echysttas";s:27:"Padd_Advertisementweb_url";s:24:"http://www.echysttas.org";s:26:"Padd_Advertisementtarget";s:4:"_new";s:29:"Padd_Advertisementcss_class";s:0:"";}";      So the MySQL returns the data! However, get_option returns **nothing**. I echo-ed it and it's empty. On the other side...               get_option('magaling_installed'); //works and returns "1"      Everything else works fine, even returning other theme-specific (integer or string) values.               var_dump( get_option('magaling_ads_468060_1') ); //shows bool(false)      var_dump( get_option('magaling_installed') ); //shows string(1) "1"      var_dump( get_option('blogname') ); //string(9) "Echysttas"


StackExchange-like flag system for WordPress

Is there a plug-in that can incorporate a StackExchange-like flag system on a WordPress blog? Then registered users can flag an article/post so that the admin or moderator can review the post later and decide whether the post should be published or not.


Of thumbnails and folder permissions

I am trying to make TimThumb work on my domain. After having tried and tested every step on this troubleshooting guide, it finally came down to folder permissions. The thumbnail cache is owned by my `accountname`, while the processes trying to access the folder (i.e. WordPress) are `nobody`. The solution suggested by the author of the linked post is to `chown` the folder to nobody. What are the implications of this? Will it affect how WordPress works or my FTP?


intellisense in wp search

Is it possible to bring intellisense (autocomplete) in the search box of the website????


List a current posts' taxonomy terms in a widget in Wordpress

I would very much like to know if there is a widget that exists that would let me show the current page's associated taxonomy terms (preferably hierarchically) in a widget. For example, if the current post has a Taxonomy term "Tom Hanks" in the Taxonomy of "Actor", the widget would list "Actor" then "Tom Hanks". Even though there are many other actors in the taxonomy of "Actors", only the ones from the current page, are listed.


How to display custom message for (Genesis) featured posts if no posts

I'm using the Genesis Framework, and the custom post types featured post widget (code below). I need to display a custom error message for a particular post type if there are no post present for that post type. Currently, the plugin displays nothing if there are no post, but still displays the widget title. I don't know where to begin.               <?php     /**      * Genesis Featured Custom Post Type Widget      *      * @package GenesisFeaturedCustomPostTypeWidget      * @author  StudioPress      * @author  Jo Waltham      * @license GPL-2.0+      *      */           /**      * Register Genesis Featured Custom Post Type Widget      *       * @package GenesisFeaturedCustomPostTypeWidget      * @author  StudioPress      * @author  Jo Waltham      */           /**     * Please note that most of this code is from the Genesis Featured Post Widget included in the Genesis Framework.     * I have just added support for Custom Post Types     */               class Genesis_Featured_Custom_Post_Type extends WP_Widget {              /**          * Holds widget settings defaults, populated in constructor.          *          * @var array          */         protected $defaults;              /**          * Constructor. Set the default widget options and create widget.          *          * @since 0.1.8          */         function __construct() {                  $this->defaults = array(                 'title'                   => '',                     'post_type'               => 'post',                 'posts_cat'               => '',                 'posts_num'               => 1,                 'posts_offset'            => 0,                 'orderby'                 => '',                 'order'                   => '',                 'exclude_displayed'       => 0,                 'show_image'              => 0,                 'image_alignment'         => '',                 'image_size'              => '',                 'show_gravatar'           => 0,                 'gravatar_alignment'      => '',                 'gravatar_size'           => '',                 'show_title'              => 0,                 'show_byline'             => 0,                 'post_info'               => '[post_date] ' . __( 'By', 'genesis-featured-custom-post-type-widget' ) . ' [post_author_posts_link] [post_comments]',                 'show_content'            => 'excerpt',                 'content_limit'           => '',                 'more_text'               => __( '[Read More...]', 'genesis-featured-custom-post-type-widget' ),                 'extra_num'               => '',                 'extra_title'             => '',                 'more_from_category'      => '',                 'more_from_category_text' => __( 'More Posts from this Category', 'genesis-featured-custom-post-type-widget' ),             );                  $widget_ops = array(                 'classname'   => 'featured-content featuredpost',                 'description' => __( 'Displays featured custom post types with thumbnails', 'genesis-featured-custom-post-type-widget' ),             );                  $control_ops = array(                 'id_base' => 'featured-custom-post-type',                 'width'   => 505,                 'height'  => 350,             );                  parent::__construct( 'featured-custom-post-type', __( 'Genesis - Featured Custom Post Types', 'genesis-featured-custom-post-type-widget' ), $widget_ops, $control_ops );              }              /**          * Echo the widget content.          *          * @since 0.1.8          *          * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.          * @param array $instance The settings for the particular instance of the widget          */         function widget( $args, $instance ) {                  global $wp_query, $_genesis_displayed_ids;                  extract( $args );                  //* Merge with defaults             $instance = wp_parse_args( (array) $instance, $this->defaults );                  echo $before_widget;                  //* Set up the author bio             if ( ! empty( $instance['title'] ) )                 echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;                  $query_args = array(                 'post_type' => $instance['post_type'],                 'cat'       => $instance['posts_cat'],                 'showposts' => $instance['posts_num'],                 'offset'    => $instance['posts_offset'],                 'orderby'   => $instance['orderby'],                 'order'     => $instance['order'],             );                  //* Exclude displayed IDs from this loop?             if ( $instance['exclude_displayed'] )                 $query_args['post__not_in'] = (array) $_genesis_displayed_ids;                  $wp_query = new WP_Query( $query_args );                  if ( have_posts() ) : while ( have_posts() ) : the_post();                      $_genesis_displayed_ids[] = get_the_ID();                      genesis_markup( array(                     'html5'   => '
',                     'xhtml'   => sprintf( '
', implode( ' ', get_post_class() ) ),                     'context' => 'entry',                 ) );                      $image = genesis_get_image( array(                     'format'  => 'html',                     'size'    => $instance['image_size'],                     'context' => 'featured-post-widget',                     'attr'    => genesis_parse_attr( 'entry-image-widget' ),                 ) );                      if ( $instance['show_image'] && $image )                     printf( '%s', get_permalink(), the_title_attribute( 'echo=0' ), esc_attr( $instance['image_alignment'] ), $image );                      if ( ! empty( $instance['show_gravatar'] ) ) {                     echo '';                     echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] );                     echo '';                 }                      if ( $instance['show_title'] )                     echo genesis_html5() ? '' : '';                          if ( ! empty( $instance['show_title'] ) ) {                              if ( genesis_html5() )                             printf( '
%s
', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );                         else                             printf( '
%s
', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );                          }                          if ( ! empty( $instance['show_byline'] ) && ! empty( $instance['post_info'] ) )                         printf( genesis_html5() ? '
%s
' : '
%s
', do_shortcode( $instance['post_info'] ) );                      if ( $instance['show_title'] )                     echo genesis_html5() ? '' : '';                      if ( ! empty( $instance['show_content'] ) ) {                          echo genesis_html5() ? '
' : '';                          if ( 'excerpt' == $instance['show_content'] ) {                         the_excerpt();                     }                     elseif ( 'content-limit' == $instance['show_content'] ) {                         the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) );                     }                     else {                              global $more;                              $orig_more = $more;                         $more = 0;                              the_content( esc_html( $instance['more_text'] ) );                              $more = $orig_more;                          }                          echo genesis_html5() ? '
' : '';                      }                      genesis_markup( array(                     'html5' => '
',                     'xhtml' => '
',                 ) );                  endwhile; endif;                  //* Restore original query             wp_reset_query();                  //* The EXTRA Posts (list)             if ( ! empty( $instance['extra_num'] ) ) {                 if ( ! empty( $instance['extra_title'] ) )                     echo $before_title . esc_html( $instance['extra_title'] ) . $after_title;                      $offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] );                      $query_args = array(                     'post_type' => $instance['post_type'],                     'cat'       => $instance['posts_cat'],                     'showposts' => $instance['extra_num'],                     'offset'    => $offset,                 );                      $wp_query = new WP_Query( $query_args );                      $listitems = '';                      if ( have_posts() ) {                     while ( have_posts() ) {                         the_post();                         $_genesis_displayed_ids[] = get_the_ID();                         $listitems .= sprintf( '
%s
', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );                     }                          if ( mb_strlen( $listitems ) > 0 )                         printf( '
%s
', $listitems );                 }                      //* Restore original query                 wp_reset_query();             }                  if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) )                 printf(                     '
%3$s
',                     esc_url( get_category_link( $instance['posts_cat'] ) ),                     esc_attr( get_cat_name( $instance['posts_cat'] ) ),                     esc_html( $instance['more_from_category_text'] )                 );                  echo $after_widget;              }              /**          * Update a particular instance.          *          * This function should check that $new_instance is set correctly.          * The newly calculated value of $instance should be returned.          * If "false" is returned, the instance won't be saved/updated.          *          * @since 0.1.8          *          * @param array $new_instance New settings for this instance as input by the user via form()          * @param array $old_instance Old settings for this instance          * @return array Settings to save or bool false to cancel saving          */         function update( $new_instance, $old_instance ) {                  $new_instance['title']     = strip_tags( $new_instance['title'] );             $new_instance['more_text'] = strip_tags( $new_instance['more_text'] );             $new_instance['post_info'] = wp_kses_post( $new_instance['post_info'] );             return $new_instance;              }              /**          * Echo the settings update form.          *          * @since 0.1.8          *          * @param array $instance Current settings          */         function form( $instance ) {                  //* Merge with defaults             $instance = wp_parse_args( (array) $instance, $this->defaults );                  $args = array(                 'public' => true             );             $output = 'names';             $operator = 'and';             $post_type_list = get_post_types( $args, $output, $operator );                       ?>
                 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'genesis-featured-custom-post-type-widget' ); ?>:                 <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" />

                         <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Post Type', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>">                                  <?php                             foreach ( $post_type_list as $post_type_item )                                  echo '<option style="padding-right:10px;" value="'. esc_attr( $post_type_item ) .'" '. selected( esc_attr( $post_type_item ), $instance['post_type'], false ) .'>'. esc_attr( $post_type_item ) .'</option>';                                   echo '<option style="padding-right:10px;" value="any" '. selected( 'any', $instance['post_type'], false ) .'>'. __( 'any', 'genesis-featured-custom-post-type-widget' ) .'</option>';                              ?>                                   </select>

                         <label for="<?php echo $this->get_field_id( 'posts_cat' ); ?>"><?php _e( 'Category', 'genesis-featured-custom-post-type-widget' ); ?>:                         <?php                         $categories_args = array(                             'name'            => $this->get_field_name( 'posts_cat' ),                             'selected'        => $instance['posts_cat'],                             'orderby'         => 'Name',                             'hierarchical'    => 1,                             'show_option_all' => __( 'All Categories', 'genesis-featured-custom-post-type-widget' ),                             'hide_empty'      => '0',                         );                         wp_dropdown_categories( $categories_args ); ?>

                         <label for="<?php echo $this->get_field_id( 'posts_num' ); ?>"><?php _e( 'Number of Posts to Show', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'posts_num' ); ?>" name="<?php echo $this->get_field_name( 'posts_num' ); ?>" value="<?php echo esc_attr( $instance['posts_num'] ); ?>" size="2" />

                         <label for="<?php echo $this->get_field_id( 'posts_offset' ); ?>"><?php _e( 'Number of Posts to Offset', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'posts_offset' ); ?>" name="<?php echo $this->get_field_name( 'posts_offset' ); ?>" value="<?php echo esc_attr( $instance['posts_offset'] ); ?>" size="2" />

                         <label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Order By', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">                             <option value="date" <?php selected( 'date', $instance['orderby'] ); ?>><?php _e( 'Date', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="title" <?php selected( 'title', $instance['orderby'] ); ?>><?php _e( 'Title', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="parent" <?php selected( 'parent', $instance['orderby'] ); ?>><?php _e( 'Parent', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="ID" <?php selected( 'ID', $instance['orderby'] ); ?>><?php _e( 'ID', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="comment_count" <?php selected( 'comment_count', $instance['orderby'] ); ?>><?php _e( 'Comment Count', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="rand" <?php selected( 'rand', $instance['orderby'] ); ?>><?php _e( 'Random', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>

                         <label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>">                             <option value="DESC" <?php selected( 'DESC', $instance['order'] ); ?>><?php _e( 'Descending (3, 2, 1)', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="ASC" <?php selected( 'ASC', $instance['order'] ); ?>><?php _e( 'Ascending (1, 2, 3)', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>

                         <input id="<?php echo $this->get_field_id( 'exclude_displayed' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'exclude_displayed' ); ?>" value="1" <?php checked( $instance['exclude_displayed'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'exclude_displayed' ); ?>"><?php _e( 'Exclude Previously Displayed Posts?', 'genesis-featured-custom-post-type-widget' ); ?>

                         <input id="<?php echo $this->get_field_id( 'show_gravatar' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'show_gravatar' ); ?>" value="1" <?php checked( $instance['show_gravatar'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'show_gravatar' ); ?>"><?php _e( 'Show Author Gravatar', 'genesis-featured-custom-post-type-widget' ); ?>

                         <label for="<?php echo $this->get_field_id( 'gravatar_size' ); ?>"><?php _e( 'Gravatar Size', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'gravatar_size' ); ?>" name="<?php echo $this->get_field_name( 'gravatar_size' ); ?>">                             <option value="45" <?php selected( 45, $instance['gravatar_size'] ); ?>><?php _e( 'Small (45px)', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="65" <?php selected( 65, $instance['gravatar_size'] ); ?>><?php _e( 'Medium (65px)', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="85" <?php selected( 85, $instance['gravatar_size'] ); ?>><?php _e( 'Large (85px)', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="125" <?php selected( 105, $instance['gravatar_size'] ); ?>><?php _e( 'Extra Large (125px)', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>

                         <label for="<?php echo $this->get_field_id( 'gravatar_alignment' ); ?>"><?php _e( 'Gravatar Alignment', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'gravatar_alignment' ); ?>" name="<?php echo $this->get_field_name( 'gravatar_alignment' ); ?>">                             <option value="alignnone">- <?php _e( 'None', 'genesis-featured-custom-post-type-widget' ); ?> -</option>                             <option value="alignleft" <?php selected( 'alignleft', $instance['gravatar_alignment'] ); ?>><?php _e( 'Left', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="alignright" <?php selected( 'alignright', $instance['gravatar_alignment'] ); ?>><?php _e( 'Right', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>

                         <input id="<?php echo $this->get_field_id( 'show_image' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'show_image' ); ?>" value="1" <?php checked( $instance['show_image'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Show Featured Image', 'genesis-featured-custom-post-type-widget' ); ?>

                         <label for="<?php echo $this->get_field_id( 'image_size' ); ?>"><?php _e( 'Image Size', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'image_size' ); ?>" class="genesis-image-size-selector" name="<?php echo $this->get_field_name( 'image_size' ); ?>">                             <option value="thumbnail">thumbnail (<?php echo get_option( 'thumbnail_size_w' ); ?>x<?php echo get_option( 'thumbnail_size_h' ); ?>)</option>                             <?php                             $sizes = genesis_get_additional_image_sizes();                             foreach( (array) $sizes as $name => $size )                                 echo '<option value="'.esc_attr( $name ).'" '.selected( $name, $instance['image_size'], FALSE ).'>'.esc_html( $name ).' ( '.$size['width'].'x'.$size['height'].' )</option>';                             ?>                         </select>

                         <label for="<?php echo $this->get_field_id( 'image_alignment' ); ?>"><?php _e( 'Image Alignment', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'image_alignment' ); ?>" name="<?php echo $this->get_field_name( 'image_alignment' ); ?>">                             <option value="alignnone">- <?php _e( 'None', 'genesis-featured-custom-post-type-widget' ); ?> -</option>                             <option value="alignleft" <?php selected( 'alignleft', $instance['image_alignment'] ); ?>><?php _e( 'Left', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="alignright" <?php selected( 'alignright', $instance['image_alignment'] ); ?>><?php _e( 'Right', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>

                         <input id="<?php echo $this->get_field_id( 'show_title' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'show_title' ); ?>" value="1" <?php checked( $instance['show_title'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Show Post Title', 'genesis-featured-custom-post-type-widget' ); ?>

                         <input id="<?php echo $this->get_field_id( 'show_byline' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'show_byline' ); ?>" value="1" <?php checked( $instance['show_byline'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'show_byline' ); ?>"><?php _e( 'Show Post Info', 'genesis-featured-custom-post-type-widget' ); ?>                         <input type="text" id="<?php echo $this->get_field_id( 'post_info' ); ?>" name="<?php echo $this->get_field_name( 'post_info' ); ?>" value="<?php echo esc_attr( $instance['post_info'] ); ?>" class="widefat" />

                         <label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Content Type', 'genesis-featured-custom-post-type-widget' ); ?>:                         <select id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>">                             <option value="content" <?php selected( 'content', $instance['show_content'] ); ?>><?php _e( 'Show Content', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="excerpt" <?php selected( 'excerpt', $instance['show_content'] ); ?>><?php _e( 'Show Excerpt', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="content-limit" <?php selected( 'content-limit', $instance['show_content'] ); ?>><?php _e( 'Show Content Limit', 'genesis-featured-custom-post-type-widget' ); ?></option>                             <option value="" <?php selected( '', $instance['show_content'] ); ?>><?php _e( 'No Content', 'genesis-featured-custom-post-type-widget' ); ?></option>                         </select>
                         <label for="<?php echo $this->get_field_id( 'content_limit' ); ?>"><?php _e( 'Limit content to', 'genesis-featured-custom-post-type-widget' ); ?>                             <input type="text" id="<?php echo $this->get_field_id( 'image_alignment' ); ?>" name="<?php echo $this->get_field_name( 'content_limit' ); ?>" value="<?php echo esc_attr( intval( $instance['content_limit'] ) ); ?>" size="3" />                             <?php _e( 'characters', 'genesis-featured-custom-post-type-widget' ); ?>

                         <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'More Text (if applicable)', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'more_text' ); ?>" name="<?php echo $this->get_field_name( 'more_text' ); ?>" value="<?php echo esc_attr( $instance['more_text'] ); ?>" />

<?php _e( 'To display an unordered list of more posts from this category, please fill out the information below', 'genesis-featured-custom-post-type-widget' ); ?>:

                         <label for="<?php echo $this->get_field_id( 'extra_title' ); ?>"><?php _e( 'Title', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'extra_title' ); ?>" name="<?php echo $this->get_field_name( 'extra_title' ); ?>" value="<?php echo esc_attr( $instance['extra_title'] ); ?>" class="widefat" />

                         <label for="<?php echo $this->get_field_id( 'extra_num' ); ?>"><?php _e( 'Number of Posts to Show', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'extra_num' ); ?>" name="<?php echo $this->get_field_name( 'extra_num' ); ?>" value="<?php echo esc_attr( $instance['extra_num'] ); ?>" size="2" />

                         <input id="<?php echo $this->get_field_id( 'more_from_category' ); ?>" type="checkbox" name="<?php echo $this->get_field_name( 'more_from_category' ); ?>" value="1" <?php checked( $instance['more_from_category'] ); ?>/>                         <label for="<?php echo $this->get_field_id( 'more_from_category' ); ?>"><?php _e( 'Show Category Archive Link', 'genesis-featured-custom-post-type-widget' ); ?>

                         <label for="<?php echo $this->get_field_id( 'more_from_category_text' ); ?>"><?php _e( 'Link Text', 'genesis-featured-custom-post-type-widget' ); ?>:                         <input type="text" id="<?php echo $this->get_field_id( 'more_from_category_text' ); ?>" name="<?php echo $this->get_field_name( 'more_from_category_text' ); ?>" value="<?php echo esc_attr( $instance['more_from_category_text'] ); ?>" class="widefat" />

             <?php              }          }


WP sql query to extend Groups shortcode to return list of users AND usermeta

This is a question related to an answer posted here The above solution outputs a list of a specified Group members' display names. I need to extend it to show 2 user fields and 1 usermeta field. So I have tried to alter the SQL select statement to do 2 left joins with 2 where conditions, however it isn't working. I am wondering if someone can check my SQL statement and steer me in the right direction please? NB. mobile_phone is a custom usermeta field that I have defined and populated.               add_shortcode( 'groups_group_user_mobiles', 'groups_group_user_mobiles' );          function groups_group_user_mobiles( $atts, $content = null ) {     global $wpdb;     $output = "";     $options = shortcode_atts(         array(             'group' => '',             'show' => '',             'format' => '',             'single' => '1',             'plural' => '%d'         ),         $atts     );     $group = trim( $options['group'] );     $current_group = Groups_Group::read( $group );     if ( !$current_group ) {         $current_group = Groups_Group::read_by_name( $group );     }          if ( $current_group ) {                 $user_group_table = _groups_get_tablename( "user_group" );                 $users = $wpdb->get_results( $wpdb->prepare(                     "SELECT * FROM $wpdb->users,$wpdb->usermeta                       LEFT JOIN $user_group_table ON $wpdb->users.ID = $user_group_table.user_id                      LEFT JOIN $user_group_table ON $wpdb->usermeta.user_id = $user_group_table.user_id                       WHERE $user_group_table.group_id = %d                        AND $wpdb->usermeta.meta_key = 'mobile_phone'",                      Groups_Utility::id( $current_group->group_id )                 ) );                 if ( $users ) {                     $output .= '
';                     foreach( $users as $user ) {                         $output .= '
' . wp_filter_nohtml_kses( $user->display_name ) ." - ". wp_filter_nohtml_kses( $user->user_email ) ." - ". wp_filter_nohtml_kses( $user->meta_value ) . '
';                     }                     $output .= '
';                 }     }     return $output;     }


Absolute Path (ABSPATH) in WordPress is not working

I am currently working on a small task that store a plugin information into database, but I have problem regarding to include the file that has the functions to run the query. Here is the line that includes the file: `require_once(ABSPATH . 'wp-admin/includes/upgrade.php');` but I got the following when I run the code: > **Warning:** `require_once(ABSPATHwp-admin/includes/upgrade.php)`: failed to > open stream: No such file or directory in > `/home/najam/dev/project1/wordpress/wp-admin/admin-insert.php` on **line > 18** I searched a lot but can't find anything useful or helpful. ### EDIT Here is my code:               global $wpdb;          $table_name = $wpdb->prefix . 'table_form';          $sql = "CREATE TABLE $table_name (       id int(11) NOT NULL AUTO_INCREMENT,       rows int(11) DEFAULT NULL,       cols int(11) DEFAULT NULL,       UNIQUE KEY id (id)     );";          require_once(ABSPATH . 'wp-admin/includes/upgrade.php');     dbDelta( $sql );`


Solution for database version control and deployment?

Currently i use a dump script and commit the database to the git repo. `\--skip-extended-insert --skip-comments --skip-dump-date` means that a diff can give me a fair idea of what has changed, but it all falls down if I try to merge. The WP_SITEURL, WP_HOME and all the other places wordpress stores full URLs need updating when importing to another host (testing,staging,production) Is anyone using a better method? **Main issues:**   * Wordpress stores full URLs all through the database (non-portable)   * Lots of other, non-relevant records change      * auto_increment values (i just strip these out, but have run into ID issues)     * timestamps (can also strip out, potentially)     * _transient_ * records ... no idea what to do with them A process that created timestamped migrations, with only the things added or removed, would be ideal... but i'm not sure if it's even possible?


Get post id in Post Page within Wp-admin

I want to get post ID within Post page. I need this for custom meta box so i can set the id in shortcode. I can show the result in notices but don't know how to make it global to use for meta input. What i got till now is :               function foo(){     global $post;     $nid = $post->ID;     var_dump($nid);     }     add_action( 'admin_notices', 'foo' );      which show the id but i need it as a variable so i can use it later. so i tried to make `$nid` global then echo it but it show nothing.


mini loops and qtranslate (localization mini loop url)

I have both mini loops and qtranslate, everything works fine but i have some problems with urls. I mean, let's say i have an article, in 2 languages, **IT** and **EN**. so, for this article there are two different urls: http://www.mysite.com/ **it** /article http://www.mysite.com/ **en** /article now, i have a loop that display certain articles on the homepage, but the `[url]` shortcode gives always the "default" url which is in this case: http://www.mysite.com/article so, the default language is displayed, is there a way to localize the url in some way? **edit** some code:

[ml_image from=thumb width=115 height=115 crop=0]

[ml_title]

View productsVedi prodotto

      ![widget setup](http://i.stack.imgur.com/tRguI.png)


How to disable posts and use pages only

I am new to Wordpress theming and I would like to set up a Website that only has static content. Therefore would it make sense to disable posts and only use static pages? If so, is there an easy way to do that?


How to remove Filters from post admin page?

On a custom post type, I want to remove the filters that show up on /edit.php (where all of the posts are listed out). I have a custom taxonomy that shows up as a filter that I WANT to keep, but I want to REMOVE the 'Show all dates' and 'View all categories' filters. Any ideas?


Do I need to include a textdomain if my theme doesn't support translation?

According to the codex > Themes are required to use theme-slug (or a reasonable facsimile) as > textdomain for translation Does this mean that my theme needs to include a textdomain even if my theme doesn't support translation? ... and also is there any harm in including a textdomain in `style.css` if there are no translation options.


Why is a 500 error generated by admin-ajax.php not going into the Apache error log?

I'm getting 500 errors with AJAX on the admin side. However, these errors aren't being logged in the Apache logs so they're rather hard to debug. Is there some way I can find out what they are? Thanks


wp_list_pages - Using a Walker to customize output order

I'm using wp_list_pages to create a navigation menu. I've run into a challenge with the menu order, though, and I am trying to figure out a way to take more control over the order of the menu. Is it possible to customize the order of the wp_list_pages output using a Walker? For example, I'd like to check if a given page in wp_list_pages results has a `post_meta` value of `page_x` and output that _first_ , then do the same for another page, then, if none of the rules match, continue as normal.


How to add active class on current menu item page?

I have two links: Products and News. When i click on Products or News, it returns me an archive page that contains some posts, when i click on a post it returns me a single page of this post. In the menu I use this code on `<li>` to add a class called active if the page is home:               <li<?php if(is_home()) {?> class="active"<?php } ?>>      But i dont know how to do it when I have two archive pages and two singles pages. If i use `if( is_archive() || is_single() )` it'll add class on both menu itens. Some help would be appreciated.


Does Wordpress provide themes_api function?

http://wp.tutsplus.com/tutorials/plugins/communicating-with-the-wordpress-org- plugin-api/ From the link above, we can see the Wordpress.org provide a function that can access the Wordpress.org plugins and get the plugins information from there...      But I search on google for few days already...still cannot found any information about the wordpress.org themes api. Is Wordpress provide a function like plugins_api? And the usage of the themes_api(if available)? That is my question.


wp_kses enable HTML comment code.filter

Is there a way to enable the category description to allow HTML comment EX:               <!-- example of the HTML comment -->      How it looks in the category description.               <!-- This story is about the dot -->      `This is a story of .....` How it looks when others see it in the category page There is a space here `This is a story of .....` How I want it to show: no more space should be here. `This is a story of .....` I apologize if I was not clear enough but am pretty sure. You get where am going with this.


Cannot query custom post type taxonomy from theme options array

I am having no luck with querying a custom post type taxonomy from an array in theme options. My full code is below, would be grateful for some feedback to get it working correctly as I cannot get this to work.               // Pull all the custom taxonomies into an array     // options.php          $options_taxonomies = array();     $taxonomies_terms_obj = get_terms('portfolio_category');       foreach ($taxonomies_terms_obj as $taxonomy) {     $options_taxonomies[$taxonomy->term_id] = $taxonomy->name;     }          // Select a Featured Homepage Category           $options[] = array(     'name' => __('Featured Homepage Category', 'options_framework_theme'),     'desc' => __('Choose a category to feature on your homepage.', 'options_framework_theme'),     'id' => 'homepage_feature',     'type' => 'select',     'options' => $options_taxonomies);      }          // WP_Query and Loop     // front-page.php          <?php           $num_cols = 3; // set the number of columns here          if ( function_exists( 'of_get_option' ) ) :             $args = array(        'posts_per_page' => 3,         'tax_query' => array(          array(             'taxonomy' => 'portfolio',             'field' => 'id',             'terms' => of_get_option( 'homepage_feature' )              )          )       );            $my_qry = new WP_Query($args);             if (have_posts()) :       for ( $i=1 ; $i <= $num_cols; $i++ ) :       echo '
';       $counter = $num_cols + 1 - $i;       while (have_posts()) : the_post();           if( $counter%$num_cols == 0 ) : ?>                 <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail-home', array('class' => 'image-fade')); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
       <?php endif;       $counter++;     endwhile;     rewind_posts();         echo '
'; //closes the column div     endfor;     else:        echo '
Please create a post.
';       endif;       endif; rewind_posts(); wp_reset_query();      ?>


Hook Widget to Woo Theme in functions.php

Right now I am adding a sidebar above my woocommerce products. How can I hook the sidebar to my theme. Have registered sidebar and it works.               register_sidebar(          array(              'name'          => __( 'Filters', 'woothemes' ),              'id'            => 'filters',              'description'   => __( 'Optional widgetized shop page (displays only if widgets are added here).', 'woothemes' ),              'before_widget' => '
',              'after_widget'  => '
',              'before_title'  => '
',              'after_title'   => '
'          )      );      This is the hook I have used without success.               add_action( 'woo_main_before', 'woo_sidebar' );     function woo_sidebar() {     if (is_woocommerce()) {          echo '
';             woo_sidebar( 'filters' );         echo '
';     }      *Update: Using the code below adds this widget area to all other widget areas. Example: In the footer of www.lne.net.au.               add_action( 'woo_main_before', 'woo_sidebar' );     function woo_sidebar() {     if (is_woocommerce()) {          echo '
';         dynamic_sidebar( 'filters' );         echo '
';     }     }


Show last post of employee in his profile page

I have built a wordpress theme in which I have listed employees of the organization via custom post type. And I am displaying each employee via custom post type. The employees listed are authors in my website too and they regularly write posts. When I am viewing each employees Profile page, I want to show the lst post written by that employee. I hope I am clear in my explanation. Please help me...


How to back-up a database on IIS

I've been having trouble finding a good tutorial on how to back-up a WordPress database using IIS as the web server. I installed WordPress using IIS's web platform installer and now I can't even find where the database file resides. I've been doing everything under a local development if that helps. So my question is, how exactly do I back-up the database file associated with IIS?


Arrange custom fields with drag and drop?

I am making theme for hotel and i made custom metabox with list of various custom fields that i would need in posts. What i did is i made a list of fields like   * booking   * wifienabled   * coffe   * pool   * spa and so on... Problem is that currently i can show those custom fields in website frontend only by order how i added them in array, if i change places in my list custom fields will change places in website frontend. Is it possible that custom fields have specific order? Some kind of drag and drop to rearange those fields and change order of display in frontend?


Contact Form 7 - Debugging email send failres

I am getting the red failed error when trying to send a message. I referred to the FAQ and this is the extent of help available: "There are really various reasons for server side problems, so I can’t explain exactly what yours is. But experiences of other users who solved their problem might be helpful for you." Not helpful at all! I don't really want or expect someone else to solve my problem, all I want is some debugging guidance to see the error that is being produced so I can debug it myself! How can I see the actual error that is occurring instead of the generic "failed" message?


Scheduled posts: set default time?

I want to be able to set the default time in the options for a Scheduled Post to be a specific time of the day, as opposed to it defaulting to the current time. Is there a plugin or some code I can add/tweak to accomplish this? I was unable to find anything here or on Google to do this.


Limit the number of posts a category can have - newest post goes in, oldest one drops out, possible? plugin?

I would like to limit the number of posts which can belong to a given category, for example: The "News" category should have no more than ten posts. When the eleventh post is created the oldest post should be dropped from the category without the need to edit the post manually to remove it from the given category. Does it sound possible?


All my inserted images gets a link to the full image even if it is already full size image

So when I create a new post and I upload an image onto the my server. Normally depending on the size of the image you can select small, medium, large image to place inside the post. On other sites that I have with Wordpress, if I select medium image and insert, Wordpress will place `<a href="...uploads/full-size-img.jpg"><img src="medium.jpg"></a>`. Then if I was to insert a full size image, Wordpress would know that I don't need the `<a href="...upload/full-size-img.jpg"></a>` around the full size image. The problem I have at the moment is that now it always thinks I need an `<a href="upload/full-size-img.jpg"></a>` around all my images even if it is a full sized image already. When I select the none option in the inserting image popup window, the next time I try to insert a medium sized image, it doesn't detect that I would need the `<a href="...uploads/full-size-img.jpg"><img src="medium.jpg"></a>`. I could keep changing the link option in the image inserting window, from "none" when it is full size image to "file URL" to when it's a medium sized image. But with my site I have 26 different writers so I would have to explain to all of them what to do.


custom post archive URL is wrong

I recently found out that I could use the `with-front=>false` argument in `register_post_type()`. So I went and changed my custom post type slugs and did a `flush_rewrite_rules()`. Now 2 of my custom post types are using the desired URLs and 2 are not. The only difference between the 2 that work and the others, is that they also have custom taxonomies. Here is the code from my `functions.php` file. Any idea what I'm doing wrong?               add_action('init','ASH_addtaxonomies');     add_action('init','ASH_addposttypes');          function ASH_addtaxonomies(){         register_taxonomy('ash_weave_structure', null,                           array('labels'=>array('name'=>'Weave Structures',                                                 'singular_name'=>'Structure'),                                 'public'=>true,                                 'hierarchical'=>true,                                 'rewrite'=>array('slug'=>'samples_weaving/structures', 'with-front'=>false),                                 'query_var'=>true                           )         );         register_taxonomy('ash_weave_technique', null,                         array(  'labels'=>array(    'name'=>'Weaving Techniques',                                                     'singular_name'=>'Technique'),                                 'public'=>true,                                 'hierarchical'=>false,                                 'rewrite'=>array('slug'=>'samples_weaving/techniques', 'with-front'=>false),                                 'query_var'=>true                         )         );           register_taxonomy('ash_equip_cats', 'ash_equipment',                         array(  'labels'=>array(    'name'=>'Equipment Categories',                                                     'singular_name'=>'Equipment Category'),                                 'public'=>true,                                 'hierarchical'=>true,                                 'show_ui'=>true,                                 'show_in_nav_menus'=>true,                                 'rewrite'=>array('slug'=>'equipment/category', 'with_front'=>false),                                 'query_var'=>true                         )         );     }          function ASH_addposttypes(){              //good archive url: http://example.com/samples_weaving/         register_post_type('ash_weaving',                             array(                               'description' => 'Picture, draft and technical details of a weaving sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_weaving', 'with_front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag','ash_weave_structure','ash_weave_technique'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Weaving Samples'),                                                   'singular_name'=>__('Weaving Sample')                                                   )                             )                         );         //bad archive url: http://example.com/archives/samples_spinning/         register_post_type('ash_spinning',                             array(                               'description' => 'Picture and technical details of a spinning sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_spinning', 'with-front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Spinning Samples'),                                                   'singular_name'=>__('Spinning Sample')                                                   )                         )         );              //bad archive url: http://example.com/archives/samples_dyeing/           register_post_type('ash_dyeing',                             array(                               'description' => 'Picture and technical details of a dyeing sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_dyeing','with-front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Dyeing Samples'),                                                   'singular_name'=>__('Dyeing Sample')                                                   )                             )         );              //good archive url: http://example.com/equipment/     register_post_type('ash_equipment',                             array(                               'description' => 'Weaving and spinning equipment that ASH makes available to members',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'equipment','with_front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag','ash_equip_cats'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'excerpt',                                                     'thumbnail',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Equipment'),                                                   'singular_name'=>__('Equipment')                                                   )                             )             );     }


latest post showing up twice on posts page

Can someone please help me alter my coding to eliminate my problem? I am using this line before the loop:               <?php query_posts('cat=3&showposts='.get_option('posts_per_page')); ?>      for context:               <?php get_header(); ?>

                  <?php query_posts('cat=9&showposts='.get_option('posts_per_page')); ?>                  <?php if (have_posts()) : ?>                      <?php while (have_posts()) : the_post(); ?>                          <div <?php post_class('post') ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                             <?php the_content('Read the rest of this entry »'); ?>

Posted <?php the_time('M j Y') ?>

                           <?php endwhile; ?>

<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>

                  <?php else : ?>
Not Found

Sorry, but you are looking for something that isn't here.
                 <?php get_search_form(); ?>                  <?php endif; ?>

      I believe this is what is causing my latest post to show up twice. Is there supposed to be something else along with this line??


WP SQL Categories Export and Import

I want to export and export only the Categories and their description using SQL. For now I've managed to retrieve them using this:               SELECT         wp_term_taxonomy.description,         wp_terms.term_id,         wp_terms.name,         wp_terms.slug     FROM wp_term_taxonomy         JOIN wp_terms ON ( wp_term_taxonomy.term_id = wp_terms.term_id )     WHERE wp_term_taxonomy.taxonomy = 'category'      I need some advices on how do to this so I can not screw up the blog. I mention that on the new blog I do not have these categories.


wp_options flooded with transient API entires

I make heavy use of the WordPress Transient API. Suddenly a few days ago my `wp_options` table began being flooded with transient entries (2GB worth on average). Normally WordPress only writes them to the DB if there is not persistent object caching mechanism. However I use Lite Cache for object caching and that hasn't changed in months. Any ideas on why this would start happening?


How can I add user profile fields to my mailpress mailout

I want to be able to send emails to my subscribers but reference their name in the email and possibly some other profile fields. Can I do this using mailpress? So for example. I want each email sent out to start with. Hi _Tom_ , rather than Hi, I notice that you can add custom fields but couldn't work out how to relate that to a user profiles field at the time.


How do I hook a sidebar via add_action?

On one of my templates I have an action hook 'do_xyz' I want to attach a custom sidebar to the action hook do_xyz Here is what I am trying in my theme functions.php file, does not work:               add_action('do_xyz', 'get_sidebar('secondary')' );      What is the proper way of doing this? I know my hooks are setup right because if I attach a custom built function there, then it works. I just can't seem to attach the sidebar the way I am trying to. **EDIT** I have this in my functions file: > function do_xzy() { do_action('do_xyz'); } Then in my template itself I have:               do_action( 'do_xyz' );      I fully understand registering an action hook in my theme, and also adding a place for the action to occur. I even somewhat understand add_action, it is just not liking it when I put the get_sidebar('secondary') in there as my function I want to attach to my action hook. Hope that makes more sense.


User meta and author meta

Here's what I have so far..               class emailer {     function notifyHeart($post_ID)  {              $interests = get_user_meta( get_current_user_id(), 'interests', TRUE );         $to = the_author_meta( 'user_email', get_current_user_id() );              if(has_tag($interests[0])) {             $email = $to;             mail($email, "An article about Heart",                'A new post has been published about heart.');             return $post_ID;         }     }     }          add_action('publish_post', array('emailer', 'notifyHeart'));      What I need to do now, before actually sending the email, I need something that checks if the user has an $interest and if so, send them an email. Any help with this?


Resizing Images to lower Disk Space Using Plugins

I'm trying to take existing images and shrink the file size down by resizing to photos to a smaller resolution. I've tried a few methods so far:   1. Simply editing the photo in photoshop and reuploaded, replacing the existing (and larger) file.   2. I tried the Imsanity plugin and set the options to be less than 1024x1024 and then bulk resized the images without failure (but it did not do the trick).   3. I also tried the Regenerate Thumbnails plugin, and ran the rebuild without failure (but it did not resize the photos). Maybe there is a better or a right way to accomplish what I'm doing, but I can't seem to find anything on this issue. I'm running a Multisite install and WP FTP is not enabled and can't be enabled to solve this.


Add/remove action on jQuery toggle

I have Ajax setup and I'm trying to toggle a function from being loaded into wp_head. It works on the first toggle function, but the second function doesn't register.               function av_maintenance_mode_turn_on() {         if( !wp_verify_nonce( $_GET['nonce'], 'av-maintenance-mode-nonce' ))         die( 'Go away!');         if( add_action( 'get_header', 'av_maintenance_mode_active' ) ) {             echo 'maintenance_mode_on';         }         die();     }     add_action( 'wp_ajax_toggle_av_maintenance_on', 'av_maintenance_mode_turn_on' );      This function works ok. The response is seen.               function av_maintenance_mode_turn_off() {         if( !wp_verify_nonce( $_GET['nonce'], 'av-maintenance-mode-nonce' ))         die( 'Go away!');         if( remove_action( 'get_header', 'av_maintenance_mode_active' ) ) {             echo 'maintenance_mode_off';         }         die();     }     add_action( 'wp_ajax_toggle_av_maintenance_off', 'av_maintenance_mode_turn_off' );      There is no response here. I can echo something before the if statement and the response shows up, so this is likely because `remove_action` is not working. Here is my JavaScript:               jQuery(document).ready( function($) {         var widget_inside = $('#av_maintenance_mode_widget .inside');         var toggle_on = {             action: 'toggle_av_maintenance_on',             nonce: av_maintenance_mode_vars.nonce         };         var toggle_off = {             action: 'toggle_av_maintenance_off',             nonce: av_maintenance_mode_vars.nonce         };         $('#av_maintenance_mode').toggle(              function() {                 $.get( av_maintenance_mode_vars.ajaxurl, toggle_on, function(response) {                     if( response == 'maintenance_mode_on' ) {                         $(widget_inside).addClass('maintenance_mode_on');                     }                 });             },              function() {                 $.get( av_maintenance_mode_vars.ajaxurl, toggle_off, function(response) {                     if( response == 'maintenance_mode_off' ) {                         $(widget_inside).removeClass('maintenance_mode_on');                     }                 });             }         );     });      **EDIT** I tried the same with 'wp_head' as the tag as well as add/remove filter instead of action, but I'm still not removing the function from the header.


Show ellipsis (...) only if the number of characters exceeds limit defined in substr

I'm limiting the number of characters in the title with `substr`. But even if the title is less than 50 characters, being shown the ellipsis (...). I would not display the ellipsis if the title does not exceed the limit of 50 characters.               $title = substr( $title, 0, 50 ) . "...";      > Title of my post ... (Incorrect: Title less than 50 characters in this case should not display "...") > `Title of my post that exceeds 50 characters ...` (Correct: Title longer than 50 characters are cut and accompanied by "...")


Custom search result

I've tried to google it for several time but i couldnt find anything clear. I added a select field in the `searchform.php`, but if the user choose one of the options, i dont know how to show it on the result page. here's my `searchform.php`:               <form id="busca" action="<?php echo home_url(); ?>" class="search" method="get">
Busca

Pesquise as opiniões das pessoas
que fazem Pernambuco

             <input type="text" id="palavraChave" name="s" class="search-input" value="nome ou palavra-chave">             <button class="search-submit" type="submit" role="button"></button>

                     <select name="areaAtuacao" id="areaAtuacao" class="custom">                 <option value="">selecione a área de atuação</option>                 <?php                     $args = array('taxonomy' => 'categoria_entrevistados', 'title_li' => 0);                     $cats = get_categories( $args );                          foreach ($cats as $cat) {                         echo '<option>' . $cat->cat_name . '</option>';                     }                 ?>               </select>

      and here's my results page:               <?php get_header(); ?>

<?php echo sprintf( __( '%s Search Results for ', 'html5blank' ), $wp_query->found_posts ); echo get_search_query(); ?>

             <?php get_template_part('loop'); ?>                  <?php get_template_part('pagination'); ?>

      could someone help me?


RSS feed link on archives page not working

I am trying to add a RSS link on my website archive-pages, which means, Suppose I am on page `http://mbas.in/location/mba-in-usa/` then on this page, I will be having a **RSS LINK** named link, when I click on this link, it should redirect me to `http://mbas.in/location/mba-in-usa/feed` When anyone navigates through my archive-pages, they will get RSS FEED OF THAT PAGE just by clicking one link, for this I tried the following code `<a href="<?php get_permalink(); ?>/feed">RSS feed of this page</a>` but I am not getting that, instead its giving me `http://mbas.in/feed`


'Organize Series Plugin' as muti author feature

Currently with organize series plugin author level user cannot manage their own series. I am trying to add feature to the plugin so that author level user can create & manage their own post and admin and editor can manage all series post. After a little bit searching I have found that that can be done by creating a 'series owner' metadata for series taxonomy and filter by this 'series owner=authorid' to show & manage authors' own post. For adding meta for series taxonomy I have found some tuts and plugin wordpress.org/extend/plugins/taxonomy-metadata/ and shibashake.com/wordpress- theme/add-term-or-taxonomy-meta-data. Now how can I do that? Any help will be appreciated.


Displaying content from one WP site on separate WP site

I have two totally separate WP websites setup. Different domains, different databases. I manage both of them and they are both hosted on a dedicated server. I am trying to include some basic content that requires just a tad more than an RSS feed. I need to pull data from SITE-1 and display it on SITE-2, using basic WP formatting from a loop. Everywhere I've looked makes it seem impossible. I've tried calling wp-load.php but can't get it to work, and am not sure if it is even the right way to go. I have access to both sites' root servers, and even the server root if necessary. Is there anyway to do this? Thanks!


Subscribe to email for security fixes?

Is there any email alert list for security fixes? I'd rather not rely on just an RSS feed.


Create a new page in WordPress theme

I am creating a functionality in WordPress where I need to create a new php page and have to link it in the menu section of my website. Though I can create a page from the dashboard but due to some reasons that option has been discarded. Aim is to create a new page and link it with my existing site. I have created a page with following entries               <?php get_header(); ?>
             <a href="<?php echo get_option('home'); ?>/">Home » Custom
Custom page

             <?php mycustomFucntion(); ?>

     <?php get_sidebar(); ?>     <?php get_footer(); ?>      I am clueless how I can link it with my existing site so that when some one click on the link on menu user should be redirected to this page.

<a href="<?php echo get_option('home'); ?>/">Home
              <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
<a href="<?php echo get_option('home'); ?>/">CustomPage

      I am just playing around with php and WordPress in J2ee I know I can hit an action class and can return this custom page as new view but not sure how i can do this in WordPress.