Feedburner doesn't update when "scheduled post" publishes

I've searched around and can't find anything on this, so thought I'd see if y'all could help. I am successfully scheduling posts and having them publish - no "missed schedule" problems - but when a scheduled post is published, WordPress does not ping Feedburner, and my feed is not updated. I can manually go into Feedburner and update the feed, but that's a pain (well, it's easy, but I forget to do it! that's the whole point of scheduling posts! :-) ). Does anyone know of a setting in either Feedburner or WordPress that I need to change to make this work? My 'privacy' settings are set to visible to search engines. Here's the site if that helps in any way: http://thegladdestthing.com/ Thanks for your help!


Change the 'published on' text?

I am using the date and time in the post dialogue to log the date and time of future events, and would like to change the text to reflect that. Is there an action hook I can tap into to achieve that? Also, it would be perfect if I could pull those controls out of the 'publish dialogue', and add it to my own meta box. ![Publish dialogue](http://i.stack.imgur.com/GxOzW.png)


Using get_option() in JavaScript

Previously, I used the `get_option()` function to get an option in PHP, like this:               $width = get_option('my_width');      This is inside a shortcode function. Now, I want to have an option in JavaScript. Is that possible? The JS is added with `wp_enqueue_script`, from a shortcode function.


How to import my YouTube channel into WordPress?

I want to know how to import my YouTube channel into my WordPress website? * * * Example: I have a YouTube channel with 7 videos. I want to bring all the videos into my WordPress website's sidebar. If I click the listed videos from my channel's list, it'll need to play. For more reference this is the sample output that I need: ![screenshot of desired video layout](http://content.screencast.com/users/Manna/folders/Jing/media/7f444d05-7ca4-4e5f-9ba0-1f32004b5a0c/2011-07-18_2117.png)


Commentlist: bypostauthor problem with children list

I have a rather annoying problem with my commentlist. After trying out a lot and playing around with the CSS stylesheet I don't think this is a CSS problem anymore which is why I decided to post here and ask, because I really have no clue what's wrong. So, I want to "highlight" author comments. I'm using "li.bypostauthor" in the CSS stylesheet to do so. So far so good, it works! But only for the first depth layer!! Not for any of the children! There, suddenly all comments have the "author-only" style! Like I said I already tried to fix it with CSS but it got a really long code snippet and in the end still didn't work. Now, I was wondering if "bypostauthor" won't work for nested comments? Is there any other solution? Please have a look at this comment list. There you can clearly see the problem (please ignore the messed-up design right now). If I also should post code snippets of my comment.php or function.php please let me know! Edit: I don't seem to be the only one who has that problem, but it hasn't been solved yet, it seems. Edit2: After some more hours of working on it I thought I finally got it to work, but I was wrong. It still doesn't work. Now it seems that children replies who are replies to the admin's comment get the same styling as the admin/author, but others don't. I'm really going crazy here and hope somebody could help me out here, thanks a lot! Thanks a lot in advance!


How do we restrict a user to see a field in a post without registration, after registration the user will be able to see the link. I have a project in which I have created a post from an excelsheet by a plugin, now I want to hide a field of link with login/register button, after registration the user will able to see this link.


How to add a menu that belongs to parent blog to all child-blogs?

I want to add a menu that belongs to parent multisite blog to all child-blogs. I need the menu displayed in all child-blogs, I mean the same menu on all multisites blogs. How I can do that?


All scripts and style links return 404 on a local virtualhost

I am setting up a local development environment for a WordPress site on a Ubuntu desktop. When I go to run the installer at `nimble-demo.local/wp- admin/install.php`, the page loads but every script and stylesheet returns a 404 Not Found. I don't think it's a permissions issue because `wp-admin/install.php`, which loads, and `wp-admin/css/install.min.css`, which does not load, have the same permissions: 755, owned by dan:dan (me). The project is located inside my home directory, and my virtualhost is configured accordingly:               <VirtualHost *:80>         ServerAdmin webmaster@localhost         ServerName nimble-demo.local         SetEnv DATABASE_URL postgres://nimble_demo:xxxxxxxx@localhost:5432/nimble_demo              DocumentRoot /home/dan/WMM/demos/nimble-demo/         <Directory />             Options FollowSymLinks             AllowOverride None         </Directory>         <Directory /home/dan/WMM/demos/nimble-demo/>             Options Indexes FollowSymLinks MultiViews             AllowOverride all             Order allow,deny             allow from all         </Directory>              ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/         <Directory "/usr/lib/cgi-bin">             AllowOverride None             Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch             Order allow,deny             Allow from all         </Directory>              ErrorLog /home/dan/WMM/demos/nimble-demo/error.log              # Possible values include: debug, info, notice, warn, error, crit,         # alert, emerg.         LogLevel warn              CustomLog /home/dan/WMM/demos/nimble-demo/access.log combined              Alias /doc/ "/usr/share/doc/"         <Directory "/usr/share/doc/">             Options Indexes MultiViews FollowSymLinks             AllowOverride None             Order deny,allow             Deny from all             Allow from 127.0.0.0/255.0.0.0 ::1/128         </Directory>          </VirtualHost>      I am able to serve a simple html file that links to a stylesheet from another virtualhost in my home directory with a nearly identical setup, so I am thinking that the problem I am having is probably WordPress related.


Settings API settings section not appearing

Settings API always been a little confusing for me. I am trying to add a simple theme options page for a child theme I am developing. I guess I am doing something wrong that preventing the section being appearing. The `settings_fields()` is working fine though (printing all those hidden fields in the form), but the sections are not. Here is my code, please help me troubleshooting.               /********************************         Add Theme Sub Menu Page     ********************************/     function sr_theme_options_setup() {         add_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', 'srchild', 'ia_theme_page_settings' );     }     add_action( 'admin_menu', 'sr_theme_options_setup' );               /*************************************         Generate Options Page HTML     *************************************/     function ia_theme_page_settings() {     ?>
             <?php screen_icon('themes'); ?>
Theme Settings
             <?php settings_errors( 'ia-settings-errors' ); ?>             <form id="form-ia-options" action="options.php" method="post" enctype="multipart/form-data">                     <?php                         settings_fields('ia_options');                         do_settings_sections('ia_section_id');                     ?>
                         <input name="ia_options[submit]" id="submit_options_form" type="submit" class="button-primary" value="<?php esc_attr_e('Save Settings', 'iathemes'); ?>" />                         <input name="ia_options[reset]" type="submit" class="button-secondary" value="<?php esc_attr_e('Reset Defaults', 'iathemes'); ?>" />
             </form>
     <?php     }               /******************************************         Register Settings/Section/Fields     ******************************************/     function iathemes_init() {         register_setting( 'ia_options', 'ia_options', 'ia_options_validate' );              // Add a form section for the Logo         add_settings_section('ia_section_id', __( 'Theme Settings', 'iathemes' ), 'ia_section_callback', 'srchild');              // Add Logo uploader         add_settings_field('ia_options_logo',  __( 'Logo', 'iathemes' ), 'ia_options_logo', 'srchild', 'ia_section_id');     }     add_action( 'admin_init', 'iathemes_init' );          function ia_section_callback() {         ?>
<?php echo 'Manage Theme Settings'; ?>
         <?php     }          function ia_options_logo() {         $options = get_option( 'ia_options' );         ?>             <input type="text" id="logo_url" name="ia_options[site_logo]" value="<?php echo esc_url( $options['site_logo'] ); ?>" />             <input id="upload_logo_button" type="button" class="button" value="<?php _e( 'Upload Logo', 'iathemes' ); ?>" />             <?php _e('Upload an image for the banner. Should be 300x40 pixels in size', 'iatheme' ); ?>         <?php     }      Please tell me where I am doing wrong.


Can't call custom css in style.php

I am using SMOF options to control variables in the backend. As it is just now I have the css options being generated in the header file and they work, however I wish to add them to a style.php. I have set this up however the variable data is not being displayed and the css options are empty.i.e               .site-header, .header-bar {                 background-image:URL('');       I presume it is the `global $data;` call that is incorrect. How would I fix this? Style.php               /* Body Styling */     body {         background:<?php global $data; echo $data['body_background'];?>;         background-image:url(<?php global $data; echo $data['body_background_background']; ?>);         background-repeat:repeat;     }          a {         color:<?php global $data; echo $data['link_color'];?>;     }          a:hover {         color:<?php global $data; echo $data['link_color_hover'];?>;     }          html,body {         font-family:<?php global $data; $arraytype = $data['typography_body']; $stringtype=implode(",",$arraytype); echo $stringtype;?>;          color:<?php global $data; echo $data['font_color_select'];?>;         font-size:<?php global $data; echo $data['font_size_select'];?>;     }          h1,h2,h3,h4 {         font-family:<?php global $data; $arrayheading = $data['typography_h1']; $stringheading=implode(",",$arrayheading); echo $stringheading; ?>     }          /* General Styling */     .singlebutton,.tags-button a,.contactbutton input,#commentsubmit,.btn-standard-blog,.search-submit {         background-color:<?php global $data; echo $data['button_color_select'];?>;         color:<?php global $data; echo $data['button_color_text'];?>;     }          .singlebutton:hover,.tags-button a:hover,.contactbutton input:hover,#commentsubmit:hover,.btn-standard-blog:hover,.search-submit:hover {         background-color:<?php global $data; echo $data['button_color_hover'];?>;         color:<?php global $data; echo $data['button_color_text'];?>;     }      **FUNCTIONS.php** ...               wp_enqueue_style( 'albaband-dynam-css', get_template_directory_uri() . '/includes/css/style.php' );      ...


Move the 'Reply' link to the end of existing replies

I'm using a custom theme based on _s but I think this is standard WordPress behaviour. Currently, if an existing comment already has several replies, the reply link remains just below the original comment rather than at the end of the list of replies.               The original comment (with meta, avatar etc.)     Reply link [actual]               Hey, I like your comment!              Me too, I think it rocks.              I like it more than you do etc...         Reply link [wanted]      If you have quite a few replies, after scrolling down to read them, to reply you have to scroll back up to the original comment to find the reply link, and I would like to move it to the bottom of the list of replies. Is there a relatively simple way to do this? I already use a callback function with wp_list_comments to customise my comments output (that's actually how _s sets things up by default), and the call to comment_reply_link is the last thing in that callback function. Looking at the codex for wp_list_comments it appears I might need to add an $end-callback parameter, but it says "use with caution" and I don't want to break how WordPress handles hierarchical comments etc.


Single.php - Get Current Parent Category

**The Problem** I'm trying to display the current parent category title with the post title right under it. The problem is, I can't seem to get the posts current category inside or outside of the loop. I can get a list of parent categories. For instance, if I have a post in 3 different categories, and I browser to the single post in those categories, I want it to display the current category name at the top, not just the first [0] category it is in. * * * **The Example** `Test Post` is in the categories: `Cat1, Cat2` I go view the `Test Post` in `Cat1` it should display `Cat1 - Test Post` I go view the `Test Post` in `Cat2` it should display `Cat2 - Test Post` * * * **Trial and Error** `get_the_category()` returns both the categories: `Cat1, Cat2` `$post->post_parent` always returns 0 `echo $category[0]->name;` will of course only return the top most category - `Cat1`


Issue on Setting $icon_url Parameter on WP add_menu_page()

I am trying to create a custom Menu by using the WordPress `add_menu_page()` function. I think I understand the whole function parameters as Codex point it out as:               <?php            add_menu_page( $page_title,                          $menu_title,                          $capability,                          $menu_slug,                          $function,                          $icon_url,                          $position );      ?>      The only problem which I have is how to point to an existing WP icons liketool, edit, upload and so on.., in $icon_url? I already find this post but I coulnt' figute it out how to add style to `div` at:                <?php              add_menu_page(                    'custom menu title',                     'custom menu',                     'add_users',                     'myplugin/myplugin-index.php',                     '',                     'div', //this part                    6);       ?>      inside of my `.php` file?!


Post dynamic fields and style

dynm![Desired Post style](http://i.stack.imgur.com/IsuMV.jpg) I am stuck in getting wordpress post to the attached screnshot's style, My apology for being a pretty noobs amd my question shows it. I searched and found a wonderful article : how-to-display-word-count-of-wordpress-posts- without-a-plugin Most of my desired features are figured out there very well but still looking for a way to input price field, can I have a price field while posting from admin panel ?


Query Posts From Multiple Post Types

Is there an easier or more efficient way of querying posts from multiple post types by the date of which they were published? I read this question here: Using Query Posts With Multiple Post Types And A Taxonomy and the accepted answer. Although the answer provided probably works, I decided to put a bit of a spin on it in hopes of a more efficient method of retrieving posts from multiple post types using `WP_Query();` instead of `get_posts();` Here is what I came up with:               private function get_posts(){         if(!$this->post_types){             return false;         }         global $wpdb;         $post_ids = array();         foreach($this->post_types as $post_type){             $results = $wpdb->get_results($wpdb->prepare(                 "                 SELECT ID                 FROM ".$wpdb->posts."                 WHERE `post_type` LIKE '%%%s%%'                 AND `post_status` = '%s'                 ORDER BY `post_date` DESC                 ",                 $post_type,                 'publish'             ));             if(!$results){                 continue;             }             foreach($results as $result){                 $post_ids[] = $result->ID;             }         }         if(!$post_ids){             return false;         }         if(get_query_var('paged')){             $paged = get_query_var('paged');         } elseif(get_query_var('page')){             $paged = get_query_var('page');         } else{             $paged = 1;         }         $query = new WP_Query(array(             'post_type' => 'any',             'post_status' => 'publish',             'post__in'  => $post_ids,             'orderby' => 'date',             'order' => 'DESC',             'paged' => $paged         ));         if(!$query->posts){             return false;         }         return $query->posts;     }      `$this->post_types` is just a simple array of post type names which posts should be retrieved from. If I specify `'post_types' => $this->post_types` in my query arguments, it only fetches posts from the post type `post`, and none of the other custom post types in the array. When I specify `'post_types' => 'any'` it retrieves the posts just fine. However, if I were to drop `'post__in' => $post_ids` and leave `'post_type' => 'any'` then it would be retrieving posts made in ANY post type, but if I change to `'post_type' => $this->post_types'` then it again, only returns posts from the post type `post`. To clear things up. With the code I provided above, it does exactly what I need it to do. Is there an easier or more efficient way of querying posts from multiple post types?


Conditional using get_the_ID() not working

I'm using this script to not show title on a specific page               <?php if (get_the_ID() != 50){ ?>      Now I need to add another page:               <?php if ((get_the_ID() != 50) || (get_the_ID() != 317)){ ?>      But it's not working.


WP_Query with meta_query dosen't return results

I am trying to get list of posts filtered by fields I added using the advance custom fields plugin. I have more fields that I want to use but it doesn't work as I want it to. Here is what the query looks like:                        "query":{                 "posts_per_page":"10",                 "orderby":"meta_value_num",                 "meta_key":"site_return_rate",                 "meta_query":[                    {                       "key":"casino",                       "value":"Test Casino",                       "compare":"="                    }                 ],                 "post_type":"slot",                 "post_status":"publish"              },      Without the `meta_query` the results are fine, I tried with `like` instead of `=` but it still isn't working === Update === It's an array in array, the above example is what `wp_query` returns, here is the code that creates the `meta_query`:               if(!empty($_GET['casino_name']) ||!empty($_GET['slot_type'])){         $args['meta_query']=array();         if(!empty($_GET['casino_name'])){             $args['meta_query'][]=array(                 'key'=>'casino',                 'value'=>$_GET['casino_name'],                 'compare'=>'='                 );         }              if(!empty($_GET['slot_type'])){             $args['meta_query'][]=array(                 'key'=>'slot_type',                 'value'=>$_GET['slot_type'],                 'compare'=>'='                 );         }     }      === Update 2 === Here is the request query that `wp_query` returns:                SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts  INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)\nINNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id) WHERE 1=1  AND wp_posts.post_type = 'slot' AND (wp_posts.post_status = 'publish') AND (wp_postmeta.meta_key = 'site_return_rate'\nAND  (mt1.meta_key = 'casino' AND CAST(mt1.meta_value AS CHAR) = 'Test Casino') ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value+0 DESC LIMIT 0, 10      === update 3 === After some time and some question in comments(thx) i remembered that the fields are category type and the value of filed is actualy the term id not the name, it works now but i am just wandering if there is a better way then what i do :               if(!empty($_GET['casino_name']) ||!empty($_GET['slot_type'])){         $args['meta_query']=array();         if(!empty($_GET['casino_name'])){             $temp = $wpdb->get_results("select term_id from wp_terms where name like '%".mysql_real_escape_string($_GET['casino_name'])."%'");             $casino_list=array();             foreach ($temp as $key => $value) {                 $casino_list[]=$value->term_id;             }                $args['meta_query'][]=array(                 'key'=>'casino',                 'value'=>$casino_list,                 'compare'=>'IN'                 );         }              if(!empty($_GET['slot_type'])){             $temp = $wpdb->get_results("select term_id from wp_terms where name like '%".mysql_real_escape_string($_GET['slot_type'])."%'");             $slot_type_list=array();             foreach ($temp as $key => $value) {                 $slot_type_list[]=$value->term_id;             }                $args['meta_query'][]=array(                 'key'=>'slot_type',                 'value'=>$slot_type_list,                 'compare'=>'IN'                 );         }     }


Get specific sidebars $wp_registered_sidebars

I've got the following functions as in this pastebin in a child theme: > http://pastebin.com/uzjmXiyN This functions creates a drop down box from where you can choose a sidebar for use on a specific page. Everything works fine after a lot of sweat. My only problem is the > $wp_registered_sidebars function in the following piece of code               foreach($wp_registered_sidebars as $sidebar_id => $sidebar)     {         $output .= "<option";         if($sidebar_id == $val)             $output .= " selected='selected'";         $output .= " value='".$sidebar_id."'>".$sidebar['name']."</option>";     }          $output .= "</select>";          echo $output;      This function lists all the available sidebars of the theme, and this is what I don't want. I only want the drop down box to display the sidebars in the > $dynamic_widget_areas array. If I replace > $wp_registered_sidebars with > $dynamic_widget_areas I get the following errors: > Notice: Undefined variable: dynamic_widget_area ...etc and > Warning: Invalid argument supplied for foreach() ...etc What is the correct way to display only certain sidebars.


why i cannot see some plugins while they are enabled on network admin page?

i am using WPMU 3.3.1, i have some plugins enabled but why i cannot see them in some wordpress panel, it is confusing, but these plugins may take effect to these blogs, it is really strange to take effect before i enable it ... these erroneous plugins include **Private Only** , **WordPress Importer** , **WP Super Cache** also some plugins which were disactivated appear in blogs' panel, such as **Akismet** , why? i think plugins which are disabled by network admin should not appear in individual blog's panel, and plugins which are enabled by network admin should appear in individual blog's panel. the this is not true to my wpmu, why? any clues? or this is a bug of WPMU, if yes, any method to find what is the lines that lead to this bug? **Edit 1** Network Admin portal: 7 plugins have been enabled here. ![enter image description here](http://i.stack.imgur.com/xQmf8.jpg) plugin portal in sub blogs: why i can only see 2 plugins here? in fact i should see 7 plugins... ![enter image description here](http://i.stack.imgur.com/Phd1N.jpg)


vertical menu bar css

i would like to customize my dashboard navigation menu to vertical styling. i needed to find the `<div id="adminmenu">` but there are tons of CSS inside `/wp-admin/css` also, does changing the CSS adminmenu is the correct approach of changing the `<ul>` into vertical styling?


Show only posts from one category on custom post type archive page

I have a custom post type, called Exercises. I also have many categories within that custom post type. I use archive-exercises.php custom loop to display my main exercises page. Question: How do I modify my archive-exercises.php so it will display only post from specific category? I managed to get similar effect on my home page with regular posts:               <?php query_posts('cat=93&showposts='.get_option('posts_per_page')); ?>


Should 3rd Parties Use $wp_scripts/$wp_styles->add_data?

Within the `WP_Dependencies` class exists a method named `add_data`. This function adds data to scripts/styles that have been enqueued during the WordPress load. A commonly cited use for this function is to add a conditional when adding stylesheets that are targeted at different versions of IE. For example, to target IE8 and lower:               function test_wp_print_styles() {         global $wp_styles;              wp_enqueue_style( 'test-style', get_template_directory_uri() . '/css/test.css', array(), 1, 'all' );         $wp_styles->add_data( 'test-style', 'conditional', 'lte ie8' );     }     add_action( 'wp_print_styles', 'test_wp_print_styles' );      This will render as:               <!--[if lte ie8]>     <link rel='stylesheet' id='test-style-css'  href='http://trunkosaurus.dev/wp-content/themes/twentyeleven/css/test.css?ver=1' type='text/css' media='all' />     <![endif]-->       When I look through Core, I see a handful of places where this method is used:   * **`WP_Styles->add_inline_style()`** : adds inline style after the referenced stylesheet (done via `WP_Styles->print_inline_style()`)   * **`WP_Scripts->localize()`** : adds a json encoded object (wrapped by the more "public" `wp_localize_script()` function)   * **`wp_plupload_default_settings()`** : adds json encoded object (created from a multidimensional array) for the 'wp-plupload' script (note that this is forthcoming in 3.4)    * When registering/enqueueing scripts and styles Adding data for default scripts (`wp-includes/script-loader.php`) From reading through the uses of the method, it does not appear to have a specific use case. In `wp_plupload_default_settings`, it seems to allow for arbitrary data injection. In `wp_register_script`, it seems to be used to differentiate between header and footer scripts. In `add_inline_style`, it is used to denote inline style that should be added after a specified stylesheet is enqueued. An excellent use for this function would be something like the following code where you are enqueuing an external script but need to send it some config vars, some of which come from the DB:               function zdt_enqueue_add_this() {         global $wp_scripts;              wp_enqueue_script( 'zdt-add-this', 'http://s7.addthis.com/js/250/addthis_widget.js#pubid=myidhere' );              // Contrived example of database call to get a twitter handle stored in the db         $author_twitter_handle = zdt_get_twitter_handle();              $js = "var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @" . sanitize_key( $author_twitter_handle ) . "' } };\n";         $js .= 'var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };';              $wp_scripts->add_data( 'zdt-add-this', 'data', $js );     }     add_action( 'wp_enqueue_scripts', 'zdt_enqueue_add_this' );      This will result in:               <script type='text/javascript'>     /* <![CDATA[ */     var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @tollmanz' } };     var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };     /* ]]> */     </script>     <script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js?ver=3.4-beta4-20731#pubid=myidhere'></script>      Note that this cannot be accomplished with `wp_localize_script` because the `addthis_share` object has properties within properties (I did write about a somewhat hacky way around this before). _EDIT: I was wrong in stating this.`wp_localize_script` handles multidimensional arrays just fine._ This method seems to work really well for the following reasons:   1. It allows you to attach the data to the script handle so it is always properly enqueued with the script. Further, it will be intelligent about deenqueueing the script, script order, and script placement.   2. It allows you to use PHP to send vars to JS.   3. It seems more organized than using `wp_print_styles` to print out some arbitrary script that is acted on later by an enqueued script. There are some things that do not work as expected that worries me about this method. One such issue is that if you use `wp_localize_script` along with `$wp_scripts->add_data`, you can get unexpected results. For instance:               // Contrived example of database call to get a twitter handle stored in the db     $author_twitter_handle = zdt_get_twitter_handle();          $js = "var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @" . sanitize_key( $author_twitter_handle ) . "' } };\n";     $js .= 'var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };';          $wp_scripts->add_data( 'zdt-add-this', 'data', $js );     wp_localize_script( 'zdt-add-this', 'addthis_share', array( 'var' => 'val' ) );      Produces:               <script type='text/javascript'>     /* <![CDATA[ */     var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @tollmanz' } };     var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };     var addthis_share = {"var":"val"};     /* ]]> */     </script>     <script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js?ver=3.4-beta4-20731#pubid=myidhere'></script>      Whereas this script:               // Contrived example of database call to get a twitter handle stored in the db     $author_twitter_handle = zdt_get_twitter_handle();          $js = "var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @" . sanitize_key( $author_twitter_handle ) . "' } };\n";     $js .= 'var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };';          wp_localize_script( 'zdt-add-this', 'addthis_share', array( 'var' => 'val' ) );     $wp_scripts->add_data( 'zdt-add-this', 'data', $js );      Produces:               <script type='text/javascript'>     /* <![CDATA[ */     var addthis_share = { templates : { twitter: '{{title}} {{url}} (by @tollmanz' } };     var addthis_config = { ui_header_color: "#FFFFFF", ui_header_background: "#FA9628", ui_cobrand: "My Site" };     /* ]]> */     </script>     <script type='text/javascript' src='http://s7.addthis.com/js/250/addthis_widget.js?ver=3.4-beta4-20731#pubid=myidhere'></script>      The `data` key that is set by `wp_localize_script` is ultimately overwritten by the call to `$wp_scripts->add_data`, whereas if you call `wp_localize_script` twice for the same script, the string will be properly concatenated. While all of this is a really handy way of printing arbitrary script for use with an enqueued script, it makes me think that it should not be widely used because of potential of conflicts. I certainly can see an argument for using this in personal projects where the code will not be used in community plugins/themes. I also looked at Core Trac to see if there was any clues as to the purpose of the function. I found one ticket (http://core.trac.wordpress.org/ticket/11520) (an epic one at that) that explored other ways of adding arbitrary JS. So it seems that there is interest in creating a better way to add arbitrary JS, but not sure exactly if `add_data` should be part of the process. My main question is: should developers be using this function? In some cases (e.g., `wp_register_script`), it seems like a "private" function that 3rd parties should not use; however, in other cases (e.g., `wp_plupload_default_settings`), it seems like a perfectly reasonable way to inject arbitrary JS prior to an enqueued script. I don't imagine there is a "correct" answer to this, but would love to hear what other devs think. I also imagine that there are pieces to this puzzle that I've completely neglected and would love to hear what others have to say about it.


uploaded images not going to /uploads folder

having a huge problem with a site. i updated the theme to use post thumbnails (that's how old it is) and then when trying to upload an image to use as featured thumbnail: the images process/crunch but then the URLs result in 404s. ![enter image description here](http://i.stack.imgur.com/6nQvQ.png) there isn't anything abnormal in the site's .htaccess. there actually wasn't a wp-content/uploads directory so i made one and the chmod permissions are 0755, so that shouldn't be the issue. i reset the media settings folder to be the default but no images are ending up in that folder. edit: changing the uploads folder to 0777 permissions seems to resolve this. is it safe to leave the permissions this way?


Compare the_excerpt() to the_content()

Is there a way to compare the_excerpt() to the_content() to know if the_excerpt() is actually showing the entire post content? for instance, if a post were particularly short. ultimately i'd like to have a "Read more" link at the end of excerpts. but i want it to say 1 thing for posts and another for posts of the video format (ie... 'watch the video' instead of 'read the rest'). but at the same time i don't want to manually tack this on after the excerpt, but i have plenty of posts that are short enough they don't need a 'read more' link, since the_excerpt displays the full post. but adding the permalink to the excerpt_more filter isn't quite right since it won't add a link to the video posts that have no other content. so i'm stuck between the two. i hope that made sense. if it didn't it's late and i will try to re-explain in the morning.


Wordpress URL rewrite problem

blog.com/product/somename In the above URL - how do I tell Wordpress that 'product' is a variable and 'somename' is its value. Then how do I extract that value and use it inside a function I'll create? In short I need to: register variable, check url for variable, extract value, use default post template and generate the_content based on that value, but only if there is a value and only for that url. Right now I'm neither able to register/extract the variable (when I visit the above-mentioned URL I get a 404) nor specify that the_content should only be replaced when the url contains that variable - it simply replaces the content on all regular posts. Here's what I came up with so far:               function product_rewrite_rules(){         add_rewrite_rule('^product/(\d+)/?$','index.php?product=$matches[1]','top');     }     add_action( 'init', 'product_rewrite_rules' );               add_filter( 'query_vars', 'setup_filter_query_vars_product' );     function setup_filter_query_vars_product( $query_vars ){         $query_vars[] = 'product';         return $query_vars;     }               function products_page () {     global $wp_query;     if( isset( $wp_query->query_vars['product'] )) {     $productvalue = $wp_query->query_vars['product'];          echo "product is $productvalue";     }     }     add_filter ('the_content', 'products_page');        What am I doing wrong?


How can I edit the slugs of tags?

I'm interested in specifying different URL slugs for tags than the text they contain (e.g. changing the slug for a "QnA" tag to "questions-and-answers"). What's the easiest way of making and maintaining these changes for a large number of tags?


How do I create a post_id column, for admin posts list?

I'm trying to add a column to display the post_id from the wp_postmeta table. I would like to display it in the admin posts list. Here is my code:               add_filter( 'manage_edit-movie_reviews_columns', 'my_columns' );      function my_columns ( $columns ) {       global $post;       $columns['id'] = 'ID';         return $columns;     }     add_action( 'manage_posts_custom_column', 'populate_columns' );     function populate_columns( $column ) {       if ($column == 'id'){         echo $post_id;       }     }      The ID column is visible, but no post_id are in that column- it is just blank. Please can you suggest changes. I'm new to wordpress development so please be gentle.


Listing taxonomies from custom post type

I have a custom post type with several taxonomies within it Eg. the post type is called `campsites` and the taxonomies are various `counties`: cheshire, staffordshire etc. What I want to do is: list all of the counties and when you click on a county it links through to a page which lists all of the posts within that County. How can I do that.


Related posts widget - category

I want edit this widget to display related posts from current category. This code below display only posts from category that I must choose manually. So I want related posts from category ..thanks for help               add_action( 'widgets_init', 'catposts_load_widgets' );          function catposts_load_widgets() {         register_widget( 'Catposts_Widget' );     }          class Catposts_Widget extends WP_Widget {              function Catposts_Widget() {             /* Widget settings. */             $widget_ops = array( 'classname' => 'catposts', 'description' => __('Adds posts from a specific category .', "solostream") );             /* Widget control settings. */             $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'catposts-widget' );             /* Create the widget. */             $this->WP_Widget( 'catposts-widget', __('Category Posts Widget', "solostream"), $widget_ops, $control_ops );         }              function widget( $args, $instance ) {             global $post;             $post_old = $post; // Save the post object.                  extract( $args );                  // If no title, use the name of the category.             if( !$instance["title"] ) {                 $category_info = get_category($instance["cat"]);                 $instance["title"] = $category_info->name;             }                  // Get array of post info.             $cat_posts = new WP_Query("showposts=" . $instance["num"] . "&cat=" . $instance["cat"]);                  /* Before widget (defined by themes). */             echo $before_widget;                  // Widget title             echo $before_title;             if( $instance["title_link"] )                 echo '' . $instance["title"] . '';             else                 echo $instance["title"];             echo $after_title;                  // Post list             echo "
\n";                  while ( $cat_posts->have_posts() )             {                 $cat_posts->the_post();             ?>                     <div class="post" id="catpost-<?php the_ID(); ?>">
                                  <a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php include (TEMPLATEPATH . "/post-thumb.php"); ?>
<a href="<?php the_permalink() ?>" rel="<?php _e("bookmark", "solostream"); ?>" title="<?php _e("Permanent Link to", "solostream"); ?> <?php the_title(); ?>"><?php the_title(); ?>
                                  <?php the_excerpt(); ?>
                              <?php include (TEMPLATEPATH . "/postinfo.php"); ?>

             <?php             }                  echo "
\n";                  echo $after_widget;                  remove_filter('excerpt_length', $new_excerpt_length);                  $post = $post_old; // Restore the post object.     }              function form($instance) {         ?>
                 <label for="<?php echo $this->get_field_id("title"); ?>">                     <?php _e( 'Title' ); ?>:                     <input class="widefat" id="<?php echo $this->get_field_id("title"); ?>" name="<?php echo $this->get_field_name("title"); ?>" type="text" value="<?php echo esc_attr($instance["title"]); ?>" />

                                      <?php _e( 'Category' ); ?>:                     <?php wp_dropdown_categories( array( 'name' => $this->get_field_name("cat"), 'selected' => $instance["cat"] ) ); ?>

                 <label for="<?php echo $this->get_field_id("num"); ?>">                     <?php _e('Number of Posts to Show'); ?>:                     <input style="text-align: center;" id="<?php echo $this->get_field_id("num"); ?>" name="<?php echo $this->get_field_name("num"); ?>" type="text" value="<?php echo absint($instance["num"]); ?>" size='3' />

                 <label for="<?php echo $this->get_field_id("title_link"); ?>">                     <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id("title_link"); ?>" name="<?php echo $this->get_field_name("title_link"); ?>"<?php checked( (bool) $instance["title_link"], true ); ?> />                     <?php _e( 'Make widget title link' ); ?>
                  <?php         }     }


Prevent users from changing post status

The scenario is this: An agent enters the post data (custom post), but can only do a pending for review or change the visibility of the post. He cannot change the post status manually. I have achived the pending for review, but I cannot hide the "Status: published/pending etc. Edit". How is it possible (if possible)?


Custom Posts values in custom post overview

I created a custom post type. I have an overview page with Title, Author, Editor. These are defined in the supports array (`'supports' => array( 'title', 'author', 'editor' ),`). Is it possible to add some custom values to the overview, e.g. values from custom posts? BR, mybecks


Private feedback on users

I am trying to find a way for users to write private/anonymous feedback on each other (similar to ebay or amazon but private, and so that users can view feedback on them and feedback they have sent). I was trying the custom post route with custom fields however there would be no way to (1) aggregate feedback on one user and (2) make it private. For example every month I would want users to fill out a form that displays with dropdown boxes: >   * Select User: User 1/User 2 etc. >   * Rate Performance: Excellent/Good/Poor >   * Rate Reliability: Excellent/Good/Poor >   * Rate Productivity: Excellent/Good/Poor >   * Add a comment via text box > Then to be able to sumbit this (e.g. once a month) and user 1 can see all the feedback on him, user 2 can see all the feedback on her (but not let user 1 see feedback on user 2). **Edited to add a question** Basically I'm wondering what route go down to implement this? I wonder that custom post types with custom fields are the wrong route? Should I be looking at forms, and if so how could I attempt to make these private? Thanks!


Metabox repeating fields - radio buttons not saving correctly

I have multiple radio buttons set up inside of a metabox in a custom post type. I have created the metabox like so:                   add_action('admin_init', 'add_meta_boxes', 1);         function add_meta_boxes() {             add_meta_box( 'repeatable_fields', 'Top 10 Movie List', 'repeatable_meta_box_display', 'cpt_top_ten_list', 'normal', 'default');         }              function repeatable_meta_box_display() {             global $post;             $repeatable_fields = get_post_meta($post->ID, 'repeatable_fields', true);             wp_nonce_field( 'repeatable_meta_box_nonce', 'repeatable_meta_box_nonce' );               if ( $repeatable_fields ) :              // set a variable so we can append it to each row         $num = 0;         $second_num = 0;              foreach ( $repeatable_fields as $field ) {         $num++;          <div class=" playbackformat-holder-<?php echo $num; ?> playbackformat-holder">         <form id="playback-form-<?php echo $num; ?>">             <label for="dvd-<?php echo $num; ?>">             <input type="radio" class="playbackformat-holder-radiobutton" value="dvd" name="playback_format[<?php echo $second_num; ?>]" id="dvd-<?php echo $num; ?>" <?php if($field['playback_format'] == 'dvd') { echo 'checked'; } ?>>DVD                               <label for="bluray-<?php echo $num; ?>">             <input type="radio" class="playbackformat-holder-radiobutton" value="bluray" name="playback_format[<?php echo $second_num; ?>]" id="bluray-<?php echo $num; ?>" <?php if($field['playback_format'] == 'bluray') { echo 'checked'; } ?>>Bluray
                      <label for="3d-<?php echo $num; ?>">             <input type="radio" class="playbackformat-holder-radiobutton" value="3d" name="playback_format[<?php echo $second_num; ?>]" id="3d-<?php echo $num; ?>" <?php if($field['playback_format'] == '3d') { echo 'checked'; } ?>>3d
         </form>
     second_num++;     }      And here is my save function to store the data into an array.               add_action('save_post', 'repeatable_meta_box_save', 10, 2);     function repeatable_meta_box_save($post_id) {              if ( ! isset( $_POST['repeatable_meta_box_nonce'] ) ||         !wp_verify_nonce( $_POST['repeatable_meta_box_nonce'], 'repeatable_meta_box_nonce' ) )         return;              if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)         return;              if (!current_user_can('edit_post', $post_id))         return;              $old = get_post_meta($post_id, 'repeatable_fields', true);         $new = array();              $playbackFormats = $_POST['playback_format'];                   $count = count( $names ) - 1;              for ( $i = 0; $i < $count; $i++ ) {              // currently only storing the last stored radio value         $new[$i]['playback_format'] = $playbackFormats[$i];              // save movie description          // and however you want to sanitize         if ( !empty( $new ) && $new != $old ) {             update_post_meta( $post_id, 'repeatable_fields', $new );         } elseif ( empty($new) ) {             delete_post_meta( $post_id, 'repeatable_fields', $old );         }          }      The problem I am facing is that , lets say I have three rows. If I set the first to DVD, the second to bluray and the third to 3D only the last value stores as 3D. All other `['playback_format']` store as 'null'. The way I have things set up it looks like things should be saving properly. This is a trimmed down version. I have input fields that are storing correctly, but the radio buttons have been a major issue. It looks like my save function should be storing each `['playback_format']` into its appropriate place in the array. But only one stores. I've gotten it to store the same value for all three rows, but can't get a unique value for each row and not sure why. Any help would be appreciated, as this is the last piece of the puzzle! Thanks! (Screenshot below for a visual aid) ![repeatable rows - visual aid](http://i.stack.imgur.com/rWQi2.jpg) Here is the value of `var_dump($field);` after storing the data in the screenshot above.               array(4) {       ["name"]=> string(116) "http://onecinephile.staging.wpengine.com/wp-content/uploads/2014/01/lon-chaney-phantom-hunchback-penalty-300x280.jpg"       ["select"]=> string(14) "Test #2"       ["url"]=> string(35) "Testing movie description #2"       ["playback_format"]=> string(3) "dvd"      }           array(4) {       ["name"]=> string(103) "http://onecinephile.staging.wpengine.com/wp-content/uploads/2014/01/spencer-tracy-boys-town-300x225.jpg"       ["select"]=> string(14) "Test #1"       ["url"]=> string(35) "Testing movie description #1"       ["playback_format"]=> NULL      }           array(4) {       ["name"]=> string(100) "http://onecinephile.staging.wpengine.com/wp-content/uploads/2014/01/Ronald-and-Madeleine-225x300.jpg" ["select"]=> string(14) "Test #3      ["url"]=> string(35) "Testing movie description #3"       ["playback_format"]=> NULL      }


get unserialized array without using get_option()

I'm working on a WPMU plugin that cycles through tables in each blog on the network. I can't use get_option to pull the settings array out of the `wp_n_options` tables, so I'm trying to do it by querying $wpdb and then using `unserialize()`. I know the query is successful because I can `print_r` `result`, but it's wrapped in an array, and I can't figure out how to just get the serialized string out of it. Any pointers? ---EDIT--- What it's actually returning is this: `stdClass Object ( [option_value] => ~serialized string~ )`


Injecting HTML on (arbitrary) admin pages

I would like to create a plugin that is able to inject some html on admin- pages, no matter if these are post, pages, settings or any option page for a plugin. So I am searching for a suitable hook, so that I could run code like this (pseudo-code):               function plugin_inject_html()     {         if( preg_match( '<regexp to parse the url>', $_SERVER['REQUEST_URI'] ) > 0 )         {             echo 'my html here';         }     }     add_action( '<the hook I am searching for', 'plugin_inject_html' );      So my question is: Which action or filter would be suitable to hook in, so that the result of the echo would arrive in the right location of the overall admin-page (inside the `div.wpbody-content`)?


Reset Password - change from name and email address

When the password reset goes out, the name is 'WordPress' and the from address is wordpress@domain.com. I need to change these to the company name. I'm running WordPress 3.8 multisite and have done the following:   * Updated general settings name and email address for the subsite   * Installed 'WP Change Email' plugin and updated the details However, this has no effect. I think its because the password reset side of things uses different hooks. I'm using the following code (from http://s14.codeinspot.com/q/2472332) in functions.php to customise the password reset title and body:               function my_retrieve_password_subject_filter($old_subject) {         // $old_subject is the default subject line created by WordPress.         // (You don't have to use it.)              $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);         $subject = sprintf( __('[%s] Password Reset'), $blogname );         // This is how WordPress creates the subject line. It looks like this:         // [Doug's blog] Password Reset         // You can change this to fit your own needs.              // You have to return your new subject line:         return $subject;     }          function my_retrieve_password_message_filter($old_message, $key) {         // $old_message is the default message already created by WordPress.         // (You don't have to use it.)         // $key is the password-like token that allows the user to get          // a new password              $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";         $message .= network_site_url() . "\r\n\r\n";         $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";         $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";         $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";              // This is how WordPress creates the message.          // You can change this to meet your own needs.              // You have to return your new message:         return $message;     }          // To get these filters up and running:     add_filter ( 'retrieve_password_title', 'my_retrieve_password_subject_filter', 10, 1 );     add_filter ( 'retrieve_password_message', 'my_retrieve_password_message_filter', 10, 2 );      However, I don't know how to extend this to change the from name and email address?


Get posts inside Get terms problem

i have a get_terms which loads correctly.   inside of it i have used get_posts. then using get posts i am   trying to get each post tags (and count <= not currently inside this script)               <?php         $categories = get_terms( 'blogs_cat', array(             'type'                     => 'blogs',             'orderby'                  => 'name',             'order'                    => 'ASC',             'hide_empty'               => 0,             'exclude'                  => '1',             'number'                   => '1000',             'pad_counts'               => true              )         );               echo '
';         echo '
';         foreach ($categories as $category) {                  $colorClass = '';                  // COUNT NUMBER OF TAGS AKA: PUBLISHED / NOT PUBLISHED ARTICLES             $termID = $category->term_id;             $taxonomyNAME = $category->taxonomy;             $termSLUG = $category->slug;                  $items = get_posts( array(                 'post_type'   => 'blogs',                 'numberposts' => -1,                 'taxonomy'    => $taxonomyNAME,                 'term'        => $termSLUG                 ) );             $totalPostsCount =  count( $items );                  // WHEN PRINT_R EACH ITEM RETURNS UNIQE ID             foreach ($items as $item) {                 $posttags = get_the_tags($item->term_id);                 if ($posttags) {                   foreach($posttags as $tag) {                     // HERE I GET SAME TAG NAME FOR ALL TAGS ACROSS POSTS (IN THIS CASE ITEMS)                     echo $tag->name;                    }                  }             }                       //print_r($category);             echo '

slug, 'blogs_cat') . '" title="' . sprintf( __( "All Articles By: %s" ), $category->name ) . '" ' . '>' . $category->name.'
 ('.$totalPostsCount.' / p'.$publishedArticle.')

';         }         echo '
';         echo '
';     ?>      . The Issuse is "echo $tag->name;" returns always the same tag.. can anyone help me to spot the problem / offer a better way   i might have gotten mixed with this script. Thanks **EDIT 1 - RESPONSE TO: @tollmanz** when i *"print_r($item);"* inside the foreach i get this   (similer to each post that exist with its own details):               stdClass Object (          [ID] => 875          [post_author] => 1          [post_date] => 2012-06-25 14:34:53          [post_date_gmt] => 2012-06-25 11:34:53          [post_content] => Content Content Content         [post_title] => itle Example         [post_excerpt] =>          [post_status] => publish          [comment_status] => open          [ping_status] => open          [post_password] =>          [post_name] => post-name          [menu_order] => 0          [post_type] => blogs          [post_mime_type] =>          [comment_count] => 0          [filter] => raw      )       . Also... When i _"echo $item->ID;"_ i get the correct post id.   .   BUt when i try to *"print_r($posttags);"*   after this line: *"$posttags = get_the_tags($item->ID);"*   .   **i get nothing... any ideas why?**


With WP 3.4 customizer, while using postMessage & working within your JS for one option, can you retrieve current value for another option?

I'm currently working with this awesome article by Otto: http://ottopress.com/2012/how-to-leverage-the-theme-customizer-in-your-own- themes/ For my question, I have two separately registered settings, and I'd like to see if I can get them to work together within my JS. ![enter image description here](http://i.stack.imgur.com/QPGSg.png) With both settings I can use jQuery bind to do alter things on site in real- time when each setting is changed, as the article explains. However, what I'm curious about is if when I'm working on one option, can I grab the current value from another option? Hopefully, this screenshot will illustrate what I mean. ![enter image description here](http://i.stack.imgur.com/ehS4B.png) Note: In this example, I could probably come up with some workaround to get the currently set font-size with jQuery to determine the current value, but I'm more asking just as a general example if this is possible. Thanks in advance!


After moving my site from a dev subdomain, to root, all my custom meta data is gone

I just movde my site from a dev subdomain, to the root. I have extensive amounts of data saved in custom meta fields which I created with the WpAlchemy class. All of this data is not appearing in the site (back or front end), although it appears to be in the database. This happened right after attempting to use the search replace plugin to change any lingering urls. This attempt ended in `Fatal error: Out of memory`. I noticed everything was gone, so I swapped out the db for my backup (after doing a manual search-replace for my subdomain). This produced the same result. I think I've read somewhere that data serialization (am I getting this right?) can mess up this kind of thing. Is that whats happening to me here? What steps should I take to get the site up and running ASAP. Currently it is live, and terribly broken :-(


Wordpress Site login problem with facebook, twitter and other social media

I am running My Wordpress Powered Website on a free hosted platform and the provider blocked PHP curl extension. I want to let visitors login with facebook and other social platforms. I tried with some wordpress plugins (e.g: nextend facebook connect, social connect etc.) But, those plugins requires curl extension to work. Is there any alternatives to activate facebook, twitter connect in my wordpress website for login? Any help or suggestion will be highly appreciated.


How can I get the name of term post meta value which equals term id

I have a custom taxonomy (location) that is being populated automatically by an advanced custom field on user save. The issue is that it saves the term_id in the postmeta meta_value field. When I echo that field in my archive or taxonomy template it obviously shows me the term_id and not the actual term name (ex. I get 41, instead of California displaying). I have tried multiple things to get this to appear and days and basically any query I do ends up just a blank space displaying on my archive/taxonomy page. Can anyone assist me in how I might retrieve the term name from the term_id being outputted? Thanks in advance!


Lightbox popup on WooCommerce add_to_cart action

I would like to create a modal 'pop-up' window in WooCommerce to appear when the "Add to cart" button has been clicked. This has to occur _after_ the WC actions that actually add the product to the cart but before/instead of any redirects. I have found several likely/possible hooks, actions and filters which may be useful to me but I am unsure which I need and how to use them properly (sorry I'm a total WooCom n00b):   * `woocommerce_template_loop_add_to_cart`   * `woocommerce_template_single_add_to_cart`   * `woocommerce_after_add_to_cart_button`   * there's also the `add_to_cart_redirect` filter for _$url_ I am also not sure how to actually _trigger_ the lightbox to appear from within PHP! (Okay in HTML I use an element like a hyperlink which has to be clicked, but how to trigger the same thing at a certain point in the PHP execution? -- Do I need AJAX?) Lastly I was planning to use ThickBox as it is bundled with WordPress, is there any reason to avoid this and or a better option available, or is there a lightbox implementation bundled with WooCommerce? Kind thanks for any and all help!


Can I make Wordpress use a custom template for a child page

I have a custom post type called communities. Then I have the appropriate single-community.php page. Works great! So we want to use some of these "communities" as parent pages. Then underneath them we'd have multiple child pages. Can I have the parent pages use single-community.php and the child pages use single.php or something similar?


Change permalink from wp_list_categories

**UPDATE:** This helped me:               $cat_name = 'onde-encontrar';     $category = get_category_by_slug( $cat_name );     $taxonomies = array( 'category' );     $args = array( 'parent' => $category->term_id );     $terms = get_terms( $taxonomies, $args );     foreach ( $terms as $term ){     echo "term_id}'>{$term->name}";     }      But this doesn't print **subcategories** , and I want to print subcategories too. Any suggestions? **OLD:** I have this code that works perfectly for what I want, but I want the link that shows the `wp_list_categories`, is the id of the category and not the permalink. For desire that when you click on the category it scroll down and does not change the main page ... My code:               <?php     $category = get_category_by_slug( 'onde-encontrar' );     wp_list_categories('title_li=&child_of='.$category->term_id);     ?>      What it shows me:               São Paulo      But I need:                São Paulo      something like that.


Text after more tag in posts

Hey, is it possible that i can put a chunk of code somewhere and it will show up after the more tag seperator but within the post ? I mean if i put more seperator after first paragraph then on post areas after that will show up the code i will put.. probably some html with a twitter and rss link. Help is appreicated :) cheers Ayaz


Replace all media (images)

I created a new theme for my Wordpress site and I need to replace all the media (images) on the site, since I am using all new image sizes (which are larger than the largest on my current site). 98% of the images will use the same names. Each post only contains one (featured) image and there are no images within the content area of the posts, so this makes the job slightly easier. I was wondering what the best (and cleanest) way was to go about doing this. I have considered the following:   * Using a Wordpress plugin   * Manually removing the featured images from all of my posts, deleting them and then manually adding the new images   * Deleting all my media in my uploads folder and replacing them with the new images then re-generating the image sizes via a plugin I was wondering if there were any other easier and cleaner ways to do this. Most of the ways I suggested above would add downtime to my site while I get all this done.


change backend header options

Wordpress is offering backend pages for header and background under the design tab, which can be activated inside functions.php. Is it possible to customize that options? For example I would like to have the possibility to choose a logo. Or would it be a better idea to not alter that pages and integrate the custom header/background options into my theme's options tabs instead?


issue with setting up permalink programmatically

I created a plugin that activate my theme programmatically. I want to set default permalink using programming. It does't seems to work with custom post types. it works well with default custom post type. I tried it on admin_footer hook with 9999 priority but not helped. The code i used is:               add_action('admin_footer','default_permalink',9999);      function default_permalink(){        if(get_option('change_permalink')!= 'post_name_permalink') {          global $wp_rewrite;         $wp_rewrite->set_permalink_structure( '/%postname%/' );         $wp_rewrite->flush_rules();          if(function_exists('flush_rewrite_rules')){            flush_rewrite_rules(true);         } //Set default permalink to postname end                update_option('change_permalink','post_name_permalink');        }     }      Please help.


Sub-domain or 2nd, temporary different domain?

I'm developing a Wordpress site for a website that already exists (that's not currently using Wordpress). The current website cannot be taken down until the new Wordpress site is ready to replace it. I've read the Moving Wordpress codex article and the Giving Wordpress it's Own Directory codex article but I cannot decide, and do not have enough experience to know, which method would be easier/more efficient when it's time to make the website switch?: **Option 1:** Develop the website in a subdomain (ie: http:// wordpress.website.com) **Option 2:** Develop the website on a 2nd, temporary domain (ie: http:// w3bsite.com) Any advice from those who have done either would be appreciated. P.S. The site has already been built locally, using Xampp, but now needs to be deployed online so others involved in the project can populate the site with content.


admin_notices not displaying in plugin

I know I'm probably doing something dumb here but I just can't get this to run. I'm trying to set up a little API for my plugin and to create a class to display admin notices a little easier. Here's what I have:               // Send data to class to get HTML for admin notice     $efpd=Efpdd::getInstance();     $plugin_update = $efpd->efpd_admin_notice(         $notice_info = array(             'type' => 'update',             'message' => 'The plugin has just been updated.',             'button' => 'Click for details'         )     );     //wp_die(var_dump($plugin_update)); // Testing output of admin notice HTML code     add_action('admin_notices',function(){echo $plugin_update;});      And in my class, there is this function:               public function efpd_admin_notice($data=array()){         extract($data); // Extracts $message, $type, and $button from $data array         if(empty($message) && !empty($type)){ // If no message was passed through the $data array, create one based on the type of notice passed, also begin the HTML output here             switch($type){                 case 'error':                     $message = 'There\'s been an error!';                     $return = "
\n";                 break;                 case 'update':                     $message = 'There\'s been an update!';                     $return = "
\n";                 break;                 default:                     $message = 'There\'s something wrong with your code...';                     $return = "
\n";                 break;             }         }         if(empty($button)) $button = 'Click Here';         $return .= "
{$message}
\n";         $return .= "
{$button}
\n";         $return .= "
\n";         return $return;     }      So I guess I'm asking, what am I doing wrong to get this admin notice to not show? Is there a workaround to get this to work? Thanks.


Sorting by 2 Custom Fields + Post Title

So I've successfully sorted my custom post type "property" based on it's city and state using this:               <?php     $querystr = "     SELECT wposts.*     FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta, $wpdb->postmeta wpostmeta2     WHERE wposts.ID = wpostmeta.post_id     AND wposts.ID = wpostmeta2.post_id     AND wpostmeta.meta_key = 'state'     AND wpostmeta2.meta_key = 'city'     AND wposts.post_type = 'property'     AND wposts.post_status = 'publish'     ORDER BY wpostmeta.meta_value ASC, wpostmeta2.meta_value ASC     ";$pageposts = $wpdb->get_results($querystr, OBJECT);?>      Now I'd like to add a third sorter, which would just be the post title (the name of the property). How can I add this in? What is the proper name for identifying the post title as part of the query string?


Displaying a message when plug-in is deactivated

I'm using the following code to deactivate my WordPress Plugin if the requirements are not met                   public function activate() {             if (!$this->check_requirements()) {                 deactivate_plugins(plugin_basename(__FILE__));                 wp_redirect(admin_url('plugins.php'));                 exit;             }         }      The function activate() is called when the plug-in is activated. I want to add a message to the user explaining what happened. Is there a way to do that?


Displaying icon image for WordPress post formats, is there a cleaner way to do this?

The code I am currently using in the loop is in this code snippet: https://gist.github.com/1316622 This just seems messy, and long. I am thinking the best method would really be to use CSS sprites and the post class, but for some reason I cannot put my brain around how to do this. I created another gist of the output of my WP loop, so you can see the post format is added to the class of the article. Not sure if that is the easiest method to address this, and am appreciative of any help: https://gist.github.com/1316633


How To Pass Array To get_the_category_by_ID() and Get An Array Back?

I am trying to pass an array of category IDs to `get_category_by_ID()` in order to get an array of category names back. Since I'm still trying to get this to work I'm just using `var_dump()` on the output. I'm using the values 1, 5, 3 since 5 and 3 are categories I have and 1 is uncategorized, which I need this to work for. I started with this:                   $CatID = array(1, 5, 3,);     foreach ($CatID as $ID) {          $names = get_the_category_by_ID($ID);     }     var_dump($names);      I returned the correct category name for category 3, but nothing else. So then I tried it like this:               $CatID = array(1, 5, 3,);     $x=0;     foreach ($CatID as $ID) {          if ($x==3) break;         $names[$x] = get_the_category_by_ID($ID[$x]);         $x++;     }     var_dump($names);      This time I got this array of errors:               array     0 =>      object(WP_Error)[262]       public 'errors' =>          array           'invalid_term' =>              array               ...       public 'error_data' =>          array           empty      1 =>       object(WP_Error)[261]       public 'errors' =>          array           'invalid_term' =>              array               ...       public 'error_data' =>          array           empty     2 =>      object(WP_Error)[215]       public 'errors' =>          array           'invalid_term' =>              array               ...       public 'error_data' =>          array           empty


Why are my widgets not saving when being added to a sidebar?

The following is in my `function.php` file. I see the sidebar in my `Appearance > Widgets` page but whenever I drag something on over the sidebar and save it just disappears once I leave the admin area. I've scoured the web and the only solution I seem to find is that I need to disable ALL plugin to find the culprit... which I've done to no avail. If I switch the theme to the WP 2012 theme then it seems to work, only my theme seems to break it.               add_action( 'widgets_init', 'ditto_register_sidebars' );          function ditto_register_sidebars() {         register_sidebar(array(             'name' => __( 'Right Hand Sidebar' ),             'id' => 'rightBar',             'description' => __( 'Widgets in this area will be shown on the right-hand side.' )         ));     }      This is my `sidebar-rightBar.php` file:               <?php     if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('rightBar') ) :     endif; ?>      and how I include it in my theme:               <?php get_sidebar( 'rightBar' ); ?>      Just a quick note, I'm running on version 3.5.2. I've tried to save in both Chrome and Firefox and my javascript console isn't giving me any problems. I've also tried to do it in accessibility mode with no luck. Any help is appreciated.


Post meta select input, if statement

I have created a meta box with a select input (drop down menu). It has a few values and I want to display different content depends on which value the user selects. I am just unsure how to display this conditional content with post meta select boxes.               Item One Select:     <select name="item_one" id="item_one">         <option value="option1" <?php selected( $item_one_selected, 'option1' ); ?>>Something 1</option>         <option value="option2" <?php selected( $item_one_selected, 'option2' ); ?>>Something 2</option>         <option value="option3" <?php selected( $item_one_selected, 'option3' ); ?>>Something 3</option>     </select>      Can I do something similar to a checkbox like:               <?php if (get_post_meta($post->ID, 'metavaluehere', true)) { ?>     //do something      <? } else { ?>     //do something else     <? } else { ?>     //do something else     <?php } ?>      I am just unsure the proper way to form this conditional statement with a metabox select input. In plain english I'd want this, using the top example: If option1 is selected do this, else if option 2 is selected do this instead, else if option 3 is selected do this... Any help would be greatly appreciated! Full code here:               <?php     add_action( 'add_meta_boxes', 'post_options_box' );     function post_options_box()     {         add_meta_box( 'post-options-box', 'Post Options', 'post_options_callback', 'post', 'normal', 'high' );     }               function post_options_callback( $post ){         $options_values = get_post_custom( $post->ID );         $item_one_selected = isset( $options_values['item_one'] ) ? esc_attr( $options_values['item_one'][0] ) : '';         wp_nonce_field( 'my_post_options_meta_nonce', 'post_options_meta_nonce' );      ?>
      Item One Select:         <select name="item_one" id="item_one">             <option value="option1" <?php selected( $item_one_selected, 'option1' ); ?>>Something 1</option>             <option value="option2" <?php selected( $item_one_selected, 'option2' ); ?>>Something 2</option>             <option value="option3" <?php selected( $item_one_selected, 'option3' ); ?>>Something 3</option>         </select>
                  <?php         }          add_action( 'save_post', 'post_options_save' );     function post_options_save ( $post_id )     {         if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;              if( !isset( $_POST['price_meta_nonce'] ) || !wp_verify_nonce( $_POST['price_meta_nonce'], 'my_price_meta_nonce' ) ) return;              if( !current_user_can( 'edit_post' ) ) return;                        if( isset( $_POST['item_one'] ) )             update_post_meta( $post_id, 'item_one', esc_attr( $_POST['item_one'] ) );               }     ?>


How to intercept Post Title on Post-Save

I am new to WP and I couldn't find this solution by myself. this is my function,               function explodetitletotags() {              global $post;              $title = $post->post_title;              $tags = explode(' ', preg_replace('/[^\p{L}0-9 ]/', ' ', $title));               foreach $tags as $tag {                  global $post;                  $thePostID = $post->ID;                  wp_add_post_tags($thePostID, $tag);              }          }          add_action('publish_post', 'explodetitletotags');           The Function works like a charm except **When the post title in the new single post page updated** , the title always give the previous value, not the value the last time I typed in the input title box. My assumption here is, `$title = $post->post_title;` in my function call the old version of the title from Database instead of the new version, I think why don't just grab the title before it sent to the Database so the title always the latest version, is this okay? If yes, Is there a way to intercept/catch wordpress on Post-Save before it's saved in wp_posts table Database? I am sorry for my English, since it's not my first tongue and Thank You for your help.


Automatically adding images to a certain page through the Media Uploader

I have a plugin that calls the Media Uploader to allow users to add images to a Page. The uploader is being displayed and taking images fine, but it is not attaching them to Page ID 65 as I wish (or showing images attached to that Page as in the Gallery). Am I missing something, or is this just not possible in WP? Thanks.               jQuery(document).ready(function($){              $('.manage-images-button a.button-secondary').on('click', function(){                  tb_show('Manage Front Page Images', 'media-upload.php?referer=dd-options&TB_iframe=true&post_id=65', false);             return false;              });          });


When do I need to use esc_attr when using WordPress internal functions

When I am putting a WordPress value inside the attribute tag, for example, the following method does not need `esc_attr` e.g.               // JS code     alert('<?php echo get_bloginfo('name');?>');      the following method does need `esc_attr`               // JS code     alert('<?php echo esc_attr($post->post_title);?>');      What is the convention used?


Disable or lock parent pages from being edited in wordpress admin

Is there a way to disable or lock parent pages from being edited in wordpress admin? I only want the children pages to be editable.


Renaming the Twenty Fourteen Wordpress theme

I know the benefits of creating child themes, but it in my case I really would like to create a theme based upon another one without any dependencies to a parent theme. I tried to use a `sed` command to replace all occurrances of 'Twenty Fourteen'/'Twenty_Fourteen'/ 'twentyfourteen' in all files, but that just doesn't seem to be enough, the theme gets broken. Is there a way to do this? Thank you. * * * Update - SOLUTION: Rename all instances of 'Twenty Fourteen', 'Twenty_Fourteen' and 'twentyfourteen' to your desired new theme name, watch out for case-sensitivity, it should work out. Use a code editor that can replace words in a directory, `sed` should also work if you know how to use it properly, unlike me.


meta box on custom post type

Okay I have look on the site and need more help! I am adding Learndash to my site and need a meta box to show on their custom post type pages. Here is the meta box code I have which works fine for just normal posts;                   // META          $prefix = 'dbt_';     $meta_box = array(         'id' => 'my-meta-box',         'title' => 'Post Customization',         'page' =>  'post',          'context' => 'normal',         'priority' => 'high',         'fields' => array(             array(                 'name' => 'Post Color',                 'id' => $prefix . 'color',                 'type' => 'select',                 'options' => array('orange', 'pink', 'green', 'purple')             ),             array(                 'name' => 'Image URL',                 'desc' => 'Optional',                 'id' => $prefix . 'img-url',                 'type' => 'text',                 'std'  => 'Image'             ),             array(                 'name' => 'Video URL',                 'desc' => 'Optional',                 'id' => $prefix . 'video-url',                 'type' => 'text',                 'std'  => 'Video'             ),             array(                 'name' => 'Link URL',                 'desc' => 'Optional',                 'id' => $prefix . 'link-url',                 'type' => 'text',                 'std'  => 'Link'             ),          )     );          add_action('admin_menu', 'mytheme_add_box');      Now how do I get it to show on all the following post types; sfwd-courses sfwd-lessons sfwd-topics ... Replacing `'page' => 'post',` with `'page' => 'sfwd-courses',` shows the meta box on the courses page but not normal posts. I thought the following should work but does not... `'page' => 'post', 'sfwd-courses', 'sfwd-lessons', 'sfwd-topics',` Please help...


Manually updating a plugin , is it overriding the previous settings of the plugin?

This is basiscly what i can't figure out ! I have some plugins that cant be updated automatically, so i want to update a plugin manually by replacing it with the newest version through ftp. maybe a noob questions but i really dont know. So does this override all settings i previously made with the plugin ? (since all files are replaced by the new version?)


Show full posts in archive

I have an issue where I need to display the full posts in my archive page. E.G. I have >two posts and I would like to have EACH of them displayed in full in the archive page. Thanks! How would I do this with the hueman theme? Here is the contents of the archive.php theme:               <?php get_header(); ?>
              <?php get_template_part('inc/page-title'); ?>         <?php if(function_exists('pf_show_link')){echo pf_show_link();} ?>
                       <?php if ((category_description() != '') && !is_paged()) : ?>
                     <?php echo category_description(); ?>
             <?php endif; ?>                  <?php if ( have_posts() ) : ?>
                     <?php $i = 1; echo '
'; while ( have_posts() ): the_post(); ?>                     <?php get_template_part('content'); ?>                     <?php if($i % 2 == 0) { echo '

'; } $i++; endwhile; echo '
'; ?>
                      <?php get_template_part('inc/pagination'); ?>                  <?php endif; ?>

          <?php get_sidebar(); ?>          <?php get_footer(); ?>      Here is the content.php file: " >
             <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">                 <?php if ( has_post_thumbnail() ): ?>                     <?php the_post_thumbnail('thumb-medium'); ?>                 <?php elseif ( ot_get_option('placeholder') != 'off' ): ?>                     <img src="<?php echo get_template_directory_uri(); ?>/img/thumb-medium.png" alt="<?php the_title(); ?>" />                 <?php endif; ?>                 <?php if ( has_post_format('video') && !is_sticky() ) echo''; ?>                 <?php if ( has_post_format('audio') && !is_sticky() ) echo''; ?>                 <?php if ( is_sticky() ) echo''; ?>                          <?php if ( comments_open() && ( ot_get_option( 'comment-count' ) != 'off' ) ): ?>                 <a class="post-comments" href="<?php comments_link(); ?>"><?php comments_number( '0', '1', '%' ); ?>             <?php endif; ?>

<?php the_category(' / '); ?>

<?php the_time('j M, Y'); ?>

             <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?>
              <?php if (ot_get_option('excerpt-length') != '0'): ?>
                          <?php the_excerpt(); ?>
         <?php endif; ?>
         Thanks for your interest!


Extending the user profile

Is there any way that developing a Wordpress admin panel like this would be possible? http://deanelliott.me/wp-content/uploads/account-backend.jpg My client wants it to be displayed within the website template aswell. I really don't want to have to outsource this, but I'm stumped as to how to achieve this. Any help would be greatly appreciated.


How to get url of a post from admin panel

I want to get post url from the back end edit post page, the edit post url is : www.ddd.com/wp-admin/post.php?post=1&action=edit the real post is: www.ddd.com/wp/?p=1 since the user can edit permalink, i need some wordpress parametrs so it will be constant. Looking for this answer:                global $post;      get_permalink($post->ID);      thx all


How do I access cPanel features within Wordpress?

Is there a plugin that can access cPanel features from within Wordpress? In particular I'd like to be able to:   * View bandwidth, quota and other server info from the WP Dashboard   * Access my webmail   * Access the file manager to edit files (useful for .htaccess, php.ini and non-WP files) I know I can just open a new tab and log on to my cPanel account, but it would be great if it could be integrated some how. If there isn't a plugin to achieve the above, then I suppose an easier way would be for some links to be added to the Dashboard menu (for example webmail and file manager) which would link directly to those sections in cPanel and perhaps open in an iframe. So, to recap... does a plugin exist to achieve the above (or it easy to make one) or if not, does a plugin exist (or how do I create one) that adds these links to the dashboard. Any ideas from people who use cPanel and WP on a regular basis would be helpful.


What is a reasonable memory limit for Wordpress

Although the accounts on my server generally have a lower memory limit, I've configured my Wordpress user accounts with a memory limit of 32Mb using the php.ini file and `memory_limit = 32M` Unfortunately I've found that I'm still getting the odd memory error, even on small tests blogs. I've had to increase the limit to 64Mb which in my mind seems a little high for normal usage. What should be a reasonable upper memory limit to have on standard Wordpress installs with popular plugins? For your information some of the plugins that I suspect might be causing memory issues are:   * W3 Total Cache   * Role Scoper   * Smush.it


WP_Query with checkbox meta_query - Wordpress

> **Possible Duplicate:**   >  WP_Query with checkbox meta_query Ok, so I have a custom post type and have used the Verve Meta Boxes plugin to create some custom meta values for the post type. The meta box is called 'Subjects' and has a checkbox list of subjects to assign values to it. For example, I have ticked Math, English and Science. Now I want to perform a WP_Query which will take an array of subjects selected by the user as an array, compare those subjects to those selected for the custom post type, and return posts if any of them match. Here's the code so far:               $subjects_array = explode("_", $_GET["subjects"]);          $args = array(                 'post_status' => 'publish',                 'post_type' => 'any',                 'meta_query' => array(                   // Not sure what type of meta query to do                         )             );               $query = new WP_Query($args);      To cut a long story short, I just need to know if there's a way to perform a meta_query which will compare an array against whatever format the data in the meta box is in? If this is not possible, I just need to know then I'll look at a different way of doing it, but I'm thinking there's perhaps some meta_query ability I don't know about. Any help would be much appreciated.


how to know if the post has pagination (<!--nextpage-->) or not

i need a solid solution for checking if a post has pagination or not, regardless of the number of current page in the pagination, and even if the post is in the first page of the pagination. the check is inside the loop. thanks.


Front End Dropdown Showing All Custom Post Type 'Agent'

Title says it all, I pretty much just want to put a dropdown list on the front end that will list all the posts of custom post type 'agent', preferably in alphabetical order, and go to that post when user clicks on it.


CSS isn't rendered on a post but just posted as text

I have a wordpress.com hosted blog at sergiotapiag.wordpress.com and I can't seem to get my code to be published with my required setting. Wordpress is not rendering my embedded stylesheet but displaying it's contents. I'm using Windows Live Writer 2011 and the Insert Code plugin to format the code. Any ideas on how to tell wordpress to RENDER the html/css i post and not just escape it as text?


Fix Admin Dashboard Posts tab

I have WordPress v3.5.1 and using a theme from WPZoom. I added an SEO plugin called WordPress SEO which in turn added 4 more columns to my Posts Admin table which caused the columns to squish together making it very hard to see all the posts now. I have tried to change the CSS in the admin CSS but that does not help at all yet when I do change it using Firebug it helps. how can I fix the squished columns? You can see a copy of the image for better understanding at http://justawebbie.com/facebook/post-window.jpg.


Frameworks for Premium Theming

> **Possible Duplicate:**   >  WordPress frameworks and parent themes I want to get my feet wet with wordpress premium theme development. I see lots marketplaces where developers sell wordpress themes (Such as themeforest.net). My guestion is, do developers use some kind of a wordpress framework that they bought and build all their themes on it, or do they develop their own framework? I assume that not all frameworks that are sold, such as Genesis or Thesis, will allow you to use their framework to build themes to be sold, but I would like to know if there are frameworks which do give you the freedom to sell themes using their framework as the basis?


How to install a plugin for a free WordPress site?

> **Possible Duplicate:**   >  How can I install a plugin on a Wordpress.com hosted blog? I've a free WordPress (xxx.wordpress.com) blog and now I want to install a plugin like the way I install them with my WordPress site at my own domain. Can't find it in the menu. Isn't this possible with a free WordPress site?


RSS Feed for posts containing any term from a taxonomy

I imagine the answer to this will be related to this question I asked yesterday: Custom Taxonomy WP_Query for All Terms in a Taxonomy? I would like to output an RSS feed containing all posts that have ANY entry from a particular taxonomy assigned to them. I can do this: http://blog.example.com/feed/?taxonomy=taxonomy-name&term=test-term To return all posts assigned to a particular term, but I would like to have a feed that shows all posts from all terms in that taxonomy. Thanks, Dave


wp_allow_comments checking for blacklisted words effectively

I have a big list of prohibited words on the DB. The problem Im running to is that no comment is getting through. They are all getting sent to spam. I was looking at comment.php and found the functions that are handling this. I dont wanna modify the core functions but to write my own. I tried something like `add_action( 'wp_blacklist_check', 'my_wp_blacklist_check');` and pad the words with spaces, so words like 'bi' dont conflict with... let say, the word 'combination'. Obviously my action did not work is there something Im missing? a different hook or something? Thank!


Want to have the Post editor remembering the last editing position

As you probably know the WordPress _theme editor_ remembers its last editing position, but I want my _post editor_ to do the same (it jumps to the top if you save a post/page).... Any tips/hacks how to resolve this ? Help with this is very much appreciated !!


Call custom post type by category

Ok, I used Custom Post Types Ui to create several custom post types. When setting up the CPT's I checked off that categories were enabled, and then I added a few categories to one of the CPT's. Now I'd like to call one of the categories (upcoming-meetings on a page, but it doesn't seem to be working. Here's my code:                   <?php $cpt = get_post_meta($post->ID, "my_meta_box_select", true); ?>              <?php $temp = $wp_query;          $wp_query= null;          $wp_query = new WP_Query(); ?>               <?php $wp_query->query("post_type= '.$cpt.'&paged=".$paged.'&showposts=5&cat=upcoming-meetings'); ?>      Any help would be appreciated. I looked around some, but didn't quite understand the difference between Categories and Taxonomies. If anyone wants to shed some light on that for me, that would be great as well. Thanks, Matt


"Quick Edit" > update clears out my custom meta values

I have two custom meta fields that I've enabled for each post, scottb_customHeader and scottb_customTitle These work fine as long as I'm using the full edit feature to edit posts. However, when I click "Quick Edit", then click "Update", my custom meta values for the post are cleared out. What do I need to do to resolve? Code is below...               add_action('save_post', 'custom_add_save');               function custom_add_save($postID){         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $postID;         }         else         {             // called after a post or page is saved             if($parent_id = wp_is_post_revision($postID))             {             $postID = $parent_id;             }                  if ($_POST['scottb_customHeader'])              {                 update_custom_meta($postID, $_POST['scottb_customHeader'], '_scottb_customHeader');             }             else             {                 update_custom_meta($postID, '', '_scottb_customHeader');             }             if ($_POST['scottb_customTitle'])              {                 update_custom_meta($postID, $_POST['scottb_customTitle'], '_scottb_customTitle');             }             else             {                 update_custom_meta($postID, '', '_scottb_customTitle');             }         }     }          function update_custom_meta($postID, $newvalue, $field_name) {         // To create new meta         if(!get_post_meta($postID, $field_name)){         add_post_meta($postID, $field_name, $newvalue);         }else{         // or to update existing meta         update_post_meta($postID, $field_name, $newvalue);         }     }


Automatic updates not working/plugins not installing

I am trying to run an automatic update from Wordpress 3.0 to 3.02. However, I get the following error message: "Unable to locate WordPress Root directory. Installation Failed" I also cannot install plugins on the same server. The error message for the plugins is quite similar: "Plugin could not be deleted due to an error: Unable to locate WordPress Plugin directory." I have contacted the host but they have not been much help. Any ideas would be greatly appreciated. Thank you! Jeff


Remove the Featured Image Meta Box

How can I remove the Featured Image meta box? I've tried using the `remove_meta_box` function and specifying the boxes ID but it doesn't seem to work like it does for the other native meta boxes. Here is the specific code I tried:               add_action( 'admin_menu', 'remove_thumbnail_box' );          function remove_thumbnail_box() {         remove_meta_box( 'postimagediv', 'post', 'side' );     }


How to add to a user_meta field (append)

Is this possible? I want to use Gravity Forms or another hook to somehow write to the END of a user_meta field - not overwrite it. For example... Before:               $purchase_history = get_the_author_meta('purchase_history', $user->ID);     echo $purchase_history; ('Concert in the Park 01/12/2004')      After:               echo $purchase_history; ('Concert in the Park 01/12/2004', 'Pancake Breakfast 05/15/2005')      Any ideas? Thanks.


Filter categories using tags

I have a website with the following categories:   * Videos   * Pictures   * Stories And I have a lot of tags like: Funny, Awesome, Mind Blowing, Crazy, etc. Is there a way I could filter lets say: Videos tagged as "Crazy"? I know you can do: http://domainname.com/tag/crazy/ But that would retrieve ALL content tagged as crazy, I just want "Videos". I've searched WP documentation without luck. Thanks! Johann


Strange problem with HIdden Input field and WPAlchemy

I've been going Bananas with this problem for hours trying to figure out what is wrong. I have this code, simple enough and used in a similar manner many times before:               <?php               //  Get the field: on_the_map         $mb->the_field('date_calendar_item_not_available');      ?>       <input type="hidden" id="date_calendar_item_not_available" value="<?php echo (!$mb->is_value('') && !$mb->is_value('NONE')) ? $mb->get_the_value() : 'NONE'; ?>" name="<?php $mb->the_name(); ?>">      Here's the issue, on this one particular WPAlchemy field. The value isn't set into the field even though there is a string of information there, such as:               '2013-01-18,2013-01-23,2013-01-24'      E.g:               <input type="hidden" id="date_calendar_item_not_available" value="" name="_WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked]">        Now if I follow that hidden field with an identical one the value is output to the second field.               <input type="hidden" id="date_calendar_item_not_available" value="" name="_WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked]">     <input type="hidden" id="date_calendar_item_not_available" value="2013-01-18,2013-01-23,2013-01-24" name="_WPAlchemy_Suppliers_Supplier_Details[date_calendar_item_provisionally_booked]">      I would like to mention that this may not be a WPAlchemy issue but maybe something I am doing wrong, or maybe something else entirely, as for some reason in Internet Explorer the value is output, but in the other browsers it isn't i.e. Chrome, Firefox and Safari. Am I making a stupid markup mistake?


How to update post parent?

I have an array of image id's and i want assign them to the specific post:               foreach ($image_ids as  $image_id)         var_dump(wp_insert_post(array('ID' => $image_id, 'post_parent' => $new_post_id), TRUE));      But there occurs error:               object(WP_Error)#252 (2) {       ["errors"]=>       array(1) {         ["empty_content"]=>         array(1) {           [0]=>           string(38) "Content, title, and excerpt are empty."         }       }       ["error_data"]=>       array(0) {       }     }      So is it possible to update the `post_parent` without updating other data?


Problem On Retrieving Post Meta Data on Custom Column

I am trying to add Custom post Metadata to a Custom Column. The meta-box has two text fields as Price and Company but When I publish a new post it just shows values from company in Price column and edit box also it retrieves the company value inside the Price box! Can you please let me know why I cant' retrieve the correct value in Custom Column? Am I doing something wrong in saving or retrieving the data?               add_action('admin_init', 'admin_init');     add_action('save_post', 'save_options');     function admin_init(){     add_meta_box(         "product_options",         "product",         "normal",         "low"       );     }          function product_opt(){     global $post;     $custom = get_post_custom($post->ID);     $price = $custom['price'][0];     $coMake = $custom['coMake'][0];          echo 'Price:         <input name="price" value="'. $price . '" style="width:250px;" />';          echo '
Company:         <input name="price" value="'. $coMake . '" style="width:250px;" />';         }          function save_options(){     global $post;     if (!isset($_POST['price']) || $post->post_type != 'product')     {         return $post;     }     update_post_meta($post->ID, "price", $_POST['price']);          if (!isset($_POST['coMake']) || $post->post_type != 'product')     {         return $post;     }     update_post_meta($post->ID, "coMake", $_POST['coMake']);         }                    add_filter("manage_edit-product_columns", "edit_col" );         add_action("manage_posts_custom_column", "custom_col");              function edit_col($columns){     $columns = array(         "cb" => "<input type ='checkbox' />",         "title" => "Product Title",         "price" => "Price",         "coMake" => "Company",         "type" => "Product Type"      );     return $columns;         }              function custom_col($column)         {     global $post;     switch ($column)     {         case "price":             $custom = get_post_custom($post->ID);             echo $custom['price'][0];             break;         case "coMake":             $custom = get_post_custom($post->ID);             echo $custom['coMake'][0];             break;         case "type":             echo get_the_term_list($post->ID, 'type', '', ', ', '');             break;     }        }      Thanks for comments and helps in advance