title: With WordPress Importer, why can't I import post meta containing a multi-dimensional array, in which value(s) of that array contain line breaks?

text: ## The Question With WordPress Importer, why can't I import post meta containing a multi- dimensional array, in which value(s) of that array contain line breaks? Is there a workaround that I can do to save my data so it will work? Is there something I can do in my sanitation proces to format the data differently before saving it to the post meta? ## The Background Info I've created a WordPress plugin that provides a layout builder. Users can construct the content for a custom layout with certain "elements" given to them (i.e. a slider, a set of columns, a content input, etc), and then apply that custom layout to a static page on their site. Originally, my goal was for all custom layouts to work with WordPress's import/export tool. So each custom layout is actually a custom post type post, and its respective set of "elements" are saved as post meta to that post. So, essentially I'm saving this _single_ multi-dimensional array with all "elements" as a custom field to the custom post, which is the custom layout. ## The Problem If any of a custom layout's "elements" contain any user-inputted text with a line break, it prevents that post meta from being imported through _Tools > Import > WordPress_. The result is that the the custom post (i.e. custom layout) gets imported but the element's post meta is empty. So the user sees a blank layout with no elements. So, this first example has no line breaks and _does_ work. ![](http://picturestack.com/264/757/GC3exchange4apt.jpg) ![](http://picturestack.com/264/362/0wOexchange1DGG.jpg) However, in this second example the user has put in a line break and so it _does not_ work and the problem described above occurs. ![](http://picturestack.com/264/362/V7mexchange3Jch.jpg) ![](http://picturestack.com/264/362/gq9exchange2EzE.jpg) ## Possible Solutions? I'd really like to be able setup sample content for users and give them the WordPress import file so they can quickly import these sample layouts. So, I'm just trying to figure out if anything can be done to avoid this? Is it possible within my sanitization process I can format the data any differently before I store it in the post meta? Obviously I'd just strip out all the white space, but then the user won't be able to format their text within the options of the layout builder.


title: Is there a (sane) way to get all custom fields for a post, which do not have a leading underscore?

text: I know about `get_post_custom()`, but that returns _all_ custom fields, including those with a leading underscore. Is there a reasonable way to get only the ones without a leading underscore? Would I just have to resort to using `get_post_custom()` plus a regex to parse the results?


title: How to add the Author on my RSS Feed

text: just done on my feed burner, I noticed however, that author is not being labeled in the RSS feed: http://feeds.feedburner.com/BiotechStart . How should I able to do that? any idea please.


title: Retrieving multisite blog IDs, somehow failing to foreach them properly

text:
Working on a directory listing and have cobbled together the shortest query I can. It appears to return the listing ok (I think) but the foreach is somehow failing to process the array properly. Can anyone give me a tip on what I'm doing wrong?               global $wpdb;      $site_blog_ids = array($wpdb->get_results($wpdb->prepare("SELECT blog_id FROM wp_blogs     where blog_id > 1"))); // get all subsite blog ids          print_r( $site_blog_ids ); // checkem - output is "Array ( [0] => Array ( [0] => stdClass Object ( [blog_id] => 2 ) [1] => stdClass Object ( [blog_id] => 3 ) [2] => stdClass Object ( [blog_id] => 5 ) ) ) "          foreach( $site_blog_ids as $site_blog_id ) { //iterate through the ids     print_r( "siteid ".$site_blog_id ); // checkem - this just outputs "array array" ??       The blog IDs aren't coming through the foreach properly somehow, it's just outputting "array array" whereas it should show the list of blog IDs. Does this look like a problem with the $site_blog_ids array or did I mess something else up? Thanks for any help! David V.2 per MBoynes' help. Fixed the double array because wpdb already outputs an array. But it's still not working at the foreach to ouput the $site_blog_id, and changing to "$site_blog_ids[0] AS $site_blog_id" only outputs the first one in the array and then stops.               global $wpdb;      $site_blog_ids = $wpdb->get_results($wpdb->prepare("SELECT blog_id FROM wp_blogs where     blog_id > 1")); // get all subsite blog ids          print_r( $site_blog_ids ); // checkem - output is "Array ( [0] => stdClass Object ( [blog_id] => 2 ) [1] => stdClass Object ( [blog_id] => 3 ) [2] => stdClass Object ( [blog_id] => 5 ) ) "          foreach( $site_blog_ids AS $site_blog_id ) { //iterate through the ids     print_r( "siteid= ".$site_blog_id."
" ); // checkem - this shows no blog ids output at all ??      v.3 Working version for posterity global $wpdb; $site_blog_ids = $wpdb->get_results($wpdb->prepare("SELECT blog_id FROM wp_blogs where blog_id > 1")); // get all subsite blog ids               print_r( $site_blog_ids ); // checkem - output is "Array ( [0] => stdClass Object ( [blog_id] => 2 ) [1] => stdClass Object ( [blog_id] => 3 ) [2] => stdClass Object ( [blog_id] => 5 ) ) "          foreach( $site_blog_ids AS $site_blog_id ) { //iterate through the ids     print_r( "siteid= ".$site_blog_id->blog_id."
" ); // checkem - anything in the loop that needs the blog ID value must pull it with the ->blog_id key.


title: Cache WordPress for offline use

text: Client of mine will be out in the sticks and needs to have an offline version of her WordPress site. Is there a way to cache the entire site so that it is available offline? I know I can use Xampp but she is not tech savvy enough and I am concerned something might go wrong at this event she will be at. If worst comes to worst this is the option I will take but if there are other alternatives I will appreciate it. Thanks


title: Make different sites on multisite reference same script

text: I'm using multisite and want all my scripts to point to the same URL so they are optimized as well as they can be. Currently I have: http://www.site.com/news/wp-content/themes/js/bxslider.js http://www.site.com/events/wp-content/themes/js/bxslider.js But they both reference the same file. I'd like them to be both something like: http://www.site.com/wp-content/themes/js/bxslider.js That way it would save people having to download the same file again even though they already have it cached locally. This question is the same question but the solution isn't up to date. Does anyone have any ideas of code or any plugins that might help solve ? Thanks


title: Convert many posts from having a specific meta_key to use a post_format

text: I have 350 posts that were using a plugin-provided option stored in a meta_key ("custom_post_template", to be precise). I want to convert these posts to assign them a specific post_format ("gallery"). I could do it one by one, but it's going to take ages (there are 4000+ posts), so i'm looking at a clever SQL query that could do that. Right now, i have found how to retrieve the 350 posts that were using the old system:               SELECT *      FROM  `wp_postmeta`      WHERE  `meta_key` LIKE  'custom_post_template'      But i don't understand where Wordpress keeps track of the post_format-to-post association. What would be the SQL query?


title: A plugin is giving me "You do not have sufficient permissions to access this page." error

text: I noticed this morning that I was logged off from my site. Whenever I tried to access /wp-admin it gave me a "You do not have sufficient permissions to access this page." error. After an hour of searching, restoring backups and checking database tables in vain, I finally solved the issue by simply renaming my plugins folder; meaning that one of my plugins caused this issue. My question is: How can I track down the culprit? I think one of the following plugins caused this issue as they have been updated recently, and works by messing with the WP core files and DB tables.   1. Google XML Sitemaps   2. Ithemes Security (AKA Better WP Security)   3. W3 Total Cache As of now I'm afraid to reactive any of these plugins.


title: Add tooltips with image in Wordpress Menu?

text: I want to add tooltips with image modal inside my menu dropdown. See this link: My site When on the dropdown menu, when we hover on the the product item, I want a tooltips with image to it. How could I achieve this whether with plugin or something elses? Thank you so much!


title: Add a filetype to the permitted upload types?

text: I'd like to attach an LDraw lego design file (.ldr) to one of my wordpress posts. However the upload media widget complains that the file type cannot be uploaded "for security reasons", which is totally understandable since this is not a "common" file extension it would have been programmed to accept like PDF. How can I make .ldr an exception to the forbidden file-types list or otherwise permitted?


title: What is the best way to avoid spammers registering to my blog?

text: I would like to be able to easily control who registers to my blog because recently I had tons of spam users registering. I came accross the plugin Stop Spammer Registrations, but i'm not sure it is reliable enough and I would also like to have a full log of every user who was rejected by the plugin/service. Is there any good alternative? Thanks


title: Custom columns on edit-tags.php main page

text: I am trying to add custom columns to edit-tags.php for a custom taxonomy that I have created. This custom taxonomy is called equipment-types and it only applies to one custom post type called equipment. I am trying to use the same filters and actions that I would use to add custom columns on the edit.php page. I was able to actually create the custom columns with this filter:               add_filter('manage_edit-equipment-types_columns', 'define_equip_types_columns');      However, I cannot seem to populate these columns with any data. Normally, for the edit.php page I would use the following action:               add_action('manage_posts_custom_column', 'my_post_type_columns_content'));      And then within the my_post_type_columns_content function I would conditionally output column data based on the post-type. The problem is I can't seem to find a similar hook for the edit-tags page. Adam Brown's website lists these hooks:               manage_blogs_custom_column          manage_comments_custom_column          manage_comments_nav          manage_link_custom_column          manage_media_custom_column          manage_media_media_column          manage_pages_custom_column          manage_plugins_custom_column          manage_posts_custom_column          manage_sites_custom_column          manage_themes_custom_column          manage_{$post->post_type}_posts_custom_column      None of which I think would be any help. Does anyone know of a way to do this? I'm so close, I have the columns created with titles, I just need to fill them with data! EDIT: To be clear, I am not trying to make custom fields. I am trying to make custom COLUMNS in the table to the right on the main taxonomy page. Regularly on the edit.php page where it displays All Posts for that post type I can make custom columns such as the quantity column like this: > ![enter image description here](http://i.stack.imgur.com/zBmXD.jpg) However, I don't think there is a hook to populate the columns on the edit- tags.php main page, even though I can create a custom column such as Image URL below: > ![enter image description here](http://i.stack.imgur.com/K9sX6.jpg)


title: Displaying the facebook profile picture in the WP-FB AutoConnect widget?

text: Is ther a way of displaying the facebook profile picture in the WP-FB AutoConnect widget? Like the bbPress login widget: ![enter image description here](http://i.stack.imgur.com/WoLnj.png) The WP-FB AutoConnect widget doesn't show it (I think it is like this by default): ![enter image description here](http://i.stack.imgur.com/InkUi.png) (I'm using the latest version of the plugin + Wordpress 3.1 + bbpress plugin (also the latest version).


title: Filter or order based on custom field

text: I have added a custom field to some posts called 'frontpagerank' The plan is to order the posts by this value but first I just want to filter out any that don't use a front page rank. I have achieved this by putting the relevant posts into another array. But what to do next? Also tried a query: $the_query = new WP_Query(array( 'meta_key' => '0', 'meta_value' => '44' ));               while ($the_query->have_posts()) : $query->the_post(); $count++;      This just does nothing. This code is hard to debug!


title: Custom Post Type “Event”: chronological list of recurring events

text: i'm looking for a good and easy way to have a custom post type "event" that can have multiple dates. (I have tested about 20 plugins). I think i have no problem building a metabox allowing the user to duplicate the field group "date and time" multiple times. But **how would a query look like that creates a chronological list of events from the meta data?** (The project is a playing schedule for a theatre. Productions play on several dates.) Thank you!


title: Display list of Sub-Categories and the posts they contain, within one main Category

text: I've found tons of code and plugins to do various things; from show posts for specific cats, subcats of a cat, etc.. BUT, I cannot for the life of me find, nor do I know the WP API well enough to do what I need with it.. Here is what I'm trying to accomplish: Display a UL of all subcats within Cat31, and the posts for each of those subcats:   * **SubCat1**     * Post 1      * Post 2   * **SubCat2**     * Post 1      * Post 2   * **SubCat3**     * Post 1      * Post 2 It's pretty straight forward, but all the loops I have tried fail either at the subcat loop or the post loop (one or the other works, I cannot get them both to work..) So, unless I can find a plugin to do this (I'd prefer to code this into a template file!) then I need to figure out how to: Loop Subcats within Cat31 while looping subcasts, loop posts for each subcat Any help is GREATLY appreciated!


title: Direct link to category?

text:
I'm trying to build up a menu of category links for specific categories I'd like to highlight and apply styling/classes to. I've tried this sort of thing.
<a href="<?php get_site_url(); ?>category/Gadgets"> Gadgets
      And
 Gadgets
      It's showing up as sitename/category/category/category/gadgets on the front end. I can't use `<?php wp_list_categories('orderby=name&title_li='); ?>` because it's going to spit out all of them and limit the styling I can do on the html. I just want to link to categories directly, by name, preferably without hard coding in the site name.


title: Specific and Different Ads for each Post?

text: I am working with a magazine client who sells adversiting offline in their magazine and now has a WordPress online magazine. Each of their stories is broken into different posts, and they are using the Wootheme Spectrum. They want the ads in the magazine to correspond to the ads online. So if Story B has Ad Z, then online, Post B should have Ad Z in the sidebar. However, Story A and C might have differents ads. What's the best way to accomplish this?   * Custom plugin?   * Plugin?   * Adsense? Thank you.


title: Template redirect inside of plugin not redirecting

text: I have this inside of my plugin but it's not loading it ...                function templateRedirect()      {     if(is_home()){         echo 'hello';     }      }       add_action('template_redirect', 'templateRedirect');


title: Space in WordPress Attribute Causing Problems

text:
I'm trying to write my first caption plugin and having some difficulties. I'm setting up a shortcode like so:               function Shortcode_Caption( $atts, $content=null ){             // DEFAULT ARGUMENTS ARRAY               $args=shortcode_atts( array(         'caption' => 'Caption',         'link' => 'http://www.link.com'        ), $atts);             // ENCLOSED SHORTCODES        if($content){           return '
               '.$content.'
';        };     };            add_shortcode( 'Caption', 'Shortcode_Caption' );      Some JS picks it up from there. So then when the shortcode is used:               [Caption caption="This is the Text" link="http://www.go_here.com"]some content[/Caption]      The above doesn't work, because of the spaces in the "caption" attribute. However, removing the spaces works 100%:               [Caption caption="Text" link="http://www.go_here.com"]some content[/Caption]      I'm not sure what I'm doing wrong with this? Thanks!


title: Many to Many select metabox

text: How can i create a metabox on a custom post type similar to how you input tags where it's free text - auto suggest drop down selection while adding multiple values to the category? For instance if I have a restaurant custom post type then want to select the cities that it applies to ( I don't want to use check boxes because I might have thousands of cities). I want to do free text entry with drop down suggestions and then you select from the list of suggestions while allowed to do multiple entries just like adding tags to a Post. Ideally, I'd like to lock it to where it only let you select one from the drop down (pulled from DB) and not freely type in your own value. I've spent a few hours scouring looking for some information on how to do this, but can't find anything. Maybe I'm using wrong terminology to search for it? Any help would be great. thanks.


title: Scanning Database for malicious Data

text: After a site of a friend has been hacked I told him he should just clean up the mess and restart from scratch so he know that no file has been altered. I could scan the site for him with tools like grep an so on (For a start: Grep and Friends) but what I wondered about is, how to scan the database? What if some hacker has placed payload inside the database. Can be something simple like XSS or even PHP code in case there is some eval'ing still going on in core (or was at the time of the hack). Any suggestions? I thought about using SQL-Queries with the LIKE comparison function or there is even some REGEX possible. But maybe someone has already done this or wants to do this an has some ideas to share.


title: Hooking "delete_option_rewrite_rules" for rewrite rule addition

text: I'm trying to find the most efficient way to ensure my word press "rewrite rules" are set correctly in the event that another plugin calls the `flush_rules()` function. Traditionally I've seen instructions on adding the rules on every page load of your plugin (eg here)               add_action('wp_loaded','define_rules_here');     function define_rules_here()     {       add_rewrite_rule($foo,$bar,$yams);     }      My concern is the way I've written my plugin is the rewrite rules are configurable by the user, and that having to load the options from the database for every page load seems inefficient. I've found little information on the following, but it seems just as valid...               add_action('delete_option_rewrite_rules','define_rules_here');     function define_rules_here()     {       add_rewrite_rule($foo,$bar,$yams);     }      What I've found is that the first thing `flush_rules()` calls is `delete_option('rewrite_rules');` which seems to trigger my hook quite nicely as the `delete_option` function ends with a `do_action( "delete_option_$option", $option );` call. My question is: Is there anything fundamentally wrong with this approach of hooking into the "delete_option_rewrite_rules" action?


title: How to remove commenters ability to add hyperlinks to comments?

text: I'd like to be able to filter out a commenters ability to add hyperlinks in their comment text. I removed the "websites" field from the mix to reduce the amount of spammage already (see: Removing the "Website" Field from Comments and Replies?") which has helped a lot. By default, they can use the '< a '> tag to do so in the comment box text, which allows spammers to embed hyperlinks to their sites. Is there a way to filter out that capability in the wysiwyg editor for comment fields?


title: How to retrieve hashtaged tweets from a list of users and post to Wordpress

text: Is there any way retrieving all the tweets from a list of profiles which are tagged with certain #hashtag using Twitter API 1.1 and applying it as a feed to Wordpress? I have found this but I'm not able to get this to work with Wordpress. Thanks


title: Show Future and Published posts in category archive

text: I want to make a list of events using a blog category. Category page shows Published and Future posts. Tricky thing is that I want to show Future posts on top with posts sorted by:               'order' => 'ASC'      ... and published posts sorted by default:               'order' => 'DESC'       so far, I've got the publish and future posts on the same cat template working with this placed on functions.php:               function special_cat_template($query) {         if ( !is_admin() && $query->is_main_query() ) {                  $conf_cat = get_category_by_slug( 'slug' );             $conf_cat_id = $conf_cat->term_id;             $cat = get_queried_object();             $cat_id = $cat->term_id;                  if ( $query->is_category( $conf_cat_id ) || cat_is_ancestor_of( $conf_cat_id, $cat_id ) ) {                      $query->set( 'post_status', array( 'publish', 'future' ) );          }   }   }     add_action('pre_get_posts','special_cat_template');      You guys think that this is doable? or should I use more than one loop?


title: Is there an error in get_the_tag_list()?

text: I'm using the theme TwentyThriteen1.0 for my WordPress blog. I recognized that the tags in the meta-part of an article are not separated by a comma. I had a look at the function `twentythirteen_entry_meta()` in the file `functions.php` of my theme, which contains:               $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );      According to the documentation for `get_the_tag_list()` (http://codex.wordpress.org/Function_Reference/get_the_tag_list), the tags should be separated by a space after the comma. Looking at the HTML source reveals `</a>,<a href=`, instead of `</a>, <a href=`. When I now add a space in the `functions.php` in front of the comma:               $tag_list = get_the_tag_list( '', __( ' , ', 'twentythirteen' ) );      the HTML source has both spaces: `</a> , <a href=`. This is really strange to me,... Is this a error or deliberate? Or is this an error of the function `translate()` (alias `__()`) that removes trailing spaces if there are no leading spaces? I'm using the german version of Wordpress.


title: How do you load js and style resources from CDN with local fallback using wp_enqueue_scripts?

text: I had a hard time finding the correct way to do this. I want to load the CDN resources here: http://www.bootstrapcdn.com/ but use `wp_enqueue_scripts` and have local fallback. This is the method I am using for local fall back now directly in header.php:               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>     <script>window.jQuery || document.write('<script src="js/jquery.js">\x3C/script>')</script>      I want something like this for all resources but also using wp_enqueue_scripts. I successful switched the enqueue Jquery using this method but this does not provide a fallback:               /** Jquery **/     wp_deregister_script( 'jquery' );     wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.5./jquery.min.js','', 'latest', true );     wp_enqueue_script('jquery','','',true);      Any help is greatly appreciated!


title: Sends out email to admin with post author

text: Hello i'm using this :               add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){         $to = 'admin@email.here';         $subject = 'subject';         $message = "Here is :".get_permalink($post_id);         wp_mail($to, $subject, $message );      to send out a mail to wordpress admin when a post is publish by author. And I would like to add the post author in $message. I try `get_the_author();` and `the_author();` but nothing happens. Any ideas guys ? Thank u ! (Sorry i'm french)


title: How can I add a 'Click to Enlarge Image' feature, with the enlarged image opening in a popup?

text: I have several images of UI forms and tasks, that are quite large. I would like to display a smaller, 'thumbnail' image snf give the user an option to 'Click to Enlarge', and then display the fill size image in either a pop-up or separate window or tab. I pop-ups are frowned upon, but this is a decision I must still make. How would I go about this? Where would I place the JavaScript that loads the full size image and opens a new window?


title: Sortable columns by meta value holding a date - can't get it to work

text: I'm trying to sort the posts (in the edit screen (wp-admin/edit.php)) by meta value corresponding to an event date but I can't get it to work properly... For example, `ASC` returns: 2012/10/12   2012/12/11   2012/09/7   and `DESC` returns: 2012/09/7   2012/12/11   2012/10/12   I'm using the following functions to create the sortable custom columns:               function event_date_column_display( $name ) {         global $post;         switch ($name) {             case 'event-date':                 $pid = $post->ID;                 $event_date = get_post_meta($pid, '_event_date', TRUE);                      if ($event_date) {                     echo $event_date;                 }         }     }          function event_date_column_register_sortable( $columns ) {         $columns['event-date'] = 'event-date';           return $columns;     }      Any hint on how to fix this?


title: Single page theme that uses pages for the content

text:
I'm making a one page site. On the page I want to run WP_Query three or four times to pull in those 3-4 pages. The page looks a bit like this:
      <?php              $args = array( 'pagename' => 'page-1');               $the_query = new WP_Query( $args );              // The Loop         if ( $the_query->have_posts() ) :         while ( $the_query->have_posts() ) : $the_query->the_post();           get_template_part('content');         endwhile;         endif;              // Reset Post Data         wp_reset_postdata();     ?>

      <?php              $args = array( 'pagename' => 'page-2');               $the_query = new WP_Query( $args );              // The Loop         if ( $the_query->have_posts() ) :         while ( $the_query->have_posts() ) : $the_query->the_post();           get_template_part('content');         endwhile;         endif;              // Reset Post Data         wp_reset_postdata();     ?>

      <?php              $args = array( 'pagename' => 'page-3');               $the_query = new WP_Query( $args );              // The Loop         if ( $the_query->have_posts() ) :         while ( $the_query->have_posts() ) : $the_query->the_post();           get_template_part('content');         endwhile;         endif;              // Reset Post Data         wp_reset_postdata();     ?>
      Of course I'm repeating myself here, and that's a bit of a waste. What I want to do is function-ize this instance of WP_Query. Here's what I've done, but it doesn't seem to return anything at all. It has to be something stupid, but I can't see what it could be (in functions.php):               /**      * Functionize wp_query      *      * @since 0.1      */     function waterstreet_fetch_page( $pagename ){         $args = array( 'pagename' => $pagename );               $the_query = new WP_Query( $args );              // The Loop         if ( $the_query->have_posts() ) :         while ( $the_query->have_posts() ) : $the_query->the_post();           get_template_part('content');         endwhile;         endif;              // Reset Post Data         wp_reset_postdata();     }      Then of course, in my template files, I want to be able to just run:
         <?php waterstreet_fetch_page('page-1'); ?>

         <?php waterstreet_fetch_page('page-2'); ?>

         <?php waterstreet_fetch_page('page-3'); ?>
      Advice welcome! Thanks.


title: Deregister a CSS file that comes with a plugin

text: WPML plugin comes with its own CSS file. I want to get rid of all the CSS it contains, so I put everything between `/* */`. However I'll have to do that again when I'll update the plugin. Is there a way to "unload" a CSS file ?


title: Change default from "Attachment post URL" to "File URL" in Add Media

text: When a user upload images, by default, the Attachment Post URL option is selected. How can I change the default to be "File URL"? If that is not possible, how can I remove the attachment post url completely? I made a Google search that brought more questionmarks than answers. EDIT: I found a way to disable the attachment post URL, this code works:               add_filter('attachment_fields_to_edit', 'my_attachment_fields_edit', 10, 2);      function my_attachment_fields_edit($form_fields,$post){          //Set attachment link to none and hide it.         $html = "<input type='hidden' name='attachments[".$post->ID."][url]' value=''/>";              $form_fields['url']['html'] = $html; //Replace html         $form_fields['url']['label'] = ''; //Remove label         $form_fields['url']['helps'] ='';//Remove help text              return $form_fields;     }      However I am still looking for a way to change which one is set as default.


title: How to list the Hooks and order of execution in current loading page?

text: I need to know the list of hooks that are called in the current page . How to identify the priority assigned to the action and filters in the action . If i want to remove the default action on word-press . It cause any error ? May i overwrite the default action that to be execute?               add_filter( $tag, $function_to_add, $priority, $accepted_args );       in this case i change the priority as 50 . i don't get any changes compare with 10 or Default. if This Priority value is for order of execution means i need to change the values as bigger or smaller?.


title: [&hellip appearing instead of [...]

text: There is some problem with my wordpress website, instead of [...] I am getting [&hellip everywhere. I have changed the charset to UTF-8 but the problem persists. Any help would be appreciated. Here is the link to the website : http://theappjuice.com/


title: Wordpress subadmin can create N user

text: Is there a way to create a subadmin that has a capability to create a number (N) another users. So that, if the subadmin has reached N value, he can't add another user anymore.


title: Execute PHP code in Javascript onclick

text: When a user clicks on the table row, I want to:   * save a value in the user profile   * go to a page I am within this loop:               <?php $query = new WP_Query(array('post_type' => 'aanvraag', 'posts_per_page' =>'-1', 'post_status' => array('publish', 'pending', 'draft', 'private'/* , 'trash' */) ) ); ?>     <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>     <?php endwhile; endif; ?>      This is not working:               <tr onclick="window.location.href='http://www.areal-agro.nl/<?php          $user = get_the_title();         update_usermeta( $current_user->id, 'current_user', $user );             ?>'">      If I `echo` the `$user` value, it outputs the right (current) value.   If I use the `update_usermeta` as written, it uses the last value.   If I use `update_usermeta( $current_user->id, 'current_user', 'test');` it works. How can I export the **current** value? Why is `onclick` not behaving like it's in the loop, and how can I improve this?


title: Which files get updated in a plugin update?

text: When a user updates a plugin from the WordPress admin panel, does every plugin file get overwritten, or just the ones that have changed from the previous version? For example, let's say that a plugin has 3 files: a.php, b.php, and c.php Version 2.0 has changes to a.php and b.php; c.php was unchanged. However, the user made a change to c.php before updating to 2.0. Does the user lose his changes?


title: Where do URI files come from?

text: Installed locally or in a web server, how is a file (for example, style.css using `wp_enqueue_style`) created? More specifically, when I tried this using the default twentythirteen theme:                echo get_stylesheet_uri();      I get this: `http://yourwebsite.com/wp- content/themes/twentythirteen/style.css`. So I thought of trying to go to `http://yourwebsite.com/wp-content` but was surprised that nothing comes out. However going to the stylesheet URI will bring out the stylesheet. Where's the server keeping this file? Another related question would be:                echo get_theme_root().'twentythirteen/style.css';      VS                echo get_stylesheet_uri();      I know the above is a directory while the one below is the URI example I've given above, but how are they different in terms of linking content of the file itself?


title: Creating an online questionnaire form - by Importing the questions from a spreadsheet?

text: I've got a spreadsheet where each row of the first column is a question, and the next 4 columns are the optional 4 answers to that question. I want to turn these questions into an online form (like as the one offered by google docs) Is there a form plugin (or another solution) that can offer something like this?


title: Categories Listing with "selected" category highlighted

text:
Is there a way to draw the categories listing and highlight the current category being viewed? In addition, it would be great to highlight the current category if a post or page that's assigned to it is being viewed. Any help much appreciated... Here's my current code (I'm excluding the default "uncategorized" category)...                 echo "

";         $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);         $cat_args['title_li'] = '';         $cat_args['exclude_tree'] = 1;         wp_list_categories(apply_filters('widget_categories_args', $cat_args));       echo "

";


title: Calling a function from functions.php in header

text: Been searching a lot for how to call a function in header.php where the function is in functions.php. How do I solve this? I have my function in functions.php like this:               function testFunction()     {     echo "This is a test";     }


title: Different widgets on different page templates?

text: If I have a couple of different Page templates, how would I show a different collection of sidebar widgets for each of these templates? I'm using the Starkers theme as a starting point.


title: Is there a way to remove categories in bulk?

text: I just migrated to worpress and want to remove all of the 'uncategorized' categories, since all of my posts are now all categorized. Is there a way to do this easily?


title: How do I add to the list table a filter?

text: I am trying to find the hook for adding a filter to the list under "Posts [Add New]": ![enter image description here](http://i.stack.imgur.com/2xDQ3.png)


title: Tracking Published Date as Custom Variable for Google Analytics

text: I want to track traffic with Google Analtyics based upon the post publish date. For example, what new articles are doing well or poorly compared to similarly published posts. I added this before my analytics code with no avail:                   <script type="text/javascript">_gaq.push('_setCustomVar',1,'Publish Date','<?php the_date('F j, Y', '', ''); ?>', 3);</script>


title: Sticky Header in Wordpress using BootstrapWP theme

text: So I am using Rachel Baker's open source BootstrapWP starter theme to develop a Wordpress theme. There is a repository on Github but I didn't think this question was appropriate to post there. I am trying to get the header to be static but I am unsure of how to make it work. I have found a working example that achieves this with this theme but I can only see the HTML output as an example. I am a novice Wordpress coder just trying to figure things out. I cannot see or figure out what is the best way to achieve this. So on the example site where this feature is working the HTML being output by the header.php file has different classes of the header so that depending on where the browser is the correct header will be displayed. It outputs three separate nav-menu lists in the HTML. The first nav-menu starts with `<li id="" >` and the following two don't have an id, they only have `<li class="">`. Here is a pic: ( Or just see the pastebin shared below) ![enter image description here](http://i.stack.imgur.com/qBy2J.png) Here is a pastebin of this code including the jquery script being used. I am assuming that this can be achieved with the wp_nav_menu php code in the header but I wasn't sure how to do this.                               <?php wp_nav_menu(                             array(                             'menu' => 'main-menu',                             'container_class' => 'nav-collapse collapse left-aligned nav-collapse-main',                             'menu_class' => 'nav',                             'fallback_cb' => '',                             'menu_id' => 'main-menu',                             'walker' => new Bootstrapwp_Walker_Nav_Menu()                         )                     ); ?>      Theme has a Custom Walker file which is in the includes folder, can be easy seen in the Github repo, this site wouldn't let me share more than 2 links per post, sorry. I've got lots of questions but I think my first one would be, do I need a loop of multiple wp_nav_menu calls or is there a better method? Thought this would be a nice feature for anybody using Bootstrapped Wordpress themes, hope someone can help.


title: Search results in custom template

text: I have a custom page `resources-search.php` template which handles search results for the search form. And in my `function.php` I have the following array:               $YearList = array('2000','2001','2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012','2013');      Yes, You guessed it right. Its an array of year. In my `resources-search.php` I' am using this code:               <select name="year" id="opt_year">     <option value="0" selected="true" disabled="true">Year</option>     <?php     foreach($YearList as $key => $value){     echo '<option value="'.$value.'">'.$value.'</option>'; //close your tags!!     }      ?>     </select>      Its a drop-down menu from the array above. This method doesn't actually works for me. In other pages it does work but not in `resources-search.php`. Any ideas anyone?


title: Need equivalent of single_term_slug

text: I am building a taxonomy archive page and I am trying to create a linked instance of the current term outside the loop. So, let's say my taxonomy and current term are:   * Taxonomy: Animals    * Term: Elephants I want to echo the term Elephants and have the term name linked to the Elephants term archive. So, this would be the output:               Elephants      Elsewhere I use single_term_title(); and that perfectly grabs the term name for that specific archive page. In other words, I can echo the title fine. I just want it linked to the archive page for that term. In an ideal world, the code that I want would be:               <a href="http://www.mywebsite.com/tag/<?php single_term_slug(); ?>/"><?php single_term_title(); ?>      There is no single_term_slug(); and I have tried a number of things, but so far nothing has worked. Another alternative is that I am trying to echo the permalink for the current page. I have looked into ways of doing it that was as well. Something like get_canonical(); but that does not exist either. So either the answer is something that I have not found or could not come up with myself... Or it is so darn easy that it is right in front of my face (which could very well be the case). Thanks.


title: The Best Way to always load the newest version of 3rd party code

text: There is a class for plugins and themes that makes custom meta boxes easier to develop called cmb_Meta_Box from Custom-Metaboxes-and-Fields-for-WordPress at https://github.com/WebDevStudios/Custom-Metaboxes-and-Fields-for-WordPress and they update that class and code. I'm trying to make sure that if I use the latest version of this class/script in a plugin that if a user has an older version of it, it fails gracefully. So, for example, 1.1.0 has some new features, but if someone already has loaded 0.9.0 from another plugin that loaded before my plugin, what can I do? There is now a constant so I'm thinking I could warn the user on my admin pages, but if they're not technical they wouldn't know what to do with that warning. I hope this makes sense and some folks have ideas what I can do within WordPress to solve this possible issue. Thanks!


title: Automatic updates in plugin - not hosted on wordpress repository

text: I'm coding a plugin which probably will have updates in the future, and I want to take advantage of the automatic update mechanism in wordpress. I followed this tutorial: Everything seemed quite straightforward to me, but for some reason, nothing works. The function hooked to the `pre_set_site_transient_update_plugins` filter never gets called. I tried to go step by step and just added a "Hello" and a log line on that hook. It simply doesn't get called, even when I tried to force the update checks. Is there any catch on that? Btw, I'm trying that on a multisite installation. Any help would be greatly appreciated. Arnaldo UPDATE: I got the function hooked to the `pre_set_site_transient_update_plugins` to be called. Strangely, if I do the hooking inside the constructor of the object which has the checking function it works, otherwise, it doesn't. Example (this works):               class XYZ {         public function __construct() {             add_filter('pre_set_site_transient_update_plugins', array($this, 'check_update'));         }              public function check_update($transient) {             // logic here         }     }      However, if I simply do this on my main plugin file, it doesn't work:               add_filter('pre_set_site_transient_update_plugins', array('XYZ', 'check_update'));       First of all, I'd like to understand what's the difference between the two scenarios. Besides that, I had to do               set_site_transient('update_plugins', null);      to force the hook to be called, otherwise I think I'd have to wait the normal wordpress update check cycle, right? And now, another issue has surfaced: the `$transient` variable which is passed to the `check_update()` function is always null! Is that because of the `set_site_transient()` instruction? If it is, how can I check the whole solution without suffering for several hours to be able to test my latest changes? Thanks again, Arnaldo UPDATE 2: @kaiser, the behavior is exactly as I described, even using a static method. I had tried that already.


title: Getting error when trying to redirect WP site to mobile site

text: I've tried a few different plugins to redirect a WP site to a static page for for mobile devices smaller than iPads. Of the several I've tried, I get the following error. Can someone tell me what's causing the error or direct me to a thread or article that I can follow to just create the code without a plugin? I'm trying to keep the plugin count as low as possible. Thanks! _Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration._ I'm using the latest version of WP 3.7.1. core site: http://clients.weinsteinau.cgvcreative.com/ mobile: http://clients.m.weinsteinau.cgvcreative.com/ This is the error I get when I install the Equivelant Mobile Redirect plugin. *Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /home/green83/public_html/clients/weinsteinau/wp-admin/includes/plugin-install.php on line 77* I don't have the exact code since I don't know where the error is coming from. This is what happens when I activate the plugin: *Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /home/green83/public_html/clients/weinsteinau/wp-includes/update.php on line 259*


title: Parse Shortcodes in Theme's Custom Field?

text: I have a theme which has a "PRICE" custom field that only accepts numerical values. Is there anyway to parse shortcodes in that custom field so I can dynamically display the price using another plugin? Thanks!


title: Object of class WP_Error could not be converted to string

text:
After deleting some categories (shouldn't have done this), I get the following error > Catchable fatal error: Object of class WP_Error could not be converted to > string in [FILENAME] on line 45 Here's the file which caused the error. Here's an excerpt (line 45 is `$output .= '<a href="' . $link . '">' . $term->name. '</a>, ';`)                  ...       foreach($item['value'] as $value) {             $term = get_term($value, $fieldSettings['taxonomy']);             $link = get_term_link($term);                  // no option may inerrupt !             if(!$term) {               continue;             }                  if(isset($formatterSettings['link_bool']) && $formatterSettings['link_bool']) {               $output .= '' . $term->name. ', ';             } else {               $output .= $term->name . ', ';             }           }         }      ...      How can I fix this problem? I recreated all the deleted categories (I backuped their names and slugs), but the error still remains. Thank you for your help! Here's the complete file               namespace Hydra\Formatters;          use Hydra\Builder;          class TaxonomyFormatter extends BasicFormatter {            public function __construct() {         $this->name = 'taxonomy';       }            public function render(\HydraFieldViewRecord $viewView, $post) {              $items = $this->getValues($viewView);         if(!$items) {           return $items;         }              $fieldSettings = $viewView->field->attributes;         $formatterSettings = $viewView->settings;              $meta = $viewView->field->meta;         $output = '';                   foreach ($items as $item) {           if(is_string($item['value'])) {             if($item['value'] == 0) {               continue;             }             $item['value'] = array($item['value']);           }                foreach($item['value'] as $value) {             $term = get_term($value, $fieldSettings['taxonomy']);             $link = get_term_link($term);                  // no option may inerrupt !             if(!$term) {               continue;             }                  if(isset($formatterSettings['link_bool']) && $formatterSettings['link_bool']) {               $output .= '' . $term->name. ', ';             } else {               $output .= $term->name . ', ';             }           }         }              $output = trim($output, ', ');         $terms = $output;              $output = '';         $output .= '
printAttributes($viewView) . '>';              if ($meta->prefix) {           $output .= "
" . $meta->prefix . "
";         }              $output .= "
" . $terms . "
";         if ($meta->suffix) {           $output .= "
" . $meta->suffix . "
";         }         $output .= "
";              return $output;       }            public function getSettingsForm($parentElement) {         parent::getSettingsForm($parentElement);         $parentElement->addField('checkbox', array('link_bool', __('Link to taxonomy page', 'hydraforms')))           ->setDefaultValue(false);       }     }


title: Some blog posts containing source code fail to save draft or publish

text: I have a blog that contains source code on some posts. I've discovered that some posts don't accept the source code and I get variously a Server 500 error or a 403 error. I can only assume there is some protection mechanism in Wordpress that sees the source code and rejects it. However, as my hosting doesn't seem to have any logging enabled I cannot see what is wrong with it (assuming, of course, I'm looking in the right place for a log - which I may not be. I've only just migrated my blog and I'm still learning the technical detail about how WordPress works yet.) I've narrowed it down to two types of source code:   * SQL code   * Razor (the new view engine that arrived with ASP.NET MVC 3) I've found a work around for getting these posts in to WordPress (Uss the Wordpress RSS Import plugin and copy my post in to an artificial RSS feed file which I import). This is rather unwieldy and I frequently find typos so need to update posts. The importer only ever creates new posts so I can't correct any errors. Any ideas about how to get posts with source code into Wordpress? I'm using Windows Live Writer to create and publish posts, but as a work around for problematic posts I can always copy and paste the raw HTML then edit directly in the admin pages in Wordpress, but I get the same issue. Any help much appreciated.


title: Infinite Scroll applied to ajax loaded content

text:
I'm doing a WP_Query on let's say page-a.php, that page has a div called target where page-b.php is being loaded into. Page-a is a custom template and page-b is an archive page. The structure on page A as example:

       while

Title

Description

       endwhile

           On page-b I only include the < post > and < pagination > divs within a regular wp loop. Now the jQuery:                $(window).load(function() {                     $('.target').infinitescroll({                       navSelector  : ".navigation",                                                 // selector for the paged navigation (it will be hidden)                       nextSelector : ".navigation a.next",                                          // selector for the NEXT link (to page 2)                       itemSelector : ".post",                                                // selector for all items you'll retrieve                       debug : true,                       loading: {                           finishedMsg: '

All posts were loaded

',                           img: '',                           msg: null,                           msgText: "

"                         }                          }, function(arrayOfNewElems){                      $('.post').animate({"opacity":"1","max-height":"150px","padding":"15px 8px"},800, "jswing");                     }                      );               });      -If I call that script on page-a.php will only work on it, once page-b content is placed on  -If I call on page-a.php and page-b.php it works on first, then when first ajax content is loaded and then (if I apply a new filter) it won't work. -If I call the script on my ajax response function it will work once, then if I apply another filter and target div refreshes content, I get the  > Uncaught TypeError: Cannot call method 'appendTo' of null div classes called (.target and .post) are present on the page. What the hell am I doing wrong here. Thanks. PS: If you need to take a look at the real scripts let me know and I will provide.


title: Add scripts on custom post add/edit pages Not Working

text: im Trying to Add scripts on custom post add/edit pages but Not Working PHP Code ,(it's working and Get Js Code)               if(strstr($_SERVER['REQUEST_URI'], 'wp-admin/post-new.php') || strstr($_SERVER['REQUEST_URI'], 'wp-admin/page-new.php')) {     wp_enqueue_script('myscript', 'http://exemple.com/wp-content/themes/theme/js/rt_api.js');      The Probleme is Js Code Not Give Result : Check my Js and HTMl Code


title: How to put a form with php code into a variable or shortcode?

text:
I'm trying to put my frontend form into a variable or a shortcode so I can wrap another shortcode around it (specifically Bainternet Post Creation Limits). My form has PHP code in it so I'm not exactly sure how to do this. I have tried creating other variables for each line of PHP code but it's not working as I thought it might. I know how to create a shortcode; I don't know how to put a form with PHP into a shortcode though. I don't know how to put the form into a variable at all and I can't find information how to do this. Here's the form:               <form id="new_post" name="new_post" method="post" action="" class="submit-form" enctype="multipart/form-data">         <fieldset class="tax">             Class Price:                 <input type="text" value="" class="class" id="class" name="class" placeholder="20" /> €             Accent:                 <?php wp_dropdown_categories( 'tab_index=15&taxonomy=accent&hide_empty=0&name=accent&show_option_all=Select one' ); ?>
Rates

             Face-to-face classes             <?php                 $clocations = get_terms('class-location', 'orderby=id&hide_empty=0');                 $counter = 0;                 foreach ($clocations as $clocation) {                     $counter++;                     $option = '
<input class="checkbox" type="checkbox" name="class-location[]" id="'.$clocation->slug.'" value="'.$clocation->slug.'" onclick="enable_text(this.checked)" />';                     $option .= ''.$clocation->name.'';                     $option .= '<input type="text" class="rate" value="" id="'.$clocation->slug.'-rate" name="'.$clocation->slug.'-rate" disabled="disabled" /> €
';                     echo $option;                 }             ?>
                  <input type="submit" value="Add Teacher" tabindex="40" id="psubmit" name="submit" />         </fieldset>                  <input type="hidden" name="action" value="new_post" />             <?php wp_nonce_field( 'new-post' ); ?>          </form>      How do I put this form into a variable or a shortcode?


title: Query get post,how to add comment box

text: Hello I have a query that gets a post with id=x and it works but it leaves out the comment box. Is there a way to add "get comment box" to the query?               <?php      $post_id = 104;      $queried_post = get_post($post_id);      $content = $queried_post->post_content;      $content = apply_filters('the_content', $content);      $content = str_replace(']]>', ']]>', $content);      echo $content;       ?>


title: WooCommerce is slow with many categories

text: I'm struggling a bit with WooCommerce (and WordPress) being a bit slow. I have a development store for a customer with the following stats 5,319 Products 2,437 Product Categories Categories are hierarchical like this _/product-category/by-model/accord- ch1-1998-2003/body/accessories/_ The default /shop/ page (showing just sub- categories) takes 14 seconds to load. Stepping through the categories, each one takes less time to load. _/product- category/by-model/_ takes 6 seconds to load. _/product-category/by- model/accord-ch1-1998-2003/_ takes 1.5 seconds to load. _/product-category/by- model/accord-ch1-1998-2003/body/_ takes 1.5 seconds to load. None of those categories contain products, only sub-categories. And finally _/product-category/by-model/accord- ch1-1998-2003/body/accessories/_ the first category with any products in takes a more respectable 600 ms to load. Taking to load == time to first byte - once the server sends the data, we have DOM ready milliseconds later. The theme payload is about 500Kb per page. I was sure the issue was with the insane amount of SQL queries it does in the higher level categories. Before posting this, I moved the site from it's original home on a low-load, shared Dell R410 server to a VPS on similar hardware so I can mess with apache or MySQL a bit more. Server performance is good. Load is low. I've tried using an advanced-cache and an object-cache (both memcache based) and I don't see much gain. When I watch the general MySQL log I see these massive queries go past. None of them are slow according to the slow query log, I can only assume it is the sheer number of them, or the joins it does on the taxo tables. SQL caching is also enabled but doesn't seem to help much either. (All other pages load fast, just these Woo categories cause issues). Using SQL Profiler, I don't think it is SQL that is slow, more PHP sits at ~100% CPU load whilst WooCommerce does something. Total query time: 0.09768s for 89 queries. Page generated in 15.40064s (99.37% PHP, 0.63% MySQL) Has anyone experienced this kind of behaviour before? I'm running out of ideas rapidly! ## Edit I'm sure it is related to Woo looping over unnecessary terms The shop home page (/shop/) does a query like this http://pastebin.com/jsiaYenq TWICE! Which returns ~13,000 rows. Another similar query http://pastebin.com/B9xhFLFe returns almost the same number of rows. SQL returns these queries quick, however NewRelic proves that WooCommerce is trying to do something with these massive data sets, that consume 100% of the CPU and take ~25 seconds to complete. New Relic shows the app sits at the "woocommerce" stage for a long time. ![newrelic](http://i.stack.imgur.com/ZJATH.png) I'm convinced this is the problem!


title: Display users in order by an "order" custom meta field

text: Alright, so here's my current code (which works, displaying the users in order by ID and excluding the admin user):               $site_admin = "1";     $order = 'ID';     $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->usermeta WHERE ID != '$site_admin' ORDER BY $order"); // query users     foreach($user_ids as $user_id) : // start authors' profile "loop"         $user = get_userdata($user_id);              $level = $user->user_level;         if ($level > 0)          { ?>              ((information to display goes here))             <?php  } ?>      What I'd like to do is add a meta field (I believe that's the right terminology, but please correct if wrong), and I have already added that, then type in a number for each author. Here's how that was added (in functions.php):               <?php function my_new_contactmethods( $contactmethods ) {     $contactmethods['order'] = 'Order on the About Page';      return $contactmethods;     }     add_filter('user_contactmethods','my_new_contactmethods',10,1);?>      Last, I'd like to display the users in that order. There are a number of related questions, but none that I could find that order the users by fields which are added in addition to the typical Wordpress user information (e.g. ID, user_nicename, etc.) I can simply replace "ID" in the code above with "user_nicename" and that works fine, but I need to be able to manually set the order of each of the users, so none of the built-in fields will work for that purpose.


title: Which image is used for thumbnail in List Category Post plugin

text: Which image does the plugin use for the thumbnail? From the customer field "thumbnail" or "featured-image"? What about an option to use "first attached image" or "first image in post" as some other plugins do?


title: Having separate plugins and themes folder for multi-site setup

text: My multi-site setup uses sub-directory. I am creating one plugin + one theme to customize each of the sites. Is there any way to have separate plugins and themes folder per site like so or something similar:               root     +----wp-content     |     +----site1     |          +----plugins     |          +----themes     |     +----site2     |          +----plugins     |          +----themes     +----mu-plugins     |     +----shared-plugin1     |     +----shared-plugin2     +----plugins     |     +----optional-plugin1     |     +----optional-plugin2        The goal is so that each site can only activate/deactivate the plugin/theme intended for it. **Edit** Multisite Plugin Manager can be a way to achieve what I want to do logically, though it does not put the plugins in their individual directories. I am still interested to hear other solutions.


title: Send mail to wordpress admin

text: I have a page on my wordpress site that has some fields to be filled by visitor. On the click event of 'submit' button, all the details filled by visitor should be mailed to the wordpress admin. I got to know how to Send automatic mail to Admin when user/member changes/adds profile but i don't have anything to do with the profiles right now. I want to send a mail to wp admin simply on button-click. Any help will be appreciated.


title: get the number of queries made on a page(inside my plugin)

text: Is there an easy way to see how many queries you make on a page(inside my plugin)? As I dont want to many queries in my plugin.


title: Help needed to make my site as Aggregator

text: I am having a doubt about using "Cron Job" . I have installed a Plugin named FeedWordpress which lets us to publish RSS feeds .It has given me an option to publish automatically or to publish by setting cron Jobs . Could any one guide me to set these Cron Job? I have no Idea on it .This is the message it given for that configuration . > If you want to use a cron job, you can perform scheduled updates by sending > regularly-scheduled requests to http://......?update_feedwordpress=1 For > example, inserting the following line in your crontab: > > */10 * * * * /usr/bin/curl --silent http://......?update_feedwordpress=1 > will check in every 10 minutes and check for updates on any feeds that are > ready to be polled for updates. I have another doubt .Is there any possibility to slow down and affects the load (It is of shared hosting ) ,if I turn on the Automatic Updates of feeds?How does it helps me If I use cron Job and put a cetain limit? So that it affects the server load only when It updates the feeds . Is there any chance to suspend my hosting account by Host If I Make my Blog as Aggregator because of high loads?


title: How do you add Read more ... link to posts?

text: How do you add Read more ...link to a particular post or to all posts in a blog ?


title: Best host for running large mem and processor intensive WordPress sites?

text: I host a number of WordPress sites, some of which have VERY large databases. I've gone through several popular web hosts though no joy yet. Any suggestions.


title: how can i add a menu link that goes to an external page

text: i started a new blog and i see that there are two pages it starts out with:   1. Home   2. About i want to add a third one but instead of having it load up an internal page, i want to have this go to an external link. is this possible ?


title: User-friendly cropping of post thumbnails?

text: Is there a way to let my users define the crop area of a post thumbnail? The thumbnails always are existing post attachments, I would rather not create an extra attachment per thumbnail. The post thumbnails should be 200x100 pixels, and come from one of the images used in the post. So in my ideal world, when you click the "Set Featured Image" link, you get an overview of the already included images, and when you click one of these, you can define the crop area yourself (moving or resizing it, but keeping the 2x1 aspect ratio). When you click "OK", the new post thumbnail is saved with the original attachment (in the `_wp_attachment_metadata['sizes']['post-thumbnail']` metadata field for example), not as a new attachment. Using an image that is already used as a post thumbnail for another post should not be allowed, or at least give a warning. I believe the included image editor will not suit my needs, since you can choose to edit all versions of the image, or the regular thumbnail, but not only the post thumbnail. I also find it a bit confusing to know what versions I am editing, so I think my users will have even more trouble with it. Is there a plugin that does what I want, or that I can easily extend to my needs? ## Update: Example UI I really like the interface of the Mac OS X Address Book image picker: you select an image, and resize a fixed ratio thumbnail cropper via a slider. You can also drag the base image around. You can expand this idea to multiple image sizes (I have a `post-thumbnail` and `post-thumbnail-1/2` that's half that size, for example). Let the user select the sizes (s)he is editing now with checkboxes, and draw the appropriate crop rectangles on the screen. ![The Address Book image cropper in action](http://i.stack.imgur.com/e5KiS.png)


title: Self Develop or Plugin as first option?

text: One of the things that attracted me to the WordPress platform was the plugin API and large selection, but more recently I have been self developing before looking for plugins, only using plugins for things that I don't feel I would be able to complete on time and in budget. So what do you do when you need functionality? Do you first think how you can do it yourself, or do you dive into the plugin repo straight away, the 'never reinvent the wheel' mentality? I think both have valid arguments.


title: What plugins are in use on wordpress.com

text: is there a list of plugins that are in use on WordPress.com somewhere? It would be very interesting to see how they have implemented specific widgets and functionality.


title: Is there a way (plugin?) to restrict a user to being able to edit just one page?

text: We use wordpress like a CMS and would very much like to allow users to have a "homepage". Ideally they'd be prevented from mucking up the whole site. Is there a simple way to limit users editing rights to a single page? I'm currently using the Members plugin to do other permission-based stuff, so it'd be great if a solution could either neatly augment this, or replace it entirely. Bonus points for automatic creation of a homepage when a new user is created. * * * UPDATES: I should clarify that these pages need to be confined to a specific area of the site (i.e. all children of the same page). Also, after speaking to some users it seems that they'd find it useful to create sub-pages branching from their home page.


title: I need to display post related info

text: WordPress CPT URLs are displayed at this format: www.example.com/cpt/post- slug. I need to have URL like this www.example.com/cpt/post-slug/rating that will include rating details for corresponding post-slug. For example: www.example.com/cpt/harry-potter/rating will display rating details for 'harry-potter' and www.example.com/cpt/abcdefgh/rating will display rating details for 'abcdefgh' I don't know what to name this functionality or how to do it :( Would you please share some opinion with me? --code for cpt named 'lessons'--               function register_lesson_init() {              $labels = array(                 'name'                => _x( 'Lessons', 'Lessons', 'text_domain' ),                 'singular_name'       => _x( 'Lesson', 'Lesson', 'text_domain' ),                 'menu_name'           => __( 'Lessons', 'text_domain' ),                 'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),                 'all_items'           => __( 'All Items', 'text_domain' ),                 'view_item'           => __( 'View Item', 'text_domain' ),                 'add_new_item'        => __( 'Add New Item', 'text_domain' ),                 'add_new'             => __( 'Add New', 'text_domain' ),                 'edit_item'           => __( 'Edit Item', 'text_domain' ),                 'update_item'         => __( 'Update Item', 'text_domain' ),                 'search_items'        => __( 'Search Item', 'text_domain' ),                 'not_found'           => __( 'Not found', 'text_domain' ),                 'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),         );         $args = array(                 'label'               => __( 'Lessons', 'text_domain' ),                 'description'         => __( 'Lessons Description', 'text_domain' ),                 'labels'              => $labels,                 'supports'            => array( 'title', 'editor', 'revisions', 'post-formats'),                 'taxonomies'          => array( 'es-lesson-topic' ),                 'hierarchical'        => true,                 'public'              => true,                 'show_ui'             => true,                 'show_in_menu'        => true,                 'show_in_nav_menus'   => true,                 'show_in_admin_bar'   => true,                 'menu_position'       => 5,                 'menu_icon'           => '',                 'exclude_from_search' => false,                 'publicly_queryable'  => true,                 'capability_type'     => 'page',         );         register_post_type( 'es-lesson', $args );}      i need to display related question page for this cpt url will look like: www.example.com/lessons/post-slug/question and I don't khow how to :(


title: Query to view scheduled or draft post

text: I have created a mailer template for my my single post. I can view the mailer version of my post using a url variable `?mailer` I've configured the above using the code below within my **single.php**...               if ( isset($_GET["mailer"]) ) {                get_template_part( 'mailer/template', 'post' );          } else {     /**      * @package WordPress      * @subpackage Josh 2014      * @since MyTheme 1.0     */     get_header();      Quite simple really. I then use the `get_permalink().'/?mailer'` which I then pass to campaign monitor to import my mailer template by url. Within my **mailer/template-single.php** I use this the basic loop to pull in my post data.               <?php              if ( have_posts() ) :                                                while ( have_posts() ) : the_post();     ?>          <!-- MY POST -->          <?php         endwhile;                                endif;     ?>      Everything above is working OK.    **My problem I have ran into today is with scheduled posts.** I would like to be able to view my post still (when not logged in) in the mailer template only, and not on the website. So I amended the code in my mailer template to this...               <?php              $args = array(                     'post_status' => array('publish','pending','draft','future','private')                 );              query_posts( $args );         if ( have_posts() ) :                                                while ( have_posts() ) : the_post();          ?>          <!-- MY POST -->          <?php         endwhile;                                endif;     ?>      I then visited my scheduled post permalink with my mailer variable in a new browser where I am not logged in. And I just get 404 error on my site.               http://www.mywebsite.com/scheduled-test-post/?mailer      So I'm guessing my query_posts above is not working. > Does any one have any ideas in how to amend my query to show scheduled posts > in my mailer template?


title: Permalinks all messed up, I am helpless

text: Today I tried to make the Permalinks of my Wordpress site more SEO friendly. I got it working for all links, except the ones linking to a custom post type page. I Googled the problem and found out that it's a common, in my eyes not- so-easy-to-solve-type problem. That's why I wanted to use the default permalink structure again (I am still in development phase). Now nearly all links are broken! Sometimes I get a 404, sometimes the browser itself says "page not found" - on some links, the default structure is still working. When I manually try to get to a page by entering the id manually in the brower's address bar, the address changes to the new structure, but I get a 404. You see, something is all wrong there and I don't really know how to fix it. I read about editing the .htaccess or httpd.conf (I'm in XAMPP) file, but because I don't know anything about this, I don't really want to change anything in there. Is there any way of "resetting" all permalinks to their default format? * * * **Edit:** Ok, according to the comments I should post the rewrite rules. _Problem:_ I don't even know what exactly to post from there! Plus one funny thing happened: I set the Permalink structure to `/%postname` again (since I am in 3.3.1 this should be alright I guess) and now it is working again. Only one link (the link to the custom-post type) is still ugly. So now I am in the same state as a few hours ago - although I still don't understand what is going on. When everything is correct, a URL looks like this: > http://www.example.com/kitchen But for a custom post type, the URL looks like this: > http://www.example.com/?food=food or when I visited > http://www.example.com/kitchen before that: > http://www.example.com/kitchen?food=food I use a the custom-post-type-ui plugin to create the post types. Please tell me what I should copy (I mean, that's a pretty long list right now...), then I will post it, but I just don't know right know. I guess that's why I can't even precisely describe the problem above, I am sorry! * * * **Edit:** The `.htaccess` looks like this:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /wordpress/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress/index.php [L]     </IfModule>     # END WordPress


title: Change description of my Jetpack facebook shared links

text: When I try to share a link from my WordPress site on facebook using the Jetpack Sharing Settings the link shows up like this:               (My Featured image picture here)          Put a hat on yo’ baby! | Trendz with Trina          http://www.trendzwithtrina.com/2012/02/0...          You may use these HTML tags and attributes: < a href="" title=""> < abbr title=""> < acronym title=""> < b> < blockquote cite=""> < cite> < code> < del datetime=""> < em> <i> < q cite=""> < strike> < strong>      How do I get rid of the "you may use blah blah blah" and have a description of my site or the post?


title: Using javascript on the new widget preview / customizer page

text: Widget customizer has just become core in WordPress 3.9. I'm trying out the beta version hoping to get widgets working on the customize screen in the same way I have on the ordinary widgets page. Some of my widgets use javascript, like a select element transformed using a jQuery plugin - called tokenInput. I need to be able to initialise the javascript on the new customizer screen where I can add / edit widgets.   * I can already initialise javascript on page load   * I can't reinitialise javascript on widget add, or on widget save. So basically when I click on a widget to add it, or when I save it, I lose the jquery plugin and it goes back to a normal select element. I solved this for the ordinary widgets page using something like this:               jQuery(document).ready(function() {                  // -------------------------------------------             // On page load             // -------------------------------------------             input.tokenInput("/search-posts.php");                  // ---------------------------------------------             // On new widget dropped in the sort area             // ---------------------------------------------                  jQuery(".widgets-sortables").on("sortreceive", function(event, ui) {                      setTimeout(function() {                           jQuery("#widgets-right .select_news_post:not(.token)").each(function(){                              var input = jQuery(this);                         input.addClass('token');                         select = input.next('select');                              input.tokenInput("/search-posts.php");                     });                 }, 500)             });                  // ---------------------------------------------             // On widget save             // ---------------------------------------------                  jQuery(document).ajaxSuccess(function(e, xhr, settings) {                      var widget_id_base = 'news-post';                 if (settings.data !== "undefined") {                          if (settings.data.search('action=save-widget') != - 1 && settings.data.search('id_base=' + widget_id_base) != - 1) {                              // jQuery Tokeniser                         jQuery("#widgets-right .select_news_post:not(.token)").each(function(){                                  var input = jQuery(this);                             input.addClass('token');                                  input.tokenInput("/search-posts.php");                         })                     }                 }             }     }      Does anyone have any idea what I would use on the widget customizer page to make it reinitialise the javascript on add new widget and save widget?


title: How to create category index table out of wordpress site or on other website?

text: I want to create a page on other part on my website (outside wordpress directory) where I can show list of posts from a specific category.   I am looking for exact solution provided by @toscho here: How to create tabled index of posts in a certain category For example, if my wordpress site is `example.com/blog/`, I want to create a standalone solution (php script) which will show list of posts from the wordpress site based on the category. Something like: `example.com/category.php`. Is this possible with RSS or any other solution?


title: Buddypress Registartion template

text: How do I create a registration template in Buddypress? I can't seem to find any way to integrate the registration form in a template page. I tried adding this code to my template page, it displays nothing but a blank form: http://pastebin.com/QsL65A53 Can anyone tell me what I am doing wrong? **UPDATE:** * * * Now I have this in my front-page.php file: http://pastebin.com/ZeK43zkv It shows all the fields but doesn't work. When I click the signup button it returns the same page and does not register the user. Anyone?


title: How to prevent a page from being linked in the menu/crossbar

text: I apologize if the question is confusing. Let me explain: I'm running a modified version of Twentyten and I've been doing the parent/child thing with my pages, which show up on the horizontal menu that I like to call the crossbar. However, I want to add pages that are not linked to from there, only from a sidebar widget. Unfortunately, I am not at all fluent when it comes to PHP...I've been trying to learn. Does anyone understand what I'm trying to do/have a solution? EDIT: I ended up just making a seperate html document that uses the stylesheet and linked to it. Is there an outstanding reason NOT to do this?


title: submit button not work

text: i try make 2 submit button in admin post edit page i try this               function extra_fields_box_func2( $post ){          $user = get_current_user_id();          $change_user = get_post_meta($post->ID, 'change_author', true);          if ($user==$change_user){               echo'<form method="post">';               echo'<input type="submit" name="save" value="Принять" />';               echo'<input type="submit" name="reset" value="Отклонить" />';               echo'</form>';               if (isset($_POST['save'])) {                  error_log('save');                  $res='yes';                 }               else               if (isset($_POST['reset'])) {                   error_log('delete');                   $res='no';                 }               if (isset($res)){               changenotice($post_id, $res);               }             }     }      and i try this code               function extra_fields_box_func2( $post ){     ?>     <form method="post">     <input type="submit" name="save" value="Принять" />     <input type="submit" name="reset" value="Отклонить" />     </form>     <?php          $user = get_current_user_id();          $change_user = get_post_meta($post->ID, 'change_author', true);          if ($user==$change_user){               //echo'<form method="post">';               //echo'<input type="submit" name="save" value="Принять" />';               //echo'<input type="submit" name="reset" value="Отклонить" />';               //echo'</form>';               if (isset($_POST['save'])) {                  error_log('save');                  $res='yes';                 }               else               if (isset($_POST['reset'])) {                   error_log('delete');                   $res='no';                 }               if (isset($res)){               changenotice($post_id, $res);               }             }     }      but is not work, debug.log is empty, what i make wrong ?


title: Listing Pages With Checkboxes In a Metabox (and saving them)

text: Here is what I'm basically trying to accomplish:   1. I have a custom post type called 'quotes'   2. I have a number of wordpress pages What I am trying to do is this: each time when I create a new "QUOTES" post, I want to be able to choose on which page this quotes post is supposed to go. I've decided to do this by creating a new metabox on the "quotes" post page and listing in that metabox all the pages, with a checkbox in front of them: ![pages listing metabox screenshot](http://i.stack.imgur.com/GYLT5.jpg) All fine and well, but now I don't know how to save these checkboxes. Here is the function I use to print the content of the metabox:               function myplugin_inner_custom_box( $post ) {         $custom = get_post_custom($post->ID);         $checkfield = $custom["checkfield"][0];              // Nonce to verify intention later         wp_nonce_field( 'save_quote_meta', 'custom_nonce' );          $pages = get_pages();               foreach ( $pages as $page ) { ?>                <input type="checkbox" name="checkfield_<?php echo $page->ID; ?>" value="yes" <?php if ($checkfield == 'yes') { ?> checked <?php } ?> /> <?php echo $page->post_title; ?> <br>            <?php          }      }      And here is the function I use to save them:               //save the meta box action     add_action( 'save_post', 'myplugin_meta_save' );          //save the meta box     function myplugin_meta_save()     {         global $post;         update_post_meta($post->ID, 'checkfield', $_POST['checkfield'] );     }      Obviously this doesn't work - I am not sure how to save all those checkfields values.


title: How do I use fetch_feed() to pull in a large number of posts?

text: When I use fetch_feed() to pull in posts from a feed, even if I set the maximum posts variable to a very high number, it will only pull in 10 posts. I want to pull in all the posts and then paginate the way I would for my regular blog posts. I thought maybe it was set to the number in my Reading settings, but I changed it to 30 with no change. There are definitely more than 10 posts in the feed I am trying to pull in. Is this possible or is this inherently limited for this function?


title: 2 different post->IDs for single page load only in Firefox

text: I am saving the post->ID in a session array to keep a history of the accessed pages for a specific custom post type. This code was added to that specific custom post type's template, so that the session data only updates for requests for this type. So, if the user loads the page with postID 1, then "1" is saved in the session. If he then loads a page with postID 5, then "5" is added to the session, resulting in array(1, 5), and so on. This works just fine across all major browsers with the exception of FireFox (Windows & Mac). For some reason the initial session is saved properly, but the next time I reload the same page, it will suddenly show for example array(1, 5) even though only postID 1 was accessed. I added logging to the script to log whenever the session data gets updated and that's when I noticed that for some reason FireFox sends like a partial request (faster than full page load) before loading the actual post, e.g.:   1. user loads page with postID 1, session gets updated with array(1)   2. user hits reload, FireFox loads postID 5 and then loads postID 1 again, resulting in array(1, 5) This extra page load is not visible and also doesn't show in Firebug, but somehow FireFox sends those multiple page requests even when just reloading a single page. I have already ruled out the code, since it's working fine in all other browsers and I also disabled all plugins/addons but it still happens even in vanilla FireFox. Plus it's cross-platform, so happens on a mac & windows PC when using FireFox. Has anyone experienced a similar issue before?


title: How can I add buttons to a custom column in the taxonomy table?

text: I am working on an **issue-based publishing system** for a friend of mine. So far I have created a custom taxonomy called "Issue"; added several custom fields to the custom taxonomy (like "Issue number", "PDF URL" and "Is Published?"); and expanded the taxonomy management page with additional columns to show these custom term data. Now I want to implement a convenient method to publish (and unpublish) the individual issues. My plan is to **add an additional custom column to the taxonomy management page which contains "Publish" and "Unpublish" buttons**. So I tried to populate the custom column with a form which contains hidden data fields and a visible submit button; basically I duplicated the functionality of the default term edit form, and put it in the table cells. The problem is that the whole taxonomy management table is wrapped in a form, called "posts-filter", and **forms cannot be nested**. So my solution doesn't work properly. Is there a proper solution for adding such buttons to a custom column? Any suggestions are welcomed! An image for clarification: http://img845.imageshack.us/img845/669/customcol.png               add_filter("manage_issue_custom_column", 'manage_issue_columns', 10, 3);          // The function that manages the custom columns     function manage_issue_columns($out, $column_name, $issue_id) {         $issue = get_term($issue_id, 'issue');     switch ($column_name) {         case 'issue_pdf_url':             $term_meta = get_option( "taxonomy_term_$issue_id" );             if ( isset( $term_meta["issue_pdf_url"] ) ){                 $out .= $term_meta["issue_pdf_url"];              }            break;              case 'issue_num':             $term_meta = get_option( "taxonomy_term_$issue_id" );             if ( isset( $term_meta["issue_num"] ) ){                 $out .= $term_meta["issue_num"];             }         break;              //This is the column where I need to add buttons         case 'issue_published':             $term_meta = get_option( "taxonomy_term_$issue_id" );             $term_object = get_term($issue_id, "issue");             if ( isset( $term_meta["issue_published"] ) && $term_meta["issue_published"] == "yes" ){                 //This is the form which shows the publishing buttons; not working due to being nested in other form                 $out .= '<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="">  <input type="hidden" name="action" value="editedtag" />  <input type="hidden" name="tag_ID" value="' . esc_attr($issue_id) . '" />  <input type="hidden" name="taxonomy" value="issue" />  ' . wp_original_referer_field(true, 'current') . wp_nonce_field('update-tag_' . $issue_id) . ' <input name="name" id="name" type="hidden" value="' . $term_object->name . '" />  <input name="slug" id="slug" type="hidden" value="' . $term_object->slug .'" />  <input name="description" id="description" type="hidden" value="' . $term_object->description .'" />  <input type="hidden" value="" checked="" id="term_meta[issue_published]" name="term_meta[issue_published]">  <input type="submit" value="Unpublish" class="button-primary" id="submit" name="submit"></form>';             } else {                 $out .= '<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="">  <input type="hidden" name="action" value="editedtag" />  <input type="hidden" name="tag_ID" value="' . esc_attr($issue_id) . '" />  <input type="hidden" name="taxonomy" value="issue" />  ' . wp_original_referer_field(true, 'current') . wp_nonce_field('update-tag_' . $issue_id) . ' <input name="name" id="name" type="hidden" value="' . $term_object->name . '" />  <input name="slug" id="slug" type="hidden" value="' . $term_object->slug .'" />  <input name="description" id="description" type="hidden" value="' . $term_object->description .'" />  <input type="hidden" value="yes" checked="checked" id="term_meta[issue_published]" name="term_meta[issue_published]">  <input type="submit" value="Publish" class="button-primary" id="submit" name="submit"></form>';             }         break;              default:         break;     }          return $out;     }


title: Wordpress auto login after registration not working

text: So I looked up a bunch of threads trying to figure out how to automatically log a user in after registration, and came up with this.               function log_me_the_f_in( $user_id ) {         $user = get_user_by('id',$user_id);         $username = $user->user_nicename;         $user_id = $user->ID;         wp_set_current_user($user_id, $username);         wp_set_auth_cookie($user_id);         do_action('wp_login', $username, $user);         exit;     }     add_action( 'user_register', 'log_me_the_f_in' );      According to many responses I've seen, `wp_set_auth_cookie` and `wp_set_current_user` alone should be enough to log a user in by id, but even this isn't doing anything. Does anyone have any idea what I'm doing wrong?


title: Making footer widgets responsive

text:
I have 4 footer widgets in the theme I'm working on. It works great. The only thing that I can't get to work is the responsiveness of the widgets. The 4 footer widgets keep on showing up next to each other on smaller screens, and I need them to be on top of each other for smaller screens. Can any one help me around this problem. Here is my code :               <div id="footerwidget" <?php pietergoosen_voet_widgets_klas(); ?>>     <?php if ( is_active_sidebar( 'sidebar-15' ) ) : ?>
         <?php dynamic_sidebar( 'sidebar-15' ); ?>
     <?php endif; ?>          <?php if ( is_active_sidebar( 'sidebar-16' ) ) : ?>
         <?php dynamic_sidebar( 'sidebar-16' ); ?>
     <?php endif; ?>          <?php if ( is_active_sidebar( 'sidebar-17' ) ) : ?>
         <?php dynamic_sidebar( 'sidebar-17' ); ?>
     <?php endif; ?>          <?php if ( is_active_sidebar( 'sidebar-18' ) ) : ?>
         <?php dynamic_sidebar( 'sidebar-18' ); ?>
     <?php endif; ?>


title: WXR? Export from Drupal 7 - import into WordPress

text: I have used some of the tutorials out there to convert a Drupal 7 site over to WordPress. My problem is that I am not finding any tutorials with the lines I can use in my MySQL to convert the users,comments,tags,category table in Drupal 7 over to the wp_users table in WordPress 3+. As I said... everything else has converted perfectly, but this is the only thing left.


title: Programmatically create blogs with dummy content on a WPMU site

text: I'm trying to set up a WPMU test environment with 5-6K blogs, lots of posts comments, users etc. Browsing trough the WP's functions, I picked up wp_insert_post, wp_insert_comment, create_empty_blog(), and wp_insert_user(). So basically I would run a big for loop in which I create random blogs, get their ID, switch to each of them and insert posts with random content. Is this really this easy as it looks? :) Or I'm missing something here?


title: Remove the number of posts displayed in wp_list_categories()

text: When I use wp_list_categories(), it results in the number of posts in a category being shown, how do I hide the number? For example: I have xyz category, it has 3 posts, the result will be:               xyz(3)


title: Get search term not on searh results page?

text: I would like to get the last term that was searched, but when not in the search.php page. For that, I know, I could use **get_search_query()** function, but if user clicks on a post for example, so he is now in the single item and that function will retrieve an empty string. I want to preserve that search phrase and get it on other page. Any ideas? Thanks


title: Warning: Cannot modify header information - How to resolve this issue?

text: What is the wrong with this code. I am always getting the error like: > Warning: Cannot modify header information - headers already sent by (output > started at /home/krishnas/Documents/wordpress/wp-admin/menu-header.php:91) > in /home/krishnas/Documents/wordpress/wp-includes/pluggable.php on line 866               $upload_dir = wp_upload_dir();             $basedir = $upload_dir['basedir'];             $baseurl = $upload_dir['baseurl'];             $filename = "products_".date('YmdHis').".xls";             $fp = fopen($basedir.'/'.$filename,'wr');             fwrite($fp,$content_final);             $excell_file = $baseurl.'/'.$filename;             //echo $basedir;             //echo $baseurl;             //exit;             //exit;             wp_redirect($excell_file);exit;}}?>


title: How to add a full edit link to front-end editor?

text: I would like to add a full edit button to the Front-end Editor plugin. It's currently like this: > [EDIT] Text text text I would like to make it like: > [EDIT] Text text text (enables front-end editor) > > [FULL EDIT] Text Text Text (goes to the back-end editor) I think this is the current code for the [EDIT] button: `wp-content/plugins/front-end-editor/build/editor.min.js`:               base.prototype.pre_edit_button = function() {           var _this = this;           return jQuery('<button>', {             'class': 'fee-hover-edit',             'html': FrontEndEditor.data.edit_text,             'click': function(ev) {               _this.last_mouse_pos = ev.pageY;               return _this.start_editing();             }           });


title: How to deal with equal & similar arguments for a function?

text: I'm currently extending my pagination plugin, after a hint by @toscho. So the plugin will now use the same filters, hooks and arguments as the native wordpress pagination functions. My problem is that the different wp functions name their arguments ... different. ### Example: _This is how you change the text for the "Next" link._   * `wp_link_page()` = `'nextpagelink'`   * `paginate_links()` = `'next_text'` After retrieving the input in the class, I `wp_parse_args( $args, $this->defaults );` my arguments and then `extract` them. ### Problem: When I now allow both `'nextpagelink'` & `'next_text'` as valid arguments, how would i deal with them? Which would I check first? Do I need to set some priority, so one overrules (if both are set) the other? ### Example: This example shows my dilemmas:   * Which one has the higher priority? How can I avoid deciding?   * It's really long code just for deciding what to do with 2 vars. Code:               if ( $nextpagelink && $next_text )      {         // CASE 1: both are set         // which one should I take now?     }     elseif ( $nextpagelink )     {         // CASE 2: only one is set - should this one override the next one?         // set something     }     elseif ( $next_text )     {         // CASE 3: only one is set - should this be overridden by the previous one?         // set     }     else     {         // CASE 4: none is set - apply default         // set default     }


title: Switched server & domain name, now custom post types won't save

text: I had the site on oldsite.com but was using the database at newsite.com, everything was working great. I moved the site to newsite.com, now when I try adding a new post using a custom post type, it disappears, I am still able edit older posts, of the same custom post type. I checked the db when I create a new post nothing is saved, when I make changes to existing posts the change is saved. Not sure where to look next. Thanks this is in my functions.php http://pastebin.com/n5baM3R8


title: How do I embed youtube video via url in frontend posting

text: I would like to embed videos & images by entering url in my wordpress site. In WordPress repsitory there are many plugins for embed video by url but in my site I want to enable this functionality from frontend. Registered users can be able to enter a url and this video will enbed in the post. How can I achieve this.


title: Auto log in hook is requiring a page refresh

text: I have a simple auto log in hook that looks like the following:               function auto_login() {         if (!is_user_logged_in()) {             //Removed some code for brevity.                  $user = get_userdatabylogin($domainName);                  if ($user != null) {                 //Set the auth cookie.                 wp_set_auth_cookie($user->ID, false, null);                 //Set the current user (this will also set WP objects at the global level)                 wp_set_current_user($user->ID);             }         }     }     add_action('init', 'auto_login');      This code does work, but, in order to get the admin bar at the top of the page it requires a page refresh. This makes me think that I'm not getting some global objects populated early enough in the Wordpress page life cycle. Should I be calling this method somewhere else besides `init`?


title: Display Headings on Index page in different font sizes

text: The index page of any wordpress blog has a same size of font in their heading. Can't we tailor size of headings by ourselves for each post? If we change it by CSS, every heading will be changed. Or may be we can create a shortcode for it? Any clues to get started?