Display single widget

I've created a simple one-off widget to let the admin change some copy on the home page, but the widget isn't showing its contents. On the home page, I have this code: `<?php the_widget('home_widget'); ?>` And this is the source code for the widget itself, as it appears in my functions.php file (it's Jeff Starr's Clean Markup Widget):               // Clean Markup Widget @ http://perishablepress.com/clean-markup-widget/     add_action('widgets_init', create_function('', 'register_widget("home_widget");'));     class home_widget extends WP_Widget {         function __construct() {             parent::WP_Widget('home_widget', "home page box",                               array('description'=>"The contents of the home page box"));         }         function widget($args, $instance) {             extract($args);             $markup = $instance['markup'];             if ($markup) echo $markup;         }         function update($new_instance, $old_instance) {             $instance = $old_instance;             $instance['markup'] = $new_instance['markup'];             return $instance;         }         function form($instance) {             if ($instance) $markup = esc_attr($instance['markup']);             else $markup = __('Sample markup', 'markup_widget'); ?>
                 <label for="<?php echo $this->get_field_id('markup'); ?>"><?php _e('Markup/text'); ?>
                 <textarea class="widefat" id="<?php echo $this->get_field_id('markup'); ?>" name="<?php echo $this->get_field_name('markup'); ?>" type="text" rows="16" cols="20" value="<?php echo $markup; ?>"><?php echo $markup; ?></textarea>
     <?php }     }      The widget looks and works perfectly in the Admin tool, and I can add text and save it, etc. But nothing displays on the home page. How can I get it to display the widget contents? To be clear: while I am putting the widget into a sidebar on the Admin interface (because you have to), I don't want to display the sidebar (since I have other widgets in there). I just want this one-off widget to display its contents on the home page. Very simple.


add_action and wp_head not display content in head section

I have a big problem. In a Wordpress page I've a function that generate og meta tags. I want to "append" that generated meta in the head section. So, I write this code:               add_action('wp_head', '_set_meta_tag');     function _set_meta_tag()     {         global $nome;         global $descr;         global $file;         global $path_meta;              $output = "";         $output .= '<meta property="og:title" content="'.$nome.'" />';         $output .= '<meta property="og:type" content="article" />';         $output .= '<meta property="og:image" content="'; $output .= get_bloginfo('template_url'); $output .= '/includes/img/immagini_evento/'.$file.'" />';         $output .= '<meta property="og:url" content="'.$path_meta.'" />';         $output .= '<meta property="og:description" content="'.truncate(htmlentities($descr),200).'" />';         $output .= '<meta property="og:site_name" content="'; $output .= get_bloginfo('name'); $output .='" />';              echo $output;}      `add_action('wp_head', '_set_meta_tag');` not display `$output`. Why? I've prooved also to echoes a simple "hello world", but nothing happened!


Suddenly unable to share WordPress link on Facebook

I was able to share links from my WordPress blog on Facebook with no issues up till about a month ago. Previously, the abstract and featured image turned up fine, but now only the link shows up. I've tried adding OG meta tags to my `functions.php` but it is not solving the problem. Using a plugin didn't help either. I ran the facebook object debugger and I got a response code: 200 Error: > Can't Download: Could not retrieve data from URL. Here is a sample link.


Create a wordpress admin user and only let them edit and post blog posts?

Is it possible to create a WordPress admin user and only let them edit and post blog posts?


Display Custom Post Type Taxonomy Child Categories and their Posts

How can I do this for custom post type taxonomies?               <?php     //get all child categories for category 15, then for each child category display the posts     $parent_cat = 15;     $taxonomy = 'category';     $cat_children = get_term_children( $parent_cat, $taxonomy );          if ($cat_children) {     echo '
Category 15
';     foreach($cat_children as $category) {     $args=array(       'cat' => $category,       'post_type' => 'post',       'post_status' => 'publish',       'posts_per_page' => -1,       'caller_get_posts'=> 1     );     $my_query = null;     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {       echo 'List of Posts belonging to Category ' . $category;       while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php     the_title_attribute(); ?>"><?php the_title(); ?>
         <?php       endwhile;     }     }     }     wp_reset_query();  // Restore global post data stomped by the_post().     ?>


Changing the permalink structure with 'with_front' not redirecting old URL

I'm attempting to change the permalink structure of the default post type with the following code:               $args = array(         'rewrite'   =>  array(                 'with_front'    => true,                 'slug'          => 'the-lab'             )         );     register_post_type( 'posts', $args );      However,               http://www.example.com/hello-world/     http://www.example.com/the-lab/hello-world/      both work.


sharing video on facebook from wordpress

When a user tries to share a page with an embedded video on it only the title of the pages shows up on their facebook status and not the flash video player. This happens while sharing with the addthis button or if the url is posted directly to the facebook page. Any idea how I can make facebook pickup the embedded flash video?


Would it be dangerous to send all the wp_options to javascript file?

I've noticed that wordpress allows me to send the wordpress options to javascript via wp_localize_script:               wp_localize_script( $this->plugin_slug . '-plugin-script', 'wp_options', wp_load_alloptions() );      This way, my javascript can access different settings such as what day the week start on and what date format the user has chosen. Are there any risks, sending all the options as a variable to js, or is this okay? I've noticed that options such as "logged_in_key" and "logged_in_salt" becomes available in the front end too. My gut tells me that this is bad practice - securitywise ? But I wanted to hear from someone who knows more about security in wordpress. Thanks. Malthe


Redirects from Tumblr to new WP

I migrated a site from Tumblr to WordPress and was able to get all the content over (in pieces) using the FeedWordPress plugin. What I am now trying to do is get the old permalink structure to redirect dynamically. The plugin added a custom field with the old Tumblr permalink (syndication_permalink is the name of the field). Is there a function I can write using wp_redirect to check for this field, and if so redirect to the new permalink URL?


deny IPs from wp-login using .htaccess

i am trying to ban a spam bot IP from my wordpress, since the "limit login attempts" extension mails me multiple times every day, that the same IP is trying to login. so i added the following to the .htaccess file in the wordpress root:               order allow,deny     allow from all     deny from x.x.x.x      with x.x.x.x being the IP of the bot. still the bot is trying to login. so i tried my own IP and found out, that the htaccess order does only block the css of the login page. mywordpress.com/wp-login.php still shows the login form, though without any styling, but the bot can still try to gain access. so how can i really block the entire site including the backend from certain IPs?


How to redirect /%postname%-%post_id%/ to /%postname%/

I expected WordPress to handle this permalink change automatically but it is not doing so. I tried Redirection plugin but it requires Regex. Can anyone suggest what can be added to .htaccess file to handle the redirection without requiring any plugin? Even Regex for Redirection plugins would help. Thanks!


How do I create Widget within plugin that uses its own class?

I wrote WordPress plugin and want to include 2 extra Widgets with it...               if( !class_exists('plugin_name') ) {         class plugin_name {                 // plugin code         }     }          // include widgets code     require_once( 'include/custom_functions.php' );      ...and Widgets (according to WP codex) should be created like this within "custom_functions.php":               class My_Widget extends WP_Widget {         // widget code     }     function sfp_register_widgets() {         register_widget( 'My_Widget' );     }     add_action( 'widgets_init', 'sfp_register_widgets' );      I can't put "class SFP_Search extends WP_Widget" inside my plugin's class and if I place it outside, I get an error:               Class 'WP_Widget' not found in /Applications/XAMPP/...etc      Is there any other solution? Thanks!


How can I only show a widget prior to a specific date?

I can't find a solution for this anywhere, so help is highly appreciated! The problem is, that my Dropbox account is losing aboz 48 GB's, so I had to remove my podcast episodes from there... because there are too many posts to change now, I want to add a note in the left sidebar. This note should only be seen on posts prior to August 22nd. Where I will tell the people on how to download now, if they tried to download using the dropbox link. I tried widget changer, dynamic widgets and some other plugins, but none of those did the trick. Maybe you have an idea. I hope I made clear what I meant, if not please ask if something is unclear. again, any help would be highly appreciated. thank you


How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only

Is there a way to **limit the creation of pages** (custom post type) to a **specific depth** - e.g. level 1 (where 0 = parent, 1 = child, 2 = grand- child, etc.)? For example, let's create a 'Summer' recipe page (custom post type: Recipe) with a slug '/summer'. Let's now create a 'Pie' page (a child of 'Summer') with a slug '/summer/pie'. I want to prevent the user from creating a page which is a child of 'Pie' or of any other sub-page.   * example.com/summer -> GOOD   * example.com/summer/pie -> GOOD   * example.com/summer/pie/apple -> BAD   * example.com/summer/pie/blackberry -> BAD Thanks.


How can I check email exists via a jquery keyup()?

I have setup a jQuery keyup delay function to check the email typed into an input field. It works fine after testing with an `alert('Key pressed!');` But I want it to say, for example, 'Yes this email is associated with a user' OR 'Sorry, this email is not in our database' without submitting any page requests.                   var delay = (function(){             var timer = 0;             return function(callback, ms){                 clearTimeout (timer);                 timer = setTimeout(callback, ms);             };         })();         $('input').keyup(function() {             delay(function(){                 // check email exists and output result                 // Can I use PHP here?                  // Can ajax/json help?             }, 500 );         });           I tried to check with php but this is rendered before the jQuery of course which is where I'm storing my email var. After a few google searches it sounds like this may not be possible. Can anyone confirm or offer a solution? Thanks


Force unique page slugs across all post types

I have a site with many custom post types and I need a unique slug for each page. What I'm seeing is that wordpress only checks for slug conflicts within a post type before appending "-2", "-3". So I can have "actor/foo", "book/foo", "book/foo-2". I don't want that. I want each foo to have its own slug no matter the post type. I want to avoid using a rewrite on the slug and I'd prefer not to edit any WP source outside of plugins/themes. Is this possible?


Force hide custom field metaboxes

How can I completely remove the custom fields and the collapse button in the Edit Post/Edit Page custom screen, but without removing the capability to add custom fields with a PHP function?


Media Library not showing images but still acknowledges existence

I have no idea why this is happening. I've read A LOT about it and there don't seem to be any solutions. I once read that it was expected behaviour because of some plug-ins and that the Hotfix plugin would fix it but that wasn't the case. ![media library](http://i.stack.imgur.com/tblrU.png) However, if I go to the actual media gallery through the sidebar, I can see all my images. I've tried searching and filtering the page in the image but still no images show. **Any one familiar with this problem and know of a fix?**


is_user_logged_in() not working in Firefox

In Firefox (IE, Chrome, and Safari are fine), we are having a problem with is_user_logged_in(). What happens is: a member logs in and is then automatically redirected back to the portal page. This page does not recognize they are logged in (we use is_user_logged_in()) until they refresh the page. Then all is fine after that. Any ideas? Here is a small piece of the code which changes the log in/out button based on is_user_logged_in(). Upon log in and redirect, is_user_logged_in() is false until the page is refreshed in browser (Firefox only):
          <?php if( is_user_logged_in() ) : ?>          <a class="button full-width" href="<?php echo wp_logout_url( home_url() ); ?>" target="_self">         Quitter               <?php else: ?>          <a class="button full-width" href="<?php echo wp_login_url( get_permalink() ); ?>" target="_self">         Ouvrir mon portail               <?php endif; ?>
      Sorry I'm unable to share the site as it's a private members portal.


How to pass url as a parameter in a add_rewrite_rule

I am building a plugin which relies on passing the url as a GET parameter. Now, I am trying to prettify the links by using rewrite rules but am stuck. What I have now:               function oe_wpib_add_rewrite_rules() {              add_rewrite_tag( '%wpib%','^(http(?:s)?\:\/\/[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*\.[a-zA-Z]{2,6}(?:\/?|(?:\/[\w\-]+)*)(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$' );         add_rewrite_rule( '^wpib/([^&]*)', 'index.php?wpib=$matches[1]', 'top' );          }          add_action( 'init', 'oe_wpib_add_rewrite_rules' );      What above does is recognizes               http://domain.com/wpib/somestring       and translates it to a               http://domain.com/?wpib=somestring      The problem is that when I pass the url like this:               http://domain.com/wpib/http://google.com      I get this as the query value:               http://domain.com/wpib/http:/google.com      So basically, one slash is missing. Can you help me out here, as I am lost, first time doing rewrites so would appreciate any guidance.


Dynamic number of fields in a meta box

I am working with a recipes blog and I use custom meta boxes.               $food_box = array(         'id' => 'foodbox',         'title' => __('Ingredients details','splus'),         'page' => 'recipes',         'context' => 'normal',         'priority' => 'high',         'fields' => array(),);     $arr = array ( 'name' => '-', 'desc' => '-', 'id' => '-','type' => 'text', 'std' => '');     add_action('admin_menu', 'mytheme_add_box');  // Add meta box          function mytheme_add_box() {         global $meta_box;         global $food_box;         global $test_box;         add_meta_box(             $meta_box['id'],              $meta_box['title'],              'recipe_details_show_box',              $meta_box['page'],              $meta_box['context'],              $meta_box['priority']         );         add_meta_box(             $food_box['id'],              $food_box['title'],              'ingredients_show_box',              $food_box['page'],              $food_box['context'],              $food_box['priority']         );     }      Acoording to recipe ingredients are devided to sets of food and the same food item can be present 2 time in one recipe (for example, 200gr sugar for dough and 50 gr for stuff). To combine two taxonomies (food items and food sets) I created custom table and I add fileds `$food_box['fields'][] = $arr;` from this table by next code:               foreach ( $terms as $term ) { // show tabs content for foodset         $s = ($i==1) ? ' ': ' style="display: none;"';         echo '
term_id .'" class="tabs-panel"' . $s . '>';             echo '
';                 echo '
';                 echo '
';   //show header                     echo '  FoodSet        	';                     echo '  FoodId     	';                     echo '  Description    	';                     echo '  FoodUnit       	';                     echo '  Quantity       	';                     echo '  Order      	';                     echo '  Comment        	';                 echo '
';                 foreach ( $foods as $food ) {       //show data                     $food_row = $wpdb->get_row($wpdb->prepare(                         "SELECT rf.post_id, rf.foodset_id, rf.food_id, tt1.description, rf.food_unit, rf.quantity, rf.food_order, rf.food_comment                            FROM $wpdb->term_taxonomy tt1 JOIN $wpdb->recipefood rf ON rf.food_id = tt1.term_id                           WHERE (rf.post_id=".$post_id.") AND (rf.foodset_id=".$term->term_id.") AND (rf.food_id=".$food->term_id.")"));                     $food_set = $term->term_id;                     $food_id = $food->term_id;                     $id = $food_set . '-' . $food_id;                     $food_name = $food_row->description;              echo '
';         echo '',$food_set,'	';         echo '',$food_id,'	';         echo '',$food_name,'	';         $fls = array ('food_unit','quantity','food_order','food_comment');         foreach ($fls as $fl) {             switch ($fl) {             case 'food_unit':             $def_val = $def_unit; break;             case 'quantity':             $def_val = $def_qty; break;             case 'food_order':             $def_val = '1'; break;             case 'food_comment':             $def_val = 'comment'; break;         }         $meta = ($food_row->$fl == '') ? $def_val : $food_row->$fl;         $arr = array ( 'name' => $fl.'-'. $id, 'desc' => $fl.'-'. $id, 'id' => $fl.'-'. $id,'type' => 'text', 'std' => $meta);         $food_box['fields'][] = $arr; //add new field to array         echo '','<input type="text" name="'.$fl.'-'.$id. '" id="'.$fl.'-'.$id.'" value="',$meta , '" style="width: 50%"/>', '	';         // $meta ? $meta : $food_box[$fl.'-'.$id]['std']     }     echo '
';      But unfortunately I can not save my updated data as `$_POST['quantity-708-481']` is empty and not defined in               add_action('save_post', 'mytheme_save_data');   // Save recipe post from meta box     function mytheme_save_data($post_id) {             global $meta_box, $food_box;             //...             $wpdb->update( $wpdb->recipefood,             array( //set                 'food_comment' =>  $_POST['quantity-708-481']             ), array( //where                 'post_id' => '1',                 'foodset_id' => '822',                 'food_id' => '484'             )          );      In other words, the field is added in meta box but not visible during saving. Any suggestion are more than welcomed.


Trying to display short code content in template file with do_shortcode()

I installed the WP Issuu plugin on a site and tried to use `do_shortcode()` to render the shortcode in the template file. Strangely it doesn't work, although it does for the `[gallery]` shortcode. I.e. this works:               echo do_shortcode('[gallery link=file]');      But this doesn't work:               echo do_shortcode('[issuu width=420 height=272 documentId=120118010023-8b7bf623bdd642d98252f310d62f1625]');      After some research, I found that this would work too:               echo apply_filters('the_content', '[issuu width=420 height=272 documentId=120118010023-8b7bf623bdd642d98252f310d62f1625]');      Any idea what's going on and how I can solve this? Thanks


Load comments.php template outside the post loop

I'm loading a post via ajax and outputting using `$post = get_post( $post_ID );` Is there a way to load the comments.php template after I've output my post? I tried using:               global $withcomments;     $withcomments = true;     comments_template();       But it's not within the loop so it's not loading the template. I'm trying to get my comment form and any current comments to display, just having some difficulties. Any help would be much appreciated!


WPML & CFT: keeping custom field file to translation

i got a wp site with the WPML plugin and the CFT plugin. I set up custom fields for posts and what i'm trying to do is to keep the content of an `input type file` from the original post to its translation. That would save time as the pictures are the same between both posts and also save disk space on the ftp. So far i couldnt get it working, not even to get basic `input type text` automatically pasted from the 1st post to its translation. I tried the different options in WPML > Translation management > Mutlilingual content setup > Custom fields translation without any result. PS: am using WP 3.1.3, WPML 2.0.4.1 and CFT 1.9.2.


Change code to display image attachment page

I have this code which displays images with their captions in a list. On clicking caption, opens image in an attachment page, but clicking on image, opens that image with a dark-gray background. Is there a way to display image on attachment page on clicking on it?? I played alot with it, but no success.               $i = 0;         $rand_id = mt_rand(1,1000);         foreach ( $attachments as $id => $attachment ) {             $image_attributes = wp_get_attachment_image_src( $id,'large' );                       $link = isset($attr['link']) && 'file' == $attr['link'] ? ''.wp_get_attachment_image($id, $size, false).'' : ''.wp_get_attachment_image($id, $size, false).'';             $output .= "<{$itemtag} class='gallery-item'>";             $output .= "                 <{$icontag} class='gallery-icon'>                     $link                 </{$icontag}>";                   if ( $captiontag && trim($attachment->post_title) ) {  //caption display                 $output .= "                     <{$captiontag} class='gallery-caption'>                     " .wp_get_attachment_link($id, $size, true, false, wptexturize($attachment->post_title))  . "                     </{$captiontag}>";                }                  $output .= "</{$itemtag}>";             if ( $columns > 0 && ++$i % $columns == 0 )                 $output .= '
';         }


Transferring author information from a custom field to a proper author

A WordPress site I'm doing a redesign for has around 1.400 posts by approximately 30 different authors. Unfortunately the authors of the posts have so far been entered as a custom field within the post, and not as separate authors in WP. I'd like to transfer this to the 'proper way', where each post has an author attached to it, since this would make it possible to display more posts by each author without resorting to plugins like Search Everything. Does anybody know of a script that could look through all the posts, search for the custom field containing and author and create that author, and then link the post to that author? (I know, long shot...) Is that even possible or is there an another way apart from going through 1.400 posts and changing them by hand?


How do I get allowed Media Library upload file extension list?

WordPress has list of allowed Media Library upload extensions in wp- includes/functions.php but is there any way to return them to theme's files as an array?


Woocommerce Product Category Widget - hide categories that have no products in stock

I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows categories that contain only products that are out of stock - that I would like to change. Technical explanation: WooCommerce products are a custom post type (`product`), the product categories are a custom taxonomy (`product_cat`), and the stock count is a custom field on the products (`_stock`). The WooCommerce Product Categories widget shows them using `wp_list_categories()`. I have tried digging into a code to look for some filter call that I could hook onto, but failed to find one. Is there a good way of doing this without modifying core or WooCommerce code? Maybe a hook/filter somewhere that I missed that would allow to check the custom field value?


Displaying Archives List

I'm displaying list or archives using               <?php get_archives('monthly', '', 'html', '', '', FALSE); ?>      and my list displays December 2012 November 2012 etc However I would like to format this to display: 12.12 11.12 10.12 etc Any ideas?


Displaying the custom taxonomies side by side on the admin dashboard

I got 5 top level cats and for each of these top level cats, I have directly corresponding 5 non-hierarchal custom taxonomies. By default, WordpPress UI display these CT's one after the other. Right below the cats... By using a plug in, I can define the order... As far as admin UI options, WP gives me the ability to change the UI from 1 col to 2 col view which helps but not totally. In 2 col view, I can easily see that I got plenty of room to fit in at least 3 or 4 CT's floating next to each other. When I turned the 2-col view however, current UI allows me to drag only one tag box into what's below the post content editor. So, with 2 col view, I don't get to do what I wanted to. There simply is no point to drag a tag box below the post editor cause it is unnecessarily too long. Is it possible to make the tag boxes to float right next to one another? So, The more room there is, the more the CT's show side by side.               post content___________________________________________________cats box here          CT 1__________CT 2__________CT 3__________CT 4__________                       CT 5__________


Woocommerce with metabox plugin

I'm using woocommerce as my e-commerce solution and the metabox plugin ( http://www.deluxeblogtips.com/meta-box/ ) to make my life a lot easier when implementing meta boxes. I've never had any issues with it but I now need to add my own custom meta box to the woocommerce product post type....but it never gets added? If I add the meta box in the old fashioned add_meta_box way and the meta box gets added correctly....so I was just wondering if you would have any ideas why using the plugin would cause an issue? Here is the code I'm using to add the meta box to the global meta_boxes array:               global $meta_boxes;          $prefix = "esfproduct_";          // Aggregator metaboxes          $meta_boxes[] = array(     'id'    => 'additionalproductdetails',     'title' => 'Additional Details',     'pages' => array( 'product' ),     'context' => 'normal',     'priority' => 'side',     'fields' => array(         array(             'name' => 'Product Features',             'id'   => "{$prefix}productfeatures",             'type' => 'text'         ),     )     );      Thanks for any help you can provide!


Show only posts with images and a fixed amount of posts

I found this code online. Its a code that only shows posts with images inside. Now, the problem is that if you set Wordpress to show 50 posts, this code shows the posts with the images, but also counts the ones without. With other words.. if you got 50 posts on your frontpage where 6 are with images this code shows only 6 posts. Does anyone know how I can make it show 50 posts (the same as set in WordPress) with images?               <?php      while ( have_posts() ) : the_post();         $content = $post->post_content;         $searchimages = '~<img [^>]* />~';         preg_match_all( $searchimages, $content, $pics );         $iNumberOfPics = count($pics[0]);         if ( $iNumberOfPics > 0 ) {             //your loop content goes here         }      endwhile;      ?>


Convert imploded plain text into links

I'm completely open on how to do this: I have the line:               echo implode(', ',get_field('categories'));      Which is outputting this:               Branding, Web, Print      I have 20 or so options it can output depending on what checkboxes were ticked. At the moment, what it's outputting is just plain text. How can I make each tag a link? The link would need to be unique per tag so:               Branding, Web, print       UPDATE: The first part of the question is working thanks to Brady. I now have an additional question - Using Brady's answer on the line:               $elements[] = '' . $category .'';      If you look at the href it has the link /tags/design/, some of the tags it's outputting are using the correct link but some are from another section and the link should be /tags/marketing/. How can I account for this? (Not that I know how to do this, someone will need to show me!) Could I create an array with the tags "Branding, Web, Print" and if the $category variable matches this then give it the variable $design. Could I then create another array with "Advertising, Analysis, Campaign" and give it the variable $marketing if the $category matches that. Then in the link I could put href="/tags/$design/$category" or href="/tags/$marketing/$category"? So a couple of examples would be (I'll put them as normal links): From the design section:               Branding     Web     Print      From the marketing section:               Advertising     Analysis     Campaign      There are only two sections design and marketing, within those sections there are several tags, if that makes sense. The sections in WP are setup like this: tags > design > (each tag - branding, web, print is it's own page). tags > marketing > (each tag - advertising, analysis, campaign is it's own page).


Match checkbox data with page title to show certain items

I want to show the projects that has had it's checkbox ticked as Branding, if it's on the Branding page (i.e the page title is Branding). To explain the code a bit: This line show's all the checkboxes that have been ticked for each project so it will output "Branding", "Web", "Print" if they have been ticked.               implode(', ',get_field('categories')      This next line is just checking the page title is "Branding":               implode(', ',get_field('categories')      I'm trying to put these both in an if statement where it would just output the checked boxes and if they match the title then output them.               <?php if(implode(', ',get_field('categories')) && $grid_title == "Branding"); {     echo "testing";      }     ?>      The code above shows what I want to do but it doesn't quite work. **IMPORTANT: I'm usingthis plugin to create the custom checkboxes so please bear that in mind.**


Custom query with DECIMAL(5,2)

I want to know if there is a way to DECIMAL (5,2) instead of DECIMAL in meta_query


How To Protect Plugin Display From Being Affected By Theme's CSS

I am developing a custom wp plugin that is using shortcode to display table in the front end. But its front end display is affected by the theme's css. So it is always following the table styling that comes with the theme. Is it possible to protect it from being affected by any theme's css' without doing any extra work digging into the theme which the plugin is installed together with?


Using /%postname% for a custom post type

I have a custom post type whose permalink needs to sit in the same space as pages, like so:               /an-example-thing  <--  custom post type 'thing'     /about-the-things  <--  a normal page      I'm well aware that this isn't the recommended way to do it, but I don't really have a choice - that's what the client has specified. I've created the custom types with register_post_type, and used the Custom Post Permalinks plugin to set their permalink like so:               /%thing%/      However, this creates a conflict between the rule that recognises my custom posts, and the one for normal pages - which turns all normal pages into 404s. This problem disappears when the permalink is changed to something like this:               /things/%thing%/      Using the Monkeyman Rewrite Analyser shows that the rule for the custom post is coming first. Even when I try forcing it to use verbose rules:               global $wp_rewrite;     $wp_rewrite->use_verbose_page_rules = true;      the custom post type rule is higher priority than the verbose rules for pages so they still get a 404. I'd like it to look for _things_ first, and when none is found with that name look for pages. The other way round would be acceptable. Is there no way of persuading it to look for both _things_ and pages before hitting a 404?


How to add a Capability to a User Role?

I am managing a Wordpress network and would like to add the unfiltered_html user capability to the already predefined user role of Admin. In a standard installation of Wordpress the Admin account would already have this capability but in an MU installation only Super Admins are afforded this capability. Wordpress Roles and Capabilities. How can I augment the Admin role from within a theme or plugin?


What exactly does "Posts page" do in WordPress?

Hay, I'm making a WordPress template, and i have 4 main pages.               HOME     BLOG     CONTACT     ABOUT US      As you can see "Blog" is a page (i need it to display when i call wp_list_pages()), but how do i edit this blog page? I assigned the "Blog" page a custom temeplate (called blog.php), but when "Blog" is set as the "Post page" in the Reading section of the WordPress admin, the page fails to render the template. How do i edit this "Blog" page?


Possible to change the URL for the regular post type without affecting the URL of other custom post types?

_**The Dilemma_** I have a few custom post types:   * Portfolio Items   * Testimonials   * FAQs The URL structures for these custom post types are:   * mysite.com/ **portfolio** /name-of-custom-post   * mysite.com/ **testimonial** /name-of-custom-post   * mysite.com/ **faq** /name-of-custom-post I'd like to use the normal, built-in WordPress post type to control our blog entries, and have the URL for each blog entry be like this:   * mysite.com/ **blog** /name-of-post If I go to Settings > Permalinks and adjust the URL structure to be like...               /blog/%postname%/      ...then the URLs for _all_ of my post types are affected, which results in:   * mysite.com/ **blog/portfolio** /name-of-custom-post   * mysite.com/ **blog/testimonial** /name-of-custom-post   * etc... _**The Question_** What I'd like to know -- is it possible to adjust the URL structure for the built-in WordPress post type without affecting the URL structure of other custom post types? The only other way I see to solve my dilemma is to create another custom post type called "Blog." This seems wasteful, because then I won't be using the built-in WordPress post type at all. _**If anyone needs it, The Why_** If anyone wonders why I need "blog" in the URL so badly, it's because we're merging our blog into the same install as our site, and want to keep the URLs intact so we don't lose valuable Google juice. Any help is greatly appreciated -- thanks!


Site Registration & MailChimp Coordination?

I have a client who would like to post research documents on his site for download with the following functionality:   1. Users could browse entire site, but in order to download, users would need to register and login.    2. Would like all registration info to be automatically passed to MailChimp (name, email, other optional info) for inclusion into mailing list.    3. User would be able to opt out of mailings, but keep site registration active Are there any existing plugins (or combo of plugins) that do this?


Passing feed URLs with "&" to fetch_feed()?

How do I pass feed URLs with `&` in the URL to `fetch_feed()`? The feed is not parsed correctly if there is a `&` in the feed URL. Actually it works in the example I gave, but now I'm populating the feeds array dynamically with this code :               $rss_subscriptions = array();     $terms = get_terms('news_rss','hide_empty=0');     $count = count($terms);     if($count > 0){         foreach ($terms as $term) {             array_push($rss_subscriptions,$term->description);         }     }      The RSS feeds URLs are stored in the descriptions of the taxonomy `news_rss` terms. Somehow in this code, passing `&` into the array makes the `fetch_feed($array)` not work. * * * ### Original question: fetch_feed() on multiple feeds, how to pass the feeds array properly ? Hi, this is too weird, perhaps someone can explain what is going on here. Why does this :               $feeds = array('http://www.mysite.com/feed','http://www.coolsite.net/feed');     $result = fetch_feed($feeds);      return a different result than this :               $result = fetch_feed(array('http://www.mysite.com/feed','http://www.coolsite.net/feed'));      Actually, the second example works, the first one returns feed items, but for some reason they are not the last ones... I want to find a way to populate the feeds array dynamically, that's why I'd like something like the first example better.


Troubleshooting fetch_feed and SimplePie

I've got a very basic solution using `fetch_feed()` and SimplePie to pull in RSS items which is working on my localhost, but for some reason `is_wp_error()` persists as `true` on the live server. Is there anyway for me to get specific output about the nature of the error so as to work towards a solution on the live server?               <?php       include_once(ABSPATH . WPINC . '/feed.php');       $rss = fetch_feed( '[rss feed removed from example]' );       if (!is_wp_error( $rss ) ) :         $maxitems = $rss->get_item_quantity(5);         $rss_items = $rss->get_items(0, $maxitems);         $isc = 'http://dtd.interspire.com/rss/isc-1.0.dtd';       endif;     ?>
       <?php if ( $maxitems == 0) : ?>
No items.
       <?php else : ?>         <?php foreach ( $rss_items as $item ) :            $image = $item->get_item_tags( $isc, 'thumb'); ?>
...
         <?php endforeach; ?>       <?php endif; ?>


Allow anonymous users to post to my site for moderation

I'm in need of the ability to allow anyone (they don't have to login) to fill out a form with email and a textarea and submit it to my site. This form would be treated as a post and appear somewhere for me to moderate. If i hit publish, it would be published to my site like any other post i wrote. Is there a plugin that allows me to do this or do i need to code it myself, if the latter, how would i go about doing that? Thanks in advance!


Relative instead of absolute links in pages?

I have my blog under `blog.mydomain.com`. I am using pages for some static content that needs to be accessed from another subdomain. So `careers.mydomain.com` will show WordPress content from `blog.mydomain.com/careers`. My problem is that all the links on the page still reference `blog.mydomain.com`. Is there a way to ask WordPress to use relative links? Or a way to change the baseURL for pages?


How can i force wp-admin to use 2-column dashboard layout?

How can i force wp-admin to use 2 column layout via plugin?


Hide widget on page

How can I hide a widget from a certain page (one page). After spending an hour, all I can find is with the plugins. The problem is, that I know with them how to do it, but one widget (ad widget) is placed inside my theme panel not like a drag/drop widget, so I cant set it up with widget. This is my code of widget which i need to hide on one page. Any solution how to do it ?               <?php if(get_option('gd_leader_ad')) { ?>
                          <?php if(get_option('gd_logo_loc') == 'Small in navigation') { ?>
                             <?php echo get_option('gd_leader_ad'); ?>
                          <?php } else if(get_option('gd_logo_loc') == 'Large below navigation') {  ?>
                             <?php echo get_option('gd_leader_ad'); ?>

                             <?php if(get_option('gd_logo_large')) { ?>                             <a href="<?php echo home_url(); ?>"><img src="<?php echo get_option('gd_logo_large'); ?>" alt="<?php bloginfo( 'name' ); ?>" />                             <?php } else { ?>                             <a href="<?php echo home_url(); ?>"><img src="<?php echo get_template_directory_uri(); ?>/images/logo-large.png" alt="<?php bloginfo( 'name' ); ?>" />                             <?php }
?>                     <?php } ?>


Posts and Pages not showing on admin, but showing in theme

I've just transferred a WordPress install over from and old IIS server set up by our client, to our new Lunix based VPS. Whether that is relevant or not, i'm not sure. I've changed all the usual settings and database options i'd usual do on moving a website to a new/live server environment.. This has worked perfectly other than the data doesn't show in the WordPress admin specifically, but does if you visit www.lenstec.co.uk. That suggest the data is being successfully pulled in as it normally would. My initial thoughts are that this may be a global variable somewhere within the theme that WordPress does not like? Unfortunately, i've check through my function file and corresponding theme files and not come across anything. Can anyone suggest something I may have missed?


Notification that the admin is online

How can I say to all visitors that the admin is online. I mean if the admin is online all the visitors, registered and none registered, will see this words "hello the admin is online...talk with me"... ? Thank you


Custom taxonomy in WP_Query not working

I'm truly stumped here. I have a specific taxonomy for sorting posts into different types of "featured" posts on a news site. Here's the problem: When querying by them the results aren't what they should be. Here's what I have:               $featured_loop = new WP_Query( array( 'featured' => 'home-featured', 'posts_per_page' => '1') );     if ( have_posts() ):             while ( $featured_loop->have_posts() ) : $featured_loop->the_post();                 the_post();       There is then another underneath, with different formatting:               $featured_loop_2 = new WP_Query( array( 'featured' => 'home-featured', 'posts_per_page' => '3', 'offset' => '1') );     if ( have_posts() ):             while ( $featured_loop->have_posts() ) : $featured_loop->the_post();                 the_post();      The problem is, it is outputting posts that aren't in the taxonomy... although which ones it outputs changes as I tweak it, which I find even more strange. I tried a tax_query, and that didn't seem to solve it either. Any ideas? I used "Ultimate Taxonomy Manager" to create the taxonomy.


When I try and use contact form 7 it breaks my page

I am using the following code to add a contact form to my template, but this code as is breaks the page. It just shows a white page when I add this code. Am I doing it wrong.               <?php     [contact-form-7 id="181" title="Contact form 1"]     ?>


Enable post excerpts in wordpress theme twentythirteen

How do I enable excerpts in the theme?Currently excerpts are only displayed on the search page but I would like to enable them on tag and category pages.


How to second orderby in "pre_get_posts" by meta value or combine single date and time to timestamp

This is somewhat of a continued problem from another question that I had asked. Here is the original post. pre_get_post filter returns results when there should not be Since then I added an orderby clause....                 if ($post_ids) {                     $wp_query->set('post__in', $post_ids);                     $wp_query->set('meta_key', '_start_date');                     $wp_query->set('orderby','meta_value');                     $wp_query->set('order', 'ASC');                 }else{                     $wp_query->set('post__in', array(0));                      }                 return $wp_query;      Problem is that I need to order by another meta_key's value. The meta_key is`'_start_time'`. The $post_ids are compiled from another (complex)query and then I needed to compile that even more based on other factors. What I ended up with was the post ids that I needed and now I just need to display them in the order that I need. I have the order by `_start_date` working, but if there are more than one post on that date then they are not ordering by the right time that I need. So I also need to order based off the `'_start_time'` meta_key value, but can't seem to find a solution for this. Thanks for any help you can provide.


how do I know the term used for accessing my taxonomy page?

In a custom taxonomy, using the taxonomy.php, how can I work out for the terms associated within that taxonomy? E.g. A taxonomy of three elements, I need to list all of them. Thanks Andrea


Thumbnails for custom post not showing up in query

My thumbnails are not showing up in my custom post type when I do a query, however they show in the `single.php` file. I have added `'supports' => array('title','editor','author','thumbnail','excerpt','comments')` to the function so I know its not that issue. I am gettin the rest of the data on the query as viewable below but the image should be above the text: ![enter image description here](http://i.stack.imgur.com/7VjAi.png) I am not having this issue in the single page with the featured image showing up : ![enter image description here](http://i.stack.imgur.com/oH5te.png) I am registering my custom post type as so:               add_action('init', 'video_custom_init');              /* SECTION - video_custom_init */     function video_custom_init()     {         // the remainder code goes here     }     /* #end SECTION - video_custom_init --*/          // The following is all the names, in our tutorial, we use "video"         $labels = array(             'name' => _x('videos', 'post type general name'),             'singular_name' => _x('video', 'post type singular name'),             'add_new' => _x('Add New', 'video'),             'add_new_item' => __('Add New video'),             'edit_item' => __('Edit video'),             'new_item' => __('New video'),             'view_item' => __('View video'),             'search_items' => __('Search videos'),             'not_found' =>  __('No videos found'),             'not_found_in_trash' => __('No videos found in Trash'),             'parent_item_colon' => '',             'menu_name' => 'video'         );              // Some arguments and in the last line 'supports', we say to WordPress what features are supported on the video post type         $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'show_in_menu' => true,             'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'has_archive' => true,             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title','editor','author','thumbnail','excerpt','comments')         );              // We call this function to register the custom post type         register_post_type('video',$args);      I am pretty confused about what the issue would be. It is probably something really simple. Query used to display custom post.               <?php if ( have_posts() ) : ?>          <?php $args = array( 'post_type' => 'video', 'posts_per_page' => 3 );                 $loop = new WP_Query( $args );                     while ( $loop->have_posts() ) : $loop->the_post();                               get_template_part( '/templates/content-3col');                              endwhile;?>                      <?php endif; ?>      and the code in col3.php
     <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                      <?php if ( 'post' == get_post_type() ) : ?>
             <a href="<?php the_permalink(); ?>" rel="bookmark">         <?php   if ( has_post_thumbnail() ) {                 the_post_thumbnail('col-6-thumb');                          } ?>
             <?php endif; ?>

<?php the_time('M jS') ?>

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

by <?php the_author() ?>


Enqueue never runs

My enqueue scripts are never called I can't figure out why. All my paths are correct and I'm assuming the code is correct **Functions.php**               function tim_enqueue_default_scripts() {         if (ENVIRONMENT == 'dev') {             $globaljs = 'global.js';             $globalcss = 'global.css';         }         else {             $globaljs = 'global-0.3.min.js';             $globalcss = 'global-0.5.min.css';         }         wp_enqueue_script('globaljs', get_bloginfo('template_directory') . '/res/js/' . $globaljs . '', false, false, true);         wp_enqueue_style('globalcss', get_bloginfo('template_directory') . '/res/css/' . $globalcss . '', false, false, true);     }     add_action('wp_enqueue_scripts', 'tim_enqueue_default_scripts');      **Header.php**               <?php wp_head(); ?>     </head>      **Footer.php**               <?php wp_footer();  ?>     </body>


Single parent post lists child posts with pagination

I would like to build on this answer so I can incorporate pagination and a couple of other features. We have over 1,600 entries in our Glossary so certain letters have far more than 20 (my max posts/page) entries. If a user clicks "A" or accesses "/dev/glossary/a" I'd like them to see a list of all entries with parent "A". I'd also like:   * The list to be in alphabetical order   * The number of entries for this parent to be displayed at the top of the page   * The list to be paginated I've had a basic attempt at this using `$paged = (get_query_var('page')) ? get_query_var('page') : 1;` and the `paged` argument in the `WP_Query`, but my `next_posts_link` doesn't even display. I'm not quite sure where to begin with this so any guidance would be much appreciated.


What's the purpose of $wp_did_header?

It is referenced in load_template but Wp does nothing with it ?!!! so what's the use ?               1105  function load_template( $_template_file, $require_once = true ) {     1106      global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID;     1107       1108      if ( is_array( $wp_query->query_vars ) )     1109          extract( $wp_query->query_vars, EXTR_SKIP );     1110       1111      if ( $require_once )     1112          require_once( $_template_file );     1113      else     1114          require( $_template_file );     1115  }


Value prints outside of the echo

My code validates and returns the custom field value. However, I can't get the value to return inside of the anchors. Here is the code:
     <?     if(function_exists('get_custom_field_data')) {     echo '';     }      ?>
      This is what is returned:
     http://yada.yadayada.yada:5000/pop.jsp?id=1711436


Custom Filter in Wordpress to modify footer information via plugin?

Basically, I've got a plugin that searches for certain tokens in the entire page and replaces the tokens with images. The problem is, I've got one of those tokens in the footer and, as far as I can tell, there's no filter for the footer. So the question is, is there a way to make a custom filter? And is that the best way to go about doing this? My plugin does a preg_match in the content and, if it finds, for example "{picture here}", it replaces it. I'm not sure how to extend this functionality to the footer, though?


Is it possible write, publish and edit posts with Wordpress from console aka terminal?

I would like to write things like LaTex with Wordpress i.e. a title would be a section, to use vimlatex -plugin to speed up writing etc. Also, it would be cool if I could publish things without going into the Graphical interface. I like to use my own editor and see things in the directory level, is there some easy way to write things there without opening a browser? Suppose I had 3 categories: A) Fun, B) Future and B) Past. My writing directory would look like this               $ pwd     /home/h/Wrtiing     $ tree     .     ├── fun     │   ├── chess     │   ├── climbing_game     │   ├── go     │   └── zero_match     ├── future     │   └── project_improbable     └── past         ├── test1         └── test2      then with permissions `$ chmod +r fun/go` or some other way, I could publish things. I could change permission the day when I want to publish something. Is there something this dead easy done with wordpress?


Get Child category "name" of post

I have this piece of ode in a buy template. I like to know what to add to get the child name of the category the mais display category is sponsor. but in the sponsor category, there is : gold, silver, platium... i want to get that "color" category an output it as `<div class="cat-name">platium</div>` here is the code :

<?php echo get_cat_name( $carouselCategory ) ?>

         <?php $showPostsInCategory = new WP_Query(); $showPostsInCategory->query('cat='. $carouselCategory .'&showposts='. $carouselNumber .'');         if ($showPostsInCategory->have_posts()) : while ($showPostsInCategory->have_posts()) : $showPostsInCategory->the_post();?>
                 <?php $data = get_post_meta( $post->ID, 'key', true ); ?>                 <?php echo get_cat_name( $carouselCategory ) ?>                 <a href="<?php  if ($data[ 'custom_link' ]) { echo $data[ 'custom_link' ];} else { the_permalink(); } ?>">                     <?php the_post_thumbnail('sponsor', array('title' => "")); ?>
         <?php endwhile; endif; ?>

     <?php } ?>


Return all custom meta data for one custom post type

I've set up a custom post type which has three custom meta fields: name, latitude, longitude. Each post already shows the name on an integrated map based on it's latitude and longitude. I now would like to add a page to my site which shows ALL the names on a map based on their latitude and longitude. I obviously know how to get single values out and get them on a map, but I'm not that experienced in Wordpress so I'm not sure what the best way would be to get all this information out in a structured way for what I'm trying to do. Any pointers to get me started would be appreciated.


How to reduce repetitive code

I've been searching for how to do this for a while but to no avail. Part of my template is using a lot of the same code, i.e. retrieving a specific page. If this was Javascript I'd set up a function and keep calling the function. How can I call the code below repeatedly?               <?php         $page = get_page_by_title('Excerpts Showreel'); <-- This piece of code will change     // the code below will never change.     ?>     <?php         $my_id = $page;         $post_id = get_post($my_id, ARRAY_A);         $title = $post_id['post_title'];         $content = $post_id['post_content'];     ?>     <?php          echo $content     ?>


Optimal solution to develop a wordpress theme?

What i was doing previously, are as follows -   1. I copy the wordpress base theme (like twentytwelve in wordpress 3.5)   2. Rename the folder and converted index.html of my HTML to index.php for wordpress theme.   3. Replace style.css with my current style.css. Is it the right way of theme development or some else better technique can be applied for theme development ? I google a lot for the theme development but 99% tutorials are only using index.php , style.css only(some only header/footer etc) although in the new version of wordpress 3.5 twentytwelve I found there are too many files in the theme. So for the client case I dont want to leave any core theme functionality provided these dummy themes, so is it the correct way I am following or for the best way I need to design and code for each file ?


Updating Other User's Metadata

I have created a custom user meta field, and that value is being used to get data from an external API and display it on the user profile page. On admin pages I have used the following code to make sure that when an administrator account views a user profile, s/he can view the data displayed from the API. And then calling the API, and retrieving the cached data from a transient prefixed by the user id yadadada. This all works perfectly, and the data displays properly. But if the administrator then tries to update another user's account custom meta field despite the fact that I pass the correct userid to the update_user_meta function, meta value does not update. Below is the code for the update function.               function af_askFRED_update_fencer_field() {         $user = wp_get_current_user();         $userid = $user->ID;              if (current_user_can('delete_users') && isset($_GET['user_id'])) {             $userid = $_GET['user_id'];         }              $usfaID = $_POST['af_askFRED_usfaID'];         update_user_meta($userid, 'af_askFRED_usfaID', $usfaID);         delete_transient($userid.'AF_USFA_KEY');          }          add_action('personal_options_update', 'af_askFRED_update_fencer_field');      NOTE: If I update any other profile field it works perfectly.


Make each Value of custom field show related posts when clicked

i have create a Custom Post Type calle "Places". I have created a Custom Field with Field Type "Multi CheckBox" Option Title "Type of Pub" Option values "Sports, Rock, Biker, Beer, Live Band, Restro, Gastro, Irish, Karaoke Bar" Field Title "Type of Pub" Field name "typeofpub" Basically turn option value to tags, so that once someone clicks on sports, it will show the archive page of sports showing all the posts with option value sports.


how do i combine keyword search and taxonomy in a WP_query $args array Worpresss

I'm trying to figure out how to get the following code to work as one wp_query . i'm trying to filter the loop on the search values and the taxonomy values: Both of these sections work independently but i'm looking to tie these into one query..? I have tried various combinations but am getting no where....any ideas of the best approach to this issue...?                   global $query_string;              $query_args = explode("&", $query_string);         $search_query = array();              foreach($query_args as $key => $string) {             $query_split = explode("=", $string);             $search_query[$query_split[0]] = $query_split[1];         } // foreach         $args = array(         'post_type' => 'listings',         's' => 's',         'keyword' => $search_query['s'],         'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'type',                 'field' => 'slug',                 'terms' => $search_query['type']             ),             array(                 'taxonomy' => 'rooms',                 'field' => 'slug',                 'terms' => $search_query['rooms']             )         )     );         $the_query = new WP_Query($args);


Stop header code from showing in category page?

Hi I'm using the code below to show different header images in my custom template archives. Only problem is that it is also showing the headers in the category templates. go to http://tv-cafe.com/category/video that image at the top isn't suppose to be there, how do i get that to not show.               <?php     if ( ! is_home() ) {          if ( get_post_type() == 'pretty-little-liars' ) {         echo '

';     }     if ( get_post_type() == 'revenge' ) {         echo '

';     }     if ( get_post_type() == 'grimm' ) {         echo '

';     }     }     ?>


CPT taxonomy as dropdown with checkboxes - how to and URL length

I have a CPT taxonomy with 2 levels of nesting as per screenshot: ![enter image description here](http://i.stack.imgur.com/fslzM.png) I would like to display this drop-down list as checkboxes. Something similar to this screenshot: ![enter image description here](http://i.stack.imgur.com/BmErt.png) I've got 2 questions:   1. What's the best way to do it? I assume there is no WP function for this.   2. Is there a limit for URL length? If most of them will be selected plus I have another two taxonomies for the same search. The URL will be long - will it be a problem and is there a way to avoid it? I'd prefer not to use session and allow the URL to be bookmarked. Many thanks, Dasha


Add 'first name', 'last name', 'date of birth' and 'terms and conditions' to register fields?

How can I add 'first name', 'last name', 'date of birth' and 'terms and conditions' to WordPress' register fields? My site is adult-themed and I would like to verify users' ages and have them agree to the terms before entering.


Get value form wordpress database

I'm sorry if this ambiguous but I'll try my best I have the following php code from a WordPress Plugin `$url = 'http://mydomain.com/'.$ListingID.'/';` I need to define a value for `$ListingID` The value will come from the wordpress database and is found in the table called wp_fsrep_listings the name of the column in the table is listing_id and the value is related to a listing page that is similar to a normal wp post page. Therefore is presume I need to define the "value" in this manner `$ListingID = "value"` How do I define the "value"? Thank You


Jquery and Sticky

I have a trouble with jquery and sticky in a div in my website. I have included jQuery core in my page, inside the tag "head":               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>      Next, included the Sticky JS after the jQuery core:               <script src="js/stickySidebar.js"></script>      and I put inside it this code:               $(document).ready(function() {            $('.one_fourth_style_4').stickySidebar();          });      But it's not working. link: my page


Counter code for paginated category pages in wordpress

I am trying to customize the category template whereby I wish to show the ordered list of 10 posts on each page. I am using the following code in the loop:               <?php $counter = 1;      while(have_posts()) : the_post(); ?>          <div class="entry">             <?php echo $counter++; the_excerpt(''); ?>         </div>      <?php endwhile; ?>      On the first page: it shows the excerpts arranged in a 1 to 10 ordered list, but on the second page (using wp-pagenavi), it again starts from 1. Is there any way that all the posts of a category can be shown in a consistent ordered list from post 1 to last post.


WordPress Multisite and S2Member - How to add new users to all blogs?

We have WordPress setup to run as Multisite and are using the S2Member plugin. We are also using a modified version of the 'Multisite User Management' plugin. The Multisite User Management has a function (which we know works as we've tested it manually) called msum_add_roles(). You simply pass the users ID to the function and default roles are added to the user to allow them to login and access other sites on the network. Currently, when someone creates a new account on the main/parent site, they then login and are able to access all other network/child sites. If a user creates a new account on one of the child sites, they can only log in to the child site. However, once logged in to the child site, they can then browse to the main/parent site and appear as being logged in. If a child site user tries to log in to the main/parent site, they get the error message: "ERROR: Invalid username for this site." What we need is for the msum_add_roles() function to be called automatically when a new user is created. I've tried:               add_action( 'user_register', function( $user_id ){msum_add_roles( $user_id );}, 10, 1 );      ** Please note, the msum_add_roles function definitely works as we've tested it. We just need it to run automatically when new users are created on all child sites. *** Edit *** After further investigation it appears the code above is now correct and working, however the msum_add_roles() function only works when it's ran from the main/parent site. Any ideas how we can get this function to run from the main site when a user on a child/sub site registers an account? I've just tried this:               add_action( 'user_register', function( $user_id ){switch_to_blog(1); msum_add_roles( $user_id ); restore_current_blog();}, 10, 1 );      But this doesn't appear to work...? *** Note about my testing *** For testing the msum_add_roles() function manually I'm adding the following code to each sites theme, in functions.php: `if ( isset( $_GET['update_roles'] ) ){ msum_add_roles( $_GET['update_roles'] ); }` So if I add '?update_roles=5109' to the sites URL the user ID 5109 should get updated. This works if done from the main site but not on child sites... *** Further Testing *** Just a note to add that I've done some further testing trying another approach but this hasn't worked either...?? I'm really scratching my head now... Please see code below:               add_action( 'user_register', function( $user_id ){curl_add_roles( $user_id );}, 10, 1 );          function curl_add_roles( $user_id ) {         $ch=curl_init();         curl_setopt($ch, CURLOPT_URL, 'http://www.maindomainname.co.uk/?update_roles=' . $user_id );         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);         curl_setopt($ch, CURLOPT_TIMEOUT, 15);         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);         $response = curl_exec($ch);     }           if ( isset( $_GET['update_roles'] ) ){         msum_add_roles( $_GET['update_roles'] );     }      Thanks in advance!


How do I remove a category from a wordpress loop>

I have a question. I need to have, in my archive.php file, a exclusion of a specific category. given what I have now, how would I make that happen? Here is the code:                   <?php              query_posts(array(                 'post_type' => 'post',                 'showposts' => 5             ) );         ?>         <?php while (have_posts()) : the_post(); ?>
                 <a style="text-decoration:none;" href="<?php the_permalink() ?>">
<?php the_title(); ?>

Posted on <?php the_time('m/j/y g:i A') ?>
Categories: <?php the_category(' ') ?>
Tags: <?php the_tags(' ') ?>

<?php the_excerpt(); ?>

         <?php endwhile;?>      Thank you


Retina images - custom syntax for inserting images into post content

I am currently in the process of building a responsive real estate WordPress theme and I'm figuring out how to properly add support for HiDPI screens. I decided to use a JavaScript solution Picturefill, which mimics the functionality of proposed picture HTML element. WordPress lets us create custom image sizes, and I have decided that for each image size (like listing gallery images on single listing page) I will need four images sizes declared:   1. Regular low-res image for desktop devices   2. @2x hi-res image for HiDPI desktop devices (currently only Retina MacBook)   3. Smaller low-res image for smartphones (why would smartphones need to load full size image?)   4. Smaller hi-res image for smartphones For tablets I've decided to serve the same sized images as for desktop devices, simply because the size of tablet-specific image size is not so much different from the desktop one, so the bandwidth gains are not huge enough to justify adding two image sizes (per image location) to WordPress (low- and hi- res) and cluttering the uploads and DOM. Now, everything is fine and dandy when we are dealing with images that the theme is pulling automatically (like post thumbnails, automatic post gallery etc.), but since for Picturefill script to work I need to output four different image paths (with appropriate media queries) - **how would I go about images that the user manually places into the post content**? For those who don't want to read how the Picturefill works, here is the syntax that the script expects:

      **If you have any suggestions for my proposed method please share, but I would be interested in your ideas on how to create the above syntax for the images that users manually put into the post content.** As a side not, please refrain from suggesting to put such functionality into the plugin, as in my opinion HiDPI images are clearly presentational feature and should be handled by the theme. Also, I am aware of already existing Wp Retina 2x plugin, but this is not exactly what I need since my images has to not only be hi-res, but also responsive - I don't want to force smartphone users to download ~800KB desktop hi-res images.


Conditionally bypass plugin

I would like to defer the loading of an othervise active plugin for certain pages. Since all plugins reside in the same folder, and WordPress only loads the activated ones, it must have an array of active plugin-handles at some point that it goes through. There's probably even a filter available to modify this array just before its being read (I'm hoping..). So is it possible to conditionally bypass the loading of an otherwise active plugin, by removing it's handle from the list of active plugins, dynamically, without deactivating the plugin using deactivate_plugins()?


Wordpress post text starts newline after 93 characters

When typing the text of a new post, my text stops halfway the textarea and starts on a new line again. There are no linebreaks after a cut-ff sentence. When I type a single line of characters the Wordpress starts a new line after 93 characters. See the attached image to see how it looks. ![enter image description here](http://i.stack.imgur.com/hx6Ab.png)


Custom Taxonomy Leads to 404 Page - Permalink Structure Flushed

I have a CPT:               function CPT_init(){         register_post_type('custcpt', array(             'labels'            =>  array(                 'name'          =>      __('Products'),                 'singular_name' =>      __('Product'),                 'all_items'     =>      __('View Products'),                 'add_new'       =>      __('New Product'),                 'add_new_item'  =>      __('New Product'),                 'edit_item'     =>      __('Edit Product'),                 'view_item'     =>      __('View Product'),                 'search_items'  =>      __('Search Products'),                 'no_found'      =>      __('No Products Found'),                 'not_found_in_trash' => __('No Products in Trash')                                     ),             'public'            =>  true,             'publicly_queryable'=>  true,             'show_ui'           =>  true,              'query_var'         =>  true,             'show_in_nav_menus' =>  false,             'capability_type'   =>  'post',             'hierarchical'      =>  false,             'rewrite'           =>  array('slug' => '/products/', 'with_front' => false),             'menu_position'     =>  21,             'supports'          =>  array('title','editor', 'thumbnail'),             'has_archive'       =>  true         ));     }     add_action('init', 'CPT_init');      And Taxonomy with my CPT:               function custcpt_category_taxonomy() {         $labels = array(             'name'              => __( 'Product Categories' ),             'singular_name'     => __( 'Product Category' ),             'search_items'      => __( 'Search Product Categories' ),             'all_items'         => __( 'All Product Categories' ),             'parent_item'       => __( 'Parent Product Category' ),             'parent_item_colon' => __( 'Parent Product Category:' ),             'edit_item'         => __( 'Edit Product Category' ),              'update_item'       => __( 'Update Product Category' ),             'add_new_item'      => __( 'Add New Product Category' ),             'new_item_name'     => __( 'New Product Category' ),             'menu_name'         => __( 'Product Categories' ),         );          $args = array(             'labels'            => $labels,             'public'            =>  true,             'hierarchical'      =>  true,             'show_in_nav_menus' =>  true,             'has_archive'       =>  true,             'rewrite'           =>  array('slug' => '/products/', 'with_front' => false),         );         register_taxonomy( 'custtax', 'custcpt', $args );     }     add_action( 'init', 'custcpt_category_taxonomy');      I have a products page `/products/` and a taxonomy template page: `taxonomy- custtax.php`, I've tried `taxonomy.php` but it didn't seem to matter. I've flushed my permalinks probably 15-20 times by now. It works fine with default but not with `%postname%`. I've added this above my taxonomy:               function custom_taxonomy_flush_rewrite() {         global $wp_rewrite;         $wp_rewrite->flush_rules();     }     add_action('init', 'custom_taxonomy_flush_rewrite');      So when I go to `http://www.mywebsite.com/products/term` I get 404 for some reason or another. I swear taxonomy always gives me problems, every. single. time.


How to insert a variable into a query parameter?

I need to put a variable into query parameter. I have this situation:               $variable = get_field(loop_category);          $catquery = new WP_Query( 'category_name=***VARIABLE-HERE***');     while($catquery->have_posts()) : $catquery->the_post();      How can I do this?


Query custom taxonomy by term id?

I made a custom post type and a custom taxonomy, but I have a problem. When I access the url `http://www.ithemes.co.kr/?shopcat=galaxy-s`, it works well. But when I access the url `http://www.ithemes.co.kr/?shopcat=5`, it returns a 404 page. `galaxy-s` is the taxonomy term slug, but I want to access it by `term_id`, like you can with a category: `cat=1`. I prefer `cat=1`. What can I do?


Remove slug from Custom Category Permalink + dual-category permalinks

I'll try to make this as clear as possible. I'm am trying to figure out a few things to clean up the permalinks on a large website project. We're using custom post types and ~200+ custom categories (we chose this because you can really add a lot of custom field spaces and data easily with the new custom post types). We need our permalinks to look like this: example.com/books/adventure/post-name where "books" and "adventure" are both categories, but we would prefer "books" came first. We would create adventure as a sub-category of books, but we use this same category for   adventure movies, adventure games, etc. So a large site with books, movies, games, etc. where a person first chooses one of those categories and then drills down deeper to adventure, romance, kids, etc. Right now, we have: example.com/main-category/books example.com/sub-category/adventure example.com/product/post-name Basically I need to:   1. Remove the slugs from the custom type categories (i.e. main-category & sub-category)   2. Make the "sub-category" appear after the "main-category" for the permalinks for sub-category pages.   3. Create a new dynamic base category for the custom posts, which reflects the categories it's in (/books/adventures/post-name).   4. Do this as simply and clean as possible, without a lot of plugins or things that may cause trouble down the line. OR...if you have a much better way to do this, I'm open to any suggestions. I know that we can use a Wordpress Network install instead of main-categories, but with 50-100+ of them, that is not feasible for us.


Upload files in wordpress

What is the best way to upload files in wordpress? How can I upload multiple files at a time like media uploads in wordpress?


Tags interfering with next_post_link();

I am creating a theme in WordPress. I am using `query_posts('tag=front')` to limit the posts on the front page. However, I want to let the user navigate through all posts, **regardless of tags** when on the a permalink page. I am using `next_post_link()`; to deal with this. I am using this to limit the posts on the `index.php`: `query_posts( 'tag=front' );` I am using this to let the user click through each project, on `single.php`:               <?php next_post_link('%link', 'Next post →', TRUE); ?>       However, it is **only looping through posts tagged with`front`,** and not all posts regardless of tags. I want it to loop through **all**. You can see it live here: http://kurt-theme.info/


Wordpress login fail after .htaccess domain redirect

I use .htaccess to redirect requests to my (new) domain to another domain hosted on different server. The file contains:               Options +FollowSymlinks     RewriteEngine on     RewriteBase /     RewriteCond %{HTTP_HOST} ^(www\.)?amazon40\.com [NC]     RewriteRule ^(.*)$ http://steamsigs.com/amazon40/$1 [R=301,L]      The redirection works fine. The home page is redirected to steamsigs.com/amazon40 and wordpress login page shows up correctly (steamsigs.com/amazon40/wp-login.php). But the acutual login process doesn't work. It does not show the control panel and keeps on redirecting to the login page. Could be that something's interfering with the GET/POST vars but I'm not sure about this. I'd appreciate any your help to resolve this.


How to obtain a reference to $table_prefix in $wpdb object

I need to call the WordPress options table and pull some data. However, the table name may be different (typically wp_options) depending on whether the default table prefix was used on installation. How can I obtain a reference to the site's table prefix in order to properly access the site's options table via $wpdb?               /**      * WordPress Database Table prefix.      *      * You can have multiple installations in one database if you give each a unique      * prefix. Only numbers, letters, and underscores please!      */     $table_prefix  = 'wp_';


Alter media caption/description conflict in Wordpress?

When uploading an image, Wordpress reads the description meta data from the jpg via `wp_read_image_metadata` and inserts it into the `post_content` field when adding the attachment via `media_handle_upload` or `media_handle_sideload` But when adding a image to the editor in Wordpress, it looks for the caption in the `post_excerpt` field via `image_media_send_to_editor` What I'd like is just some continuity, in that when our images are uploaded, the field populated by WordPress for the images meta description is the one used for the caption when placing an image in the editor. Can anyone suggest a way I can hook into any of these functions in order to match up the process? I don't really care which way I fix it, although I tend to think that `post_excerpt` leads to less database overhead since it's a 'smaller' field. Any help is greatly appreciated. Thanks.


Custom Post Type Permalink

I have a custom post types called "Emily Davies," "Gemma Patel," and "Poppy Smythe," And I'd like to be access its archives by going to ".../emily_davies" ".../gemma_patel" and ".../poppy_smythe". Emily Davies works, but for some reason the last two don't. They just show 404 error. I have archive- emily_davies.php, archive-gemma_patel.php, abd archive-poppy_smythe.php. I have this code in my functions.php, and my permalink setting is set to be '/%category%/%postname%/'               add_action( 'init', 'create_post_type' );     function create_post_type(){          register_post_type( 'emily_davies',     array(     'labels' => array(          'name' => __('Emily Davies'),          'singular_name' => __('Post'),          'add_new' => __('Add New'),          'add_new_item' => __('Add New Post'),          'edit_item' => __('Edit Post'),          'new_item' => __('New Post'),          'all_items' => __('All Posts'),          'view_item' => __('View Posts'),          'search_items' => __('Search Posts'),          'not_found' =>  __('No Posts found'),          'not_found_in_trash' => __('No Posts found in Trash'),           'parent_item_colon' => '',          'menu_name' => 'Emily Davies'         ),     'rewrite' => true,     'publicly_queryable' => true,     'public' => true,     'show_ui' => true,     'hierarchical' => false,     'menu_position' => 5,     'query_var' => true,     'has_archive' =>true,     'supports' => array('title','editor','thumbnail','excerpt','comments',)      )      );      $labels = array(     'name' => _x('Categories', 'taxonomy general name' ),     'singular_name' => _( 'Category'),     'search_items' =>  __( 'Search Category' ),     'popular_items' => __( 'Popular Categories' ),     'all_items' => __( 'All Categories' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit Category' ),      'update_item' => __( 'Update Category' ),     'add_new_item' => __( 'Add New Category' ),     'new_item_name' => __( 'New Category Name' ),     'separate_items_with_commas' => __( 'Separate Category with commas' ),     'add_or_remove_items' => __( 'Add or remove Categories' ),     'choose_from_most_used' => __( 'Choose from the most used Categories' ),     'menu_name' => __( 'Categories' ),      );      register_taxonomy('emily_category','emily_davies',array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'emily-category' ),       ));          register_post_type( 'poppy_smythe',     array(     'labels' => array(          'name' => __('Poppy Smythe'),          'singular_name' => __('Post'),          'add_new' => __('Add New'),          'add_new_item' => __('Add New Post'),          'edit_item' => __('Edit Post'),          'new_item' => __('New Post'),          'all_items' => __('All Posts'),          'view_item' => __('View Posts'),          'search_items' => __('Search Posts'),          'not_found' =>  __('No Posts found'),          'not_found_in_trash' => __('No Posts found in Trash'),           'parent_item_colon' => '',          'menu_name' => 'Poppy Smythe'         ),     'rewrite' => true,     'publicly_queryable' => true,     'public' => true,     'show_ui' => true,     'hierarchical' => false,     'menu_position' => 5,     'query_var' => true,     'has_archive' =>true,     'supports' => array('title','editor','thumbnail','excerpt','comments',)     )      );       $labels = array(     'name' => _x('Categories', 'taxonomy general name' ),     'singular_name' => _( 'Category'),     'search_items' =>  __( 'Search Category' ),     'popular_items' => __( 'Popular Categories' ),     'all_items' => __( 'All Categories' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit Category' ),      'update_item' => __( 'Update Category' ),     'add_new_item' => __( 'Add New Category' ),     'new_item_name' => __( 'New Category Name' ),     'separate_items_with_commas' => __( 'Separate Category with commas' ),     'add_or_remove_items' => __( 'Add or remove Categories' ),     'choose_from_most_used' => __( 'Choose from the most used Categories' ),     'menu_name' => __( 'Categories' ),      );       register_taxonomy('popy_category','poppy_smythe',array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'poppy-category' ),      ));           register_post_type( 'gemma_patel',      array(     'labels' => array(          'name' => __('Gemma Patel'),          'singular_name' => __('Post'),          'add_new' => __('Add New'),          'add_new_item' => __('Add New Post'),          'edit_item' => __('Edit Post'),          'new_item' => __('New Post'),          'all_items' => __('All Posts'),          'view_item' => __('View Posts'),          'search_items' => __('Search Posts'),          'not_found' =>  __('No Posts found'),          'not_found_in_trash' => __('No Posts found in Trash'),           'parent_item_colon' => '',          'menu_name' => 'Gemma Patel'         ),     'rewrite' => true,     'publicly_queryable' => true,     'public' => true,     'show_ui' => true,     'hierarchical' => false,     'menu_position' => 5,     'query_var' => true,     'has_archive' =>true,     'supports' => array('title','editor','thumbnail','excerpt','comments',)     )     );      $labels = array(     'name' => _x('Categories', 'taxonomy general name' ),     'singular_name' => _( 'Category'),     'search_items' =>  __( 'Search Category' ),     'popular_items' => __( 'Popular Categories' ),     'all_items' => __( 'All Categories' ),     'parent_item' => null,     'parent_item_colon' => null,     'edit_item' => __( 'Edit Category' ),      'update_item' => __( 'Update Category' ),     'add_new_item' => __( 'Add New Category' ),     'new_item_name' => __( 'New Category Name' ),     'separate_items_with_commas' => __( 'Separate Category with commas' ),     'add_or_remove_items' => __( 'Add or remove Categories' ),     'choose_from_most_used' => __( 'Choose from the most used Categories' ),     'menu_name' => __( 'Categories' ),     );       register_taxonomy('gemma_category','gemma_patel',array(     'hierarchical' => true,     'labels' => $labels,     'show_ui' => true,     'query_var' => true,     'rewrite' => array( 'slug' => 'gemma-category' ),      ));      }


Page (template) with only news of the type "gallery"

Could anyone explain to me how to create a picture galleries page, using the built in Wordpress galleries (no plugins if possible)? Basically, I would like to create a page (template?) in which I loop over all the news of the type Gallery. I've seen some related questions, but without an answer. Could anyone be of service? Thanks in advance.


How can I modify what is being output in wp_head, whether by a theme or Wordpress in general?

I've been working on performance of my site using YSLOW, and noticed that Wordpress it outputting things in my document head that I know I don't need. For example, I'm already calling jQuery 1.9 from the Google CDN, so I don't need the call to jQuery in wp-includes. Also, a plugin is including a stylesheet which I don't need (because I'm overwriting 99% of those styles anyway in my theme), so I'd like to get rid of that call also. So how do I edit what is being output by the `wp_head()` function, whether Wordpress is putting it there (like the `wp-includes` jQuery call) or whether a plugin is putting it there (like the stylesheet call)?


Query Vars Not Set in Main Query

I have a function that checks page specific and global settings to determine a class related to sidebars. I call the function from the archive.php template and try to check that `post_type` is 'post', however the `post_type` var isn't set. Relevant Code:               function get_sidebar_class() {         global $wp_query;         echo 'Post type: ' . get_query_var( 'post_type' );         echo '<pre>' . print_r( $wp_query->query_vars, true ) . '</pre>';     }      `post_type` comes back empty for both attempts. Why isn't it set? Other variables (E.g. `category`) are set, but not `post_type`.


Show subpages of a category in a custom menu

I have added a post category to a custom menu through Admin. But when it shows, it just shows the category name, and does not show the posts inside the category. Is there a way to add an args; that the children post pages will also show with the category title in the menu? This is my current function:               function wp_nav_links() {        wp_nav_menu(         array(                   'menu' => 'nav_links',             'theme_location' => 'nav_links',              'container_class' => 'nav-links clearfix',              'fallback_cb' => 'nav_links_fallback'         )     );     }


taxonomy query to output slugs instead IDs

So I got a custom search form with three dropdowns containing three different custom taxonomies. The problem is, I'd need the taxonomy slugs in the address for the search to fuction properly, because now I only get the IDs. If I have product category with the name/slug of **50** , when searching it outputs the taxonomy ID which is **6** in the address. Like so: `/?s=&product_category=6&product_maksuaika=14&product_ikaraja=0` When it should be:               /?s=&product_category=50&product_maksuaika=14&product_ikaraja=0      Same goes for all of the three taxonomies I have. Here's my function:               function my_dropdown($name, $taxonomy = 'category') {     $defaults = array(         'taxonomy' => $taxonomy,         'id'       => $name,         'name'     => $name,         'show_option_none' => ' - Select - ',         'selected' => get_query_var($name)     );          wp_dropdown_categories($defaults);       }                add_action('pre_get_posts', 'my_customsearch');      function my_customsearch() {          global $wp_query;       if ( !$wp_query->is_search ) {         return false;       }            $tax_query = array();       $operacion = get_query_var('product_category');       $ubicacion = get_query_var('product_maksuaika');       $precio    = get_query_var('product_ikaraja');            // first dropdown            if (!empty($operacion) && $operacion > 0) {         $tax_query[] = array(             'taxonomy' => 'product_category',             'field'    => 'id',             'terms'    => $operacion          );       }            // second dropdown            if (!empty($ubicacion) && $ubicacion > 0) {         $tax_query[] = array(             'taxonomy' => 'product_maksuaika',             'field'    => 'id',             'terms'    => $ubicacion         );       }            // third dropdown            if (!empty($precio) && $precio > 0) {           $tax_query[] = array(             'taxonomy' => 'product_maksuaika',             'field'    => 'id',             'terms'    => $ubicacion           );            if ( sizeof($tax_query) > 0 ) {           $tax_query['relation'] = 'AND';           $wp_query->query_vars['tax_query'] = $tax_query;       }          return false;      }           // add my custom query vars      add_filter('query_vars', 'mycustom_query_vars');           function mycustom_query_vars($query_vars) {       $query_vars[] = 'operacion';       $query_vars[] = 'ubicacion';       $query_vars[] = 'precio';            return $query_vars;       }      Simply changing the field to slugs or names in the array does not do the trick. Any ideas?


kitchen sink not working

seems the kitchen sink, and sidebar show/hide links, are not working. i have upgraded to latest release with no such luck in fixing problem. Any help would be greatly appreciated.


Having Trouble Styling a Table in a Wordpress Post

I am trying to style a table in a Wordpress post, but am having difficulty getting it to work. I have set the post to HTML-editing mode and can get some of the styles to take, but not all. (To be honest, this is not the first time I have had trouble getting table styles to work.) The contents of the post (using contrived styles and high-contrast colors to make it easy to identify elements) are below. This is the incorrect result I am getting: ![alt text](http://i.stack.imgur.com/AZaqP.png) As you can see, the cells are not picking up the styles but the table itself is, well, mostly. I thought that maybe it is the blog’s theme that is interfering, but from my understanding of HTML, the `STYLE` tag that comes right before the table is _supposed_ to override anything that comes before it (and is partly doing so). If I put some style info directly into the `TD` tags, it works, but that is obviously not a practical solution.    Can anyone help me figure out how to get a table style to work in a Wordpress post? Thanks a lot. * * *

                 Title	                 Foo	                 Bar	                 Baz

                 Something

                 Something Better

                 Something Worse

                 Something Horrible


How to access the so called "Posts page"

This might be a dumb question - I'm sorry for that but: If I decide to alter "Reading Settings" and choose a front page for home I can define a "Static Page" and a "Posts Page". "Static Page" ain't leaving a question to me since it's what's gonna be grabbed if I click on my Logo. But where will I face this so called "Posts Page"? I'm feeling confused somehow :-)


Member's area with private content?

To begin with, sorry for my english.. and thank you Goggle translate! :) I come to speak here because nobody knows answer me in my country. here is my problem: I created a website (in local for the moment) where people can create a list of posts. These posts are filled with the aid of Gravity Forms. They just fill out the forms and fill the category, it is very convenient. The pages are arranged in a drop down box created with "Category Widget" I want each user has his own list of pages and of course the possibility by a menu to see a list of other users. and therefore each user has HIS "category widget" with user id maybe? i'm lost.. how to get it? Thank you very much i'm lost!


How to add testimonials with an image?

Does anybody have an idea how to add testimonials with an image in WordPress? Is there is any plugin that fulfills my requirement? I searched but did not find any. It must support PHP version 4.4.9.


Using custom mod_rewrite without breaking wordpress permalinks

I am using a theme that uses posts for multiple pages, and the blog posts goes in a category called "blog", I am using the permalinks setting "/%postname%", and the blog menu url is "/category/blog", how can I rewrite that to "/blog" without breaking the rest of the wp url rewrites?, my htaccess is the normal from wp:               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>


What is the difference between Twenty eleven & roots framework?

Just amazed by the usability of Twenty eleven wordpress theme & extensibility of roots theme http://www.rootstheme.com Now in conflict. I want all twenty eleven features to use on extensive features of roots. Is it possible to add boilerplate and bootstrap to use with twenty eleven theme? How?


Custom Post Type Statuses

I'm (still) working on a custom post type plugin for my workplace and came across an easier method of marking Visitors (my custom post type) as either "Here" (aka checked-in) or "Not Here" (not checked-in). I've explored the Edit Flow plugin and, to be honest, I can't really follow what all is going on here... I did however come across a function that appears to be in WordPress' core, but I can't seem to find much documentation on the web (none on wordpress.org even). The function is `register_post_status` but the best I found was this resource which at best only shows me the arguments that go with the function's `$args` parameter. Anyone ever tried this? Or am I the only one who's really needed custom post statuses for custom post types? **EDIT:** I've read this and this as per the answers/comments I've received. Here is an implementation that I'm not 100% sure about because documentation is lacking. I know it doesn't work, but I don't get _why_ it doesn't work. Neither of the two statuses show up in the status list. My next course of action is to hack it with a taxonomy and just create my own 'Publish' meta box.                   register_post_status('in', array(                 'label' => _x( 'Logged In', $post_type ),                 'protected' => true,                 'label_count' => _n_noop( 'Visitors logged in (%s)', 'Visitors logged in (%s)' ),                 'show_in_admin_status_list' => true,             ));              register_post_status('out', array(                 'label' => _x( 'Logged Out', $post_type ),                 'protected' => true,                 'label_count' => _n_noop( 'Visitors logged out (%s)', 'Visitors logged out (%s)' ),                 'show_in_admin_status_list' => true,             ));


can't upgrade wordpress or install plugins, it seems to "think" it's still on a local installation

I'm pretty new to Wordpress, so sorry if this is an obvious mistake :) I've just moved a site from local installation on my computer to a live server. When I'm trying to install plugins or upgrade the Wordpress vs, I get this error message: > Could not open handle for fopen() to C:\Websites\Danabick- > shanuniCoIL\site/wp-content/wordpress-3.tmp It seems it still "thinks" it's a local installation. I'm guessing I missed something when moving it, but not sure what. Any help would be appreciated :) edit: i tried searching the database for the problematic string, it's not there. if not the db, where can it be coming from?


Sanitize slug title

i need to convert this strings into the post url: (numbers with the point and € symbol) ex: 9.000€ -> 9000-euro I found this function but is not working:               add_filter( 'sanitize_title', 'sanitize_title_extra' );          function sanitize_title_extra( $title ) {              $friendlyURL = htmlentities($title, ENT_COMPAT, "UTF-8", false);          $friendlyURL = preg_replace('/&([a-z]{1,2})  (?:acute|lig|grave|ring|tilde|uml|cedil|caron);/i','\1',$friendlyURL);         $friendlyURL = html_entity_decode($friendlyURL,ENT_COMPAT, "UTF-8");          $friendlyURL = preg_replace('/[^a-z0-9-]+/i', '-', $friendlyURL);         $friendlyURL = preg_replace('/-+/', '-', $friendlyURL);         $friendlyURL = str_replace( '€', 'euro', $friendlyURL );         $friendlyURL = str_replace( '€', 'euro', $friendlyURL );         $friendlyURL = str_replace( '€', 'euro', $friendlyURL );         $friendlyURL = trim($friendlyURL, '-');         $friendlyURL = strtolower($friendlyURL);         return $friendlyURL;          }      Thanks! ;)


wp insert attachment from local drive

Is there some way to upload images from local drive to posts without using dashboard. Something like function wp_insert_attachment, bur for that function is a rule that files must be on server.


What is the action hook for save media-form on gallery tab?

I want to save a meta data to post parent when the media-form on gallery tab is saved( The submission button is "Save All Changes"). Which action hook can I use?


Adding a post shortcode to a page template?

hey guys, The "mingle forum plugin" provides the following shortcode [mingleforum]. When I paste this into a page the forum is shown. My forum is using a specific page-template called forum.php. Is it possible to already include this shortcode in the page-template itself, so I don't have to paste it in the wordpress backend anymore. So that when I use the forum.php page template the forum is always automatically embedded? Thank you for your tipps and info.