title: add_rewrite_rule to search

text: Newbie WordPress developer here. I need to map a WordPress URL like this `www.example.com/user/Username` to a search result based on that Username I already have the page that makes the search with the url `www.example.com/search-results/?name=Username` In the `functions.php` I have               add_action( 'init', 'add_username_rules' );     function add_username_rules()     {         global $wp_rewrite;              add_rewrite_rule(         "user/([^/]*)",         "search-result/?name=$matches[0]",         "top"         );              $wp_rewrite->flush_rules();     }      But this is not working and the rule is going to `non_wp_rules`.


title: Cannot access subdirectory subpages

text: I am working on a wordpress site for a client, who has a 2nd install in a subdirectory. When I try to view a subpage on the 2nd install (domain.com/folder/subpage) I get the root directory install's 404 page. It is not a htaccess issue because I have a similar set up on my own server where my website is in the root and I host other client websites in subdirectories, have never had a problem viewing any page in any sub-install. Could it be that the hosting has got directory browsing disabled or another issue? Thanks


title: How can i change the name order in the admin?

text: When i go to wp-admin/users.php, in the second column i can see the users full name, however, its not in the right order. In Hungary, we use a different name order: http://en.wikipedia.org/wiki/Hungarian_names So i need to change the name from "First name - Last name" to "Last name - First name" How can i do this?


title: Search with multiple selects that include tags

text:
I need to make custom search for specific house projects in my new wordpress site. ![enter image description here](http://i.stack.imgur.com/mnJbQ.jpg) It needs to have 4 dropdown lists - 1 [number 2] for categories and 3 [numbers 3,4,5] for tags. Tags need to be defined within the code because from 13 tags on whole site, 4 are for one dropdown, 5 are for second one a 4 are for third. Is there any option to do this? I made the dropdown for categories with this tutorial: http://www.webstutorial.com/wordpress-multiple-category-search/content- management-system-cms/wordpress-cms and by including only categories that i need to:
<?php wp_dropdown_categories('show_count=1&include=4,5,6,7'); ?>
      But WordPress doesn't have function like wp_dropdown_tags to make something like this with tags On Codex ( www.codex.wordpress.org/Function_Reference/get_the_tags ) there is something like: function drop_tags() but this only works within the_loop() and lists all tags. It needs to list defined tags, and search only by those that were chosen. Hope you understand what i mean and have any solutions. Thanks in advance.


title: get_terms() for custom taxonomy related to another taxonomy

text: I have this weird thing to do and I have no idea how to do it. Ok, so: I have two custom taxonomies: `collections` and `categories` (both are prefixed, but for the sake of simplicity, I'll use these short names). A post will have a category and will be added into a collection. What I have to do is to display all posts from a specific taxonomy - `categories` (already did this) and only show `collections` terms that have posts in the selected category. Some kind of `hide_empty` but based on another taxonomy. Make sense? Since I use WPML plugin (that is known for adding stuff into sql query), I would like a solution that not involve the rewrite of the whole query. So, any idea would be welcomed. Thanks!


title: get the username of a user in his author page

text:
I've implemented this code inside my author.php file, in order to display the username of the author:               <?php printf( "
The blog of" . get_the_author() . "
" ); ?>      It displays correctly the username of a user who has posted articles, but unfortunately displays another username when the user hasn't published anything. Is there a way to solve that ? Thanks for your help !


title: Custom Taxonomy for an "advanced search"

text: Ive done some googling around and for what id like to do but i cant seem to find anything along them line that i can look at and learn from. That being said my knowledge of taxonomy isnt great, nor is my wordpress knowledge other then the very basics of functions and design in terms on theme layout. What id like to achieve is to create two drop down menu and the last the search bar. http://i.stack.imgur.com/86Fdr.png The first dropdown menu will display all the parent categories. The second then displays the parents child categories that will be populated when the parent is selected. And then able to search the selected child category using the search bar! But i have no idea how to go about doing any of this or if this is possible with taxonomy? Any help will be greatly appreciated ! Kind regards, Thank you in advance, Thomas


title: wordpress 3.6 media manager cropping timestamp

text: I am using wordpress 3.6 with its default media manager, I uploaded an image, and then every time i crop it, it create 3/4 new images in upload directory with different name (adding timestamp in file name), But I can't see those newely created(cropped) images in my media library. I can see them on upload folder using ftp. Why it is doing is? is there solution within wordpress without any code hack? I am expecting its behaviour after cropping. either it should overwrite exiting files(all sizes) or if it creates new files with timestamp, it should show those files in media library so i can choose them. UPDATE: Now If you look at the screenshot below, You see how cropping working. There are three types of colour coding,   1. Original Images (when Image uploaded first time, it generated 4 types of image sizes automatically)   2. First time crop (when I cropped the image first time using media manager, it created 4 sizes of images again)   3. second time crop ( when I cropped the same image second time it created another set of 3 images)   4. third time crop ( when I cropped the same image third time it created another set of 3 images)  And it will keep going on every time i crop image 3 new images will be added. which is totally redundancy. While in Media image library I will only see one image. I can't delete my previous cropped image, neither do it replace previous cropped sets. When I Set Feature Image of Post after all these cropping, somehow it still choose image A-604x270.jpg from Original Image to display it in Feature Image. I can I get most recent cropped image to display As Feature Image. Previously cropped image, as i can access them from admin area, means I can delete time. How can I delete perviously cropped image, otherwise it will be waste of space. Honestly It is very unusual way of cropping system in wordpress. ![enter image description here](http://i.stack.imgur.com/u7QKu.jpg)


title: archive page sidebar not working

text:
i created a taxonomy page from archive.php , working based on thematic frame work. i tried a lot to make the sidebar working but it show nothing and even using firebug its not exist !               <?php     /**      * Template Name: MEDIT      *      * …      *       * @package Thematic      * @subpackage Templates      */              // calling the header.php         get_header();              // action hook for placing content above #container         thematic_abovecontainer();     ?>
                          <?php                     // action hook for placing content above #content                         thematic_abovecontent();                          // filter for manipulating the element that wraps the content                          echo apply_filters( 'thematic_open_id_content', '
' . "\n" );                         ?>                              <?php                         $term_slug = get_query_var( 'term' );                         $taxonomyName = get_query_var( 'taxonomy' );                         $current_term = get_term_by( 'slug', $term_slug, $taxonomyName );                         $args = array( 'child_of' => $current_term->term_id, 'hide_empty'=>false);                         $terms = get_terms( 'tagportifolio', $args);                         $assoc = taxonomy_image_plugin_get_associations();                              if (!empty($terms)):                     ?>                         <?php /*?><?php                         // calling the standard sidebar                          dynamic_sidebar('cs-project-main-category');                         ?><?php */?>                         <?php foreach( $terms as $child ): ?>                             <?php thematic_abovepost(); ?>                             <div id="cat-<?php echo $child->term_id; ?>">                             <?php                                 if(array_key_exists( $child->term_taxonomy_id, $assoc )){                                      echo wp_get_attachment_image( $assoc[$child->term_taxonomy_id], array(), false, 'thumbnail');                                  }                             ?>
<a href="<?php echo get_term_link( $child->name, $taxonomyName );?>">                             <?php echo $child->name; ?>

                                  <?php thematic_belowpost();?>                                  <?php endforeach; ?>                                  <?php                                  else:                                  // start the loop                             ?>                             <?php /*?><?php                             // calling the standard sidebar                              dynamic_sidebar('cs-sub-cat-sidebar');                             ?><?php */?>                                       <?php                  endif;                 ?>                  <?php                     // action hook for placing content below #content                     thematic_belowcontent();                 ?>
          <?php          // action hook for placing content below #container         thematic_belowcontainer();              // calling the standard sidebar          thematic_sidebar();              // calling footer.php         get_footer();     ?>      any idea what is missing in my code please ?


title: Featured images loop for Orbit Slider

text:
To integrate Zurb´s Orbit Slider in my theme, I´m trying to generate this HTML with WordPress:

     The post title 1     The post title 2     The post title 3      I managed to get a list of featured images in a div, but I´m not sure how to:   1. Add a unique data attribute to each image tag like this: `data-caption="#htmlCaption-1"` (I suppose I need to run the `preg_replace()` function to insert the custom HTML?)    2. ~~Run the second loop to generate the 3 span elements (should this be a new wp_query or can I use the same one?)~~ **Edit:** I just found out that by using `rewind_posts();` we can use the same query multiple times. This is the code I have now:               // Get the latest 5 sticky posts from the 'events' post type     $args = array(       'post_type'   =>  'event',       'posts_per_page' => 5,       'post__in'  => get_option( 'sticky_posts' )     );     $slider_query = new WP_Query( $args );          // Display the featured images in div      echo '
';            while ( $slider_query->have_posts() ) : $slider_query->the_post();         the_post_thumbnail();       endwhile;            $slider_query->rewind_posts();          echo '
';          // Print the captions        while ( $slider_query->have_posts() ) : $slider_query->the_post();            echo '';           the_title();        echo '';          endwhile;          // Reset Post Data     wp_reset_postdata();           ?>      Hope someone can help. Thanks!


title: Role that can edit only widgets, not other theme options

text: How could I make particular role access widgets administration menu ( _wp- admin/widgets.php_ ), but **not** access other theme administration menu elements. I have got that far as to display **Appearance** menu linking to _widgets.php_ by binding to **_admin_menu** event and modifying global variable _$submenu_. Although that clearly does not work, as I see this code in _wp- admin/widgets.php_ itself:                   if ( ! current_user_can('edit_theme_options') )                 wp_die( __( 'Cheatin’ uh?' ));      It is clear - you SHALL NOT be allowed to access this page, unless you clearly have **edit_theme_options** capability. But what to do, if I do not want other elements of this capability, apart of widgets, modifiable by current user (role)? It is easy to "hide" other options from menu. But that leaves user, who knows how WP works (understands addressing, at least), free to access them and that I would clearly like to avoid. Thanks for any help in advance.


title: Comments from vbulletin topic

text: I have a WordPress site and a forum that runs vBulletin. Each article I post on the website is automatically posted as a thread on a specific forum category (using the website RSS feed). Now, I have one questions for those that are far more knowledgeable in WP: Is there a simple solution that would allow me to list the thread replies on the forum as comments in the corresponding WordPress article?


title: Customizing Wordpress the_title with add_filter

text: I'm trying to create a custom wordpress title for a posts made under a custom post. Basically, its a version changelog for an application. I would like to only input the version number in the title field, and the output has to be standardized with a string accordingly. My custom post type is 'custom_version' and the title output that I'm looking for is "Application has been updated to version ". I've understood that this can be achieved using add_filter and I've tried playing with this code for days now, but I'm not really a PHP Pro so help is much appreciated :) Here's the code:               add_filter('the_title', 'new_title');     function new_title($title) {         global $post, $post_ID;         $title['custom_version'] = 'Application has been updated to v'.$title;         return $title;     }


title: Custom Template for wordpress cpt plugin

text: I am creating a wp custom post type plugin. Which supports the custom meta datas as well.Now my question is i have to create a archive page with custom template file. I have added the appropriate function for archive page and as well as single page. Single.php file work fine whereas archive.php is not working. here is my funcitons               add_filter('template_include', 'testimonial_archive');     function testimonial_archive( $template )     {          $post_types = array('astestimonial');      if ( is_post_type_archive( $post_types ) && ! file_exists( get_stylesheet_directory() . '/testimonial_archive.php' ) )         $template = dirname(__FILE__) . '/list-testimonial.php';      if ( is_singular( $post_types ) && ! file_exists( get_stylesheet_directory() . '/single-testimonial.php' ) )         $template = dirname(__FILE__) . '/single-testimonial.php';     return $template;          }


title: How to safely sanitize a textarea which takes full HTML input

text: I'm developing a plugin which enables the user to send HTML emails from within the WordPress admin. How should I sanitize the textarea input? It has to be able to contain the whole range of HTML tags that might appear in an HTML email. If I use `wp_kses()` then I would have to use a huge list of allowed tags. The textarea saves its content to the db via custom options.


title: If Posted After Date

text: I need to get a different "get_template_part" based on the date and category. I have changed the outlay of the category which means any post in that category before today's date wont be able to use the new template but needs to still use the old one.               if ( in_category( 'photographer-interviews' )) {      get_template_part( 'content', 'interview' );     } else {      get_template_part( 'content', 'blog' );     }      So i need to also check if the post inside the "photographer-interviews" was posted after today. If it was continue to the new template if not keep using the old one (blog).


title: How to fix 502 errors on my WordPress site hosted on Windows Azure that only occur when I update a post?

text: I have a Wordpress site that is hosted on Windows Azure, with the database hosted separately. Every time I try to update a post I get a 502 error, specifically: > 502 - Web server received an invalid response while acting as a gateway or > proxy server. The DB provider says everything is fine - does anyone know how I can troubleshoot this problem? Oddly enough - basic reads are fine - the error only occurs when I try to update a post.


title: How to get the content in my website

text: I'm trying to find out how to get content from my (sidebar, individual post etc) directly on my website without it loading the whole WordPress blog page. (http://www.volunteeringnews.com/wordpress/). If for example you click on the first post "test" it will direct you to my blog site but I need it to stay on my webpage and display the message where the blog is. (http://www.volunteeringnews.com). I have JavaScript running for the rest of the website where it loads the content in a div (mainC2) but I can't figure out how to do it with WordPress. I've been asking around and doing loads of research but it seems there is not really a clear answer. So I got some options. Create a theme myself and make it look like my own website. Delete all the href links (witch will disable the option of comments). Both of them are not really what I want so now I am trying to get some advice. What would be a good way for me to get what I want or at least close enough? Thank you for looking in to it! Roald


title: How to set custom cookies in Wordpress after a form is filled on a page

text: I have built a custom template for page in Wordpress: page-xyz.php This page has a some content. I want to check cookie. What I want to do is: If cookie is set: //show page content else //don't show the content. Instead show this form:               <form action="" method="post">     Name: <input type="text" name="name">     Email: <input type="text" name="email">     <input type="submit" name="submit">     </form>      After this form is submitted:   1. cookie must be set   2. do some mysql query   3. show the content I have tried but no success so far.


title: WordPress Rewrite rule is not working

text: I am trying to create a rewrite rule for one of my custom page and here is the rewrite rule               function add_my_rule() {         global $wp;         $wp->add_query_var('name_state');         $wp->add_query_var('arg_second');         add_rewrite_rule('state/([^/]+)/([^/]+)/page/([^/]+)','index.php?pagename=places-to-visit&name_state=$matches[1]&arg_second=$matches[2]&paged=$matches[3]','top');         add_rewrite_rule('state/([^/]+)/([^/]+)','index.php?pagename=places-to-visit&name_state=$matches[1]&arg_second=$matches[2]','top');              global $wp_rewrite;         $wp_rewrite->flush_rules();     }          add_action('init', 'add_my_rule');      Here is what i am trying to do. I have following URL               www.mydomain.com/state/state-name/places-to-visit      I have already created a custom page with name `places-to-visit.php`.My intentions are to redirect all such URL's to this custom page and want following information as query variable from the URL


title: How to filter or remove the "title" attribute from category links

text:
I'm placing a list of category links with this code:

Categories List

         <?php                       function my_cat_title($category_description,$category){                 return '';             }                  $cat_args = array('orderby' => 'name');             $cat_args['title_li'] = '';             $cat_args['exclude_tree'] = 1;             $cat_args['use_desc_for_title'] = 1;             add_filter('category_description','my_cat_title');             wp_list_categories(apply_filters('widget_categories_args', $cat_args));             remove_filter('category_description','my_cat_title');                  ?>

      However, each of the links has a title attribute like 'title="View all posts filed under x"' How can I remove the title attribute altogether?


title: Custom Post Menu link reverting to Blog menu item

text: So I have a Custom Post Type setup and running with no issue. I also have a WordPress menu object as my primary navigation. I added my Custom Post to the main menu and when I click on to the landing page the correct menu item is highlighted. When I however click into an individual custom post, the "Blog" menu item is highlighted. Anyone got any idea as to what the frick is going on? Thanks, Ed


title: Getting custom-sized featured image's URL?

text: I'm adding additional image sizes to my theme: **functions.php**               add_image_size( 'my-thumbnails', 122, 122, true );        I used to get thumbnails URL like this:               wp_get_attachment_url(get_post_thumbnail_id($post->ID));       And it works like a charm, but I'm not sure how to display 'my-thumbnails' version of the thumbnail? This doesn't work:               wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'my-thumbnails' );        What's wrong?


title: Date filter for post query not filtering results when variable outside the function

text: I am working on the following code which should display the most popular posts that are X days old ($days = 7;) (1) The main problem here is with my filter_where function. I want to pass the number of days from outside the function but it wont filter the results. The only way it filters them is to insert the variable inside the function. So, how can I use my variable from outsite the function? (2) Another question I have is, In my get_topposts function, what happens after I return the query? Will the remove_filter and wp_reset_postdata still get executed or not? If not, how can I do so?               function get_topposts($days) {     //$ago = 7; // days     //$timestamp = time() - ($ago * 86400);              function filter_where( $where = '' ) {                        $where .= " AND post_date > '" . date('Y-m-d', strtotime('-'.$days.' days')) . "'";                     // $where .= " AND post_date > '" . date('Y-m-d', $timestamp) . "'";                         return $where;         }         add_filter( 'posts_where', 'filter_where' );               //$args = array();               $the_query = new WP_Query( $args );         return $the_query;         remove_filter( 'posts_where', 'filter_where' );         wp_reset_postdata();     }      EDITED: This is how it looks now after applying comments made by Milo               function filter_where( $where = '' ) {     //$days = apply_filters('custom_where_clause', '-30days');     //if(!$time)                 //$days = '-30days';                 // posts in the last 30 days                  //  $where .= " AND post_date > '" . date('Y-m-d', strtotime('-'.$days.' days')) . "'";                   $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7days')) . "'";                     return $where;     }     //add_filter('custom_where_clause', 'get_topposts');          function get_topposts($posts) {     $the_query = get_transient('get_topposts');     if (empty($the_query)) {         //$ago = 7; // days         //$timestamp = time() - ($ago * 86400);         //$days = 7;              add_filter( 'posts_where', 'filter_where' );         $args = array(             'posts_per_page' => $posts,             //'category_name' =>  'NAME OF CATEGORY',             'post_status'=>'publish',             'meta_key' => 'postviews',             'orderby' => 'meta_value_num',             'order' => 'DESC',         );          // The Query              $the_query = new WP_Query( $args );         set_transient('get_topposts', $the_query, 60*60*2);         remove_filter( 'posts_where', 'filter_where' );     }     return $the_query;     }


title: Customize WooCommerce Product Images (Placement and size)

text: so I'm having trouble trying to re-size my product thumbnail images. The site can be seen here : http://www.seekoften.com/eCommerce . I'd like the single-product page to have **square** thumbnails below the large featured image, but I also want the thumbnails that show in the cart (both on the page, and the sidebar cart widget ), to be vertically oriented, like the featured images, just a scaled down version of it. What files and which loops or lines of code should I look at, and how do I go about accomplishing this ? As a secondary question, how can I customize the output so that it shows the product images that you have in your cart, but on the checkout page ( again, preferably the large vertically oriented image ) ? For what it's worth, I have plugins like regenerate Thumbnails and Simple Image Sizes I would greatly appreciate any help that anybody is willing to offer, and would like to thank you all in advance for reading this at all :) Cheers, Sincerely, Chris "Fawkz" Coffin


title: Generate a nested list of all posts, sorted first by year, then by month

text:
2011

January

Post 1

Post 2

February

etc

etc

        ![mockup](http://i.stack.imgur.com/elx7I.jpg)


title: Is it possible to add an action to the currently running action?

text:
My question is very simple but I haven't found this answer yet. Here's an example:               class MyClass {       public function __construct(){         add_action('init', array($this, 'init'));         add_action('wp_footer', array($this, 'footer'));       }            public function init(){         add_action('init', array($this, 'register_scripts'));       }            public function register_scripts(){         wp_register_script('my-script', plugins_url('/script.js', __FILE__));       }            public function footer(){         echo('
Rawr this is my plugin.
');       }     }      This is how my code looks and it's failing. It displays the div but the javascript does not get applied. So I wondered if my problem was running the `init()` function in the init action and then adding `register_scripts()` to the init action but I'm already in that action. Is this possible?


title: How can I get this code to only output one link?

text: This is the code I'm using to output the child categories of my posts as links.               <?php     $mycats = array(106, 107);     foreach (get_the_category() as $childcat) {         foreach ($mycats as $mycat) {             if (cat_is_ancestor_of($mycat, $childcat)) {                 echo 'cat_ID).'">' . $childcat->cat_name . '';             }         }     }     ?>      My questions is, how can I get it to only output _one_ link, when the post is in more than one child category? I tried adding a break command after the last line, but that didn't work. Help appreciated.


title: How do you make the "Hover Text" plugin work?

text: I've been trying to make Hover Text work. It works with a single piece of code e.g. TOC => Table of Contents but when I have many lines of code, even though I follow all instructions (e.g. all text on one line, etc.) it does not render. I've tried checking the Hover Text homepage and FAQs and other links, I tired checking plugin and WordPress version compatibility, I've troubleshooted to see if other plugins are interfering (no), I've tried deleting the code/text and re-typing it in, or cutting and re-pasting, and refreshing multiple times, I've tried the same code on a new page, I searched different forums and people reported the same problem but I did not find any report of solutions. Any assistance would be VERY much appreciated. Our website launch is Wednesday. Thanks!!! Marilyn


title: Some informations about the use of statics pages in WordPress

text: I am pretty new in WordPress world (I came from Joomla) and I have some questions about the use of static pages in WordPress. I have to use WordPress to implement a mainly static site (maybe in the future I will add some dynamic behavior but at this time I only need some statics pages) So I have install a WordPress example intallation on my server: http://onofri.org/example/ and I have create a first static page, this one: http://onofri.org/example/?page_id=4 Now I have 3 doubts on how to proceed my work:   1. **How can I say to WordPress to use the previous static page as an HomePage? I would that when the user open my website this page is show as a lassic static homepage, can I do this thing? how?**   2. **As you can see in the top of the page (upon the header) there is a menù with the names of my statics page (sample page and my HomePage pages), how can I don't show this menù? Have I to delete it from the code of my template or can I disable it from the WordPress administration pannel?**   3. **Can I have a classic menù containing the list of my statics pages in the left column (something like in this site:http://www.saranistri.com/ where in the left column I have a menù with the links to my pages)** Thanks Andrea


title: Is there a 'rake routes' for wordpress?

text: Is there an equivalent to 'rake routes' in php/wordpress that would spit out all the available wordpress url paths available?


title: How to create a complete mulilanguage site using xili language plugin?

text: I am using xili language plugin for create a multi language site. Using this i can create posts and pages on different languages. But when i switch to other language the menus doesn't converted to other language. How can i convert the menus too. Any suggestions ?


title: Use Gravity Forms and a Shopping Cart for output to Freshbooks for an Estimate

text: I've been asked to develop a website pretty much like (but not the same as): http://www.yoursingapore.com/ basically we need to allow people to add Wordpress posts (custom post types) into a sort of shopping cart (people won't make any payment); the website won't have any checkout, but the resulting list of items (posts), each one carrying one cost and other details in meta fields and gravity form (http://www.gravityforms.com/) options, should be sent to Freshbooks (http://www.freshbooks.com/) to generate an estimate (or be used for other purposes as well, ie. sent as email, or other services, within our outside Wordpress) What would you use to combine Gravity Forms with? I don't think I can do the job myself unless there's a solution ready (which I doubt), I'd rather hire a developer for my project. Nevertheless, I would like to hear some opinion on what would be the best route to go. To recap   * we have a website with custom post types   * each custom post type has certain custom fields with prices and details   * users, through gravity forms, should be able to specify further details like dates (ie checkin/checkout) and options (price changes)   * by clicking "add to list" the item is sent to the shopping cart    * when the user has finished, he should be able to review and eventually edit the resulting list   * then send the quotation request, which will be deliered to Freshbooks as an Estimate, including Client contact creation within Freshbooks (using Freshbooks API)   * eventully the same data of the final "cart" form could be used also for other puroposes thanks for any opinion you will share with me


title: Create WordPress taxonomies based on theme settings

text: Is it possible to create taxonomies based on theme settings? That is, are theme settings actions run before taxonomies / post types are initialized?


title: How to save array of datas in option page by setting api?

text:
I am trying to create my own first plugin but I am coding novice so please guide me to the right direction. This plugin is to set the post expiry date based on the user's role. Now I am stuck at the saving data phase. Since I don't want to create a new database table for the inputs. I using the settings api to do the work and saving the data in wp_options table. In my plugin setting page, I want the user able to add/edit/delete the rules. Each rule is defined by the user, with multiple inputs. To add a rule, the user to select the role, post_type, expired_action, and day_limits. I want these inputs to be stored in an array, how can I do that? For example :               array(1) {     role           => "" // get from the form input     post_type      => "" // get from the form input     expired_action => "" // get from the form input     day_limti      => "" // get from the form input              }          array(2) {         role           => ""      post_type      => ""      expired_action => ""       day_limti      => ""          }          array(3) {     role           => ""      post_type      => ""      expired_action => ""      day_limti      => ""             }     ......etc      How do I use the input name my html form so that they can saved in an array every time a user submit a rule? This is my html form in plugin option page for adding the rule:               <form action="options.php" id="apext_form" method="post" name="author_limit">                   <?php settings_fields('apext_Options'); ?>

                          <?php _e('User Role', 'apext') ?>             <select name="role" id="apext_role_id">              <option></option>                <?php global $wp_roles; if ( !isset( $wp_roles ) ) $wp_roles = new WP_Roles();                 foreach ( $wp_roles->role_names as $role => $name ) { ?>                 <option value="<?php echo $name; ?>"><?php echo $name; ?></option>                         <?php }                ?>             </select>
             	                               <?php _e('Post Type', 'apext') ?>               <select name="apext_pt" id="apext_pt_id">               <?php $post_types=get_post_types('','names');                     foreach ($post_types as $post_type ) {                 ?>                 <option value="<?php echo $post_type;?>"><?php echo $post_type;?></option>                 <?php }                 ?>             </select>
                  	                  <?php _e('Expired Action'); ?>              <select name="remove_to" id="re_to"><option value =''></option>                                                  <option value="pending">pending</option>                                  <option value="draft">draft</option>                                  <option value="trash">trash</option>                                  <option value="delete">delete</option>             	                                  <?php _e('Days Limit', 'apext') ?>                         <input type="text" id="apext_lim" name="apext_lim" id="lim" size="4" value="<?php echo get_option('apext_lim');?>"/>
              	                           <input class="button-primary" type="submit" name="Submit" value="<?php _e("Submit Rule", 'apext') ?>" />

      </form>      I know the form is not working, since it has no reference name from register_settings. It just help you to understand what I am trying to do. Again, my question: how can I saved those input values in an array?


title: Is there some way to provide the user a list of existing content in a CPT

text: I was looking at the way WordPress uses "Or Link to Existing Content" under the link button in the editor and I am wondering if there is any way I can use that code to allow users to select a page to link to when they create a new custom post. The context I am talking about is that of slides for a slider linking to content within the site.


title: WP Query and multiple pages

text: Can anyone tell me why this isn't working? Assuming two things here - 1. WP Query handles multiple page requests, and 2. doesn't need a reset because I'm creating a new WP Query. What happens is I only get the last page to be shown (389). Above this code on the same page there is another WP Query that only fetches one page. Could this be the reason, or is it the way I request the pages? I've tried applying all the reset handlers but they gave no effect. The code -               <?php $promo = new WP_Query( array( 'post_type' => 'page', 'post__in' => array(62,18,389) ) ); while ($promo->have_posts()) : $promo->the_post(); ?>     <?php the_permalink() ?>     <?php the_post_thumbnail() ?>     <?php the_title() ?>     <?php the_excerpt() ?>     <?php endwhile; ?>


title: How to create Loop code for Menu using Wordpress?

text: I have created a menu called "My Menu" in wordpress using Menus feature provided under Wordpress admin panel. I have added 3 pages into it named Page A, Page B, Page C. I have applied featured image to all these 3 pages. Now what I want to do is, I want to create a code that will loop through this "My Menu" and print all 3 featured images of these 3 pages. How can I do that ? Thanks in advance.


title: Accessing two databases wordpress

text: I'm trying to access a second database with my wordpress system. To do this, I've attempted to follow the advice found here which seems to have worked for a lot of people. In summary, I'm adding the following line to my functions.php:               global $newdb;     $newdb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);     $newdb->show_errors();      Unfortunately, when I add this I come up with the following error: > Fatal error: Class 'wpdb' not found in /home/mine/www/wp- > includes/functions.php I'm sure I must be missing wrong (obviously, right?) but the instructions don't seem to have any extra steps that I've been leaving out. Thanks for any help


title: Get all first images of posts in same category

text:
I am trying to build a list of thumbnail images linked to their associated single content pages within the same category. So, when I am in the category of 'x' the list returns all image attachments from every post in category 'x'. I have the following code in my sidebar which is brought into only the content-single pages. However this just returns the current posts image and not other posts in the same category. What am I doing wrong? EDIT: Or is this even possible?               <?php if ( is_single() ) { ?>
<?php $category = get_the_category(); echo $category[0]->cat_name; ?>

         <?php while ( have_posts() ) : the_post(); ?>
             <?php $size = 'thumbnail';             $attachments = get_children( array(                 'post_parent' => get_the_ID(),                  'post_status' => 'inherit',                  'post_type' => 'attachment',                  'post_mime_type' => 'image',                  'order' => 'ASC',                  'orderby' => 'menu_order ID',                  'numberposts' => -1             ));             foreach ( $attachments as $thumb_id => $attachment )                 ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php echo wp_get_attachment_image($thumb_id, $size); ?>
         <?php endwhile; ?>
     <?php } ?>


title: Plugin can not display in my custom theme

text: I have made my first theme. :) But I have a problem: plugins such as getsocial or dynamicwp-contact-form can not display in my custom theme. I tried using them in the twentyeleven theme, and they don't have that problem there. I think there is a problem with my theme but I don't know where..


title: How to create a template for Pages?

text: In Wordpress, when creating a page, it shows some options for Template under Attributes, such as: Default, Links, One column no sidebar, etc. Is there a way to add more custom templates to show up here? If so, how?


title: How to structure Multisite sites into categories?

text: When using WordPress Multisite with many sites, it would be nice to store them into categories. Site categories that is, not post categories. Maybe there is a way to use some kind of site meta / custom fields for sites? Is there one? How to use it? A plugin would be nice, or an example of a start, what hooks / functions to use.


title: How to show password fields on registration form w/o plugins

text:
I want to show hidden password fields on registration form. I found that these fields are already present in /wp-admin/user-new.php               <?php if ( apply_filters('show_password_fields', true) ) : ?>
         <?php _e('Password'); ?> <?php /* translators: password input field */_e('(twice, required)'); ?>	         <input name="pass1" type="password" id="pass1" autocomplete="off" />
         <input name="pass2" type="password" id="pass2" autocomplete="off" />

<?php _e('Strength indicator'); ?>

<?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).'); ?>

         <?php _e('Send Password?') ?>	         <input type="checkbox" name="send_password" id="send_password" <?php checked( $new_user_send_password ); ?> /> <?php _e('Send this password to the new user by email.'); ?>
      <?php endif; ?>      I assumed that show_password_fields is a function, that returns some value, so I can change its behavior with filters. Then I add following to my functions.php:               add_filter( 'show_password_fields', function(){return true} );      but nothing happend. Is it possible to do it with one or two lines? Thanks in advance!


title: Make tag cloud links consistent

text: I'm using this code: ` <?php wp_tag_cloud( array( 'taxonomy' => 'channels') );?>` To display custom taxonomy as a cloud tag. How can display with all links being the same size? I can't seem to override the inline styles.


title: how to convert XML from URL to HTML

text: I would like to know how can I, in Wordpress, convert XML URL (for example http://www.baligam.co.il/products/rss) to HTML and show it in actual. Maybe there is a plugin for this purpose? Thanks,


title: Is it true $wpdb->get_results is faster than WP_Query in most cases?

text:
On my homepage, I have a section where I have to display the last five featured posts, where a featured post is simply a post with a custom field is_featured set to 1. I achieved what I want with two different type of codes:      **Using wpdb**               <?php             $featuredPosts = $wpdb->get_results("             SELECT ID, post_title FROM $wpdb->posts             LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)             WHERE $wpdb->postmeta.meta_key = 'is_featured'             ORDER BY ID DESC LIMIT 5         ");              if ($featuredPosts)         {             $htmlOutput = '';                                     foreach ($featuredPosts as $featPost)                 $htmlOutput .= '
ID).'">'.$featPost->post_title.'';         }              echo $htmlOutput;     ?>         According to the "Query Monitor" plugin, this query takes 0.1s and generates this SQL:               SELECT ID, post_title     FROM wp_posts LEFT JOIN wp_postmeta ON(wp_posts.ID = wp_postmeta.post_id)     WHERE wp_postmeta.meta_key = 'is_featured'     ORDER BY ID DESC     LIMIT 5         **Using Wordpress' native calls**               <?php                                                                                $featuredPostsRevised = new WP_Query         (             array             (                 'meta_query' => array                 (                     array                     (                         'key' => 'is_featured'                     )                 )              )          );                while($featuredPostsRevised->have_posts()) : $featuredPostsRevised->the_post();     ?>
             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>     <?php         endwhile;     ?>         According to the "Query Monitor" plugin, this query takes 0.2s and generates a somehow longer SQL:               SELECT SQL_CALC_FOUND_ROWS wp_posts.ID     FROM wp_posts     INNER JOIN wp_postmeta     ON (wp_posts.ID = wp_postmeta.post_id)     WHERE 1=1     AND wp_posts.post_type = 'post'     AND (wp_posts.post_status = 'publish'     OR wp_posts.post_status = 'private')     AND (wp_postmeta.meta_key = 'is_featured' )     GROUP BY wp_posts.ID     ORDER BY wp_posts.post_date DESC     LIMIT 0, 10      My questions are:   1. How can I `prepare()` my `wpdb` query? I tried but couldn't manage because of the second parameter.   2. After using prepare, am I right in assuming that in terms of security and performance, `wpdb` is indeed a better solution?


title: Can't grab author info outside of the loop

text:
I have an author box outside of the loop that is supposed to grab the name of the author, but the correct author isn't being displayed most likely because these tags only work inside the loop. What can I change in this code to make it work outside of the loop?

About <?php echo get_the_author(); ?>
                 <?php echo get_avatar( get_the_author_meta( 'user_email' ), 70 ); ?>

<?php the_author_meta( 'description' ); ?>

<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">View all posts by <?php echo get_the_author(); ?> →

      Full code for single.php below:               <?php get_header(); ?>
                  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                               <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">

                              <?php the_category(', '); ?>
                                  <?php the_title(); ?>                                  <?php $format = get_post_format(); ?>                             <?php if ($format == "image" || $format == "gallery" || $format == "video") : ?>                             <img src="<?php echo get_template_directory_uri(); ?>/images/icon-<?php echo $format; ?>.png" alt="<?php echo $format; ?>" />                             <?php endif; ?>
                              <?php _e('Posted', 'engine') ?> <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' '.  __('ago', 'engine'); ?>                         <?php _e('by', 'engine') ?> <?php the_author_posts_link(); ?> <a class="post-twitter" href="http://twitter.com/<?php the_author_meta('twitter') ?>" target="_blank"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/twitter-icon.png" />

                                       <div class="featured-image <?php echo get_post_format(); ?>">                          <?php if (get_post_format() == 'video' && get_post_meta(get_the_ID(), 'dt_video', true) != '') : ?>                              <?php                         global $wp_embed;                         $video_url = get_post_meta(get_the_ID(), 'dt_video', true);                         $video_embed = $wp_embed->run_shortcode('[embed width="700"]'.$video_url.'[/embed]');                         ?>                         <div id="video-<?php the_ID(); ?>"><?php echo $video_embed; ?>
                          <?php elseif (get_post_format() == 'gallery') : ?>
                                  <?php                                  $args = array(                                 'orderby'        => 'menu_order',                                 'order'          => 'ASC',                                 'post_type'      => 'attachment',                                 'post_parent'    => get_the_ID(),                                 'post_mime_type' => 'image',                                 'post_status'    => null,                                 'numberposts'    => -1,                             );                                  $attachments = get_posts($args);                                  ?>                                  <?php if ($attachments) : ?>
                                  <?php foreach ($attachments as $attachment) : ?>                                      <?php                                     $format = get_post_format();                                     $src = wp_get_attachment_image_src( $attachment->ID, array( '9999','9999' ), false, '' );                                     $src = $src[0];                                     $image = dt_resize($attachment->ID, $src, 700, '', true);                                     $caption = $attachment->post_excerpt;                                 ?>
                                          <span class="overlay-icon overlay-<?php echo $format; ?>"><a rel="group-<?php the_ID(); ?>" title="<?php echo $attachment->post_title; ?>" class="colorbox-<?php echo $format; ?>" href="<?php echo $src; ?>">                                          <img                                     height="<?php echo $image['height']; ?>"                                     width="<?php echo $image['width']; ?>"                                     alt="<?php echo apply_filters('the_title', $attachment->post_title); ?>"                                     src="<?php echo $image['url']; ?>"                                     />                                          <?php if($caption != '') : ?>                                     <?php echo $caption; ?>                                     <?php endif; ?>
                                  <?php endforeach; ?>

                                      Next                                 Prev
                                  <?php endif; ?>
                          <?php elseif (has_post_thumbnail() && get_option('dt_blog_image') != 'false') : ?>                              <?php                          $thumb = get_post_thumbnail_id(get_the_ID());                         $image = dt_resize( $thumb, '', 700, '', true );                         echo '';                         ?>                          <?php endif; ?>

                     <?php the_content(); ?>

                          <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' '.  __('ago', 'engine'); ?>                          <?php comments_number(__('No Comments', 'engine'), __('1 Comment', 'engine'), __('% Comments', 'engine')); ?>

                 <?php                     $prevPost = get_previous_post();                      if(isset($prevPost->ID))                     $prevthumbnail = get_the_post_thumbnail($prevPost->ID, array(100,100) );                     $nextPost = get_next_post();                      if(isset($nextPost->ID))                     $nextthumbnail = get_the_post_thumbnail($nextPost->ID, array(100,100) );                      $default = '';                 ?>

                         <?php                             if ($nextPost && '' != get_the_post_thumbnail($nextPost->ID, array(100,100))) {                                  next_post_link('%link', $nextthumbnail, false);                                  next_post_link('%link', '« %title', false);                              } elseif ($nextPost) {                                 next_post_link('%link', $default, false);                                  next_post_link('%link', '« %title', false);                             } else {                                 print '
' . __( 'You are at the beginning!' ) . '
';                             }                            ?>

                         <?php                             if ($prevPost && '' != get_the_post_thumbnail($prevPost->ID, array(100,100))) {                                  previous_post_link('%link', '%title » ', false);                         previous_post_link('%link', $prevthumbnail, false);                              } elseif ($prevPost) {                         previous_post_link('%link', '%title » ', false);                                 previous_post_link('%link', $default, false);                                   } else {                                 print '
' . __( 'You are at the end!' ) . '
';                             }                            ?>

                   <?php $related = get_option('dt_related');                  if($related == 'true') : ?>

Recommended
                          <?php                          $related = dt_get_posts_related_by_taxonomy(get_the_ID(), 'category', get_the_ID());                          ?>
                              <?php  if($related->have_posts()) : while ($related->have_posts()) : $related->the_post(); ?>                                                       <li id="featured-post-<?php the_ID(); ?>">

                                                                              <?php the_title(); ?>                                         <?php dt_overlay_icon(); ?>
                                 <a href="<?php the_permalink(); ?>"><?php dt_image(200, ''); ?>
                              <?php endwhile;  else: ?>
<?php _e('There are no related posts.', 'engine'); ?>
                         <?php endif; ?>

                  <?php endif; ?>

About <?php echo get_the_author(); ?>
                     <?php echo get_avatar( get_the_author_meta( 'user_email' ), 70 ); ?>

<?php the_author_meta( 'description' ); ?>

<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">View all posts by <?php echo get_the_author(); ?> →

                                                  Please enable JavaScript to view the comments powered by Disqus.

                  <?php endwhile; else : ?>
<?php _e('No posts found', 'engine'); ?>
                  <?php endif; ?>
          <?php get_sidebar(); ?>          <?php get_footer(); ?>


title: Description is not seen of my title in search engine?

text: I'm using Wordpress SEO plugin and I can also see my site in google search But in general settings of Wordpress I gave title as `Gamers | Play game online` and description and also provided some description `Say something about website` But it shows me only `Gamers` as title and description is not seen what I gave in meta tag instead it shows all link name of the menus of the website. Can any one guess what might be the problem?


title: When developing entire sites for clients, is it viable to version control the entire site?

text: How do you then manage the database? An alternative, of course, is to just keep the themes in version control, and then upload them manually to the site when deploying. edit: Close this, it's duplicate. I couldn't "flag" it.


title: query with custom field

text: I figured out with my jquery slider. Need to help (: my query is:               <?php $the_query = new WP_Query('showposts=10&orderby=post_date&order=desc'); while ($the_query->have_posts()) : $the_query->the_post(); ?>     <?php $imaj = get_post_meta($post->ID, 'manset', true); ?>          <?php the_permalink()?>     <img src="<?php echo $imaj; ?>" alt="" />          <?php endwhile;?>     <?php wp_reset_query(); ?>      with this query, **the query** print all posts. But i would like to display just if the post has "manset" custom field in it. how can i do that ( sorry about my bad english )


title: Code to check amount of blog posts and add css

text:
Is there any sort of jquery I can use to check if there is only one blog post on the page, then to add custom CSS? And if there is more than one, add different CSS?
       <?php if ( have_posts() ) : ?>         <?php while ( have_posts() ) : the_post( '' ); ?>

               <time datetime="<?php the_time( 'Y-m-d' ); ?>" pubdate><?php the_time( 'F j, Y' ); ?></time>
                 <p href="<?php the_permalink(); ?>"><?php the_title(); ?>

                 <?php the_content(); ?>

               <?php               echo(types_render_field( "blog-image", array("output" => "html") ));               ?>

               <?php endwhile; ?>       <?php endif; ?>


title: How to add thumbnails to posts?

text: I am using the latest version of WordPress with the Twenty Ten theme. How can I add thumbnails to each of my posts? A step-by-step guide would be helpful in this regard.


title: Link to full size image or attachment page in photo theme

text: My site is using WooThemes Statua theme. I'm trying to get my resized slider images to link to their respective full size images (or attachment pages). I asked a similar question on the WooThemes support forums (members login required) and the code they provided links the images to the resized 960px Large image size instead of the Full size images. Here's an example page on my site, using the single.php template, and its code. How can I get the slider images to link to the full size originals or attachment pages?


title: template_include filter does not render the custom template

text: I created a plugin that will render a shortcode that is entered to a page. This Shortcode shall override the theme's page template and use the one that I included on the plugin Here's my code: api.php                  class Api{              public static $logger = null;              function Api() {             add_shortcode('my_shortcode', array(&$this, 'my_shortcode_function'));         }              function my_shortcode_function($atts,$content = null)            {             add_filter( 'template_include', 'custom_view');                  }              function custom_view()         {             $template = plugin_dir_path( __FILE__ ) . 'custom-page.php';                  return $template;              }     }              add_action('init', 'apiInit', 10);         function apiInit() {              global $api;             if (class_exists('Api')){         $api = new Api();       }         }      and here's my custom-page.php (which I am 100% sure that is in the correct path / directory that I am pointing in the code)                  <?php        /**         * Response View Template         * File: custom-page.php         *         */        echo 'I am here!';       <?      Tried to debug each function it goes through my_shortcode_function() but does not go through custom view function. Cheers!


title: Insert PHP into wordpress page

text: I want to use the following code in my wordpress page. How can I do that?               <?php     $theme_name = get_template();     $directory = "wp-content/themes/" . $theme_name . "/pdf/ECE340/";     $pdfs= glob($directory . "*.pdf");     foreach($pdfs as $pdf)     {     $link= substr($pdf,48,90);     ?>     <a href="<?php echo $pdf;?> "><?php echo $link;?>     <?php     echo "\n\n";     }     ?>


title: add_action does not work when instance multiple tab-containers via template-file

text: I wrote my first class in functions.php which I want to use to create multiple tabs with a simple call all over my template files. When I create a new instance directly in functions.php everything is fine for that instance. But when I call my class via a helper function outside my functions.php, all action hooks do not take effect. Are there any suggestions how to get this done? Regards               class EasyTabs {          private static $instance;          public static function get_instance() {              if ( !self::$instance instanceof self )             self::$instance = new self;         return self::$instance;          }          public function container_id() {         $id = rand(1000,9999);         return $id;     }          public function get_the_tabs() {         ...     }          public function tabs_js() {         ...     }          public function tabs_styles_and_scripts() {         // style         wp_register_style('jquery-easytabs-style', get_stylesheet_directory_uri() . '/inc/easytabs/style.css', array(), '', 'all');         wp_enqueue_style('jquery-easytabs-style');              //script         wp_register_script('jquery-easytabs-min', get_stylesheet_directory_uri() . '/inc/easytabs/jquery.easytabs.min.js', array('jquery'), '', false);         wp_enqueue_script('jquery-easytabs-min');         wp_register_script('jquery-hashchange-min', get_stylesheet_directory_uri() . '/inc/easytabs/jquery.hashchange.min.js', array('jquery'), '', false);         wp_enqueue_script('jquery-hashchange-min');     }          public function __construct() {         //actions         add_action('wp_enqueue_scripts', array ( $this, 'tabs_styles_and_scripts' ));         add_action('wp_head', array($this, 'tabs_js'));     }          }          if ( !function_exists( 'the_tabs' ) ) {         function the_tabs() {             echo EasyTabs::get_instance()->get_the_tabs();         }     }      **Edit:** Thanks for the hint, looking for a hook which fires later did the trick: http://shibashake.com/wordpress-theme/wp_enqueue_script-after-wp_head               class RFRQ_Tabs {              public $containerID;         public $posttype;              public function __construct( $posttype ) {             // set vars             $this->set_container_ID();             $this->set_posttype($posttype);             //add scripts and styles             add_action('wp_footer', array($this, 'scripts'));             add_action('wp_print_footer_scripts', array($this, 'ex_scripts'), 1);         }              ...              public function scripts() {             echo "<script type='text/javascript'>";                 echo "jQuery(document).ready( function() {";                     echo "jQuery('#tab-container-" . $this->get_container_ID() . "').easytabs();";                 echo "});";             echo "</script>";         }                   public function ex_scripts() {                     if (is_admin())                 return;             wp_enqueue_script('jquery-easytabs-min', get_stylesheet_directory_uri() . '/inc/easytabs/jquery.easytabs.min.js', array('jquery'), '', true);             wp_enqueue_style('jquery-easytabs-style', get_stylesheet_directory_uri() . '/inc/easytabs/style.css', array(), '', 'all');             }       }     /**      * RFRQ      * helper function to instance an tab-object      */     if (!function_exists('the_tabs')) {         function the_tabs( $posttype ) {             $easytabs = new RFRQ_Tabs( $posttype );             echo $easytabs->get_the_tabs();         }     }


title: Change template on the fly based on post parent selection

text: I want to change my page template automatically when someone selects a specific post parent. I have the code to update the template but couldn't find anything for detection of post parent attribute changes. Can you help?


title: Disable plugin function

text: I want to hide most of the backend links added by TinyMCE Templates plugin. I have problem with 'Copy to a new template' link inside Publish box. Plugin code:               add_action('post_submitbox_start', array(&$this, 'post_submitbox_start'));      I try (and it doesn't work):               function remove_post_submitbox_link(){         global $tinymceTemplates;         remove_action('post_submitbox_start', array( $tinymceTemplates, 'post_submitbox_start' ) );     }     add_action('plugins_loaded', 'remove_post_submitbox_link', 11);      Why that doesn't work?


title: save_post custom post type ? $_POST not working?

text:
i have this code.               <?php     add_action('add_meta_boxes', 'ct_meta_add');     add_action('save_post','ct_meta_save');     add_action('save_post','ct_parent');     // add meta functions     function ct_meta_add() {         add_meta_box(             'ct_chap', //id             'Thông tin chương', //title             'ct_meta_show', //callback function             'chap', //post type                  'normal' //priority         );     }     function get_blogspot_url($string) {         preg_match_all('/<a href="(.*?)"/', $string, $matches);         $string = '';         foreach($matches[1] as $val) {             $string .= $val."\n";         }         $string = str_replace('s1600', 's0', $string);         return $string;     }     // save meta functions     function ct_meta_save() {         global $post;            /* Save meta */         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;         if ( !wp_verify_nonce( $_POST['ct_nonce'], plugin_basename( __FILE__ ) ) ) return;         if( !current_user_can( 'edit_post' ) ) return;           $meta = array('ct_download_link', 'ct_list_url', 'ct_list_url2');         foreach($meta as $dt) {                  if($dt == 'ct_list_url2') {                          $_POST[$dt] = get_blogspot_url($_POST[$dt]);             }             if(isset($_POST[$dt]) && $_POST[$dt] !== '') {                 update_post_meta($post->ID, $dt, $_POST[$dt]);             } else {                 delete_post_meta($post->ID, $dt);                }                }        }     ?>     <?php     function ct_parent() {          global $post;         if($_POST['ct_truyen'] && $_POST['ct_truyen'] != "") {             //lưu hoặc thay đổi truyện của chap             $ct_post = array();             $ct_post['ID'] = $post->ID;             $ct_post['post_parent'] = $_POST['ct_truyen'];               //thay đổi thời gian cập nhật truyện             $tr_post = array();             $tr_post['ID'] = $_POST['ct_truyen'];                $tr_post['post_modified_gmt'] = current_time('mysql');             $tr_post['post_modified'] = current_time('mysql',7);                     remove_action('save_post','ct_parent');                  remove_action('save_post','tr_parent');              wp_update_post($ct_post);                wp_update_post($tr_post);                add_action('save_post','ct_parent');         }     }        ?>     <?php //save_meta function     function ct_meta_show() { ?>         <?php             global $post;             $ct_download_link = get_post_meta($post->ID, 'ct_download_link', true) ? get_post_meta($post->ID, 'ct_download_link', true) : '';             $ct_list_url = get_post_meta($post->ID, 'ct_list_url', true) ? get_post_meta($post->ID, 'ct_list_url', true) : '';             $ct_list_url2 = get_post_meta($post->ID, 'ct_list_url2', true) ? get_post_meta($post->ID, 'ct_list_url2', true) : '';         ?>         <?php wp_nonce_field(plugin_basename(__FILE__), 'ct_nonce');  ?>

                 Truyện<a class="add-chap-truyen" href="<?php echo admin_url('post-new.php?post_type=truyen'); ?>">thêm truyện	                                      <?php                     global $post;                     global $wpdb;                     $query = "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'truyen' AND post_status = 'publish' ORDER BY post_title";                     $results = $wpdb->get_results($query, OBJECT);                     echo '<select name="ct_truyen" id="ct_truyen">';                     if(!$_GET['truyen_id'] || !get_the_title($_GET['truyen_id'])) {                         echo '<option value = "">None</option>';                         foreach ($results as $r) {                             echo '<option value="', $r->ID, '"', $r->ID == $post->post_parent ? ' selected="selected"' : '', '>', $r->post_title, '</option>';                         }                     } else {                         foreach ($results as $r) {                             echo '<option value="', $r->ID, '"', $r->ID == $_GET['truyen_id'] ? ' selected="selected"' : '', '>', $r->post_title, '</option>';                         }                     }                     echo '</select>';                     ?>

                 Địa chỉ tải chương	                 <input type="text" name="ct_download_link" class="regular-text" value="<?php echo $ct_download_link; ?>"/>

                 Địa chỉ ảnh đọc online	                                      Địa chỉ ảnh 1
<textarea name="ct_list_url" rows="20" class="large-text code"><?php echo $ct_list_url; ?></textarea>
                     Địa chỉ ảnh 2
<textarea name="ct_list_url2" rows="20" class="large-text code"><?php echo $ct_list_url2; ?></textarea>

         <?php } ?>     <?php     //auto chap title     add_filter( 'default_title', 'ct_auto_title');     function ct_auto_title($title) {         if($_GET['truyen_id'] && get_the_title($_GET['truyen_id'])) {             $chap_number = get_number_chap($_GET['truyen_id']);             $title = get_the_title($_GET['truyen_id']) . ' chương ' . ($chap_number+1);             return $title;         } else {             return $title;         }     }     function ct_remove_excess_columns( $columns ) {              unset($columns['author']);         unset($columns['comments']);         unset($columns['wpseo-score']);         unset($columns['wpseo-title']);         unset($columns['wpseo-focuskw']);         unset($columns['wpseo-metadesc']);           return $columns;         }     add_filter( 'manage_edit-chap_columns' , 'ct_remove_excess_columns' );     ?>      everything is OK, but when i was saving, the function `get_blogspot_url($_POST[$dt])` didn't work because $_POST[$dt]. When i replace `get_blogspot_url($_POST[$dt])` with,               get_blogspot_url('

')      it works, so i think $_POST[$dt] have problem, can you help me? You can download php file: https://dl.dropbox.com/u/52812919/chap-meta.rar :( Sorry about my bad english


title: Allow HTML in excerpt

text: Here is my excerpt code.               // Generate custom excerpt length     function wpbx_excerpt_length($length) {         return 300;     }     add_filter('excerpt_length', 'wpbx_excerpt_length');      How do I allow html like `<a> <b> <i> <br>`


title: Craft theme content links are stripped

text: I'm working with Craft theme and I have a link on in my post. The Link works fine in the post but not on the home page where it is showcased. I was thinking I put it in the post incorrectly at first. However it looks like the theme is stripping out the link for some reason. I am trying to figure out where I can correct this. Is there some pre processing going on somewhere in the themes code that does this and where is the best place to prevent it from happening ? you can see the behavior on this site


title: Views count with time limit per IP

text: I've been looking for function about post views count. I found this simple functions using update and get post meta.               function setPostViews($postID) {         $count_key = 'views';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }      What I want is, to add functions to limit the count added per IP by given time - a day for example. So when the IP visiting on the same day, it would not counted, just once. Any idea? Thanks.


title: How to set up conditionals in page templates?

text: I have created custom template page like this with a custom query on page showing only details fetch from my custom table not any post.               /*          Template Name:product          */     <?php get_header(); ?>     <?php              $data = $wpdb->get_results("myquery Here");         foreach($data as $row)         {             product Name:  $row->p_name;             prod price: $row->p_price;     ?>         VIEW PRODUCT          <?php         }     ?>     <?php get_footer();?>      I need help about when we click on "VIEW PRODUCT" then how can I redirect to next view_detail page? For that can I create another *view_detail.php* page? What should I write on `href=""` with passing `product_id`, which I get on view_detail.php.


title: Get page slug and assign a variable within functions.php

text: I have created a lazy loading script using AJAX and JSON for my blog. It works perfectly. However I have 4 different blogs on the same site. These are created using custom post types. I need to get the AJAX to do lazy loading for all of these blogs. I can get it to work for each one by manually changing the name from post to boutiques for example. So I created a variable called $postname and want to assign this a different value depending on the slug of the page you are on when you click load more posts. How can i check what page slug is and then assign my variable a name. Here is my code but I need to know how to call the slug of the page im on and assign that to $slug.               if ( $slug == 'boutiques'  ) {              $postname = 'boutiques';          } elseif ( $slug == 'tourist' ) {              $postname = 'tourist';     }     else {         $postname = 'post';     }


title: how to fetch the meta field keys/meta boxes from a post type?

text: I need to find all the meta keys or meta boxes preferably from just a post type ...couldn't find any wordpress function to do this. Any custom queries?


title: Register/Get sidebar?

text:
I can't quite seem to figure out how it works. By default i have a sidebar in sidebar.php that i load using `get_sidebar();`. That works great (no need to register it), but i have a custom page template for another page where i want to load another sidebar. I know i can use include('filename') to load it but i assume there is some sort of wordpress way to do it as well. I know i have to register the new sidebar in the functions.php file, but where do i actually reference the sidebar file? From the doc:               name - Sidebar name (default is localized 'Sidebar' and numeric ID).     id - Sidebar id - Must be all in lowercase, with no spaces (default is a numeric auto-incremented ID).     description - Text description of what/where the sidebar is. Shown on widget management screen. (Since 2.9) (default: empty)     class - CSS class name to assign to the widget HTML (default: empty).     before_widget - HTML to place before every widget(default: '
') Note: uses sprintf for variable substitution     after_widget - HTML to place after every widget (default: "
\n").     before_title - HTML to place before every title (default:
).     after_title - HTML to place after every title (default: "
\n").      In neither of those preferences do you specify the filename of the sidebar, so how do i do it? After i have registered it successfully, i assume i can load it using `get_sidebar(ID);`, will that work? Any help is very appreciated!


title: Check if a post is in any child category of a parent category

text: In a site I'm developing, I have the following category structure:               * movies (parent)         * thriller (child)         * comedy (child)         * drama (child)      The current post is in the **comedy** category. The **has_term** function with the following parameters returns true:               has_term( 'comedy', 'category' )      But, the same function with the following parameters returns false:               has_term( 'movies', 'category' )      My question is, is there a core function to check if the current post is in any child category of a specific parent category? If not, how can I check this? Thanks in advance


title: Multiple category lists on one page

text: Is it possible to use `wp_list_categories( $args )` several times on a page to list different groups of terms from a taxonomy? The following code displays on term#58 together with a child that says "No Categories". None of the child terms appear on the page. However, if I remove the first use of the tag `wp_list_categories( $args )` then the second group appears on the page and lists the children. I'd appreciate any suggestions on how to overcome this and get both groups to display. Note that the reason I'm approaching the dispay in this manner is that I want to put the terms into a jquery accordion and so I need to separate out the parent term from the children.               <?php     //set up the header title for the first group     $taxonomy     = 'glossary';     $include      = 58;     $title        = '';               $argstitle1 = array(         'taxonomy'     => $taxonomy,         'title_li'     => $title,         'include'   =>$include     );          wp_list_categories( $argstitle1 );          // list terms in a given taxonomy using wp_list_categories.     // Specifies the list to view by using the "child-of" arguments.          $taxonomy     = 'glossary';     $orderby      = 'name';      $show_count   = 0;      // 1 for yes, 0 for no     $pad_counts   = 0;      // 1 for yes, 0 for no     $hierarchical = 1;      // 1 for yes, 0 for no     $title        = '';     $Child_of     = 58;               $args = array(         'taxonomy'     => $taxonomy,         'orderby'      => $orderby,         'show_count'   => $show_count,         'pad_counts'   => $pad_counts,         'include'        => $include,         'title_li'     => $title,         'child_of'   => $Child_of     );     ?>          <ul>         <?php wp_list_categories( $args ); ?>     </ul>


title: Wrapping code in an if block

text: Breadcrumb trail shows on all pages, except I need to remove it from the homepage. Here's my code so fare.               <?php if( !is_front_page ):?>       <div class="breadcrumbs" style="position:absolute; bottom:0;">         <?php if(function_exists('bcn_display'))           {             bcn_display();           }?>       </div>     <?php endif;?>      at this point the code is not working, even on the homepage. how should i have the if statement written so that the breadcrumb trails show up on all other pages except the homepage.


title: Black and White Thumbnail in WordPress Gallery

text: I want to have black and white thumbnail on page, and i want to show image in colour when mouse is on and when big image is shown (in lightbox) I have this ->               add_action('after_setup_theme','bw_images_size');     function bw_images_size() {         $crop = get_option('thumbnail_crop')==1 ? true : false;         add_image_size('thumbnail-bw', get_option('thumbnail_size_w'), get_option('thumbnail_size_h'), $crop);     }          add_filter('wp_generate_attachment_metadata','bw_images_filter');     function bw_images_filter($meta) {         $file = wp_upload_dir();         $file = trailingslashit($file['path']).$meta['sizes']['thumbnail-bw']['file'];         list($orig_w, $orig_h, $orig_type) = @getimagesize($file);         $image = wp_load_image($file);         imagefilter($image, IMG_FILTER_GRAYSCALE);         //imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);         switch ($orig_type) {             case IMAGETYPE_GIF:                 $file = str_replace(".gif", "-bw.gif", $file);                 imagegif( $image, $file );                 break;             case IMAGETYPE_PNG:                 $file = str_replace(".png", "-bw.png", $file);                 imagepng( $image, $file );                 break;             case IMAGETYPE_JPEG:                 $file = str_replace(".jpg", "-bw.jpg", $file);                 imagejpeg( $image, $file );                 break;         }         return $meta;     }      And i have 4 image in 3 size (1024x628, 150x100, 300x200) and 1 "name-150x100-bw.jpg". But i don't know how to use this bw.jpg. Above code is from http://bavotasan.com/2011/create-black-white-thumbnail-wordpress but code to get in loop worked only for featured image in post. Thank you.


title: NextGen Gallery template cache

text: I've implemented a custom Isotope template for the NextGen Gallery plugin, and I've made changes and bug fixes to the template, but when I refresh the page the template changes have not taken effect. I tested the cache of my browser by making changes to other theme template files, such as _header.php_ , etc. The browser recognizes these changes immediately, but the NextGen Gallery template is still on an old version. Any idea of how to flush this cache and reload this template file with each new change?


title: Custom URL for all posts in Wordpress

text: I have a wordpress site with static page as the front page. I want to have `/blog` to display the recent posts. How can I do that? thanks.


title: Search Everything & WP 3.7 update issues

text: I have been personally maintaining the Search Everything plugin for WordPress since the authors stopped. I upgraded one of my sites to wp 3.7 today but i get this error when i search: > **WordPress database error:** [You have an error in your SQL syntax; check > the manual that corresponds to your MySQL server version for the right > syntax to use near `'))) AND ncca_wp_posts.post_type IN ('post', 'page', > 'attachment', 'archive', 'r'` at line 1]               SELECT DISTINCT SQL_CALC_FOUND_ROWS          ncca_wp_posts.*      FROM ncca_wp_posts      LEFT JOIN ncca_wp_term_relationships AS trel          ON ( ncca_wp_posts.ID = trel.object_id )      LEFT JOIN ncca_wp_term_taxonomy AS ttax          ON (              ( ttax.taxonomy = 'category'                  OR ttax.taxonomy = 'post_tag'                  OR ttax.taxonomy = 'years'                  OR ttax.taxonomy = 'archive-tags'                  OR ttax.taxonomy = 'course'             )              AND trel.term_taxonomy_id = ttax.term_taxonomy_id         )      LEFT JOIN ncca_wp_terms AS tter          ON (ttax.term_id = tter.term_id)      LEFT JOIN ncca_wp_postmeta AS m          ON (ncca_wp_posts.ID = m.post_id)      WHERE 1=1          AND (              (                  ((()))                  AND ncca_wp_posts.post_type IN ('post', 'page', 'attachment', 'archive', 'research-project')                  AND (                     ncca_wp_posts.post_status = 'publish'                      OR ncca_wp_posts.post_status = 'private'                 )             )              AND post_type != 'revision'         )         AND post_status != 'future'          ORDER BY ncca_wp_posts.post_title LIKE '% %' DESC, ncca_wp_posts.post_date DESC LIMIT 0, 24      Edit: Thank you kaiser. Taken on board for next time. I can see the error is being caused by an SQL syntax error, as stated above, but I cannot figure out how to fix it. Can anybody suggest how to alter this line of code to make it work correctly?


title: How to move style from template file to <head> section?

text:
Imagine the following situation:               //header.php contains:     logo and navigation          //my-template.php contains:     <?php get_header(); ?>

     <?php get_footer(); ?>      This will disable `<header>` for my-template.php in the most modern browsers (except IE9) but it's not valid solution. Is there a way to use something like `wp_enqueue_style();` directly in my-template.php to make it load that style in `<head>` in header.php? Just to make it valid. I want to keep this modular, so I don't want to put if statement like this in header.php (it will not be stand-alone modular page template anymore):               <?php if(is_page_template( 'my-template.php' )){ ?>          <?php } ?>


title: some posts have comments closed and some open why?

text: Some posts in my wordpress isntallation display comments closed, while some are open. Did this happen because while writing those posts comments was closed and now as it is open value in db remained unchanged? If so is there a massive way to fix this?


title: is there any wp plugin that could detect wp site visitor(using mobile browser) Geo location?

text: i found one plugin http://wordpress.org/extend/plugins/ochre-w3c-geolocation- services, close to my demand but it seems still need revise some code on the activated theme. so i am wondering, if any easy to use plugin with such feature: for example, provide a widget or shortcode with a button, whenever visitors come from a mobile browser and press that button, he will get his accurate location and content info related to that location, which is predefined and inputed by site admin. if there is no such plugin yet...i think it's a good blank. anyone build it will get lots of wp users i believe,that is a basic and common demand in turning wordpress into mobile era. btw...i am not a programmer.


title: query_vars in plugin not working?

text: I have a problem writing a plugin for wordpress. First, I register a new `query_var` and add a new rewrite rule:               function nng_users_query_vars( $vars ) {         array_push( $vars, 'nng_users' );         return $vars;     }     add_filter('query_vars', 'nng_users_query_vars');          function nng_users_rewrite_rules( $rules ) {     $newrules = array(                             'benutzer/([^/]+)/?$' => 'index.php?pagename=nng_users&nng_users=$matches[1]'                           );     $finalrules = $newrules + $rules;         return $finalrules;     }     add_filter('rewrite_rules_array','nng_users_rewrite_rules');      This works perfectly, but I cannot grab any `query_var` from the plugin. Typing:               print_r( $wp_query->query_var );      or               echo $wp_query->query_var['some_var'];      does not show anything. But why? If I put the exact same thing into the function of my theme, it works. If I put it into a function and call this function in my theme, it works... Background is the following: I want to create a custom user system and therefore I need to check my custom query var to e.g. logout or header-redirect. Thanks in advance


title: Enqueue jQuery in WordPress

text: Building my first theme from scratch in Wordpress 3.4.1, I know Wordpress already has the latest version of the JQuery via Google. I have read about issue's if the script is not called properly, so want to try and keep everything as close to the recommended coding as possibly. I want to make sure the script is loaded which I believe is carried out by the below PHP script in the functions.php file (taken from the Wordpress Codex).               <?php     function my_scripts_method() {     wp_enqueue_script( 'jquery' );     }      I want to basically have a custom menu using JQuery, so is it just a case of placing the script I want to activate in the header or PHP section? Also if I wanted to enqueue another script that is not included in the Wordpress already, do I simply add the below PHP to the above code in the functions.php file?               wp_register_script( 'jqueryexample', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jqueryexample.min.js');      I am ok with HTML and CSS but PHP and JAVA is relatively new to me, any help is greatly appreciated. Thanks, Ant


title: Custom User Field in Dashboard Widget

text: I checked justin tadlocks custom profile field tutorial and wanted to add the field in the custom dashboard widget but it seems it's not working. I want to show all the user information in this widget. All that I want to do is add the custom information from the profile field to this dashboard widget and it seems to be not working. My aim here to to get all author information and show it on this dashboard. Any ideas how to achieve this task?               function example_dashboard_widget_function() {     // Display whatever it is you want to show     the_author_meta();      }           // Create the function use in the action hook     function example_add_dashboard_widgets() {     wp_add_dashboard_widget('example_dashboard_widget', 'User Profile',    'example_dashboard_widget_function');     }     // Hoook into the 'wp_dashboard_setup' action to register our otherfunctions     add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );


title: Want to be able to sign up subscribers as authors

text: I want to be able to select a subscriber an author of a post in the admin so it displays their name as having written the post, but I do not want to give them any additional privileges (if they login the only thing they can access is their profile). I saw a solution up here, but when I used that hack, it left other users off of the author drop-down (e.g., contributor, etc.). In addition, I'm going to end up having 100s of contributors I want to include as subscribers/authors, but I imagine that would destroy the dropdown or make it very difficult. Any suggestions would be so welcome and thank you very much! :)


title: How to delete orphan userdata from array in wp-options

text: I have an option that subscribes members to forum email notifications. The list of emails is in an array as an option value. All is working fine and all subscribing and unsubscribing is done using `update_option();` My problem is that were a user to be deleted it would be difficult to unsubscribe him without going into the database. So I thought this function would do it but I must be missing something :               add_action( 'delete_user', 'forum_remove_deleted_user' );          function forum_remove_deleted_user($user_id)     {            $user_obj = get_userdata($user_id);               $subscbr_email = $user_obj->user_email;              if(!empty($subscbr_email)) {                                 $list = (array)get_option('mf_forum_subscribers_1');                  if(!empty($list) &&  is_subscribed($subscbr_email)) {                 $key = array_search($subscbr_email, $list);                 unset($list[$key]);             }                        }            }          function is_subscribed($subscbr_email)     {         if($subscbr_email )           {             $list = (array)get_option('mf_forum_subscribers_1');             if(in_array($subscbr_email , $list)) {               return true;             }             return false;           }          }      I'd love to know what I'm doing wrong. Otherwise I suppose I could use `$wpdb` or perhaps I should?


title: Perform a function to create/delete custom post only if certain user meta checkbox is set to true

text:
I have a website where I would like all subscribers to be able to create or remove a post that says they are accepting new patients (they are doctors) by checking or unchecking a custom checkbox that I have added to their profile page. I am using using this post as a template to create my function. I can get a custom post (type = 'accepting') created no problem (if I remove the if/else statement surrounding that function). My problem lies in when I try to put the conditional statement around creating the post to only create it if the user has selected the checkbox and delete it if they unselect the checkbox in their user profile. Here is the code I used to create my checkbox in the user's profile:               add_action( 'show_user_profile', 'my_show_extra_profile_fields' );     add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );          function my_show_extra_profile_fields( $user ) { ?>

Accepting Patients Status

         Currently Accepting New Patients?	                      <input type="checkbox" name="accepting-patients" id="accepting-patients" value="true" <?php if (esc_attr( get_the_author_meta( "accepting-patients", $user->ID )) == "true") echo "checked"; ?> />             Yes

     <?php }          add_action( 'personal_options_update', 'my_save_extra_profile_fields' );     add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );          function my_save_extra_profile_fields( $user_id ) {     if ( !current_user_can( 'edit_user', $user_id ) )         return false;          if (!isset($_POST['accepting-patients'])) $_POST['accepting-patients'] = "false";           update_user_meta( $user_id, 'accepting-patients', $_POST['accepting-patients'] );     }      Here is the code for my function (that isn't working currently):               // checking to see if accepting box is checked     if ( $user = get_user_meta($user_id, 'accepting-patients', true) ) {          function create_accepting_post( $user_id = '' ) {     $user = new WP_User($user_id);     if ( ! $user->ID ) return '';          // check if the user whose profile is updating has already a post     global $wpdb;     $accepting_post_exists = $wpdb->get_var( $wpdb->prepare(      "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type = 'accepting' and post_status = 'publish'", $user->user_nicename     ) );          // you have a custom role for members?     // you should, because if not all user will have a page, also admin, subscribers...     // if ( ! in_array('accepting', $user->roles) ) return '';          $user_info = array_map( function( $a ){ return $a[0]; }, get_user_meta( $user->ID ) );     $title = $user_info['first_name'] . ' ' . $user_info['last_name'];     // of course create the content as you want     $content = 'This is the page for: ';     $content .= $user_info['first_name'] . ' ' .$user_info['last_name'];     $post = array(       'post_title' => $title,       'post_name' => $user->user_nicename,       'post_content' => $content,       'post_status' => 'publish',       'post_type' => 'accepting'     );     if ( $accepting_post_exists ) {       $post['ID'] = $accepting_post_exists;       wp_update_post( $post );     } else {       wp_insert_post( $post );     }          }          add_action( 'personal_options_update', 'create_accepting_post' );     add_action( 'edit_user_profile_update', 'create_accepting_post' );          }          else {     function remove_accepting_post() {          // check if the user already has a post     global $wpdb;     $accepting_post_exists = $wpdb->get_var( $wpdb->prepare(      "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type = 'accepting' and    post_status = 'publish'", $user->user_nicename     ) );          }     add_action( 'publish_to_trash', 'remove_accepting_post' );     }      Any help you can provide would be greatly appreciated!!


title: Most visited posts

text: I need a plugin which shows the most visited posts. I ve looked all plugins, they are working fine but the results can manipulate with refreshing. Is there any plugin that shows unique weekly visitors. Thanks in advance.


title: How to change picture size

text: How can I resize a picture I've already posted? I can click and drag the corner of the picture and it resizes the picture, but only horizontally, so the picture looks really squashed. I can also go into the advanced settings and manually change the height and width in pixels but the same still happens. What am I doing wrong?


title: Embedding screencast.com Videos in WordPress Multisite

text: I've got a multisite installation of WP 3.5.1 running, and I'd like to for users to be able to embed screencast.com videos into posts, preferably with a shortcode like you do with YouTube or Vimeo. I can do this using the full embed code from the screencast.com sharing menu, but I can only do this as a super admin. All other users have and tags stripped out of their posts. I can get around this by installing the Unfiltered MU plugin, but that's not ideal, since it allows users to put all sorts of untrusted code/tags in their posts. I've searched pretty extensively for some sort of simple plugin, and have come across this Screencast.com Video Embedder that seems idea, but it hasn't been updated in 2 years. So I'm wondering if there are any other solutions that might work for this.


title: Problem after updating WordPress to 3.6.1 and WooCommerce to 2.0.14

text: I have updated my WordPress and WooCommerce website and I am getting the following error > public_html/wp-content/plugins/woocommerce/classes/class-wc-payment- > gateways.php on line 45 Does anybody have the same problem? How do I fix this?


title: Custom Image Size in Insert Media

text: I have some custom image sizes set in my functions and it works just as one would expect, but I am would like this custom image size to be present when a user adds images to a post. You know when you add an image to a post, in the bottom area it gives you the option to choose from predefined sizes; basically I would like to add my own size to this area...is that possible?


title: 2 WordPress install with same database

text: I am tring to make 2 sites (1 domain and 1 subdomain) in WordPress. Subdomain should have different logo,menu,ads..etc but both of them,same database with same article.I know it is risky for Google, but I have other plans with this. I upload wp to principal domain and subdomain. In wp-config I put same database, but the links displayed on subdomain are exactly like the ones from principal. Here is a domain example: http://wow7.ro and a subdomain one: http://lol.wow7.ro . I try to duplicate wp prefix _options table in phpmyadmin to have different siteurl, but I can not find the php file in wp structure where is the code which selects this from duplicate table.


title: Category page showing posts from all categories

text: I am trying to set up a category archive (editing category.php) that displays a list of posts from one single category. If I left the twentyten default code               (get_template_part( 'loop', 'category' );)      and i go to www.mysite.com/categoryname it correctly filters the posts only for the categoryname. If I try to use my custom query code, going to www.mysite.com/categoryname every post is displayed, despite of category. This is the loop code:                   <?php if (have_posts()) : ?>         <?php                    $args = array(                        'post_type' => 'post',                        'posts_per_page' => 5,                        'orderby' => comment_count,                        );             query_posts($args);             while (have_posts()) : the_post();?>                        MY CUSTOM CONTENT             <?php endwhile; ?>                  <?php else : ?>      <?php endif; ?>      thanks