title: Add a class at specific element in custom Menu Walker

text:
I have customised my menu in wordpress by extending the Nav_Menu_Walker class and now i cannot figure it out how could i add a class at a specific ul element. I have this function which adds classes by depth:               function start_lvl(&$output, $depth) {      $indent = str_repeat("\t", $depth);      if ($depth >= 1)         $output .= "\n$indent
\n";      else         $output .= "\n$indent
\n";          }      When the $depth is 0 i would like to add a different class at the third element from $depth =0 rather than "submenu". Could you please provide me some suggestions ?


title: How to make shortcode to hide selection of text from post or page?

text: is there any shortcode or a plugin that will add new quicktag, like this example: [hidemytext]some hidden text[/hidemytext] and any text inside those tag is hidden from the post or from the page. Thanks and regards


title: Single post content custom order

text: In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text. What I need is to add some condition in single.php so that the order for display to be [video] ->entry-meta ->title ->text. Or maybe there is a function to check if I have [video] shortcode in post to display it first than the title and after rest of the content. Can anyone please help? I know that tut but I don't know how to use it in single.php.               if(has_shortcode('your_short_code')) {           // perform actions here  ...          // I want to have: do shortcode [video id] or something like this     }        I need an example in single.php I just want to have in single.php displayed first the [video id] after meta than Title +Content OR               the_content([with video]);          the_content(without video);


title: How to include external library in wordpress plugin

text: How can I make an external PHP library available with my plugin. Where the library files need to be placed?


title: Don't show attachments if they are inserted in post

text: I have attached images that I have inserted into my posts but they also appear in the attachments box at the bottom of the post. I'd like to know how to make them not appear in the attachments box if I have inserted them in the post. example post: http://www.fanboybuzz.com/2012/12/sexy-thor-girl-cosplay-2/ I don't want the smaller thumbnail image at the bottom of the post to show up since I've inserted the image in the actual post. Can anyone help me?


title: WordPress feeds and publish date

text: By default WordPress feeds have a tag which contains the date the article was first published. How can I change the content of that tag to contain the value from the post_modified field rather than post_date field for posts?


title: Organizing uploaded media with wp_insert_post() and wp_handle_upload according to time parameter

text: I'm retroactively creating a post with wp_insert_post() and attaching a featuring image to it. I need the image to go into the folder that corresponds to the post's publishing date. I'm using time parameter in wp_handle_upload function that supposed to move files to the directories according to the parameter value (see in the code - $upload_date - static value for now). But right now the image moves to the current year/month folder ignoring $upload_date (Ex.: Supposed to go **2007/11** , goes to **2012/12** ).                   $output_dir = $uploads['path'];         new_filepath = $output_dir.'/'.$file;               // INSERT POST AND GET POST ID           $my_post_id = wp_insert_post($my_post);               // Copy image from my folder to WP Uploads         rename($filename,$new_filepath);               // required for wp_handle_upload() to upload the file         $upload_overrides = array( 'test_form' => FALSE );              $upload_date = '2007/11'; // Using this date for testing purposes              $movefile = wp_handle_upload( $new_filepath, $upload_overrides, $upload_date );               $wp_filetype = wp_check_filetype(basename($new_filepath), null );         $attachment = array(              'post_mime_type' => $wp_filetype['type'],              'post_title' => $post_title,              'post_content' => $post_content,              'post_status' => 'inherit'         );         $attach_id = wp_insert_attachment( $attachment, $new_filepath, $my_post_id );         $attach_data = wp_generate_attachment_metadata( $attach_id, $new_filepath );         wp_update_attachment_metadata( $attach_id, $attach_data );               // ADD FEATURED IMAGE TO THE POST         add_post_meta($my_post_id, '_thumbnail_id', $attach_id);


title: exclude category in loop.php

text: I am using twentyten theme. I am trying to exclude category 1 from author posts. I used the following code in loop.php               query_posts(cat='-1');     while ( have_posts() ) : the_post(); ?>      But no post is displaying. How to fix this?


title: Gallery shortcode - change link file image size? (not using default fullsize image)

text: I am using this for my gallery -               <?php echo do_shortcode('[gallery size="gallery-thumb" link="file"]'); ?>      and I am using the jquery fancyapps fancybox. But some full-size images that are in my gallery are are really big and take forever to load... Instead I want the link file in the shortcode to use my custom image size below...               add_image_size( 'fancyapps-image', 1024, 1024 );      Can any one help with out using another plugin?    * * *    I am using similar script on my post/pages body where images are inserted manually and aligned etc. So something similar surely could work? This script combo functions ajax call basically scans all the images in my posts and changes the link url to the 'fancyapps-image' size... **script**               var raw_class, image_id = new Array();     $('.entry a img').each(function(i){         var img_class = $(this).attr('class');         if(img_class && img_class != undefined){              raw_class = $(this).attr('class').split(" ");             for(j=0;j<=raw_class.length-1;j++){                 if(raw_class[j].match(/wp-image-/))                     image_id[i]= raw_class[j].slice(9);             }         }     });          var image_ids = image_id.toString();     var data = { type: 'get_data', action: 'wp_get_large_image_url', data: image_ids }          $.post( wp_ajax, data, function(message){         if(message){             var raw_data = message.split(',');             for(i=0;i<=raw_data.length-1;i++){                 var image_data = raw_data[i].split('%-');                 $('.wp-image-'+image_data[1]).parent('a').attr('href', image_data[0]);             }         }     });      **admin-ajax.php call**               <?php echo "var wp_ajax = '" . admin_url('admin-ajax.php') . "';" ?>      **functions.php**               function wp_large_image_data(){         unset( $_POST['action'] );         if($_POST['type'] == 'get_data'){             $data = $_POST['data'];             $image_ids = explode( ',',  $data );             $image_large_url = array();             foreach($image_ids as $image_id){                 if($image_id){                     $attachment_data = wp_get_attachment_image_src( $image_id, 'fancyapps-image' );                     $image_large_url[] = $attachment_data[0].'%-'.$image_id;                 }             }             $image_data = implode( "," , $image_large_url);             echo $image_data;                }         die;     }     add_action('wp_ajax_wp_get_large_image_url', 'wp_large_image_data');     add_action('wp_ajax_nopriv_wp_get_large_image_url', 'wp_large_image_data');         Any ideas would be great thanks.


title: Bluehost WebHost and performance problems with W3TC

text: I'm currently arguing with Bluehost over slow server times and they pointed to a report at gtmetrix.com in which I found inefficient CSS selectors. There were 55 very inefficient CSS selectors from the login page alone. Some including: > `#adminmenu li.menu-top:hover .wp-menu-image img` Tag key with 3 descendant > selectors and Class overly qualified with tag There are many others but the CSS file is pointing to > /wp-admin/css/wp-admin.css?ver=20111208 So this is WordPress' CSS files. Is this normal? Or this referring to other CSS stylesheets that reference the same selector? **UPDATE** I'm running W3TC and I get an error: > It appears Page Cache URL rewriting is not working. If using apache, verify > that the server configuration allows .htaccess or if using nginx verify all > configuration files are included in the configuration. I'm not sure why since when I open up .htaccess, W3TC has written all the browser cache and page cache settings.


title: How to show main category related to that post

text: On my main page I have a few post from two categories, but I only want it to display only one Here is my code               <?php     /* translators: used between list items, there is a space after the comma */         $categories_list = get_the_category_list( __( ', ', 'themename' ) );             if ( $categories_list && themename_categorized_blog() ) :     ?>     <?php printf( __( '%1$s', 'themename' ), $categories_list ); ?>       Is it possible to do it by adding this `[0]` in the code somewhere, if so, where?


title: Add Metabox to all custom post types

text: Ok, I've looked through the forum here, but haven't found quite what I'm looking for. I wanted to see if it was possible to add a Metabox to all custom post types without the need to setup an array? Or, maybe just the CPTs created using Custom Post Types UI plugin? Here's the code I'm testing, but it only shows up on regular Posts.                   add_meta_box( 'my-meta-box-id2', 'Enter your PDF location for your post category below:', 'cd2_meta_box_cb', 'post', 'normal', 'high' );


title: Showing Custom Menus in the sidebar

text: I want to get custom menu in my top level page and the sub pages which are not child of the top level pages. I got many examples using wp_list_pages but it requires the sub pages should be the child of the top level page. How do use the wp_get_nav_menu_items function to show the custom menu in child page and the toplevel page Thanks


title: Wordpress Rewrite Url with arugments

text: I did not find any useful tips from google search and I wrote the same question in wordpress forum but there is no reply I am writing the complete step here First step I am redirect page to custom post archive page add_action( 'template_redirect', 'plu_redirects' ); //I am saving in the session the post_id which is the event $_SESSION['event_page'] = $_GET[ 'event' ]; wp_safe_redirect( get_post_type_archive_link('plug') ); In the archive page I am trying to get the post by id or if session not exists then get the latest post.                   if ( !isset($_SESSION['event_page'])) :             $args = array(                 'post_type'=> 'plug',                 'posts_per_page' => 1,                 'order'    => 'ASC',                 'tax_query' => array(                     array(                         'taxonomy' => 'event_type',                         'field' => 'slug',                         'terms' => 'schedule'                     )                 )             );             query_posts($args);         else :             $args = array(                 'post_type'=> 'plug',                 'posts_per_page' => 1,                                     'p' => $_SESSION['event_page'],                 'order'    => 'ASC',                 'tax_query' => array(                     array(                         'taxonomy' => 'event_type',                         'field' => 'slug',                         'terms' => 'schedule'                     )                 )             );             query_posts($args);         endif;      But this is always getting the last record when session is set ...Why? I need to is there a better way it code can be written instead of using the session and also I don't require the loop as I am getting only one record. I am having the problem in the archive page and the code which I have added is working . but not professional..


title: Am I allowed to license my Wordpress theme under the aGPL

text: I was interested in the recent conversation about whether WordPress themes need to be licenced under the GPL or whether they can be closed source. The video can be reached from matts blog and my favourite discussion about it is Dave Winers blog post. My question is - am I allowed to license my theme under the aGPL? or is this the same argument as if I wanted to use a closed source license?


title: WP_Query + random

text: Is there any way to get this               <?php      $pc = new WP_Query ('category_name=cat1&posts_per_page=5');      ?>       but each time display a RANDOM different batch of 5 ones?


title: JavaScript Errors when Loading NextGEN Gallery

text: I am using NextGEN Gallery and NextGEN GalleryView. _**(Editors Note: Not sure what this sentence means)_**   But I can't get the image those image was hidden. When I check the css and js files, all of file are included when I check in firebug the below error is shown:               jQuery.timer is undefined     ...for: http://192.168.1.210/hotel.com/wp-content/plugins/nggGalleryview/j...          jquery...r=1.1.2 (line 144)     jQuery("#ngg-gallery-1-133").galleryView is not a function               easing: 'easeInOutQuad'


title: How to query different post types in specific order?

text: I have 3 posts types, `articles`, `news` and `tips`. On the home page I want to query 20 posts in this order:               article, article, news, news, tip, ...// same order again until 20      If I use a custom query like so:               $query = new WP_Query(array(       'post_type' => array('articles', 'news', 'tips'),       'posts_per_page' => 20,     ));      I get 20 items but how to order them? Would it be possible to make 3 different queries and then merge the results?


title: Make pages visible to only logged in members

text: I want to make a page for each user on my website. When a user logs in, I want them to be able to click on pages that are just designed for them (basically when they log in, I want them to be able to view their own profile). When another user logs in, I want them to be able to view their own profile. Note: I want their profile called 'MY ACCOUNT' and I need to show that on the nav bar Any ideas?


title: Multisite vs Role Scoper

text: I have a website with several sections. Each section will have their own user to administer content on. These wouldn't be large sections, maybe a few pages to a dozen at most. My question is whether it would be worth the initial work setting up a Multisite or somehow using role scoper so that a user can only add child pages to a particular parent page If role scoper is the way to go, what's the best way to go down this avenue? Thanks


title: where is the code that executes the template hierarchy?

text: I can see a picture of the template hierarchy here, but where is the actual wordpress code which decides that it's a "category page" or an "archives page" or a "search page"?


title: Facebook profile pic used as avatar

text: I'm trying to add an avatar option for my blog and would like to avoid using Gravatar or custom avatars so I wish to use Facebook profile pic instead of an avatar. I know that there are plugins for that but they're all a bit cumbersome. I tried Incarnate but the issue with it is that there is no authentication so anyone can use any publicly available username thus misrepresenting themselves. Also, if a person doesn't have a publicly available FB profile, they can't use their profile pic. To sum up, I'd like a plugin or a code so that visitors to my blog are automatically represented with their FB profile pic (if they are already logged in to Facebook) without the need for them to register or log in with FB details to my blog. If a person is not logged in to FB, then a custom avatar is to be used. Please suggest a solution.


title: Wordpress category loop offset possible?

text: I have been on this for a while now and haven't really come across a solution to filter the posts on a category page using a sort of offset in php. There are plugin for posts and pages but I am trying to achieve this with pure php and specifically for a category page. Scenario example: A blog with 7 posts, setting the offset to say 3 would begin the loop on the category page to only show (Post4, Post5, Post6, Post7) and NOT (Post1, Post2, Post3). I am wondering if this would be possible at all and be dynamic enough to apply to all categories without the need to specifically identify which posts to exclude via id numbers.


title: Make wp_list_pages print slugs instead of titles

text: By default wp_list_pages spits out an unordered list of post titles. To save space in a sidebar menu I´m trying to create a list of page slugs instead of page titles. I suppose I´ll need to write a custom walker.. I was hoping someone can help me with an easier solution or a code snippet.


title: Change status of page after an event (Looking for best practice advice)

text: I'm looking for a best practice/ideas for modifying the status/data of a page after an event. Here's an example of what I'm trying to accomplish - This WordPress site would allow users to sponsor people (just one sponsor per person). Each person that is eligible for sponsorship has their own page, which is created via a custom content type I created called "People". That's all the easy part, it's just a basic page that give descriptive information about the person looking to be sponsored. You can then go to PayPal and pay to sponsor them. Now, the part I need help with is after they have paid and get sent back to the site how could I trigger the status of that now sponsored person's page to switch to "Sponsored". So, that no one else tries to sponsor them. I'm assuming I should go about this with Hooks, Actions and Filters, though, I haven't used them much. Anybody have any thoughts on how to accomplish something like this? If I had the basics I could take it and run with. Thank you!


title: Users: List A to Z, for Users

text: I would like to create a list of all the alphabets that represent each user in my site. Example:               A -> Link that shows list of all users whose **nickname** starting with letter "A"     B -> ...starting with letter "B"     C -> ...starting with letter "C"     D -> ...starting with letter "D"     E -> ...starting with letter "E"     F -> ...starting with letter "F"     .     .     Z -> ...starting with letter "Z"      I would like to list every alphabet regardless of if there is or isn't a user for it. But would also to know how to only show alphabets with users. Im not sure exactly which method I'll end up using, but I just want to have the option. Ive searched online but couldnt find anything for my particular situation. Id appreciate any help with this. Thanks a lot


title: Using only %postname%

text: So I see everyone's arguements against using this, but that seems like a huge flaw in Wordpress because a domain name as close to the root is crucial to a site's SEO. I want my site which has rough 8 pages total to be able to be found by their simple titles, if they're preprended by a date, it just look convoluted and out of standards with most web standards. Fast forward to me adding `%postname%` to my custom permalinks tab, all my url's were updated, and clicking on them brings me a 404. No .htaccess file was made so I made one from scratch and included this :               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /Websites/Garden%20Terrace/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /Websites/Garden%20Terrace/index.php [L]     </IfModule>          # END WordPress      **Update** Any of the permalinks except for the post ID option do not work. None of them work. What o' what am I missing from this to make it actually work? **UPDATE 12/13/2011** Wordpress 3.3 was just released. And all these problems still exist. Clicking on any of the permalinks writes this to your .htaccess . The same text for _any_ of the options :               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /Websites/Garden%20Terrace/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /Websites/Garden%20Terrace/index.php [L]     </IfModule>          # END WordPress     #      Using `/%postname%` doesn't work. At all.


title: A problem with date archives

text: I downloaded a widget for my blog, which works just like the calendar widget but displays a custom post type instead. It correctly marks my CPT-posts and creates links, such as http://localhost:8888/wp/?m=201105 for a certain month and http://localhost:8888/wp/?m=20110510 for a certain day. Now I want to create the required archive template, but it keeps falling back to index.php instead of date.php or archive.php - and the loop in index.php returns empty. I am flabbergasted, has anyone seen this before? My hypothesis: it returns empty because I does not include custom post types. It does not explain why date.php / archive.php isn't being used (and is_date() appears to return false), but it would explain why the loop is empty because I have no other articles yet. If this is the case, how can I include CPTs?


title: Were the language toggles removed from WP recently?

text: I need to change my weblogs language to "English". I am refering to the article: http://en.support.wordpress.com/language- settings/ which allegedly was "Last modified: July 16, 2012". I only looked for this option in v.3.4 forward and I cannot find it. It's also absent in v.3.5 beta 1. I initially installed and still use the German locale. Thus: 1). Were these simple drop-down menus removed from more recent versions? Because I can find neither of the two. 2). Could my webhoster be at fault somehow? They offered the "WP One-Click- Install" option, which I thought shouldn't hurt things - I guess I was wrong... 3). Could be my German locale at fault, i.e. maybe only the "international" or "English" version has this toggle, but not any of the downloadable locales? Just a guess. I am aware of the fact that I can change the language of WP manually, but first I need a clarification what happened to the above feature since July 16th this year.


title: Custom Function for SEO by Yoast plugin

text: We use a very customized version of WordPress for some of our index/root site pages where we use a custom meta box for custom permalinks. What we are looking for is a custom function that basically looks to see if the custom permalink field is being used and if it is, to grab that as the canonical url. This helps with duplicate content being indexed by search engines and we're gearing up to use Outbrain, who will be crawling our canonical urls. I came across this post on Stack Overflow but am not sure how to edit for my needs.               function design_canonical() {        global $post;             if ( get_post_type( $post->ID ) == 'design' ) {            return site_url( '/design/' . $post->post_name );        } else {            // Leave blank and Yoast SEO will use default canonical for posts/pages        }     }     add_filter( 'wpseo_canonical', 'design_canonical' )      I'm thinking the `post->ID` doesn't need the `'design'` and the `return site_url` should be my custom meta box. How to edit it properly?


title: How can I set a vote on the comments?

text: In this wordpress blog, one can vote the comments. I am wondering how can I set up this function in my wordpress blog? ![enter image description here](http://i.stack.imgur.com/ymbkC.png)


title: WordPress object for comments frame

text: For two days I have tried to make this code work. I want to add a comment frame in `single.php`. I got this code to put it in the single page's template:               <script type="text/javascript" charset="utf-8">     initFrame({ app_id: 'xxx' ,     object_id: 'ARTICLE_ID' ,     object_title: 'ARTICLE_TITLE' ,     object_content: 'ARTICLE_CONTENT' ,     object_url: 'ARTICLE_URL' ,     arguments_container: 'comment' ,     width: '610' })     </script>      and they said: Replace strings with some logic:   * ARTICLE_ID: id of the article in your website.    * ARTICLE_TITLE: title of the article    * ARTICLE_CONTENT: body content of the article   * ARTICLE_URL: the url to the article    * DIV_ID: the div id where Naqeshny arguments box appears The question is: what should I write in ARTICLE_ID, ARTICLE_TITLE, etc. to change in every topic I write on my website?


title: Fields don't reflect previous Quick Edit changes when clicking Quick Edit a second time

text:
I've added a column to the edit screen and add an input for that column in the quickedit. Everything saves and displays like I'd expect with one small hiccup. If I click on Quick Edit for a particular post, make a change to the custom input, and save.... well the column updates properly. However, if I click Quick Edit _again_ (without refreshing the page) the custom input maintains the original input.... the input isn't getting the new value, even though I am using `.on()`, `inlineEditPost.revert()` and even though the hidden value _is_ being properly updated (I can see it with Chrome's dev tools). Perhaps this is strictly a JS error, but I figured I would post here first. **This is the content of my custom column:**               echo $sub = get_post_meta(get_the_ID(), 'kia_subtitle', true);     echo '
' . $sub . '
';      **This is the jquery I am using to set the custom input's value in Quick Edit mode:**               $( '.editinline' ).on( 'click', function(){              // revert Quick Edit menu so that it refreshes properly         inlineEditPost.revert();              posttitlelabel = $( ':input[name="post_title"]', '.inline-edit-row' ).parents( 'label' );          tag_id = $( this ).parents( 'tr' ).attr( 'id' );             subtitle = $( 'div.kia-subtitle-value', '#' + tag_id ).text();                $( 'input.kia-subtitle-input', '.inline-edit-row' ).val( subtitle ).parents( 'label' ).insertAfter( posttitlelabel );          });      The `posttitlelabel`, and `insertAfter` parts are just to move the input so that it immediately follows the regular Title.


title: While loop inside another while loop

text:
OK, so I've read like 20 different articles about using a while loop inside another while loop, but still can't get this to work, and I'm about to burst from frustration. My scenario: using the Advanced Custom Fields plugin along with the WP Coda Slider. My goal is to display a small gallery of images (that are loaded via the ACF plugin, on a custom post type) inside a Coda Slider. The images in the ACF are also using the Repeater addon for ACF. This requires the use of a while loop to output the images. Facts: parent field for images: portfolio-images field key for images: image php that ACF says will display the images:                <?php while(the_repeater_field('portfolio-images')): ?>      <a href="<?php the_sub_field('link'); ?>">      <img src="<?php the_sub_field('image'); ?>" alt="image" />            <?php endwhile; ?>      I'm already running this loop for the WP Coda Slider: `                           <div id="post-<?php the_ID(); ?>" <?php post_class('panel'); ?>>

{

<?php the_field('tagline'); ?>

}

<?php the_title(); ?>

                                  <?php the_content(); ?>

                    <?php endwhile; else:                    endif;          wp_reset_query(); ?>      I don't know what else to try at this point. Any help is very appreciated. Thanks.


title: Removing /blog/ from multisites cause infinite redirection

text: I have a wp installed with multisite enabled and working with subdirectories. I noticed that in the main blog (the one that exists by default on the root), the posts links had a "/blog" in the url before the permalink. So logged as the network admin I went to "All Sites > Edit" and I removed "/blog" from the permalink setting. But now when I visit a post at for example mydomain.com/post-name, I get a 301 redirect to the same url (/post-name), so the redirection is infinite. Why am I doing wrong?


title: how to arrange the bullet list items in vertical

text: This is my test_site .In there the list items are displaying not in order. I know this is because of some silly css problem. but I don't know how to write the css to make them to display neatly. I tried `display:inline,display:block` no use. can anybody please help me to attain this?


title: Separete trackbacks/pings and numbered comments

text:
I've been googling around for tutorials of how to a) number the comments in the comment list and b) seperate trackbacks/pings from the rest of your comments. All the tutorials seem to be out of date?! They all suggest you look for something in your comment.php file that I haven't seen in any newer theme lately, namely:               <?php if ( $comments ) : ?>      or               <?php foreach ($comments as $comment) : ?>      I don't seem to have anything like that in my comment.php. I also checked the comment.template and comment.php in the wp-includes folder, but couldn't find anything. Also no luck looking through the function.php. Here's the comment-related snipped of my function.php:               function mytheme_comment($comment, $args, $depth) {     $GLOBALS['comment'] = $comment; ?>     <li <?php comment_class('clearfix'); ?> id="li-comment-<?php comment_ID() ?>">      <?php echo get_avatar($comment,$size='63'); ?>      <div id="comment-<?php comment_ID(); ?>">
         <?php printf(__('%s'), get_comment_author_link()) ?><?php edit_comment_link(__(''),'  ','') ?> <?php printf(__('%1$s @ %2$s'), get_comment_date('Y/n/j'),  get_comment_time('G:i')) ?>
           <?php comment_text() ?>

       <?php if ($comment->comment_approved == '0') : ?>          <?php _e('Your comment is awaiting moderation.') ?>
       <?php endif; ?>
          <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>

      And here's my comment.php: pastebin I'd really appreciate your advice. Thanks a lot.


title: Save user-specific options in WordPress admin

text: I'm writing a plugin that need to save user specific option in an admin page. I'm only thinking of adding username-prefix to option, for example:               $options = get_option('username-plugin_options');      Is there any better way doing that?


title: How to Removing fields from the Media Uploader/Gallery on a Custom Post Type Edit Page

text: This post shows how to remove unwanted fields from the media uploader. It works great, but I want to limit it to a custom-post-type and I can't seem to figure out how to do it. I've tried the following code, but it doesn't seem to work:               add_filter('attachment_fields_to_edit', 'remove_media_upload_fields', 10000, 2);     function remove_media_upload_fields( $form_fields, $post ) {     global $my_admin_page;     $screen = get_current_screen();     if ( 'slider' == $screen->post_type ){          unset( $form_fields['image-size'] );     unset( $form_fields['post_excerpt'] );     unset( $form_fields['url'] );     unset( $form_fields['image_url'] );     unset( $form_fields['align'] );          }          return $form_fields;     }      Any ideas on how to get this to work? Thanks, Moshe


title: Which action does wp_update_user triggers?

text: I am working modifying an ecommerce plugin, and it makes uses of wp_update_user() function, and everytime the function runs another table (created by the plugin), gets updated too. The problem is that the updated data on that second table is incorrect, and I am having troubles finding the part of the code that does it. **So I was wondering, does the wp_update_user( ) function triggers some "action" so I can search for that in all the files?** like those used in for example:               add_action('wp_logout', 'logout_handler');


title: term_exists returns NULL

text:
According to the codex ( http://codex.wordpress.org/Function_Reference/term_exists ), term_exists returns some mixed results but not NULL. In my case, I'm getting NULL, what am I doing wrong? In this particular example 'Videos' term does not exist under category. Shouldn't it be returning a false or 0? Why NULL?               $term_exists_results = term_exists($term, 'category');          echo "
term_exists('{$term}', 'category')?";      echo "
";     var_dump ($term_exists_results);     echo "
";          /*     outputs...           Taxonomy: [category Term: [Videos]          term_exists('Videos', 'category')?               NULL                                        */


title: show only sub categories if available?

text: Hii i want that when i click on category link that show sub category if available instead of posts list If No Sub category available then show normal posts how to do this that if available sub categories only show just sub categories not any other posts Mean which extra code i add in my archive page that show sub categories if available otherwise show posts Thanks


title: Feeds not working on my wordpress site

text: I just made my wordpress website live finally and now trying to set up the RSS. I came across a couple tutorials saying that you have to go to www.yoursite.com/feed copy the link and place it into the URL area in your feedburner account. However what happens if nothing shows up when you go to www.yoursite.com/feed ? It says the URL does not exist, however I have a blog on the site. Is it because my permalinks aren't set to a custom permalink?


title: Remove "You are using Wordpress 3.2.1" from Right Now Dashboard Widget

text: I'm looking for a to hide the text on the dashboard that says "You are using WordPress 3.2.1" in the Right Now widget. Not that we don't love WordPress, but for our use-case (where we'll be providing this WP install to dozens, if not hundreds of people), I'd like to get as much stuff out of there that's not needed (and that could eventually confuse them). I saw that the Right Now Dashboard is in /wp-admin/includes/dashboard.php -- but can't figure out how to change/remove that text. Thanks!


title: Overide a function that is inside a plugin

text: I would like to change the behavior of one function in a plugin. Instead of rewriting the file and having to deal with updates I would prefer a solution that works similar to the way add_filter works for the wordpress core. Is this possible using either php or wordpress?


title: plugins_url vs plugin_dir_url

text: Im seeing WordPress plugins either use plugins_url or plugin_dir_url when creating constants to some of their folders. Is one better than the other? examples:               define( 'MEMBERS_URI', trailingslashit( plugin_dir_url( __FILE__ ) ) );     define( 'WPACCESS_INC', plugins_url( 'inc', __FILE__ ) , true );


title: Creating a function that receives the taxonomy terms that have been changed in a custom post type

text: Ive been looking into actions and hooks etc... from wordpress, but cant seem to do a very simple thing. I just want to execute a function whenever a post is updated, and within the function I want the names of the terms that have been changed on that save. So maybe some sort of before and after comparison of terms?? Could somebody please just give me a hint at the direction to go in? I started off with:               add_action('save_post', 'myFunction');      But I cant seem to pass the before and after taxonomy terms to it for a comparison to see which have just been selected.. if that makes sense. Thanks :)


title: Dont’t change active Button while I’m listing a category?

text: I have a simple Navigation: _Blog, About, Contact_. Mainsite is _Blog_. To keep the current Button highlighted, I used this in my CSS:                   li.current_page_item a{        border-bottom: 1px solid #212121;         padding-bottom: 1px;      }      It works pretty fine. But I want to keep _Blog_ still active while I’m listing an item from my categories. What is the best way to do this?


title: Combining multiple stylesheets into one conditional block

text: I have multiple IE specific stylesheets that I need to add to my theme (combining them is not an option at this time), in addition to the standard ones. I am able to get this to work using the `wp_enqueue_style` and `$wp_styles->add_data` but each are output in it's own conditional block. Is there a way to combine them all into one? Example Code               wp_enqueue_style('styles','//mydomain.com/assets/styles/build/screen.css',array(),'1.0','screen and (min-width:1px)');     wp_enqueue_style('screen-medium','//mydomain.com/assets/styles/build/screen_medium.css',array(),'1.0','screen and (min-width:768px)');       wp_enqueue_style('styles-ie8','//mydomain.com/assets/styles/build/screen.css',array(),'1.0','screen');     wp_enqueue_style('screen-medium-ie8','//mydomain.com/assets/styles/build/screen_medium.css',array(),'1.0','screen');          $wp_styles->add_data('styles-ie8', 'conditional', 'lte IE 8');     $wp_styles->add_data('screen-medium-ie8', 'conditional', 'lte IE 8');      outputs:               <link rel='stylesheet' id='styles-css'  href='//mydomain.com/assets/styles/build/screen.css?ver=1.0' type='text/css' media='screen and (min-width:1px)' />     <link rel='stylesheet' id='screen-medium-css'  href='//mydomain.com/assets/styles/build/screen_medium.css?ver=1.0' type='text/css' media='screen and (min-width:768px)' />     <!--[if lte IE 8]>     <link rel='stylesheet' id='styles-ie8-css'  href='//mydomain.com/assets/styles/build/screen.css?ver=1.0' type='text/css' media='screen' />     <![endif]-->     <!--[if lte IE 8]>     <link rel='stylesheet' id='screen-medium-ie8-css'  href='//previewext.3m.com/3m_theme_assets/themes/3MTheme/assets/styles/build/screen_medium.css?ver=1.0' type='text/css' media='screen' />     <![endif]-->      where what I would like is...               <link rel='stylesheet' id='styles-css'  href='//mydomain.com/assets/styles/build/screen.css?ver=1.0' type='text/css' media='screen and (min-width:1px)' />     <link rel='stylesheet' id='screen-medium-css'  href='//mydomain.com/assets/styles/build/screen_medium.css?ver=1.0' type='text/css' media='screen and (min-width:768px)' />     <!--[if lte IE 8]>        <link rel='stylesheet' id='styles-ie8-css'  href='//mydomain.com/assets/styles/build/screen.css?ver=1.0' type='text/css' media='screen' />        <link rel='stylesheet' id='screen-medium-ie8-css'  href='//previewext.3m.com/3m_theme_assets/themes/3MTheme/assets/styles/build/screen_medium.css?ver=1.0' type='text/css' media='screen' />     <![endif]-->      I tried using an array for the `$wp_styles->add_data(array('styles-ie8', 'screen-medium-ie8-css'), 'conditional', 'lte IE 8')` but that didn't work and errored out the page. Any example I've found searching only uses one stylesheet per conditional block. I need to add about 5 or 6 with the same condition, so would ideally like to combine them, yet still use `wp_enqueue_style`.


title: Custom category URL not displaying posts

text: I have a custom post type with custom categories using the following:               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'products',             array(                 'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Product' )                 ),             'capability_type' => 'post',             'supports' => array('title','editor','comments'),                'public' => true,             'has_archive' => true,             'rewrite' => array( 'slug' => 'products' ),             )         );     }          function news_init() {         // create a new taxonomy         register_taxonomy(             'products',             'products',             array(                 'label' => __( 'Product Categories' ),                 'sort' => true,                 'hierarchical' => true,                 'args' => array( 'orderby' => 'term_order' ),                 'rewrite' => array( 'slug' => 'products' )             )         );           }     add_action( 'init', 'news_init' );      For some reason I just can't display the posts for specific categories. Can someone point me in the right direction? I'm trying to goto the url /products/category/monitors for example but it displays a page not found. I've duplicated the archive.php template and renamed it category-monitors.php.


title: How to Make Archive ShortCode

text: I checked that there is an shortcode on wordpress.com but it seems there is no build in way of adding the shortcode of archive on wordpress.org site. I know there was one plugin in repo but it's 2 years old with no updates in code. So let's say if i want to return the archive. following shortcode doesn't work. Is there anything I am missing? Or is there any way to make this work?                function archive{                return '<?php wp_get_archives('type=monthly'); ?>';           }      add_action('archives', 'archive');


title: remove 2014 from wp_get_archives

text: we have `wp_get_archives('type=monthly');` function that have a output like this:               Archives by Month:     January 2014     December 2013     November 2013      but I want style like a table that sorted by years:               2014     January     -------------     2013     December    November


title: Children categories not shown in dashboard

text: First of all: it's a strange behavior, but it works. 1) I'm working on a script, so i require the wp-load.php and after that i operate; 2) The scripts creates some categories using wp_insert_term in a hierarchically (Abruzzo > Chieti > Atessa), respectively abruzzo, chieti- abruzzo, chieti-abruzzo-atessa; 3) Here's the strange: it creates the categories good, but as you can see in the screenshot they are not visible in the dashboard. BUT i can use them, they are available (hierarchically) in a post or even to create others category using them as parents. They just don't show (the children) in this single point of the dashboard. If i create another category and i refresh the page (or even if i delete some), they will be shown. So i think it's something like a database issue. I read that the wp_insert_term func should be used into/after the 'init' hook. But as i just said.. i'm in a script. Workarounds/Solutions? ![enter image description here](http://i.stack.imgur.com/St42h.png)


title: Contact Form loaded with Ajax

text:
I'm loading Contact Form plugin with an Ajax request. It is correctly loaded, but when trying to submit the form, I get a blank page with a 0 as unique response. I'm guessing it has something to do with the Event Handler, but don't know how to solve it. Any idea? This is my ajax code in `functions.php` (here I'm omitting the contact-page template call in Ajax callback, because it works):               function theme_name_scripts() {         wp_enqueue_script( 'mi-script-ajax',get_bloginfo('stylesheet_directory') . '/js/ajax-search.js', array( 'jquery' ) );         wp_localize_script( 'mi-script-ajax', 'MyAjax', array( 'url' => admin_url( 'admin-ajax.php' ) ) );     }          function ajax_callback() {       //Submenu     echo '
';     if( $sPostType !== '' ) {         if( $sPostType == -1 ) {             $allCategories = get_categories();             foreach( $allCategories as $cat ) {                 echo '
cat_ID ) . '">' . $cat->name . '
';              }         } else {                  global $wpdb;             // set the target relationship here             $post_type = $sPostType;             $taxonomy = 'category';                  $terms_ids = $wpdb->get_col( $wpdb->prepare( "                 SELECT                     tt.term_id                 FROM                     {$wpdb->term_relationships} tr,                     {$wpdb->term_taxonomy} tt,                     {$wpdb->posts} p                 WHERE 1=1                     AND tr.object_id = p.id                     AND p.post_type = '%s'                     AND p.post_status = 'publish'                     AND tr.term_taxonomy_id = tt.term_taxonomy_id                     AND tt.taxonomy ='%s'                 ", $post_type, $taxonomy ) );                  $terms = get_terms( $taxonomy, array(                 'include' => $terms_ids,                 'orderby' => 'name',                 'order' => 'ASC'             ) );                        //$aTypeCategories = get_categories( array( 'post_type' => $type, 'number' => '10'  ) );              foreach( $terms as $cat ) {                 echo '
term_id ) . '">' . $cat->name . '
';               }         }     } else {         echo '
Sin categorías
';      }     echo '
';     }          add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );     add_action('wp_ajax_ajax', 'ajax_callback');     add_action('wp_ajax_nopriv_ajax', 'ajax_callback');      This is the full `ajax_callback` function:               function ajax_callback() {         $pageId = 0;         $newSlug = '';         $reviewSlug = '';         $sPostType = '';         $sTemplatePart = '';              //Links         if( isset(  $_POST['href'] ) ) {             $pageId = preg_match( '/^http:\/\/.+\/\?page_id=\d+$/', $_POST['href'] ) ? substr( strrchr( $_POST['href'], '=' ), 1 ) : 'no-page' ;             if( $pageId === 'no-page' && preg_match( '/^http:\/\/.+\/\?(news|reviews|entrevistas|radio_shows)=.+$/', $_POST['href'] ) ) {                 $newSlug = substr( strrchr( $_POST['href'], '=' ), 1 );             }             //$pageName = get_page_template_slug( intval( $pageId ) );             if( $pageId !== 'no-page' ) {                 if( $pageId === '8' ) {                     $sPostType = -1;                     $sTemplatePart = 'home-ajax';                 } elseif( $pageId === '22' ) {                      $sPostType = 'reviews';                     $sTemplatePart = 'reviews-rvw-ajax';                 } elseif( $pageId === '6' ) {                     $sPostType = 'news';                     $sTemplatePart = 'noticias-news-ajax';                 } elseif( $pageId === '109' ) {                     $sPostType = 'entrevistas';                     $sTemplatePart = 'entrevistas-ajax';                 } elseif( $pageId === '112' ) {                     $sPostType = 'radio-shows';                     $sTemplatePart = 'radio-shows-ajax';                 } elseif( $pageId === '412' ) {                     $sTemplatePart = 'podcasts-ajax';                 } elseif( $pageId === '415' ) {                     $sTemplatePart = 'contacto-ajax';                 }                  } elseif( $newSlug !== '' ) {                 if( preg_match( '/^http:\/\/.+\/\?news=.+$/', $_POST['href'] ) ) {                      $post_type = 'news';                 } elseif( preg_match( '/^http:\/\/.+\/\?reviews=.+$/', $_POST['href'] ) ) {                      $post_type = 'reviews';                 } elseif( preg_match( '/^http:\/\/.+\/\?entrevistas=.+$/', $_POST['href'] ) ) {                      $post_type = 'entrevistas';                 } elseif( preg_match( '/^http:\/\/.+\/\?radio_shows=.+$/', $_POST['href'] ) ) {                      $post_type = 'radio_shows';                 } elseif( preg_match( '/^http:\/\/.+\/\?podcasts=.+$/', $_POST['href'] ) ) {                      $post_type = 'podcasts';                 } else {                     //die();                 }                 $sTemplatePart = 'single-ajax';                 //get_template_part( 'single-ajax' );             }              //Siguiente y Anterior         } elseif( isset( $_POST['cadenaAll'] ) && ( isset( $_POST['cadenaPrev'] ) || isset( $_POST['cadenaNext'] ) ) ) {             if( isset(  $_POST['pageName'] ) ) {                 if( $_POST['pageName'] === 'reviews' ) {                     $sPostType = 'reviews';                     $sTemplatePart = 'next_reviews-rvw-ajax';                 }                 elseif( $_POST['pageName'] === 'news' ) {                     $sPostType = 'news';                     $sTemplatePart = 'next_noticias-news-ajax';                 }                 elseif( $_POST['pageName'] === 'entrevistas' ) {                     $sPostType = 'entrevistas';                     $sTemplatePart = 'next_entrevistas-ajax';                 }                 elseif( $_POST['pageName'] === 'radio_shows' ) {                     $sPostType = 'radio-shows';                     $sTemplatePart = 'radio-shows-ajax';                 }                 elseif( $_POST['pageName'] === 'radio_shows' ) {                     $sPostType = 'podcasts';                     $sTemplatePart = 'podcasts-ajax';                 }             }         }                   //Submenu         echo '
';         if( $sPostType !== '' ) {             if( $sPostType == -1 ) {                 $allCategories = get_categories();                 foreach( $allCategories as $cat ) {                     echo '
cat_ID ) . '">' . $cat->name . '
';                  }             } else {                      global $wpdb;                 // set the target relationship here                 $post_type = $sPostType;                 $taxonomy = 'category';                      $terms_ids = $wpdb->get_col( $wpdb->prepare( "                     SELECT                         tt.term_id                     FROM                         {$wpdb->term_relationships} tr,                         {$wpdb->term_taxonomy} tt,                         {$wpdb->posts} p                     WHERE 1=1                         AND tr.object_id = p.id                         AND p.post_type = '%s'                         AND p.post_status = 'publish'                         AND tr.term_taxonomy_id = tt.term_taxonomy_id                         AND tt.taxonomy ='%s'                     ", $post_type, $taxonomy ) );                      $terms = get_terms( $taxonomy, array(                     'include' => $terms_ids,                     'orderby' => 'name',                     'order' => 'ASC'                 ) );                            foreach( $terms as $cat ) {                     echo '
term_id ) . '">' . $cat->name . '
';                   }             }         } else {             echo '
Sin categorías
';          }         echo '
';         if( $sTemplatePart ) get_template_part($sTemplatePart);     }      And this is the Ajax code:               jQuery(document).ready(function($) {                   var linksPages = $('.menu-menu-container a');              linksPages.on('click',function(e){                     e.preventDefault();                     jQuery.post(MyAjax.url, {action : 'ajax' ,href : $(this).attr('href') }, function(response) {                     $('#content').addClass('cortinaOut');                     setTimeout(function() {                         $('#content').html(response).fadeIn();                         $('#content').removeClass('cortinaOut');                     }, 500);                 });         });              var linksPost = $('a:not(".rpswNamePrev_2, .rpswNameNext_2, .no-ajax")')         linksPost.live('click',function(e){                     e.preventDefault();                     jQuery.post(MyAjax.url, {action : 'ajax' ,href : $(this).attr('href') }, function(response) {                     $('#content').addClass('cortinaOut');                     setTimeout(function() {                         $('#content').html(response).fadeIn();                         $('#content').removeClass('cortinaOut');                     }, 500);                 });         });                   var cadenaNext='';         var cadenaPrev='';         $('#ajax-form-next, .ajax-form-num').live('submit',function(e){                     e.preventDefault();                     jQuery.post(MyAjax.url, {action : 'ajax' ,cadenaNext : $(this).find('.nextPosts').val(), cadenaAll : $(this).find('.allPosts').val(), pageName : $(this).find('.pageName').val(), numPage : $(this).find('.numPage').val() }, function(response) {                     $('#content').addClass('cortinaOut');                     setTimeout(function() {                         $('#content').html(response).fadeIn();                         $('#content').removeClass('cortinaOut');                     }, 500);                 });         });              $('#ajax-form-prev').live('submit',function(e){                     e.preventDefault();                     jQuery.post(MyAjax.url, {action : 'ajax' ,cadenaNext : $(this).find('.prevPosts').val(), cadenaAll : $(this).find('.allPosts').val(), pageName : $(this).find('.pageName').val(), numPage : $(this).find('.numPage').val() }, function(response) {                     $('#content').addClass('cortinaOut');                     setTimeout(function() {                         $('#content').html(response).fadeIn();                         $('#content').removeClass('cortinaOut');                     }, 500);                 });         });               });


title: Remove hyperlink on gallery shortcode

text: I use a gallery shortcode in my index.php (theme directory) to display 3 boxes of images. The images are fetched from my Media.               <div class="well well-clear" style="padding-bottom: 0; margin-bottom: 0;">     <?php echo do_shortcode('[gallery ids="165,166,167"]'); ?>     </div>      By default these images have a hyperlink that when I click on it, a page will open and show the bigger version of this image. I don't want this to happen. Is there any option that I need to modify so that it will not hyperlink? I'm new to WordPress, please don't be rough on me.


title: Copying theme from Localhost to Live does not copy all theme settings with it?

text: This has happened on a number of occasions now where I move my site from Localhost to Live environment and the theme settings such as the logo, and other settings are not copied with it, so I am almost have to rebuild the site twice sometimes. Responsive is one example where this is happening as well as numerous other themes I move from Localhost to Live environment. Is there something I am missing when move the DB over? Perhaps another settings file? Many thanks


title: Changing permalink structure breaks link to .php file which generates files dynamically

text: I'm creating a (calendar) plugin where one feature is the ability to download an event as a .ics-file. To do that I have a file called ics.php in which I generate an .ics-file based on the id of the event, passed by a querystring. So far everything works.               header('Content-type: text/calendar; charset=utf-8');     header('Content-Disposition: inline; filename=event.ics');     // output...      However, after changing permalink structure from the default to month and name, everytime the file is generated the browser can't find it. (net::ERR_FILE_NOT_FOUND in Chrome, and "File not found" in Firefox). I can access ics.php but when I add the id of the event to be parsed (ics.php?e=5) I get the above mentioned error. I want the users to be able to use any kind of permalink structure with the plugin, so I need a solution to this. Maybe worth mentioning is that the events are stored as custom post types.


title: Select objects from get_posts()

text: How can I select the first/last object from the list returned by get_posts()? How can I select the preceding/following object relative to an arbitrary object in the object list returned by get_posts? How can I extract a sublist from the list returned by get_posts()?


title: how to search through plugin in wordpress cimy-user-extra-fields?

text: I have a plugin clalled - Cimy User Extra Fields. I need to search the content through this plugin. This plugin is in WordPress, and all the content are stored in the database also, like industry, keyword, experience, location. I need to search all the content through the database MySQL. Is it possible to search. What is the code to write in this plugin. Is there any other plugin is there.


title: Dynamic Chart using EXCEL data

text: I want to create a dynamic chart in WordPress blog. How can I import excel data to WordPress and make a chart?


title: after wp_insert_post need to get the post id

text: I have a function in function.php and it does wp_insert_post. how can I get the post id which just posted? when I do wp_insert_posts, it saves a PR value (unique and it saves in post- meta table). Do I need to do "select"? like select post_id from wp-post where oid=".$oid...... etc like this? I have tried to get   $post_id = wp_insert_post($new_post); $post_id = get_post($post_id) But these are not working. I am not also very good at wp join. how can I do?


title: Limit search results to exact match

text: I have a problem showing results in Wordpress with `WP_Query`. Problem is simple but as far I'm not programer I wound it difficult. So, I have custom field with values like `1-1-1-1` and `2-1-1-1-1` for example. And when I search for example `1-1-1-1` it gives me also second result and thats what I dont want to. I only want exact match to show in my search results. Can anybody help me out? code:                   <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             global $wp_query;                  $query = new WP_Query( 'meta_key=wpcf-resitevtags' );             $query = $wp_query->query;             if (!is_array($query)) parse_str($query, $query);              $custom_query = new WP_Query(array_merge($query, array('posts_per_page' => $gantry->get('search-count'), 'meta_key' => 'wpcf-resitevtags', 'posts_per_page' => 22,  'paged' => $paged)));              ?>                  <?php if($custom_query->have_posts()) : ?>                  <?php if($gantry->get('search-page-title')) :                   ?>             <?php endif; ?>                  <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?>                  <?php                  //$title    = strip_tags(get_the_title());             $content    = strip_tags(strip_shortcodes(get_the_content(false)));             $excerpt    = strip_tags(strip_shortcodes(get_the_excerpt()));             $keys       = explode(" ",$s);             //$title    = preg_replace('/('.implode('|', $keys) .')/iu', '\0', $title);             //$content  = preg_replace('/('.implode('|', $keys) .')/iu', '\0', $content);             //$excerpt  = preg_replace('/('.implode('|', $keys) .')/iu', '\0', $excerpt);                  ?>


title: About WordPress site security

text: If I install WordPress on my server, does it mean that Akismet is installed automatically?   If so - do I still need to create e-mail verification and captcha tools for improving site security (as I see WP does not have this features in itself).   What is recommended for captcha test- simple php captcha or some graphical ajax invention (by drawing or moving objects etc)? My site will be rather plain, but will have user's comments on each page.


title: PHP Memory Limit Question

text: I just moved to a dedicated server and I was wondering whether i need to do anything explicitly inside wordpress config files to increase the performance of the site, like setting an upper memory limit.. is this really needed? many thanks, Andy


title: WordPress: Interact with Database Query Data and Login

text: I'm relatively new to Wordpress thats why I'm asking this question. I need something to start in order not to waste a lot of time. I want to connect a mobile device with the wordpress database. The user creates an account on the WordPress site with his browser. Afterwards the device logs in with username and password and queries new data. Is something like that already available? As a plugin or as a manual? thanks Tata


title: How to set up suhosin.ini for unlimited menus

text: On my custom menus page, I'm getting a limit (e.g. the users cannot add more menu items). I have done some research and have found that my suhosin settings may not be allowing wordpress enough memory. What is the best way to fix the config so that my menus won't be limited?


title: Wordpress Subdomain MultiSite on localhost XAMPP on :8080 with IIS taking port 80

text: I currently have Windows 7 , 64 bit on which I am running an IIS on localhost:80 and I installed XAMPP on localhost:8080. I have 15 individual wordpress sites but now i need a subdomain multisite wordpress. I created wp.dev:8080 in the hosts file for multisite, and correctly amended the apache virtual file. All worked until I added the `define('WP_ALLOW_MULTISITE', true);` to the config file. When I clicked on the new Network menu option in wordpress, I got an error: > ERROR: You cannot install a network of sites with your server address. You > cannot use port numbers such as :8080. Now here is the problem. localhost is mapped to 127.0.0.1 on port 80 for IIS. And Apache is taking all of localhost:8080. can I somehow split the localhost:80 traffic by assigning wp.dev to be the only :80 to go to Apache and the remainder to continue going to IIS. How would I define that since in Apache I already have *:8080 defined? Please help, my files are below: > Hosts file on c/windows/system32/drivers/etc/hosts this is root of iis if i > dont specify port (:80) and if i specify port (:8080) go to xampp 127.0.0.1 > localhost these below are the :8080 individual wordpress on xampp 127.0.0.1 > sb.localhost tw.localhost ups.localhost vet.localhost box.localhost > ea.localhost multisite below 127.0.0.1 wp.dev **This is my Apache config file in D:\xampp\apache\conf\extra\httpd- vhosts.conf** > NameVirtualHost *:8080 > > DocumentRoot "D:/xampp/htdocs" ServerName localhost **This is a working wordpress normal blog** > DocumentRoot "D:/xampp/htdocs/ki/abce/wordpress" ServerName abce.localhost > Options Indexes FollowSymLinks ExecCGI Includes Order allow,deny Allow from > all **This below is how network subdomain blog that would work if not for 8080 problem** > DocumentRoot "D:/xampp/htdocs/alllive/wordpress" ServerAlias *.wp.dev > ServerName wp.dev Options Indexes FollowSymLinks ExecCGI Includes Order > allow,deny Allow from all Thank you in Advance!


title: How i can get the URL?

text: How i can get the base URL in the wordpress? `get_bloginfo('url')` returns me the current URL. I just want the base URL e.g `http://localhost/wpsite/` not any **?page_id=123** with it


title: How to let a user choose an authors and save it to the database?

text:
I have a multi-author Wordpress site which reads different rss feeds and posts them to my page. I was wondering if it is possible to make a code that would provide an opportunity to registered user choice of which authors/sources to follow. There is already a few plugins that allow users to subscribe or 'follow' an author with email notifications (Example). But what I'm looking for is how to allow a user to select which feeds they want to read and this plugin would show only those feeds on my website. I have little knowledge of php but none from Wordpress really. Where should I start developing it? It needs to remember each user's follows so it has to be saved database for what i know. * * *               function select_authors_fields( $user ) {     $authors = get_users();     $user_tags = get_the_author_meta( 'select_authors', $user->ID );     ?>

             My interests:	                      <?php         if ( count( $authors ) ) {             foreach ($authors as $author) {                  if (user_can($author->ID, 'publish_posts')) { ?>
<label for="select_authors_<?php echo esc_attr( $author->ID); ?>">                 <input                     id="select_authors_<?php echo esc_attr( $author->ID); ?>"                     name="select_authors[<?php echo esc_attr( get_the_author_meta('display_name', $author->ID) ); ?>]"                     type="checkbox"                     value="<?php echo esc_attr( get_the_author_meta('ID', $author->ID) ); ?>"                     <?php if ( in_array( get_the_author_meta('ID', $author->ID), $user_tags ) ) echo ' checked="checked"'; ?> />                 <?php echo esc_html(get_the_author_meta('display_name', $author->ID)); ?>
<?php                  }              }         } ?>

     <?php         }      add_action( 'show_user_profile', 'select_authors_fields' ); add_action( 'edit_user_profile', 'select_authors_fields' );               // store authors     function select_authors_fields_save( $user_id ) {         if ( !current_user_can( 'edit_user', $user_id ) )             return false;         update_user_meta( $user_id, 'select_authors', $_POST['select_authors'] );     }     add_action( 'personal_options_update', 'select_authors_fields_save' );     add_action( 'edit_user_profile_update', 'select_authors_fields_save' );      This ones prints authors in user preferences with checkboxes. Now i need to make post_query depending selections. Any clues?


title: resizing image upload for all

text: I'm having problems with file upload, upload any image that I resized. however already deactivated every plugin, pro vopltei default theme, and still occurs redimenxionamento, tme some other option to disable automatic thumbnailing, something in the database \-- I do nothing that solves the problem, I can change the theme and the error continues, the media settings to put the maximum 1024x1024 be some more when I uploade image is resized it to 370 height, did resinstalação files from wordpress not put resolved


title: How to have custom tinyMCE buttons break onto next line when too long

text: There is probably a really simple solution that I am missing here but I have added multiple custom buttons to the tinyMCE editor in Wordpress and my problem is the row of buttons is too long (they're all on the same row - their own row) so since I am hooking into mce_buttons_3 and I have a lot of buttons, is there anyway of breaking this up so that if the row is too long to where it breaks the default WP layout that I could have the additional buttons on another row? Below is a sample of what I am working with:               add_action('init', 'add_button');       function add_button() {          if ( current_user_can('edit_posts') &&  current_user_can('edit_pages') )          {            add_filter('mce_external_plugins', 'add_plugin');            add_filter('mce_buttons_3', 'register_button');          }       }           function register_button($buttons) {          array_push($buttons, "quote", "one-fourth", "one-fourth-last", "one-third", "one-third-last", "one-half", "one-half-last", "two-third", "two-third-last", "three-fourth", "three-fourth-last", "custom-list-1", "custom-list-2", "custom-list-3", "custom-list-4", "message-box-info", "message-box-success", "message-box-warning", "message-box-erroneous", "message-box-simple", "message-box-custom", "recent-posts", "custom-frame-left", "custom-frame-center", "custom-frame-right", "custom-table", "accordion", "accordion-toggle", "tabs", "tabs-content", "toggle-content", "dropcap", "pull-quote", "clear", "divider", "divider-top", "custom-button", "round-button", "small-button", "button", "read-more" );          return $buttons;       }


title: Using Bootstrap in themes

text: Twitter has just came out with a new web framework called Bootstrap. What's the right way to use it within a theme? **Update** : The stylesheet inclusion is simple indeed. I want to know which caveats or compatibility issues I should expect.


title: Getting /feed/ behind post urls in Google Webmaster Tools; crawler errors?

text: Currently I have a wordpress site submitted in Google Webmaster Tools. But at the Crawler Errors page, I see a lot of : site.nl/post/feed. Does anyone know how these get there and how to get rid of em?


title: How to restore my wordpress site on your server?

text: Yesterday my wordpress site "http://planetofcoders.com", Hacked by someone Bangladeshi hacker. After that I did delete all site and database data. I have my site and database backup as on 09-Nov-2012. I did restore all site data and database backup on server. But after restoring all data my site doesn't work properly. I want to know that what is the process to restore my site data and database backup on your server? How to prevent my site from hackers? When i enable debug in wordpress in that case it gives me this error i.e.               Notice: register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /home/planetof/public_html/wp-includes/functions.php on line 2758          Notice: Constant HMBKP_REQUIRED_WP_VERSION already defined in /home/planetof/public_html/wp-content/plugins/wp-database-optimizer-tools/wp-database-optimizer-tools.php on line 37          Warning: Cannot modify header information - headers already sent by (output started at /home/planetof/public_html/wp-includes/functions.php:2758) in /home/planetof/public_html/wp-includes/pluggable.php on line 881


title: Storing an XML Response (Transient)?

text: Haven't worked much with XML so I'm hitting a bit of a wall:               function getapi()      {         $api_response = wp_remote_get( "http://example.com/getXML" );         $data         = wp_remote_retrieve_body( $api_response );         $output       = new SimpleXMLElement ($data );              return $output;     }      ## Get or set the Transient               function transient()     {          $transient = get_transient( 'transient_value' );              if ( ! $transient ) {             $transient = getapi();             set_transient( 'transient_value', $transient, 180 );         }              return $transient;     }      I can easily show the data, but **calling it up from a stored transient** results in this error being shown:               Node no longer exists in C:\xampplite\htdocs\...      Not sure what the extra step is that I need to perform in order to store the data correctly. Many thanks! Noel


title: Filter have_posts()/ the_post()

text: What is the best way to filter the posts being displayed? For example in my functions.php file I want to have something like               add_filter( $tag, 'filter_posts');          function filter_posts(){             if(is_home()){             //return custom post query that will be used in loop        }     }


title: Featured Image missing in Wordpress 3.2 Admin

text: I've just upgraded from 3.1.2 to 3.2, and now "featured image" is no longer listed at the bottom right of a post in admin. Has this feature of WP been removed? Can it be added back, or turned back on? My old posts still have their old featured image, but it cannot be added to new ones.


title: Viewing category won't show up Custom post type posts

text: I'm having a strange problem: I've build a category page and want to load up all related posts of a custom post type but won't give any results. I'm using the following code:                 query_posts( array( 'post_type' => 'blog', 'showposts' => 3, 'cat' => 9 ) );      When deleting the 'cat' it shows all posts of the custom post type. Is anyone familiar with this problem?


title: Stylesheet switching and caching

text: I'm implementing a site that allows users to switch stylesheets (to show a high contrast version for people with vision impairments). The switcher essentially just changes the `<link>`ref to whichever stylesheet is appropriate. However, I've just realised that this will lead to problems when I switch on caching (either using WP Supercache or W3 Total Cache) - as only one version of the page will be cached and thus displayed to the user. Any thoughts on possible solutions?


title: Wordpress 4.0 Media Gallery (Same Image) Bug - Does anyone know how to fix this?

text: So, we've been working on this site for a long time and have finally started finishing up. As a last cleanup we updated all our plugins and Wordpress to 4.0 and expected awesomeness. However, for some reason the site feels slower, takes up around 30-40% cpu on our server and this(see image) happened to the media gallery: ![this screenshot](http://i.imgur.com/oEAIhhI.jpg) Has anyone encountered this before or have any suggestions of how I might go about fixing this? Front-end everything looks fine, no errors or images missing. Backend won't let us upload images or browse images we've already uploaded..


title: Is it possible to make wp insert last comment onto another page

text: If we set wp to break comments into pages after X nr of comments and we have X+1 comments , wp only shows that last comment instead of showing X and move the comment from bottom onto the next page. Any help would be appreciated since it is a big deal for what I am trying to use it.


title: Group pages by custom field values

text: I plan to have each individual product as a page, with custom fields for : Brand, size, feature 1 and feature 2. My question: Will it be possible to build a summary page template say for Brand, based on the custom field?   I would like to be able to display a thumbnail for each brand, showing the count of products [ie pages] for each brand. When you click on the thumbnail I would like a second page listing each product with a link to the actual product page. Is this a valid approach or is there a better way?


title: How to change links in the 3 main categories, on widget category, to a javascript function call

text: I'd like to know.. How could I change my 3 main categories links, so they call a javascript function? I'm using Snapshot Theme from WooThemes. Here's the current state of the website: http://www.mpn.p.ht/wp_br2/ The categories I'd like to change the links to a javascript function call, are: **_Masculino_** , **_Feminino_** and **_Infantil_**. They are at a container with class `widget`. EDIT: I´ve changed the jquery. I've tried to use jquery in `index.php`:               $(document).ready(function() {              $(".widget ul li > a").not("ul li ul li>a").attr("href", "javascript:hideMenu();showSubMenu('m-submenu');");     $(".widget ul li+li > a").not("ul li+li ul li>a").attr("href", "javascript:hideMenu();showSubMenu('f-submenu');");     $(".widget ul li+li+li > a").not("ul li+li+li ul li>a").attr("href", "javascript:hideMenu();showSubMenu('i-submenu');");          });      But, it seems that some sub-categories are calling the javascript function. In other words, my .not() it´s not working in some cases. What could I do? Thanks.


title: htaccess rewrite conflict with wordpress rules and ssl

text: this one has me buggered- I have the below htaccess rule to redirect ssl to non-ssl pages. this works fine, except I'd like to exclude certain wordpress requests from this rule- for example, https://mysite.com/info/. I've tried the following:               #rewrite all ssl pages to non-ssl for everything that doesn't have /info/ in the request uri      RewriteCond %{HTTPS} on     RewriteCond %{REQUEST_URI} !^/info/     RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]          #wordpress     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]      the result is that https://mysite.com/info/ redirects to http://mysite.com/ instead. If I disable the wordpress rewrite rules, the preceding rules work fine. Can anyone suggest the proper way to target pretty urls in a rewrite condition?


title: Add child pages automatically to nav menu

text: I have built a custom menu in Wordpress that contains links to posts and pages. I am adding it to my header using this line of code:               <?php           wp_nav_menu(         array(             'theme_location' => 'primary',              'depth'          => 0,              'menu_class'     => 'nav-menu',         )      );          ?>      My problem is, if I add a child page to the top level ones on the menu, they don't automatically appear as sublinks on the nav. I know I can create them manually each time by rebuilding the menu, but I would like to be able to just add a child page in the pages section and have it show up in the nav without having to go to the menu and build it there also, if that makes sense? I've tried using `depth => 0`, but that didn't work. Is there a way to have child pages show up without having to build it into the custom menu?


title: Saving Custom Field Data before Publish

text: When creating a page or a post WordPress lets the content (title, body, featured image) be saved when using Ctrl + S. The Custom Fields do not save in the same way (in this case I'm using Advanced Custom Fields as well, but it happens without this plugin). Does anyone have a solution for saving this data in the same way? In this case Publishing isn't an option. **UPDATE** : If I click the "Save draft" button the Custom Fields save. The ctrl + S save only seems to be in scope when in the content area. Is there an easy way to change this to be a global post ctrl S? The "Save Draft" button thankfully removes the urgency, but that would be nice!


title: Help with WP gallery function, wrap gallery in div

text: I have a function in my functions.php file I need to change slightly and am having trouble doing it correctly. This function changes the gallery markup for Wordpress, making it more html5 friendly. It works fine as is, except that I'd like to wrap the entire gallery in a div, for example `<div id="sort">`. (I want to wrap the gallery, not the entire post.) I'm having trouble figuring out how to add that to this function:               //Gallery Code Filter     add_filter( 'post_gallery', 'my_post_gallery', 10, 2 );     function my_post_gallery( $output, $attr) {         global $post, $wp_locale;         static $instance = 0;         $instance++;         // We're trusting author input, so let's at least make sure it looks like a valid orderby statement         if ( isset( $attr['orderby'] ) ) {             $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );             if ( !$attr['orderby'] )                 unset( $attr['orderby'] );         }         extract(shortcode_atts(array(             'order'      => 'ASC',             'orderby'    => 'menu_order ID',             'id'         => $post->ID,             'itemtag'    => 'figure',             'icontag'    => 'dt',             'captiontag' => 'figcaption',             'columns'    => 3,             'size'       => 'thumbnail',             'attachment' => 'large',             'include'    => '',             'exclude'    => ''         ), $attr));         $id = intval($id);         if ( 'RAND' == $order )             $orderby = 'none';         if ( !empty($include) ) {             $include = preg_replace( '/[^0-9,]+/', '', $include );             $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );             $attachments = array();             foreach ( $_attachments as $key => $val ) {                 $attachments[$val->ID] = $_attachments[$key];             }         } elseif ( !empty($exclude) ) {             $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );             $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );         } else {             $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );         }         if ( empty($attachments) )             return '';         if ( is_feed() ) {             $output = "\n";             foreach ( $attachments as $att_id => $attachment )                 $output .= wp_get_attachment_link($att_id, $size, true) . "\n";             return $output;         }         $itemtag = tag_escape($itemtag);         $captiontag = tag_escape($captiontag);         $columns = intval($columns);         $itemwidth = $columns > 0 ? floor(100/$columns) : 100;         $float = is_rtl() ? 'right' : 'left';         $selector = "gallery-{$instance}";         $output = apply_filters('gallery_style', "");         $i = 0;         foreach ( $attachments as $id => $attachment ) {             $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);             $output .= "<{$itemtag} class='item'>";             $output .= "                                 $link                 ";             if ( $captiontag && trim($attachment->post_excerpt) ) {                 $output .= "                     <{$captiontag}>                     " . wptexturize($attachment->post_excerpt) . "                     </{$captiontag}>";             }             $output .= "</{$itemtag}>";             if ( $columns > 0 && ++$i % $columns == 0 )                 $output .= '';         }         $output .= "                 <br>\n";         return $output;     }


title: How can I change this footer.php code to call a random image on reload?

text: This comes from the `footer.php` file of a wordpress theme I would like to modify. I want one of five images to load on refresh instead of `1.jpg` every time.               <script type="text/javascript">          <?php          if((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag()) || ($posttype == 'post')  ) {             $name = "news-and-information";     }else{             $name = $wp_query->post->post_name;     }          ?>          $(document).ready(function(){                  var imgPath = '/wp-content/themes/nexus/img/page-headers/<?php echo $name; ?>/1.jpg';                  $('.subheader-wrapper').css('background-image', ('url("'+imgPath+'")'));          });     </script>


title: Changing theme = change home page for mobile visitors?

text: I'm trying to create mobile-friendly version for a wp site. I'm using the "any mobile theme switcher" to switch to an alternative (mobile) theme which works well. I have also created some alternative key pages (home, contact & news) which are heavily edited (shorter) versions of the desktop theme content and added these to a mobile-only menu. Again - this is working well. The problem I'm trying to solve is how to avoid someone using a mobile device landing on the desktop version of the home page? I can't see a way of setting a different home / front page within my mobile theme files so.. Can mobile devices be re-directed to my alternative "mobile homepage" instead? And If at all possible, retain the option to view the full desktop version if desired. I see the codex describes useful bits of code, but I need help to make them all work together. In human terms, I think what I need is something that does this - If is home page, And if is mobile, Redirect to http://mysite.com/mobile- homepage Many Thanks


title: Bookmark anchor link to load another page first before completing?

text: **Question: is there a way for a link to an anchor bookmark to arrive at its destination by loading another page first?** I'm developing a vertical-scrolling style website where the home page displays the contents of 3 other pages within sections or divs. Each section has a bookmark and a "back to top" link, and my main navigation menu uses custom bookmark anchor links. I'm also using thejQuery smooth scrolling plugin which works very well. The problem I'd like to solve is that if you are not on the home page, but another page (such as the blog page) and you hit a bookmark link then the smooth scrolling effect can't work. It simply jumps straight there. Would it be possible for the bookmark links to load the homepage first, and then continue to the required bookmark so the scrolling will still work??


title: WP_query exclude posts of a format

text: I'm using the code below to try to exclude the format "post-format-quote", but it is excluding all posts, including ones of the standard format (no format).                           $myposts = new WP_Query(array(                     'tax_query' => array(                         'taxonomy' => 'post_format',                         'field' => 'slug',                         'terms' => array('post-format-quote'),                         'operator' => 'NOT IN'                     ),                     'posts_per_page' => 3                     )                 );


title: How does WordPress choose archive type template?

text: I can't find a comprehensive list of criteria for how WordPress determines which archive type template it chooses. From what I understand it uses URL forms for this purpose, like:               example.com/category/some-category -> category.php (i guess tags work similarly)     example.com/2012 -> date.php      But what about author.php and taxonomy.php? What triggers the template hierarchy to use those routes? My ignorance is about how WP selects certain templates for I which I don't know how to trigger. I think I understand category templates with higher specificity, and archive.php I understand as a catch-all before going to index.php, but I have no idea when WP will select for example author.php and why. For example, suppose I have two posts by the same author. How do I make WP use the author.php template to show me the posts by that author? I suppose the notes around each box in the template hierarchy chart is supposed to give some clue about this, but I don't understand when and where those pieces of code should be used. I did look at the hierarchy chart, but there are things about it I don't understand, which is part of the reason I'm posing this question. For example, I can not read from the chart that if I have a URL on the form example.com/2012 it will use the date.php template. It makes sense, but I can't see that the URL should be on any form, especially this one. In general I have a hard time understanding how WordPress selects which template(route) to take. I may have misunderstood, but I expect WordPress to determine which template to use before it starts interpreting its contents. At that point it can display anything you want depending on its contents and using the is_sometype() functions. What I don't understand is how it reaches that point. Have I got this reasoning wrong? I'd be very grateful if someone could address this point. edit: Some follow-up questions after Chip's answer: Do I understand it correctly that WP parses permalinks using rewrite rules to build the query, or else the query is already in "native" format, i.e. a URL followed by ? and a concatenation of query variables? Can a combination of both occur? What is the definition of "current context" with regard to queries? Could you give an example? What do the blue .keywords signify that are below each box in Chip's diagram?


title: Force post slug to be auto generated from title on save

text: I'm running a property site where many properties are sold in apartment blocks. Because of this what the content editors do is create a post/property with all the details and then use a duplicate post plugin to create the others. Each time they duplicate a post/property they change the title to reflect the property number and maybe change a few bits of meta data E.G price. What they forget to do is wipe out the slug and let a new one be generated from the title. Here is an example slug from the first property entered: `merle-court-plot-50-182-carlton-vale-nw6-5hh` but then when they duplicate the slugs become:               merle-court-plot-50-182-carlton-vale-nw6-5hh-2     merle-court-plot-50-182-carlton-vale-nw6-5hh-2-2     merle-court-plot-50-182-carlton-vale-nw6-5hh-2-2-2     merle-court-plot-50-182-carlton-vale-nw6-5hh-2-2-2-2     etc      But when they change the titles the slugs would be better like:               merle-court-plot-51-182-carlton-vale-nw6-5hh     merle-court-plot-52-182-carlton-vale-nw6-5hh     merle-court-plot-53-182-carlton-vale-nw6-5hh     merle-court-plot-54-182-carlton-vale-nw6-5hh     etc      So my question: > How do I force the slug to be re-generated on post save, after they have > updated the property title? The slug for this CPT should always be auto generated, there is never a need to manually set it.


title: How to fix unchanged URLs in Database after running serialized search and replace script?

text: I just did my first migration from a dev site to a prod site, using the InterconnectIt serialized search and replace script. The migration worked, but here is where I’m struggling: The site was unusually slow and some clients could not view the slider and images, so we looked through the theme settings and found many URLS still with the dev site address. We had used the back button on the InterconnectIt script and run it several times at the time of migration, and I ran it again several times since then, even changing the GUID columns, but that still didn’t change all of them. Here are some examples of the old URL left in the options table: 1: http:\/\/www.example.com\/client\/wp-content 2: newsletter@example.com And from the SlimStats plugin table: 3: www.example.com (with the "http://" in front) Our criteria was: Search: http://www.example.tk/client Replace: http://www.client.org I don't feel competent to use other criteria than that, as I'm not sure of the consequences. Do I need to search with other variations of the URL in various instances (e.g., without the "http://", without the "www") in order to catch them all? I've researched and can't find a solution. Search and Replace Regex plugin only seems to change posts and author stuff, not the other tables. Other plugins don't seem to be serialized. I'm hesitant to do it myself in a text editor (as the WPTuts+ migration tutorial showed), as I'm not sure where all the serialized data is. Have you any clue why some URLs were left unchanged, or if there is something I might be doing wrong? Any help is certainly appreciated. Thank you.


title: Where the Nickname is being used in WordPress

text: I see most of the place is using the " **Display name** ", so why I need to set a Nickname? Where it is being used?


title: wordpress plugin for database field search

text: Is there any wordpress plugin to search for people's names in the database? If i have a column 'name' , i need to provide search functionality over it, give all the matching results for that column. Sentence completion would be even better. I am no PHP programmer. Any help is greatly appreciated. Thanks


title: how to interconnect custom post types?

text: I'd like to make a site about choirs, composers, conductors and singers. And so far I decided that I need to make a custom post type for "piece" -- any piece can be associated with choir[s], composer, conductor and singer[s]. I could do this with taxonomies (tags), assigned to every "piece". But I need to be able to write about conductors, too. So, I need to create another post type? So, now I have "piece", "conductor", "composer" post types. And I can use Posts 2 Posts plugin to interconnect them. But in some cases conductor may act as a soloist -- and it seems that I could create "person" type, but anyway I can not say that "piece"<\--(conductor)-->"person" and "piece"<\--(soloist)-->"the_same_person" with posts2posts. Actually I think that I need these post types (should I use tags for some?): piece, conductor, composer, soloist, collection (CD or live performance) and I need for some of them to have custom fields (creation year, publication year etc) -- hope this can be done too by other means. I guess I could add custom fields to piece and put "conductor_id" here. Do I overcomplicate things? How this could be done? Thanks! **UPDATE** : Thanks, scribu; I was wrong: it looks like posts2posts is what I need.


title: What difference does it make if I enable support for video post format?

text: I am sorry if this is stupid. I can't seem to figure out what special things it does. If I embed a youtube video(embed/iframe) it works for both standard and video format. Surely, I am missing something...


title: WP 3.9 TinyMCE no longer loads on category description editor

text: I've used this script below inside functions.php since WP 3.5 It converts the standard category description editor to a rich text editor. Unfortunately, after upgrading sites to WP 3.9, the description editor is back to a standard text area. Any ideas what I need to change for 3.9?               add_action('load-categories.php', 'cb_admin_init');     add_action('load-edit-tags.php', 'cb_admin_init');          function cb_admin_init()     {         if ( user_can_richedit() && isset($_GET['action']) && 'edit' === $_GET['action'] && ( !empty($_GET['cat_ID']) || ( !empty($_GET['taxonomy']) && !empty($_GET['tag_ID']) ) ) ){             add_filter( 'tiny_mce_before_init', 'cb_mceinit');             add_action('admin_footer', 'wp_tiny_mce');             add_action('admin_head', 'cb_head');         }     }          function cb_mceinit($init)     {         $init['mode'] = 'exact';         $init['editor_selector'] = 'description';         $init['elements'] = 'category_description,description';         $init['plugins'] = 'safari,inlinepopups,spellchecker,paste,fullscreen';         $init['theme_advanced_buttons1'] .= ',image';         $init['theme_advanced_buttons2'] .= ',code';         $init['onpageload'] = '';         $init['save_callback'] = '';         return $init;     }          function cb_head()     {     wp_enqueue_style('editor-buttons');         ?>     <style type="text/css">#category_description_tbl,#description_tbl{border:1px solid #dfdfdf;}.wp_themeSkin .mceStatusbar{border-color:#dddddd;}</style><?php     }               add_action('init', 'cb_editor_init');


title: Detecting errors generated by $wpdb->get_results()

text: How do I detect errors when using $wpdb->get_results()? For example:               $result = $wpdb->get_results("SELECT * FROM this is not a valid query");      The preceding code doesn't generate any exceptions or errors; it simply sets $result to an empty array. How do we reliably detect errors generated by get_results()?


title: Custom Connect to Facebook, problem logging in/logging out

text: I am working on a custom function for login in my users via facebook. I started by reading this nice tutorial on how to login in via facebook: http://digitalzoomstudio.net/2013/02/09/tutorial-how-to-login-via-facebook-in- your-wordpress-blog/ The function will log in the user to wordpress if an account with his/her facebook email already exists in the wordpress blog. If it doesnt exist, it will automatically create an account for the user. Everything works as expected. However, I have an issue when login in and login out. There is a "Login with Facebook" button. This button will change to Logout (this logout button is supposed to logout the user from facebook) if the user logged in. ## One issue (LOGIN IN):   * The first time the user clicks the "Login with facebook" button, the user is logged into the wordpress blog; however, Facebook API wont recognize the user thus making the facebook login button output a LOGIN button instead of a LOGOUT button.   * The second time, the user clicks the LOGIN button, Facebook API DOES recognize the user and the button changes to LOGOUT. So, why is it that the first time the user is not being recognized by facebook but the second time is? ## The other issue is this (LOGIN OUT):   * Once the user logs in the first time it hits the facebook LOGIN button, and wants to logout from my wordpress blog through a custom made logout button (this button is supposed to logout the user from the blog only and not from facebook), it works perfectly!   * However, if the user has logged in by clicking the facebook LOGIN button a second time, the custom made logout button has to be clicked twice in order to logout the user successfully. I know how to solve this partially. I could just check if the user is logged in the blog and remove the LOGIN button; however, I want to know why I am getting this strange behavior from facebook and how it is conflicting my blog. ## UPDATE For the second issue (when user logs out) I found the solution. I just had to destroy facebook session `$facebook->destroySession();` ## UPDATE 2: SOLVED! The tutorial from the link I provided was destroying the facebook session after login in and when creating a new account for some reason. I just had to remove `$facebook->destroySession();` from both parts and now everything is working as intended.


title: Retrieve data from post meta meta_key having '_product_fq_image' while having author_id and post type is PRODUCT

text: How can we retrieve data from postmeta having '_product_fq_image' while having author_id and post type is PRODUCT I have tried this               $lt_content_design= get_user_meta( $user_id, 'lt_content_design', true );      but how can we use JOIN here for listing only particular user data having posttype is product