title: Suggest me plugin/widget (sidebar) for Sharing posts

text: Actually, i am an android programmer, but own a blog to post android tutorials, examples....etc. etc. I have noticed below plugin/widget on the left-side of an article on many websites, so can you please suggest me whats that plugin actually? Thanx, Paresh ![enter image description here](http://i.stack.imgur.com/pf8La.png)


title: Enqueue Wordpress plugin scripts below all other JS

text: I am developing a simple Wordpress app but I am having an issue as all of the plugin scripts are rendered before those which are enqueued in my `functions.php`. Here is a sample section of the `functions.php`:               function my_scripts() {         wp_register_script('app-js', get_template_directory_uri() . '/javascripts/app.js', array('jquery'), null, true );         wp_enqueue_script('app-js');     }     add_action( 'wp_enqueue_scripts', 'my_scripts');      The important this to note is that (following best practice my JS is set to render at the bottom of the page. I also have couple of plugins running on the theme. The problem is that the output looks like this:               <!-- Note the plugin appears first -->     <script type='text/javascript' src='http://localhost/wordpress/wp-content/plugins/my-plugin/acl-plugin.js'></script>     <!-- And the main JS appears second -->     <script type='text/javascript' src='http://localhost/wordpress/wp-content/themes/my-theme/javascripts/app.js'></script>     </body>     </html>      How can I force Wordpress to display the main JS (which I believe is rendered by `wp_head()` ) to appear above the plugin scripts? That way the plugins can reference JS functions that are in the main theme.


title: How to get 4 Posts after the 5 most recent ones

text: Well, I think the question might be a bit confusing. But well, I want to get the recent 4 posts, ignoring the first five recent posts. So in short the sixth, seventh, eighth and ninth - most recent posts.


title: Overwriting a Shortcode

text: I have a theme that extends the Visual Composer plugin with a slider on the front page. The slider will show five testimonials from five different customers. I want to add the featured image of each testimonial as the thumbnail in the slider. Here's the shortened code from the parent theme:               function jo_customers_testimonials_slider( $atts ) {         extract( shortcode_atts( array( 'limit' => 5, "widget_title" => __('What Are People Saying', 'jo'), 'text_color' => "#000" ), $atts ) );         $content = "";         $loopArgs = array( "post_type" => "customers", "posts_per_page" => $limit, 'ignore_sticky_posts' => 1 );              $postsLoop = new WP_Query( $loopArgs );         $content = "";              $content .= '...';         $content .= '...';         $content .= '...';              wp_reset_query();         return $content;     }     add_shortcode( 'jo_customers_testimonials_slider', 'jo_customers_testimonials_slider' );       My functions.php file:               function jo_customers_testimonials_slider_with_thumbnail( $atts ) {         extract( shortcode_atts( array( 'limit' => 5, "widget_title" => __('What Are People Saying', 'jo'), 'text_color' => "#000" ), $atts ) );         $content = "";         $loopArgs = array( "post_type" => "customers", "posts_per_page" => $limit, 'ignore_sticky_posts' => 1 );              $postsLoop = new WP_Query( $loopArgs );         $content = "";              $content .= '...';         $content .= get_the_post_thumbnail( get_the_ID(), 'thumbnail' );         $content .= '...';         $content .= '...';              wp_reset_query();         return $content;     }     add_shortcode( 'jo_customers_testimonials_slider', 'jo_customers_testimonials_slider_with_thumbnail' );      In theory, the function from my functions.php file should overwrite the shortcode from the parent theme. But nothing seems to happen when I use this code. What am I doing wrong? **Edit:**   Tried this code, but it still won't work.               function wpa_add_child_shortcodes(){     remove_shortcode('jo_customers_testimonials_slider');         add_shortcode( 'jo_customers_testimonials_slider', 'jo_customers_testimonials_slider_with_thumbnail' );     }     add_action( 'after_setup_theme', 'wpa_add_child_shortcodes' );      Also changed   `add_action( 'after_setup_theme', 'wpa_add_child_shortcodes' );` to   `add_action( 'init', 'wpa_add_child_shortcodes' );`   , but no difference in the outcome. **Edit 2 (With Solution):** Changing `add_action( 'after_setup_theme', 'wpa_add_child_shortcodes' );` to `add_action( 'wp_loaded', 'wpa_add_child_shortcodes' );` solved it.


title: Switch post status to draft during import

text: I want to export all information of a WordPress database. Then I want to import the database dump into another WordPress database without having anything automatically published after the import. I need to edit each one before publishing and publish all of them manually one by one. **Question:** How do I alter the post status during importing posts?


title: Set permissions to view custom admin pages by Role, not Capability

text: When using `add_submenu_page()`, Is there a way of specifying a Role instead of a Capability? I have added a menu to the WP admin area which has 4x sub-menu pages. The level of access to three of these sub-menu pages can be changed by admins via the other (Manage). I'm declaring the `$capability` parameter as a Role selected in the aforementioned Manage sub-menu page (I.e. `administrator`, `editor`, etc.), but this is not working. I'm sure that it used to though, and this is where I've hit a brick wall... I don't really want to specify a Capability because I use custom Roles, and while the Role `Marketer` might share all of the same Capabilities as the `Editor` Role, it wouldn't be appropriate for members to be able to edit custom header options.               add_menu_page(__('Custom Admin Branding'), __('Admin Branding'), 'dont-show-as-page', 'dd-custom-branding', '', 'dashicons-art', 81);     $this->pagehook['header']   = add_submenu_page('dd-custom-branding', __('Header'), __('Header'), $this->set_current_option['role_header'], 'dd-custom-branding-header', array(&$this, 'on_show_page'));     $this->pagehook['footer']   = add_submenu_page('dd-custom-branding', __('Footer'), __('Footer'), $this->set_current_option['role_footer'], 'dd-custom-branding-footer', array(&$this, 'on_show_page'));     $this->pagehook['login']    = add_submenu_page('dd-custom-branding', __('Login'),  __('Login'),  $this->set_current_option['role_login'],  'dd-custom-branding-login',  array(&$this, 'on_show_page'));     $this->pagehook['manage']   = add_submenu_page('dd-custom-branding', __('Manage'), __('Manage'), 'manage_options', 'dd-custom-branding-manage', array(&$this, 'on_show_page'));


title: Changing permalink settings causes 404

text: I would like to have permalinks of the form `http://localhost/mysite/sample- post/`. I tried to achieve this by changing the permalink settings in the admin panel to 'Post name' from default. But this causes 404: page not found error. I've tried with the other settings e.g., month and name, numeric etc. but all of them results in 404. The generated URL is changing according to the permalink setting though. Clearing the cache did not help either. Does something else need doing here ? Thanks. Edit: My server: lamp on ubuntu 12.4 lts Contents of the .htaccess               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /mysite/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /mysite/index.php [L]     </IfModule>          # END WordPress


title: more tag not recognized but content is truncating

text:
Specifying truncating posts of category 'news' on homepage. Trim works but not recognizing the `<!--more-->` code in posts... from homepage. code in homepage                   $posts=get_posts('category=14&post_type=post&showposts=4');     if ($posts) {       foreach($posts as $post) {         setup_postdata($post);         ?>
 <a href="<?php the_permalink() ?>"   ><?php the_title(); ?>

         <?php         if ($post->post_content) {           echo  $post->post_date . '
';           echo  get_the_excerpt();          }       }     }      and in **functions**               function new_excerpt_more( $more ) {         return ' Read more »';     }     add_filter( 'excerpt_more', 'new_excerpt_more' );


title: Make Two Views of Post Type Archive At Two URLs

text: _**Updates 6 Feb 14 to make more specific as requested in comments._** I have a post type, we'll call it "Projects", with the slug "projects" for which I'd like to offer two views:   1. list view **(default)**   2. map view I'd like those views to be at the following permalinks:   1. example.org/projects/ **(default post type archive page,`archive-projects.php`)**   2. example.org/projects/map/ How do I do handle instructing WordPress to use a specific template when accessing that one specific URL that would otherwise imply a specific Projects post? It would be nice if that redirect managed to keep the default post type archive query, but I can write a secondary loop in the template if necessary. I had initially thought endpoints were the answer, but I'm pretty sure that's not true. * * * ## Original Post I have a post type—"Projects"—for which I'd like two views of its post type archive. The first is a pretty-straight forward list of Projects sorted by category and the second is a mapped view of the projects. Making templates for those two views is not a problem. **How can I make these two different views of the Post Type Archive, each with a unique URL?** Ideally I'd like the first template to be the default at `/projects/` and the second view at `/projects/map/`. It seemed like a custom endpoint was the way to go, but this comment on an old question with a title that perfectly describes what I'm looking for suggests that there is no way to have an end point for only a custom post type archive. Should I use a custom rewrite, then, or should I even consider going with a more jQuery driven solution?


title: WP audio video player with previous next options

text: I need the audio video player plugin with the following controls: previous, next, play, stop options. It needs to play continuously like windows media player. I searched over, but couldn't find the exact one. Is there any possibility for this. Please do the needful. Thanks


title: category page template for custom post type

text: I want to create a template for category page for custom post type. I have tried with category-my-campcat.php and taxonomy-my-campcat.php. But when I click on category then it redirect to category.php page. Also How can I check that I am on category page in wordpress. from is_category() ??? I have tried it but no success...


title: WordPress | Theme error

text: I have placed and previously used WordPress source on my web server everything is up and running including the DB. I even can access the site's admin page but in the theme settings page (Appearance/Themes) I'm getting these errors.               Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/mysite/wp-includes/theme.php on line 513          Warning: uksort() [function.uksort]: The argument should be an array in /var/www/dialog/wp-admin/themes.php on line 73          Warning: array_slice() expects parameter 1 to be array, boolean given in /var/www/dialog/wp-admin/themes.php on line 94          Warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/dialog/wp-admin/themes.php on line 150          Warning: natcasesort() [function.natcasesort]: The argument should be an array in /var/www/dialog/wp-admin/themes.php on line 151      tried re-uploading the content but didn't work.I'm confused of what causing this error. Thanks.


title: Shortcode callback for add_action('wp_footer')

text:
I am trying to build a Google Maps shortcode using the gMap plugin from Github, not a plain iframe. For which I have to echo a custom inline script for EACH shortcode, right before the closing body tag, after jQuery and all other scripts have been loaded. The following shortcode works, but it only adds the inline script once, not for every shortcode. When I add three [map] shortcodes, it should add the inline script for each og the shortcodes, three inline scripts, to the footer. But it only adds one script. Which is the one from the last shortcode.               class map_class     {         protected static $var = '';              public static function map_callback($atts)          {                  extract(shortcode_atts(array(                     'address'               => 'Main Street, New York City, United States',                     'zoom'                      => '14'                 ), $atts));                      $id= rand();                      $script  = '';                 $script .= '';                  self::$var = $script;                  add_action( 'wp_footer', array ( __CLASS__, 'footer' ), 20 );                          return '

';                    }              public static function footer()          {           echo self::$var;         }          }     add_shortcode( 'map', array ( 'map_class', 'map_callback' ) );      $script is holding all three inline scripts, but when I try to call $script in add_action like this:               add_action( 'wp_footer', array ( __CLASS__, $script ), 20 );      .. I get the following error: "First argument is expected to be a valid callback" I appreciate any help here.


title: How to change the quantity of feeds in custom post type?

text: I created a custom post type "podcast" and all podcasts are inside it. when I visit `http://example.com/?feed=podcast`, it only shows latest 10 podcasts. How do I change it to 99? I googled and found the code below:               function feedFilter($query) {     if (is_feed()) {         $query->set('posts_per_page','30');     }     return $query;}     add_filter('pre_get_posts', 'feedFilter');      It doesn't work. How to customize the feed items quantity in a custom post type?


title: How to register and enqueue JavaScript files without breaking plugin dependencies?

text: In theme development, what is the best way to register and enqueue JavaScript files to avoid problems with plugins? I want to create a theme which uses scripts like jQuery, Masonry and so on. I downloaded the scripts and added them via the reqister and enqueue function to **avoid problems with Wordpress Updates**.               function my_scripts() {       // Register scripts       wp_register_script( 'my_masonry', get_template_directory_uri() . '/js/masonry.pkgd.min.js', array(), '1.0.0', true );        // Add scripts before closing body tag.       wp_enqueue_script( 'my_masonry', true );     }          add_action( 'wp_enqueue_scripts', 'my_scripts' );      **The other way** would be to use the built-in Wordpress scripts to may avoid problems with plug-ins.               function my_scripts() {       // Add scripts before closing body tag.       wp_enqueue_script( 'masonry', true );     }          add_action( 'wp_enqueue_scripts', 'my_scripts' );      What is the better approach?


title: Should I escape wordpress functions like the_title, the_excerpt, the_content

text: I had look at the code but I couldnt see any escaping on funcions like `the_title` `the_content` `the_excerpt`etc. I might not be reading it right. Do I need to escape these functions in theme development like: `esc_html ( the_title () )` Edit: as pointed out in the answers below the above code is wrong regardless - the code should have read `esc_html ( get_the_title () )`


title: Can't Access Subdirectory

text: I've moved my blog from http://leghumped.com/blog to http://leghumped.com/ and now I can't access my /images directory. I've tried every combination of rules from trawling for people with the same problem, but it seems most of them say it "just started working". This is my root .htaccess               # BEGIN WordPress>     RewriteEngine On     RewriteBase /     RewriteCond %{REQUEST_URI} !^/images/     RewriteCond %{REQUEST_URI} !^/images     RewriteCond %{REQUEST_URI} !.*images(.*)     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     RewriteRule ^index\.php$ - [L]          # END WordPress     RedirectMatch wp/(.*)$ http://leghumped.com/$1      I know I'm typing the filename correctly, but I can't access anything in /images.


title: LIKE %...% Meta Query

text: I have a serialized array as a meta value and I'm trying to run WP Query where it finds a specific value in the serialized array. Here's an example of the serialized array field:               a:6:{i:0;s:3:"173";i:1;s:3:"172";i:2;s:3:"171";i:3...      Here's my query, but it doesn't work: The ID's are numberic I'm doing a search for as well.               $practiceArgs = array(         'post_type' => 'attorney',         'post_status' => 'publish',         'posts_per_page' => -1,         'meta_query' => array(                             array(                                   'key' => 'practice_area',                                   'value' => $post->ID,                                   'compare' => 'LIKE',                                   'type' => 'NUMERIC'                                   )                             )     );      I've tried using `'value' => '%'.$post-ID.'%'` in my queries, but it doesn't seem to work as well. Anyone ever had any experience working on this?


title: Why is WordPress saving full-urls to the database?

text: Every time im about to put my local project into staging/production environment im beeing hardly reminded that WordPress saves all the urls as absolute.So i need to rewrite all the urls with a SQL-query, or use something like Search-and-replace script. **But why is WordPress doing this?** What is the benefits? Is it a must for WordPress to work correctly? There are themes like Roots where there are functions like `roots_root_relative_url` using `preg_replace` to remove the full url. Wouldn't it be better to only have relative urls, **what is the downsides of that?** **The benefits of Relative urls in the database can be:** Easy migration from local to stage/production on all links, attachments and so on. Cleaner, shorter urls in html. But, Because WordPress doing absolute urls i sure that its good, im only want to now why and why not.


title: Insert data on comment post

text: I am trying to find reference for comment_post to insert custom data to custom table when comment post. I want to insert below things to my custom table   1. Comment's Post ID    2. Custom content (which will done with custom query) Can anyone please help me to do this?


title: Problem by $output and permalinks

text:
I have a problem by `$output` in a plugin in My custom Template, I do it this:               $output .= "
'".php the_title()."'>
";      But the link doesn't work it return just the normal text and not the link to the post, can somebody help me?


title: Replacing WordPress Icons (menu,icons32, etc)?

text: I want to replace wordpress admin sprites. I recreated the images and looked answrs for icon replacement using jquery and simply with CSS BUT what about ones link icons32-2x.png where I can't find the CSS? So I am trying to figure out a simple way to redirect the wordpress admin and includes folder to use my new icons INDIVIDUALLY. Again this is just not for custom post type icons but all. Basically I think through jQuery using replaceWith new icon but how can I replace an image if I don't know where its called in CSS (i.e. retina images) so I need a resolution to direct specific images in admin wp-admin and wp- includes folder.   * mydomain.com/wordpress/wp-admin/images/   * mydomain.com/wordpress/wp-inlcudes/images


title: Custom post type permalink endpoint

text: I have a custom post type called "destinations" and I have set the EP mask for the post type to default EP_PERMALINK. I have added a couple of endpoints as follows :               add_filter( 'query_vars', 'add_query_vars');          function add_query_vars($vars){         $vars[] = "tours";         $vars[] = "activities";         return $vars;     }          add_action('init', 'add_endpoints');          function add_endpoints(){         global $wp_rewrite;               add_rewrite_endpoint('tours', EP_PERMALINK);         add_rewrite_endpoint('activities', EP_PERMALINK);              $wp_rewrite->flush_rules();     }      Now if I test this on a normal post it redirects to the template that I need it to (I have a template redirect for the single template hook) ie. somesite.com/test-category/test/activities/ But for the post type (which is hierarchical) it just removes the endpoint from the url and stays on the single-destination.php template ie. somesite.com/destination/south-africa/kruger-national-park/activities/ becomes somesite.com/destination/south-africa/kruger-national-park/ Any help or guidance will be greatly appreciated. I have been struggling with this for hours and no results :( Thanks


title: Can I display submenus in groups, using wp_list_pages?

text: Say I have top-level(parentless) pages called **Fruit** , **Animals** , **Cars**. When, say, **Fruit** is selected I would like to show links to the individual **fruit** pages below. I would like to be able to dislpay these **fruits** (or **animals** , or **cars** ) in several groups with a space between each group of fruits.. a bit like this               +---------------+-----------+--------+     |   Fruit       |  Animals  |  Cars  |     +---------------+-----------+--------+        |   Apple       |           |        |     |   Kiwi        |           |        |     |   Watermelon  |           |        |     +---------------+-----------+--------+       |   Banana      |           |        |     |   Lemon       |           |        |     +---------------+-----------+--------+       |   Strawberry  |           |        |     |   Raspberry   |           |        |     +---------------+-----------+--------+        You can see in this case, I have roughy divided the **fruit** by color, putting a space inbetween. For **cars** or **animals** it might be another criteria. This criteria does not have to be explicitly named anywhere. So I wondering how to output this list, in a way which requires little techinical ability for the person who enters the pages in the backend. At the moment I do this to output the child pages:               if( $post->post_parent )         $children = wp_list_pages('depth=1&title_li=&child_of='.$post->post_parent.'&echo=0');      else         $children = wp_list_pages('depth=1&title_li=&child_of='.$post->ID.'&echo=0');          echo $children;      But I can't see a way to limit the output to categories, or something similar, using wp_list_pages. The nearest I can see is the 'authors' option, but it doesn't make much sense to login as different users to create different blocks in the menus...


title: Show the title of the latest post by author

text:
I have the following function which I use to show the author name,author avatar and the author biography in a div. I need to show the title of the latest post by the author along with this. Can anyone help?               function ajaxified_function()      {          $response = new WP_Ajax_Response();         $id        = $_POST['author_id'];         $auth_name = get_the_author_meta('display_name', $id);         $avatar    = get_avatar($id);         $desc      = get_the_author_meta('description',$id);         $auth_desig  = get_the_author_meta('designation', $id);         $output = "
$auth_name
\n
$auth_desig
\n
$avatar
\n
$desc
\n";         $response->add(array(         'what' => 'has',         'data' => $output     ));      $response->send();     }


title: What is the action or filter for adding information under the Permalink in Edit Post/Page?

text: I would like to add some HTML under the "Permalink:" in the Edit Post/Page page. Under here: ![Under Here](http://i.stack.imgur.com/mPAR5.png) So what is the action or filter?


title: Category Foreach keeps looping?

text:
I'm using the following code to acquire all the child categories of a category and displaying the child posts of the child categories.               <?php     $cats = get_categories( 'child_of='.get_query_var( 'cat' ) );          foreach ( $cats as $cat ) :              $args = array(             'posts_per_page' => 3, // max number of post per category             'category__in'   => array( $cat->term_id )         );         $my_query = new WP_Query( $args );               if ( $my_query->have_posts() ) :             echo '
'.$cat->name.'
';             ?>                  <?php while( $my_query->have_posts() ) : $my_query->the_post(); ?>                 <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
               <?php endwhile; ?>              <?php else : ?>             No Posts for <?php echo $cat->name; ?>         <?php endif; ?>     <?php endforeach; ?>      and i want to acquire this output.                Cat Child 1      -Post1 Child 1      -Post2 Child 1      -Post3 Child 1      -So on... .           Cat Child 2      -Post1 Child 2      -Post2 Child 2      -Post3 Child 2      -So on... .      But instead of that, both the child categories are being repeated over and overagain. Can anybody tell me what the problem is? This is the output I have now.                Cat Child 1      -Post1 Child 1      -Post2 Child 1      -Post3 Child 1      -So on... .           Cat Child 2      -Post1 Child 2      -Post2 Child 2      -Post3 Child 2      -So on... .      Cat Child 1      -Post1 Child 1      -Post2 Child 1      -Post3 Child 1      -So on... .           Cat Child 2      -Post1 Child 2      -Post2 Child 2      -Post3 Child 2      -So on... .      Cat Child 1      -Post1 Child 1      -Post2 Child 1      -Post3 Child 1      -So on... .           Cat Child 2      -Post1 Child 2      -Post2 Child 2      -Post3 Child 2      -So on... .      until it loops 9 times and stops. what is the problem?


title: W3 Total Cache, RackSpace Cloud Files, and Forcing Downloads

text: I'm using W3 Total Cache's CDN connection to RackSpace CloudFiles to serve severall hundred media files. My goal is to get the files to download in the user's browser, rather than stream. According to the CloudFiles Documentation (http://docs.rackspacecloud.com/files/api/v1/cf-devguide-20111115.pdf) I can set the Content Disposition headers. Does anyone know how this can be done via W3 Total Cache or, perhaps, around with it? Or, alternatively, do you know of another way to force downloads for files served via the CDN?


title: how to 301 redirect from a plugin folder

text: Some how google indexed a directory inside one of the plugins I use. I cannot figure out how to set a 301 redirect from the indexed path to the home page. has anyone else seen or dealt with this? here is what google indexed. I have replace all personal information with generic. http://www.domainname.com/wp-own-dir/wp-content/plugins/plugin-name- here/directory-in-plugin/


title: Facebook comment box won't show on main page

text: I have a custom pinterest like theme, you can see it here: http://www.recipetags.com/ If you click an image, the post comes up, but the FB comment box won't show, it's right under the title of the image. If I inspect that area, I can see that the code for the FB comment box IS being inserted, it's just not showing. When you click an image, and look in the address bar, the url to the post is displayed. If you click inside the address bar and go to the post, the comment box DOES show there. I'm using a FB comment plugin, but I get the same result when I use the code supplied by FB developers. What could cause the box NOT to show, even though the code for it is there? I hope my question is clear.


title: Restrict post to user_id

text: I only want a post to be viewable by the administrator and one user. (So I would have a post for each user) I am thinking of using the Members plugin and meta-data/custom fields to restrict the content. This would effectively make the post private to only those with access and any one else would not even see the post and if they get the url, they will be denied. So would using the Members plugin be the best choice or should I try a different method? and how?


title: Problem on the_excerpt(); function <the_excerpt> <the_content>

text: I am working on wordpress but I have problem when I write   the_content('read more'); then on indexpage each post load full data of post but I want to but when I am using the_excerpt(); then wordpress return a 10-15 word on index page and when i click for read more or click on title of post then 30-40 words just show without images... Please help me what should I do? check here is screenshot


title: Make Terms Under Custom Taxonomy Use Specific Single.php Template

text: Yesterday some wonderful people helped me solve the issue here about templates for custom taxonomy terms. Now I have a related question. Again, I have a custom post type set up in my functions.php called "Research" I have a custom taxonomy called "Classifications" Under that taxonomy I have the terms: oldresearch (parent) --- subcat1 --- subcat2 I need all the single pages under this term "Old Research" and in the sub cats to use one template. I already have a single-research.php that is being use elsewhere. So that's not my preferred option. Any ideas? Please be detailed as I'm a PHP newb - sorry. lol Thanks in advance!


title: How to diplay a div only if at least one author custom profile field is filled?

text:
I try to build a small plugin that adds few social profile fields to WordPress user form and display their social icons to the author meta box on single post. The problem I face is as follow: The frontend social icons are enclosed in a div with a certain height and background color(via css). If no field is filled by the user, my div still appears but empty(normal) with defined height and background color, what is unaesthetic. How can I make that div not appearing if not filled at least one social profile field? Here's my code snippets used so far (pseudo codes), that I think are necessary to illustrate my problem :               class My_Social_Icons {              static $social_icons_array = array(             'digg'          => 'Digg',             'dribbble'      => 'Dribbble',             'facebook'      => 'Facebook',             'flickr'        => 'Flickr',             'github'        => 'Github'             );          } // class end               function social_extra_fields( $extra_fields ) {              foreach ( My_Social_Icons::$social_icons_array as $social_id => $social_name ) {             $extra_fields[$social_id] = $social_name;         }         return $extra_fields;     }     add_filter( 'user_contactmethods', 'social_extra_fields' );      And here is the output that will display the social icons in frontend:               function display_icons( $icons = '' ) {              $social_icons_fields = get_the_author_meta(???);              if ( !empty( $social_icons_fields ) ) { // here I need to check if at least one field is filled             $icons .= '
':     // here is my code to display the social icons, not mentioned here             $icons .= '
';                  return $icons;         }     }     add_filter ( 'the_content', 'display_icons', 0 );      Any help would be greatly appreciated!


title: Why does a variable work on the front page but return NULL on all other pages?

text: Hey all. For my theme, I have multiple sidebars. Each sidebar file has a variable of $sidebar_id assigned to it. So, for sidebar-1.php, $sidebar_id = 1, for sidebar-2.php, $sidebar_id = 2, and so on. Each sidebar has an action hook inside of it. Then I write a function to hook on to the sidebar action hook. Within the function, I reference $sidebar_id to display different content in different sidebars. WordPress recognizes the value of $sidebar_id on the front page. But on archive pages, single pages and single posts, $sidebar_id always returns NULL. Even if I declare it as a global in my function. I don't get why the function can recognize the variable on the front page but it can't on all other pages. Any insights would be greatly appreciated. For example, here is my function:               function archive_only() {     global $sidebar_id;     if($sidebar_id == "archives") {     echo "only show on archive sidebar";          }     } add_action('cpress_sidebar_after', 'archive_only');       It works on the front page but doesn't on any other pages. $sidebar_id is defined in the sidebar template files.


title: convert Custom Fields Option-Values to Tags/Taxonomy

text: I have Custom Post Type "Places". In that I have Created Custom Fields. Like: **Option Title »** Type of Pub   **Option values »** Sports, Rock, Biker, Beer, Live Band, Restro, Gastro, Irish, Karaoke Bar   **Field Title »** Type of Pub   **Field name »** typeofpub What I want is to convert each title and values to tags. So that I should be able to click on them. And when I click on them it should go to the `archive- tags.php` and display all the posts with that option value.


title: Pagination Issues using WP_Paginate Plugin

text: So I have read more posts and articles about this issue than I care to admit and still nothing I can find works. Here is the issue - I can not get the pagination to advance and it shows all the same posts over and over - like I have seen in other posts. **Here is what I am using (2 seperate templates for different categories):**               <?php     $paged = get_query_var( 'page' );     query_posts('cat=4&paged='.$paged);     if(have_posts()) { while(have_posts()) { the_post();      ?>      **It works fine , but then I go to the only other page on the site - which uses the same code in the loop, different category (3) and it does not work there, it is not a typo, etc.** **I have also tired the following:** if(have_posts()){ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts($query_string . "&cat=4"); while(have_posts()){ the_post(); global $more; $more = 0; **OR**               query_posts('cat=3&paged='.get_current_page());       if(have_posts()){       while(have_posts()){       the_post();       global $more;       $more = 0;      With the get_current_page function, I used this hack, which I was told by WP VIP was not the way to do things (but it worked for both pages):               /* Get current page for paginaton navigation */      function current_page() {      $pageURL = 'http';      //check what if its secure or not      if ($_SERVER["HTTPS"] == "on") {      $pageURL .= "s";      }      //add the protocol      $pageURL .= "://";      //check what port we are on      if ($_SERVER["SERVER_PORT"] != "80") {      $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];      } else {      $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];      }      //cut off everything on the URL except the last 3 characters      $urlEnd = substr($pageURL, -3);      //strip off the two forward shashes      $page = str_replace("/", "", $urlEnd);      //return just the number      return $page;      }      **Please help!!!**


title: How Do I Link My Whole Featured Article Image?

text: I'm using the Front Slider plugin to display featured articles on my site. I've done some editing to the plugin to make it look the way I want. Somewhere along the way, I must have missed changing a value, because the top half to the image for the article being displayed links to the article while the bottom half does not. Assuming it's as simple as I think, all I need to know is what code I need to find and replace. Thanks in advance.


title: Ad rotator script for Adsense/CPA rotations. Ideas? Existing Solutions?

text: My theme handles Adsense inclusion automatically for the end user. I'm looking to add a feature that allows them to rotate in CPA ads in place of the adsense ads (on a set frequency by percentage). In other words, they can specify an image and url, then assign a weight to the CPA ad unit to determine how often it gets inserted in place of the adsense code. Are there any examples or existing plugins that do this well?


title: WP 3.0.5: Best way to add custom metaboxes for post categories?

text: I haven't been working with WP for a while and noticed that there are some new features in WP 3+ such as creating meta data for taxonomies. I'd like to be able to add unique meta data setups for different categories on my posts - what would be the best approach for this? Take for example the following categories: "press releases"   "cases"   "concepts" In the first, I'd like the admin to be able to attach more than just 1 image (the default thumbnail). In the other two I need the option of an additional textbox. Is this easier to do with custom post types? I'd rather work with the regular post categories. Thanks,   -Staffan


title: How to include PHP files in plugins the correct way

text: My problem is when on the main plugin file i include a php file something like this:               include(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php');     //or     include_once(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php');     //or     require(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php');     //or     require_once(WP_PLUGIN_URL . '/wordpress-group-buying/ipn/paypal-ipn.php');      and on that file i have a call to a WordPress function like add_action('hook,'callback'); and i get **Fatal Error: Call to undefined function add_action() ....** now before you say "use if( **function_exists** ('add_action')){" if i use that then it just doesn't work. ## the questions:   * what would be the correct way to do that?   * what are the difference between include ,include_once,require and when do i use witch? thanks for any help!


title: Restore svn trunk of my plugin repository to the initial state?

text: I messed it up and I don't know how to fix it. I thought it would be easier if I just literally delete all the files and start over again. Is there a way to do it? I tried some tips in google to no avail. Neither 'svn cleanup' nor 'svn delete' works. :-(


title: permissions on themes directory

text: I have a `ftp` user like owner of all files and directories. When I try to modify any file (e.g. `styles.css`) with Editor from Admin Panel I see this message:               To save the changes, is needed that the file has write permissions. Visit the codex for more information.      (I've translated the message so it won't be the exact text in english) I've tried to change group owner to my Admin Panel user name and give `0664` permissions to all files inside the theme directory, but it doesn't work:               cd /wp-content/themes     chown -R ftpuser:adminPanel twentythirteen/     find twentythirteen/ -type f | xargs chmod -R 0664 //this will change all files inside `twentythirteen` (not directories) into 0664 mode      The only way I've found to achieve it is giving `666` permissions:               find twentythirteen/ -type f | xargs chmod -R 0666      but I don't want it. How could I handle this?


title: No "Users" tab for other administrator-level users

text: I have WP working great for me and I'm the main 'admin' user. I've created Administrator-level accounts for other people in my company. When they log in, they see exactly what I see except they don't see the "Users" tab. Is this a feature of WP, that only the main (original user #1) 'admin' can see the Users tab? Or a bug?


title: How to retrive Custom Post Type Meta Fields in Custom WP_Query

text:
Can some one let me know How I can render the Custom Post Type Meta Fields (Meta-boxes). I have a Custom Post Type Called "News" and I successfully added a Metabox to my Custom Post Type called "News Info" which is suppose to store :   **A TextField = News Resource      A Select option = News Type      A check box** ![enter image description here](http://i.stack.imgur.com/4s1a9.png) I can retrieve the Custom post Type "News"content using a custom Loop as:               <?php      $args = array( 'post_type' => 'news');      $loop = new WP_Query( $args );      while ( $loop->have_posts() ) : $loop->the_post();         the_title();         echo '
';         the_content();         echo '
';      endwhile;     ?>      But I have no idea how to get the associated meta fields to "news" posts? trust me I Google this a lot but couldn't find any solution all of them just tried to render the Metabox on the admin page but no sample for presenting on the page! Can you please let me know how I can get access and render the data on the page using the wp-query loop? Thanks


title: Prevent Wordpress from sending emails

text: It seems like some wordpress installations on my server are sending spam. How can I find out, which script in the wordpress installation is sending it? Are these notifications on comments? Or fake comments? each time suche a mail is sent this shows up in syslog:               grep 6AE861E102E1 syslog                    Sep  6 15:53:49 myserver postfix/pickup[25439]: 6AE861E102E1: uid=33 from=<www-data>       Sep  6 15:53:49 myserver postfix/cleanup[32763]: 6AE861E102E1: message-id=<9a05e17c68fc8e2698d9bfe5943df86f@www.someblog.de>        Sep  6 15:53:49 myserver postfix/qmgr[1768]: 6AE861E102E1: from=<www-data@www1.myserver.de>, size=5334, nrcpt=1 (queue active)      Sep  6 15:53:50 myserver postfix/smtp[32765]: 6AE861E102E1: to=<ba.em@live.de>, relay=mx1.hotmail.com[65.54.188.72]:25, delay=1.6, delays=0.12/0.01/0.49/0.94, dsn=2.0.0, status=sent (250  <9a05e17c68fc8e2698d9bfe5943df86f@www.someblog.de> Queued mail for delivery)                                     Sep  6 15:53:50 myserver postfix/qmgr[1768]: 6AE861E102E1: removed


title: Custom fields not showing on front-end after xml import

text: I've just imported 700+ custom posts from one WP install to another using the XML import/export option. Everything seems to be imported fine: the field values are showing in the DB and on the admin side. However, if I try to get the field value on the front end by `get_field('field_name')` (I use Advanced Custom Fields), the value doesn't show. It does show when I save the corresponding post. Now I'm not planning on saving 700+ posts one by one, and I also don't want to do a clean WP install as suggested here.


title: adding multiple sidebars on pages

text: I am using twentyten theme and I want there to be two sidebars on my page - one on the left and the second on the right.   Can any one tell me how to do that?


title: Author must complete profile info before they can publish a post?

text: I am creating a real estate site where user info is essential part. The author info need to display under their post so that the visitor know how to contact them. Thus, the contact info in profile page is an essential part that the author must be filled. So I like to know is there anyway to force author to complete the profile information before they can publish a post??


title: One category not displaying template updates

text: I've tried refreshing, clearing the cache, opening in a new browser, renaming it from index to category.php-- ALL but one category display the correct template. I'm beyond stumped. One clue is that if I omit the loop from the template, the sidebar shows up. Otherwise it gets the 'cached' or previous version of that template page.


title: Changing wordpress permalinks for new posts only

text: I currently have many posts using the default permalink structure, domain.com/?p=123 I would like my new posts only to use a different permalink structure, domain.com/year/month/post/ The problem is that if I change permalinks, my social media plugins reset -- e.g. the 'like' counts -- presumably because these plugins store posts by URL. Thus, I would like to change permalinks for my new posts only. Suggestions on the best way to accomplish this?


title: Pull product info into WordPress page

text: WooCommerce has several functions that are related to the tabs, but I'm struggling to pull them into a regular wordpress page.               woocommerce_default_product_tabs          woocommerce_output_product_data_tabs      This is what I've tried.               global $woocommerce;     $productTabs = $woocommerce->woocommerce_output_product_data_tabs(35);     echo $productTabs;      With "35", I am trying to pull the product tabs of only that specific product ID. In this case, 35.


title: How to redirect action=register link on the lostpassword page to a different link?

text: I have a specific wordpress registration page where I have a new user complete their registration form. However, if someone clicks on the "forgot password" link in the login section of my site and then clicks on register, they'll be able to register for the site without going through the normal registation form. How can I redirect the wp-login.php?action=register page to sample.com/register ? Thanks in advance!


title: Search through custom post type and custom fields takes 5 minutes

text: I got strange problem and im stuck. I have custom post type with around 15 custom fields. I moved data from old db (not wp) by using `wp_insert_post` ,`update_post_meta` and `wp_set_object_terms`. All went good. All vcards works fine. I got 3500 vcards and now when i try to search some vcards - search just freeze for 10 minutes then i get timeout. Same thing is in admin panel if i try to search in custom post type menu search takes 10 minutes and dies... So i have a question is wordpress capable to handle that amount of custom post type posts ? or i made some mistake in coding ? If You need any kind of code to show please tell me i will paste it here since now i dont even know where to start search. Best Regards Charles * * * Here is a code: First of all i drop other pages from search - i need only my custom post type               function search_types($query) {     if ( $query->is_search )      {         $query->set('post_type', 'vcard');          }     return $query;      This part of code i found on net and just adjusted it to my needs: I grab all custom fields ( now in code i got only 1 field becouse of testing - normally is about 15)               function custom_fields_search() {     global $wpdb;          $sql = "SELECT meta_key FROM ". $wpdb->prefix . "postmeta mk WHERE mk.meta_key LIKE 'companyKeyWords'";     $results = $wpdb->get_results( $sql );          if ( $results ) :         foreach ($results as $result) {             $custom_fields[] = $result->meta_key;         }     endif;          return $custom_fields;      Now those 3 function with filter               function custom_search_groupby($groupby) {     global $wpdb, $wp_query;          $groupby = "$wpdb->posts.ID";          return $groupby;     function custom_search_join($join) {     global $wpdb, $wp_query;          if ( is_search() && isset($_GET['s']) ) {              $join  = " INNER JOIN $wpdb->term_relationships AS r ON ($wpdb->posts.ID = r.object_id) ";         $join .= " INNER JOIN $wpdb->term_taxonomy AS x ON (r.term_taxonomy_id = x.term_taxonomy_id) ";         $join .= " AND x.taxonomy = '".GO_TAX_CAT."'";                   // if an ad category is selected, limit results to that cat only         $catid = $wp_query->query_vars['cat'];              if ( !empty($catid) ) :                  // put the catid into an array             (array) $include_cats[] = $catid;                  // get all sub cats of catid and put them into the array             $descendants = get_term_children( (int) $catid, GO_TAX_CAT );                  foreach ( $descendants as $key => $value )                 $include_cats[] = $value;                  // take catids out of the array and separate with commas             $include_cats = "'" . implode( "', '", $include_cats ) . "'";                  // add the category filter to show anything within this cat or it's children             $join .= " AND x.term_id IN ($include_cats) ";              endif; // end category filter                   $join .= " INNER JOIN $wpdb->postmeta AS m ON ($wpdb->posts.ID = m.post_id) ";         $join .= " INNER JOIN $wpdb->terms AS t ON x.term_id = t.term_id ";          }          return $join;      }               function custom_search_where($where) {     global $wpdb, $wp_query;     $old_where = $where; // intercept the old where statement     if ( is_search() && isset($_GET['s']) ) {              // get the custom fields to add to search         $custom_fields = custom_fields_search();         $customs = $custom_fields;              $query = '';              $var_q = stripslashes($_GET['s']);         //empty the s parameter if set to default search text         if ( __('What are you looking for?','go') == $var_q ) {             $var_q = '';         }              if ( isset($_GET['sentence']) || $var_q == '' ) {             $search_terms = array($var_q);         }         else {             preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $var_q, $matches);             $search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);         }              if (!isset($_GET['exact']) ) $_GET['exact'] = '';              $n = ( $_GET['exact'] ) ? '' : '%';              $searchand = '';              foreach ( (array)$search_terms as $term ) {             $term = addslashes_gpc($term);                  $query .= "{$searchand}(";             $query .= "($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";             $query .= " OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";             $query .= " OR ((t.name LIKE '{$n}{$term}{$n}')) OR ((t.slug LIKE '{$n}{$term}{$n}'))";                  foreach ( $customs as $custom ) {                 $query .= " OR (";                 $query .= "(m.meta_key = '$custom')";                 $query .= " AND (m.meta_value  LIKE '{$n}{$term}{$n}')";                 $query .= ")";             }                  $query .= ")";             $searchand = ' AND ';         }              $term = $wpdb->escape($var_q);              if ( !isset($_GET['sentence']) && count($search_terms) > 1 && $search_terms[0] != $var_q ) {             $query .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";             $query .= " OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";         }              if ( !empty($query) ) {                  $where = " AND ({$query}) AND ($wpdb->posts.post_status = 'publish') ";                  // setup the array for post types             $post_type_array = array();                  // always include the ads post type             $post_type_array[] = GO_POST_TYPE;                       // build the post type filter sql from the array values             $post_type_filter = "'" . implode("','",$post_type_array). "'";                  // return the post type sql to complete the where clause             $where .= " AND ($wpdb->posts.post_type IN ($post_type_filter)) ";              }     }          return( $where );      At the end, I applyfilters :               add_filter('posts_join', 'custom_search_join');     add_filter('posts_where', 'custom_search_where');     add_filter('posts_groupby', 'custom_search_groupby');


title: Redirect after post deleted

text: On the single template, I am using a delete post link generated by the get_delete_post_link function. When I use the link to delete the post I am currently on, it adds a query string of ?trashed=1&ids=10, but, as expected, the page generates a 404 error as that post is now gone. I'm just wondering if anyone knows an action/filter I can use to detect when the post has been deleted, so I re-direct the page somewhere else afterwards? Thanks!


title: Help with Magpierss and Wordpress

text:
Hoping someone can help. I'm trying to update a friends website - the original developer has gone AWOL unfortunately and left me to pick up the pieces. On the front end of the site the developer has installed Magpierss to have a twitter feed scroll along the bottom. However we've just noticed that in the blog section (powered by wordpress), they've actually hard coded the feed so it never updates. I've tried editing the wordpress footer to reflect that of the one uses on the front-end as per below:

<?=$rss_news_items ?>

      And have updated functions.php with following:                   <?php     define('MAGPIE_DIR','magpierss');          require_once(MAGPIE_DIR.'/rss_fetch.php');          $url = 'http://twitter.com/statuses/user_timeline/421720094.rss';          $num_of_items = 10; //set  $num_of_items = 'All' to show all items;          if ( $url ) {         $rss = fetch_rss( $url , 3600 ); //60 * 60 = 1 hour cache age         $rss_feed_name =  $rss->channel['title'] . ' Updated: '. $rss->channel['lastbuilddate'] ;              if($num_of_items=='All') $num_of_items = sizeof($rss->items);              if(sizeof($rss->items) < $num_of_items)  $num_of_items = sizeof($rss->items);              $rss_news_items = '';         for ($i=0; $i < $num_of_items; $i++) {             $href = $rss->items[$i]['link'];             $title = $rss->items[$i]['title'];             $description = $rss->items[$i]['description'];             $date = $rss->items[$i]['pubdate'];                  $rss_news_items .= '   '.$description.' ';         }          }          ?>      I've uploaded the Magpierss folder to the site's theme folder but I keep getting an error in the wordpress footer saying that the directory doesn't exist. I then thought I could just use the front end version and just call the same footer.php include file that the front end of the site is using from within wordpress' footer.php file. Again - this threw an error saying something about absolute urls' not being allowed. If anyone could help it would be greatly appreciated - I'm still learning wordpress and am primarily a front-end developer rather than a PHP developer - so i'm feeling a bit out of my depth. Thanks


title: How to customize wp_signon()

text: I am trying to get a customized sign on process. The features that are absent in WordPress by default are the following:   1. Allow user to choose a password at the time of registration.   2. Allow user to sign in using social networks particularly Facebook, Twitter and Google plus.   3. Verify user's Cell Phone number using sms for activating account.   4. Let the default role of every new user, irrespective of the sign in method, be elevated to `contributor`.   5. Upon successful log in, the user should be directed to his own personalized dashboard instead of the static home page. So my questions are:   * I have looked at numerous plugins which provide social media log ins, but all of them signup the user as a contributor. So, how do it change this behavior?   * How do I send both the email and sms verification before activating the account? Which hook do I need to use here?   * Once the user logs in successfully, how do I redirect him/her?   * How do I let the user select the password, or better still, present the user creation page seen by admin only to the anonymous user?


title: Register and load scripts

text: In my `functions.php`                   function load_scripts()              {      wp_enqueue_script( 'jquery' );     wp_register_script( 'modernizr', get_template_directory_uri() .'/js/modernizr.foundation.js' );     wp_enqueue_script( 'modernizr' );     wp_register_script( 'jquery.simpleWeather', get_template_directory_uri() .'/js/jquery.simpleWeather.js', array( 'jquery'));     wp_enqueue_script( 'jquery.simpleWeather' );             }             add_action( 'wp_enqueue_scripts', 'load_scripts ');      I try to register and load scripts to my wp theme. For `jquery.simpleWeather.js` i have a part of code that load in the `header.php`                               Also i edit the code :                     But the scripts didn't register and load. Any idea? Thanks.


title: Loop through posts and get the list of all terms for a taxonomy

text: I'm within taxonomies (a) archive and I want to loop through all the posts and retrieve a list of terms for taxonomy (b) then echo that list out with no duplicates. Here's what I have so far in my `taxonomy.php`:               while (have_posts()) : the_post();       $terms = get_the_term_list( $post->ID, 'role-type', ' Role(s): ', ' ', ' ' );       echo $terms;     endwhile;      Lets say there are three posts in the archive this then echos the following: > Role(s): DOS FE RSM RSS Role(s): DOS FE SPMs RSS Role(s): CSO What it should do is display something similar to: > Role(s): DOS FE RSM RSS SPMS CSO What do I need to do? Thanks for your help.


title: Custom post types working in functions.php but not in plugin

text: I want to register a WordPress custom post type. This works perfectly fine in the functions.php, but not in my plugin file. The plugin does work except for registration of the CPT. The code is pretty standard. Registering the CPT:               add_action( 'init', 'produkte_menu' );     function produkte_menu() {     register_post_type( 'produkte',     array(     'labels' => array(     'name' => 'Produkte' ),     'public' => true,     'menu_position' => 4,     'add_new' => '',     'supports' => array( 'title' ),     'taxonomies' => array( '' ),     'has_archive' => false,     'exclude_from_search' => true     )     );     }     function toggle_custom_menu_order(){     return true;     }      I don't want the editor for this CPT:               add_action('init', 'init_remove_support',100);     function init_remove_support(){         $post_type = 'produkte';         remove_post_type_support( $post_type, 'editor');     }      Finally, I hide the "add new" button:               add_action('admin_menu', 'hide_add_new_custom_type');     function hide_add_new_custom_type()     {         global $submenu;         unset($submenu['edit.php?post_type=produkte'][10]);     }      I'm stuck here. Any help would be appreciated!


title: how to change my child theme featured image dimensions?

text: I am developing a child theme based on the twentyten theme and now i notice the featured image in the WP backend (wp-admin) shows the wrong scaled image. It shows the "twenty ten" size, meaning an image scaled to x198. How do i show the featured image of my chosen size??? regards,


title: How can I stop access of unregistered user in wp-content/uploads directory without using .htaccess file?

text: I want to give permission to only registered users into my `wp- content/uploads` directory and stop access for those users which are not members on my site.


title: Page can not be updated and disappeared in "show all page"

text: I have a strange problem now. Today I am editing a very old page. I restored to old version and also modified something. Suddenly I found I can never update that page. Then I tried set it pending then set back to published. The "no update" issue still there. What is worst is I can not find it in "page List". As you can see from the picture: All(3): only show 2 When I click Pending(1): No page found I have right to approve page as I am the only user. That page can only be found by clicking "edit this page" link when browse it as a reader. ![Only show 2 pages](http://i.stack.imgur.com/6F9vL.gif) ![The pending 1 page can never be shown!](http://i.stack.imgur.com/rjkJX.gif)


title: Bootstrap and Respond.js

text: I'm using Bootstrap in a Wordpress theme and I need to support IE8 I need to load respond.js in wordpress so I can support IE8 I can't get respond.js to load correctly. I've tired: A respond.js plugin - https://wordpress.org/plugins/respondjs/ Using wp_enqueue_script to add resond.js and Adding the respond.js inline in the html. Has anyone added respond.js to wordpress, what is the best way to do it.


title: Sort posts of custom_post_type according other post_type with metabox

text: I'll try to be as specific as possible because it's a bit confusing what I require. I'm trying to make a connection between two post_types with the help of a Metabox; This Metabox is showing in both post_types (see picture) ![enter image description here](http://i.stack.imgur.com/dJkLZ.png) I have a page in which I want to make a loop to display the post of 'post_type' => 'politics' (I'm using query_posts), but my question is how to display them in the order I want: If there is a recent post on 'post_type' => 'post' with value 'ENTITY 1' checked I want to show the post of 'post_type' => 'politics' which also has the value 'ENTITY 1' at the beginning and sort them well according to the activity of the posts of 'post_type' => 'post' Thanks and hope i've been sufficiently explicit.


title: Error when activating child theme: `failed to open stream: No such file or directory`

text: I get the following error message on wamp after I activated my child theme. what am I doing wrong?               Warning: include(C:\wamp\apps\test/wp-content/themes/test/functions/options-panel/customizer.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\apps\test\wp-content\themes\newcastle\dwframework\theme-options\config.php on line 86         Call Stack         #   Time    Memory  Function    Location         1   0.0016  754008  {main}( )   ..\index.php:0         2   0.0029  871416  require_once( 'C:\wamp\apps\test\wp-admin\admin.php' )  ..\index.php:12         3   0.0036  897368  require_once( 'C:\wamp\apps\test\wp-load.php' ) ..\admin.php:30         4   0.0043  923064  require_once( 'C:\wamp\apps\test\wp-config.php' )   ..\wp-load.php:29         5   0.0063  1054736 require_once( 'C:\wamp\apps\test\wp-settings.php' ) ..\wp-config.php:120         6   1.4685  54915528    include( 'C:\wamp\apps\test\wp-content\themes\newcastle\functions.php' )    ..\wp-settings.php:291         7   1.4693  54951624    include( 'C:\wamp\apps\test\wp-content\themes\newcastle\dwframework\config.php' )   ..\functions.php:5         8   1.4715  54984536    include( 'C:\wamp\apps\test\wp-content\themes\newcastle\dwframework\theme-options\config.php' ) ..\config.php:91


title: wp_parse_args & category parameter

text:
Am trying to use this code:               function wp_custom_archive($args = '') {             global $wpdb, $wp_locale;                  $defaults = array(                 'cat' => 6, //doing nothing                 'format' => 'html',                 'show_post_count' => true,                 'echo' => 1             );                  $r = wp_parse_args( $args, $defaults );             extract( $r, EXTR_SKIP );                  if ( '' != $limit ) {                 $limit = absint($limit);                 $limit = ' LIMIT '.$limit;             }                  // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride             $archive_date_format_over_ride = 0;                  // options for daily archive (only if you over-ride the general date format)             $archive_day_date_format = 'Y/m/d';                  // options for weekly archive (only if you over-ride the general date format)             $archive_week_start_date_format = 'Y/m/d';             $archive_week_end_date_format   = 'Y/m/d';                  if ( !$archive_date_format_over_ride ) {                 $archive_day_date_format = get_option('date_format');                 $archive_week_start_date_format = get_option('date_format');                 $archive_week_end_date_format = get_option('date_format');             }                  //filters             $where = apply_filters('customarchives_where', "WHERE post_type = 'post' AND post_status = 'publish' AND ", $r );             $join = apply_filters('customarchives_join', "", $r);                  $output = '
';                      $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC $limit";                      $key = md5($query);                 $cache = wp_cache_get( 'wp_custom_archive' , 'general');                 if ( !isset( $cache[ $key ] ) ) {                     $arcresults = $wpdb->get_results($query);                     $cache[ $key ] = $arcresults;                     wp_cache_set( 'wp_custom_archive', $cache, 'general' );                 } else {                     $arcresults = $cache[ $key ];                 }                      /*echo '
';                 print_r($arcresults);                 echo '
';*/                      if ( $arcresults ) {                     $afterafter = $after;                     foreach ( (array) $arcresults as $arcresult ) {                              $url = get_month_link( $arcresult->year, $arcresult->month );                         // translators: 1: month name, 2: 4-digit year                          $text = sprintf(__('%s'), $wp_locale->get_month($arcresult->month));                         $year_text = sprintf('
%d
', $arcresult->year);                         if ( $show_post_count )                             $after = ' ('.$arcresult->posts.')' . $afterafter;                         $output .= ( $arcresult->year != $temp_year ) ? $year_text : '';                         $output .= get_archives_link($url, $text, $format, $before, $after);                              $temp_year = $arcresult->year;                     }                 }                  $output .= '
';                  if ( $echo )                 echo $output;             else                 return $output;         }      from this post to display archives by year and month with a category parameter but without any luck so far. When i change the `show_post_count` value to `false` it doesn work well, but nothing happens when i add a category parameter as seen here. I've also tried with tags and custom fields, nothing works. I've checked the wp_parse_args function and it seems to accept normal parameters such as wp_query. Any clue?


title: How can i run the same WordPress install on multiple subdomains?

text: My site is installed on my main domain, lets say something.com for an example. I have WooCommerce installed and i would like to run the shop part of the site on store.something.com with the same WordPress install. Also, the blog would run on blog.something.com. I think Multisite is not what i'm after based on the "Before You Create A Network" article in the Codex. Is it possible to do this without installing multiple Wordpress on the subdomains?


title: front end or back end posting?

text: i want to let my users post their own content to my site. i have tried both the front-end and the back-end ways to do that. problem is: front-end way: can't find a way to display a proper preview of the content (which is trivial on the wordpress back-end) back-end way: can't find a way to fully customize the "add new" form in order to make it simple enough for my users to use. do you know any good solutions for those problems? some general information aobut my site: - using WPML plugin for translations - running as a multisite network


title: Backing up Wordpress before an update, what's the easiest way to do this?

text: I'm about to update my Wordpress blog to the latest version. It was recommended that I backup my posts and database first. It seems like a plugin would be the easiest way for me to do this. What's the best plugin available for this? Searching Wordpress' site I found the BackUpWordPress plugin: http://wordpress.org/extend/plugins/backupwordpress/ Alternatively, if a plugin isn't recommended, how should I do this instead?


title: Is it possible to load a different sidebar in single.php based on a meta_query filter?

text: I have a custom post type 'speakers' and I have a checkbox custom field (meta_query) to separate my Conference speakers from my Workshop speakers. I can filter my speakers with this meta_query and things are working fine. But how do I use a different sidebar based on the Conference or Workshop speaker meta_query? When I click the speakers for their detail (no matter Conference or Workshop speaker) the detail page loads my single-speakers.php and the code to get the sidebar in my single-speakers.php is:               <?php get_sidebar(); ?>      How can I specify a different sidebar, for example get_sidebar('workshop')? Can I write a conditional code to load a different sidebar based on the speakers meta_query? Does this make sense? Thanks


title: add_action hook for publish_post not working

text: I can't get my function to trigger on post update or save. I've found a couple of other forum posts around with the same problem, but never an answer :( My code is as simple as:               function pdfgenerator_update($post_ID) {         global $MYTEST;         $MYTEST["pageID"] = $post_ID;              }     //add_action('trashed_post','pdfgenerator_update');     //add_action('publish_page','pdfgenerator_update');     //add_action('save_post','pdfgenerator_update');     //add_action('edit_post','pdfgenerator_update');     add_action('publish_post','pdfgenerator_update');     add_action('edit_post','pdfgenerator_update');     //add_action('edit_page_form','pdfgenerator_update');          global $MYTEST     $MYTEST["Am I running"] = "YIPPEE";      (N.b. $MYTEST is an array I use to collect debug info which I then print_r in the admin footer.) As you can see, I've tried a number of different hooks. The only one I ever got working was the edit_page_form... but that didn't seem to pass in any parameters. And I do definitely need the parameters. Also, there's a point of principle. If the correct hook is publish_posts then I damn well want to know why it fails for me. The code is in my main plugin file, and that is demonstrably being loaded as the YIPPEE is printing correctly. It seems absurd that this isn't working. I've found so many tutorials and examples exactly like this. I'm frankly getting a little ape here. It should just work! What am I missing? Many thanks for your help. Alastair


title: Where to upload my new custom ShortCode in Separate .php file?

text: I wrote my first ShortCode in a file called: myShortCodes.php. Does the add_shortcode go in the same PHP file as the ShortCode itself? Where do I upload it? How does WordPress know to look in my file? I don't have to modify \wp_includes\shortcodes.php do I? So far I have tried uploading myShortCodes.php to   1. wp-includes/myShortCodes.php   2. wp-content/themes/mytheme/skeleton/myShortCodes.php


title: Modify links under 'help section'?

text: I am trying to modify the support links under the help section (Contextual help).I want to replace these Documentation on Using Themes and Support Forums with my own .So I removed the links in wp-admin folder from many pages under admin section .But for plugin pages,I can't able to find the files to remove. Is there any way to replace or remove the links site wide ?


title: Sanitizing search data for use with WP_Query

text: I'm using heavily-customised WordPress to drive a fishkeeping website. I have two separate search areas: a site-wide search and a fish species search. The latter also has advanced search features which will search certain meta values in the "species" custom post type (to allow users to search for fish that can be kept in a certain water hardness, for instance). I want to use `search.php` to deal with all of these, so I'm using `WP_Query`. The search forms have something along the lines of `<input type="hidden" name="type" value="species" />` to specify the kind of search being performed. The code I'm utilising is as follows:               <?php         if (isset($_GET["s"])) {             $search_term = $_GET["s"];         }              if (isset($_GET["type"])) {             switch ($_GET["type"]) {                 case "profile" :                     $post_type = "species";                     break;                 case "glossary" :                     $post_type = "glossary";                     break;                 default :                     $post_type = "any";                     break;             }         }              $args = array(                     's' => $search_term,                     'post_type' => $post_type                 );              $query = new WP_Query ( $args );     ?>      My (lengthy, with apologies) question is this: what's the best command to use to sanitize the data from the search box? Thanks in advance,


title: Pagination problem after WP_Query with tag filtering

text: I have a problem with a custom WP_Query. I want a page with all posts with a specific tag. This is the code I'm using:               <?php      //save old query     $temp = $wp_query;      //clear $wp_query;      $wp_query= null;       ?>           <?php      // The Query     $wp_query = new WP_Query();     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array( 'tag' => 'concurs', 'paged' => $paged );     $wp_query->query($args);     ?>     <?php      // The Loop     while ( $wp_query->have_posts() ) :         $wp_query->the_post();      ?>       [some code that displays the title, excerpt, meta-info (author, category, date) and thumbnail]            <?php endwhile; ?>     <?php posts_nav_link(); ?>                   <?php      //clear again     $wp_query = null;      //reset     $wp_query = $temp;        ?>       The problem is that when I switch to page 2 or 3 I get the same 10 first posts. What I am doing wrong?


title: In a subdomain network, what .htaccess settings can I use to have WP ignore requests to one subdomain?

text: I have a subdomain network installed at, say http://example.com. I need to have my webmail running at http://webmail.example.com. When I go to this domain it redirects to a page for creating a new site: http://example.com/wp- signup.php?new=webmail. I know there are some entries WP uses in the .htaccess file, but how can I get WP to ignore requests to webmail.example.com? Thanks.


title: get rid of random string before an for an image path on wordpress

text: When visiting my site (WordPress 3.0.3), images are loaded correctly. However, when you hit refresh, or come back to the same entry, the images' path become something like this:               http://tambnguyen.com/wp-content/imgs/ic.cf62525f6780c4cc3784907fe26cbee5.xhassleblad-h4d-40-stainless-steel,j.jpg      Here's the example entry: http://tambnguyen.com/hasselblads-ferrari- branded-h4d-camera-now-available-for-only-a-few-thousands-of-pounds/ Will you please tell me why it's doing that? This string of "ic.cf62525f6780c4cc3784907fe26cbee5.xhassleblad-h4d-40-stainless-steel,j.jpg" is hindering me from sharing the entry's URL correctly on facebook. I've gone through all the includes files to look for anything with "ic." or "md5" and had no luck. please help. Thanks.


title: How to get the main blog's id and db prefix from a mu plugin?

text: How can one get the blog ID as well as the database prefix of the main blog in a wordpress multisite installation? Is the main blog's ID always 1? Also how can the main blog's table prefix be acquired from within the mu-plugin's code?


title: How to use IN array properly in Wordpress?

text: I have an array containting these values (including the apostrohpes):               'course_3202','course_3201','course_3200','course_3199'      I try to fetch results from these values in postmeta-table.               SELECT * FROM wp_postmeta WHERE meta_key IN (%s) and meta_value=1      I get no result ( _yes, there is data and I should get results_ )               RESULT = Array ( )      My code looks like this:               function get_count_courses_array(array $courseids) {             $tmp = array();         foreach($courseids as $cid) {             $tmp[] = "'" . $cid . "'";         }             $courseids = implode(',',$tmp);              global $wpdb;         $sql = "SELECT * FROM $wpdb->postmeta";         $sql .= " WHERE meta_key IN (%s) and meta_value=1";                 $result = $wpdb->get_results($wpdb->prepare( $sql, $courseids));              return $result;         }      In phpMyAdmin I tried the same and I do get results (as expected):               SELECT * FROM wp_postmeta WHERE meta_key IN ('course_3202','course_3201','course_3200','course_3199') and meta_value=1      **What am I doing wrong?**


title: How to use current_user_can()?

text: Because it's not working for me. This code checks if a user has just registered. I want to redirect him to a custom page if so. Otherwise, redirect him to the homepage or admin page.               function mylogin_redirect($redirect_to, $url_redirect_to = '', $user = null) {         if( $user->ID ) {             $user_info = get_userdata( $user->ID );              // If user_registered date/time is less than 48hrs from now             // Message will show for 48hrs after registration             if ( strtotime( $user_info->user_registered ) > ( time() - 172800 ) ) {                 return get_bloginfo('url') . "/custompage/";             } elseif( current_user_can( 'manage_options' )) {                 return admin_url();             } else {                 return get_bloginfo('url');             }         }     }     add_filter('login_redirect', 'mylogin_redirect');      I get the expected results for the two options but the admin. `elseif( current_user_can( 'manage_options' )) { return admin_url(); }` doesn't seem to get parsed.


title: list child page items (1 level with meta keys)

text: I need to have a index page and it can pull out the title (with link), meta key description and meta key image (meta keys from custom fields) of its child pages, but only one level down. e.g. I have a index page call WORK, and few child index PRINT, WEB. there will be some pages under PRINT and WEB as well, but I don't want them to be shown on the WORK index. I only need to have PRINT and WEB to be listed and with the meta keys. Anybody can help please? many thanks!


title: What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

text: I need to delete some `postmeta` when deleting taxonomy terms from the backend. Before deleting the `term`, I need to retrieve the postmeta's `meka_key` and the term `id` that is going to be deleted. Use the term `id` to perform some tasks and then delete the `postmeta` and `term`. I already tried using the action hook `set_object_terms` however, I cannot retrieve the term `id` when deleting the `term` because it returns an empty array. So, I would need to somehow get the term `id` before it gets deleted. How can I retrieve the term id before deleting it?               add_action( 'set_object_terms', function( $object_id, $terms, $tt_ids, $taxonomy ){          //$terms is returning the term's name (when adding an object id),      //it's returning empty when deleting the term.     //I need to have a valid $terms when deleting it, where can I get it?     $user_name = $terms;     $meta_key = '_favorite_relation_added_' . $user_name;            // Customize post type in next line according to your needs. I used 'category' as example       if ( $taxonomy === 'favorite' ) {         $post = get_post( $object_id );             if ( empty( $post ) ) return;              // Customize post type in next line according to your needs. I used 'post' as example         if ( $post->post_type !== 'post' ) return;              // let's see if the post has some terms of this category,         // because the hoook is fired also when terms are removed          $has_terms = get_the_terms( $object_id, $taxonomy );              // here we see if the post already has the custom field         $has = get_post_meta( $post->ID, $meta_key, true );              if ( ! $has && ! empty( $has_terms ) ) {           // if the post has not the custom field but has some terms,           // let's add the custom field setting it to current timestamp                update_post_meta( $post->ID, $meta_key, time() );              } elseif ( $has && empty( $has_terms ) ) {           // on the countrary if the post already has the custom field but has not terms           // (it means terms are all removed from post) remove the custom fields               delete_post_meta( $post->ID, $meta_key );         }       }        }, 10, 4);


title: Custom permalinks with NextGEN Gallery

text: i set my wordpress permlink to `/%category%/%postname%` now i'm using Nextgen Gallery so when i have a gallery in a page it will be something like `/cat/page?gallery=10` i want to make it something like `cat/page/gallery id/` i tried alot with wp_rewrite ... but no luck ... any help ? this is what i'm testing on .. it's not my code it's provided from wordpress ... i will put everything in its place when i found the way ... so don't worry i will not `flushRules` on `init` ... thanks a lot               add_filter('rewrite_rules_array','wp_insertMyRewriteRules');     add_filter('query_vars','wp_insertMyRewriteQueryVars');     add_filter('init','flushRules');          // Remember to flush_rules() when adding rules     function flushRules(){      global $wp_rewrite;         $wp_rewrite->flush_rules();     }          // Adding a new rule     function wp_insertMyRewriteRules($rules)     {      $newrules = array();              //i don't know what should i put here      $newrules[''] = '';      return $newrules + $rules;      //     }          // Adding the id var so that WP recognizes it     function wp_insertMyRewriteQueryVars($vars)     {         array_push($vars, 'id');         return $vars;     }


I have a project in WordPress. I am trying to implement dialog box popup on click of hyperlink. On click of this link, function `shownm1()` is called which is placed in `.js` file. The function contains code to open modal dialog. But its showing the following error : > Uncaught TypeError: Object [object Object] has no method 'dialog' .               Click          function shownm1(){           jQuery(document).ready(function($) {       //                    alert(1);         $('#test-div1' ).dialog( "open" );          });     }        I suppose the scripts for dialog popup are not loading. Can anyone suggest how to enqueue scripts for the same? Or is there any other problem?


title: Can't print out returned value

text: Function to return the meta value as per author.                <?php           function ac_author_score() {              $userID = get_the_author_meta( 'ID' );         $query = array (             'author' => $userID,             'posts_per_page' => -1         );         $queryObject = new WP_Query($query);              while( $queryObject->have_posts() ) : $queryObject->the_post();              global $post;         $postID = $post->ID;              $score = $score + intval( get_post_meta( 'ratings_score', $postID, true ) );              endwhile;               wp_reset_query();              if ( $score > 0 )             $score = '+' . $score;              return $score;               }     ?>      So it's returning the $score, but I can't get it to output anything with echo etc. How do I actually print/echo the returned value?


title: How to use wp_nonce_url() in a link?

text: I am creating a plugin to display all posts from all custom post type. It is something like in edit.php, but instead of displaying single post type,I would like to display all posts in one page from multiple custom post type. I follow the tutorial at here to create the plugin and I did it. However there is one problem now, I want to add the Trash link under every listed posts (just like in edit.php). This field require wpnonce in order to run, but I couldn't get it how it works. Here is my codes:               function column_post_title($item){     $actions = array(             'edit' => sprintf('Edit',$item['ID']),//this part is fine             'trash'=> sprintf('Trash',$item['ID'],$item['ID']),//here I cant get it right!!         );     return sprintf('%1$s %2$s', $item['post_title'], $this->row_actions($actions) );     }      Do I need to create own nonce? Or using the exist one (if there is any). From the code above it give me Wordpress Failure Notice with :Are you sure you want to do this? Please try again. Message. Thanks


title: Custom Slider Per Page created

text: I am developing a site that will need to have a slider with 4-8 images, but only on certain page-types. These pages must be editable and the sliders must be able to be updated whenever I'd like. I can easily do the slider and the page theme, it's just the dynamic slider area that is getting me. I've been theming wordpress for a long time but have never run into this situation, it's kicking my butt. Any help would be appreciate, thank you for your time and effort. _Update_ I have the individual templates for the pages. And have looked into the conditional tags which will help for sure. I'm building this for a client who is new to Wordpress so I want to make the process very easy for them. They need to be able to post these slides themselves.


title: Sort list of Wordpress Page under tag when is_tag() called

text:
I have a site that I'm having so much trouble to try to sort the order of a list of Pages based on their tag. I've build this site over a year ago, with wordpress at the time there isn't any tag support for Page, so I used the plugin called tags4page. And I believe they still don't have tag support for pages ? Anyhow, my problem is if you go this page http://www.patentable.com/index.php/lawyers/ the list of Lawyers are in the right order. I can do this with wordpress build in order by giving each page a different weight. However the **problem is** if you try to sort the list of Lawyers by selecting the drop down manual it will return a list of lawyers that are belong to this tag that you have selected. **PROBLEM** is the order are in **reversed order** for the lawyers. Is there any way to fix this ? Right now my code is simple, basically is the following:               <?php if (have_posts()) : ?>          <?php /* If this is a tag archive */ if( is_tag() ) { ?>
Lawyers in <?php single_tag_title(); ?> Practice Area:
     <?php } ?>          <?php while (have_posts()) : the_post(); ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">      <?php the_title(); ?>
     <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>


title: Best image hosting service

text: My girlfriend has a very popular blog, but we are growing beyond current bandwidth limit (1TB). Adsense doesn't pay enough for an expensive CDN. What recommendations can you make about image hosting. Preferably a plugin, or something that can easily be implemented.


title: Create front end member login

text: I am very new at all this and not a programmer. I want to know how to create member login section on the site allowing users to see data that is not visible to the public. I am not sure how to go about doing this, is there a widget that one may suggest that does not take a brain surgeon to make it work. I am using the Unite theme and the site I am trying to put together is at tmpfire.com. I would appreciate all the help I can get. Thank you


title: Default thumb - how to set it

text: i need the code which will add default thumb, if there is not featured image available. I was using default thumb plus for this but this plugin is using a lot of resource so i need to remove it. I was trying to follow this tutorial But no luck. Inside my widget i have this code               <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>      Edited : And whole code you can see here pastebin.com/715evL1E Any idea how to this ? thanks I tried also with suggested code but i got an error .This is what i try the last in index.php               <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) { ?>                               <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('large-thumb'); } ?>       <img src="<?php echo get_template_directory_uri(); ?>/images/transfer-deadline-150x150.jpg" /><?php } ?>


title: When adding a widget, what kind of widget should I used to add images and text and styling?

text: Is there such a thing? I would settle for images, text and maybe headers. I know I can add HTML into the text widget. So is that what I should be doing? But how do I add images to the site? That widget doesn't have the image upload option. Thanks!


title: How to implement WP_List_Table functionality for custom plugins (OR any substitution for wp_list_table plugin) for bulk action

text: In the WordPress codex, following is highlighted in red for `WP List Table`. > "This class's access is marked as private. That means it is not intended for > use by plugin and theme developers as it is subject to change without > warning in any future WordPress release.". Is there any way to add bulk action and sorting functionalities like (`WP_List_Table` is doing) in custom plugins and how to use it?


title: Updating comments with replies

text: I looked around and didn't see any other questions on this topic, so here's a shot in the dark. I am trying to update the meta on a parent comment when it receives a reply. Here's the code I have so far, but I think it might not be working because I'm using the child comment to update the parent, and I am thinking it's running after the fact, but maybe not.               function update_custom_comment_field( $parent_id ) {     global $comment;     if ($comment->comment_parent) {         $parent_comment = get_comment($comment->comment_parent);         $parent_id = $parent_comment->comment_ID;     }     return update_comment_meta( $parent_id, $meta_key, $meta_value, $prev_value);     }     add_action( 'comment_post', 'update_custom_comment_field');      I'm not amazing at php, so please let me know if I'm missing something huge.


title: Pull latest stable release via git

text: I'm currently working with a workflow that makes use of Wordpress as a submodule under git. My workflow involves adding a submodule to my project from the following URL:               git://github.com/WordPress/WordPress.git      **The problem:** Doing this seems to grab the most up-to-date Wordpress version, including the non-stable alpha versions. I simply want to grab the most recent stable release, and I'm wondering whether there is some specific syntax I can add to the git URL above that allows me to specify a specific branch perhaps? Thanks


title: Using my own user table

text: Quite a broad question but I was wondering if it's possible to remove user management from WordPress and let it be handled by a remote database? I have an existing user table with everything I need and I wish to keep all my users there. Is it possible for WordPress to somewhat ignore it's own user table and use mine instead without duplicates? I understand that I'll probably need to keep admin roles in the user table, but when it comes to commenting or using bbPress I would like all the users to be referenced away from WordPress. I thought about maybe some sync process where the remote and the WordPress tables store the same info, but it opens some serious flood gates. With comments at the moment I just pre-fill the comments fields with their data, which is fine but when the user changes their name/email then it's out of sync. I've just started looking at bbPress and it seems easier to make my own forum plugin rather than hacking it to work with my user table. Thanks for the help.


title: RSS feed - get specific item from external feed

text: I am trying to figure out the best way to do this with Wordpress. I want to show a feed of news items on my site - the items are pulled from an external RSS feed. If an item is clicked, I want to show the contents of that specific item on a page within my own site. Looking at the contents of the external feed I am accessing, the unique identifier for each news item is stored in the query string of the link for that story, so I'm not really sure how I can use this to achieve what I want. Does anyone have any ideas at all? Thanks for any help


title: Multi Author blog with separate categories

text: I'm setting up a blog with 6 different authors. The main page of the blog is a grid of 6 pictures, one for each, and clicking on one will bring you to that author's "index" (archive.php is being used). I'd like to structure it so the blogs are somewhat "silo-ed" from eachother, as the authors have their own existing audiences. So when viewing an author's index, the categories and tags that show in the sidebar are specific to that author. The main issue I'm having is giving each author their own categories and posts - they shouldn't be able to see or modify others (obviously they can on the front end, but moreso for the feel of "ownership"). EDIT The alternative I've come up with in my research is to set up custom post types for each additional author and enable tags and categories for the CPT. Then, each author would be explicitly granted admin access to their CPT, and the corresponding templates would have to adjusted to show the correct info. The question now is, what is the more efficient way to do this considering site maintenance, server load, etc?


title: Ban a user and end their session

text:
I'm working on a plugin derived from this tutorial. So far, the plugin adds a checkbox on a user's profile edit page where admins can ban the user. ![checkbox](http://i.stack.imgur.com/scFl6.jpg) If checked, the user will receive a message upon logging in: ![banned](http://i.stack.imgur.com/vSdLB.jpg) It works fine. The problem is, if the user is already logged in (has an active session) and gets banned, the user can continue to interact with the site **until** either the session ends or the user logs out. **How do I end the user's session upon banning so the user is forced out?** Here is the code:               /**      * Admin init      *      * @access      public      * @since       1.0       * @return      void     */     function rc_admin_init(){              // Edit user profile         add_action( 'edit_user_profile', 'rc_edit_user_profile' );         add_action( 'edit_user_profile_update', 'rc_edit_user_profile_update' );          }     add_action('admin_init', 'rc_admin_init' );               /**      * Adds custom checkbox to user edition page      *      * @access      public      * @since       1.0       * @return      void     */     function rc_edit_user_profile() {         if ( !current_user_can( 'edit_users' ) ) {             return;         }              global $user_id;              // User cannot disable itself         $current_user = wp_get_current_user();         $current_user_id = $current_user->ID;         if ( $current_user_id == $user_id ) {             return;         }         ?>
Ban user

             	             <input name="rc_ban" type="checkbox" id="rc_ban"  /> Check to ban user.

         <?php     }               /**      * Save custom checkbox      *      * @access      public      * @since       1.0       * @return      void     */     function rc_edit_user_profile_update() {              if ( !current_user_can( 'edit_users' ) ) {             return;         }              global $user_id;              // User cannot disable itself         $current_user    = wp_get_current_user();         $current_user_id = $current_user->ID;         if ( $current_user_id == $user_id ) {             return;         }              // Lock         if( isset( $_POST['rc_ban'] ) && $_POST['rc_ban'] = 'on' ) {             rc_ban_user( $user_id );         } else { // Unlock             rc_unban_user( $user_id );         }          }               /**      * Ban user      *      * @access      public      * @since       1.0       * @return      void     */     function rc_ban_user( $user_id ) {              $old_status = rc_is_user_banned( $user_id );              // Update status         if ( !$old_status ) {             update_user_option( $user_id, 'rc_banned', true, false );         }     }               /**      * Un-ban user      *      * @access      public      * @since       1.0       * @return      void     */     function rc_unban_user( $user_id ) {              $old_status = rc_is_user_banned( $user_id );              // Update status         if ( $old_status ) {             update_user_option( $user_id, 'rc_banned', false, false );         }     }               /**      * Checks if a user is already banned      *      * @access      public      * @since       1.0       * @return      void     */     function rc_is_user_banned( $user_id ) {         return get_user_option( 'rc_banned', $user_id, false );     }               /**      * Check if user is locked while login process      *      * @access      public      * @since       1.0       * @return      void     */     function rc_authenticate_user( $user ) {              if ( is_wp_error( $user ) ) {             return $user;         }              // Return error if user account is banned         $banned = get_user_option( 'rc_banned', $user->ID, false );         if ( $banned ) {             return new WP_Error( 'rc_banned', __('ERROR: This user account is disabled.', 'rc') );         }              return $user;     }          add_filter( 'wp_authenticate_user', 'rc_authenticate_user', 1 );      So the ending of the session should go in the `rc_ban_user()` function. **EDIT** : Full plugin posted below.


title: list pages by custom_field?

text: Is there a way for me to sort these posts alphabetically according to the custom field I have defined (last_name)?               <?php     $page_id = get_the_ID();          $args = array('sort_order'=>'DESC', 'post_type'=>'page', 'child_of'=>$page_id, 'post_status'=>'publish');     $posts_array = get_pages($args);               foreach ($posts_array as $post){         setup_postdata($post);         ?>         <li>             (post content here)         </li>         <?php     }     ?>