title: Featured Image problem with resizing

text: I want include function to resize featured image to 80x80, im add this code in my function.php               add_theme_support('post-thumbnails');     set_post_thumbnail_size(80, 80);       But is not work very good, images is not resized, looks like scaled to 80x65 or something.. i need exactly 80x80 on every images uploaded...


title: Rename "post" to "article" throughout the admin back end

text: > **Possible Duplicate:**   >  Is there a way to change 'Posts' to be 'Portfolio' is the WP backend? Is there a way to accomplish this by the functions.php file ? I tried:               add_filter(  'gettext',  'change_post_to_article'  );     add_filter(  'ngettext',  'change_post_to_article'  );          function change_post_to_article( $translated ) {             $translated = str_ireplace(  'Post',  'Article',  $translated );             return $translated;      } but it does not change all the entries for "post". I still have "Post tags" for example. Any suggestion?


title: remove last separator?

text: using;               $args = array( 'menu' => 'mainmenu', 'container' => 'ul', 'menu_class' => 'span-10 clearfix', 'after'=>'/');     wp_nav_menu($args);      which gives me; london/munich/artists/fairs & events/publications/news/contact/ but using the args (or similar) can i remove the / from contact? any help welcome!


title: buddypress slug issues

text: i created a bp-custom.php and regrouped the menu items fine. But now i am trying to add a link to go to /site/members. It list all the members. When i add it though it goes under the profile I am viewing. I am redirecting to a wordpress page if that helps. example with it added http://website.com/log-in/members/username/members/ i want it to go just here http://website.com/log-in/members/ I would love to learn how to just put a url and no slug but whatever works Here is the function               function mb_bp_profile_menu_posts() {     global $bp;     bp_core_new_nav_item(     array(         'name' => 'Members',         'slug' => 'members',          'position' => 60,                )       );     }


title: Connection lost. Saving has been disabled... (Updating Posts/Pages)

text: I've been developing for Wordpress for a few years now without any trouble on an old XP/WAMP development server (v1.7.4) but recently have been getting the error " **Connection lost. Saving has been disabled until you’re reconnected** " whenever I try to update either Wordpress Posts or Pages. The majority of what I've turned up on the subject points to plugins as the source of the problem, Sadly, I find that even in a clean install of wordpress 3.8.1, in a new DB, without any plugins the problem persists. Next logical culprit then is the server. I check the logs, and find nothing. In the process of migrating my workflow to a newer Windows 7 platform (WAMP v2.2.22) I created a new install there, and the problem is gone. I've run the php.ini's from both servers through a difference engine hoping to suss out the cause, but I'm afraid it's a bit beyond me where the issue might be, nor how to share the results of the comparison here, either as a flat file, or CSV. Any thoughts?


title: Show all wp_get_post_terms slugs

text: I am using the following code to display my custom taxonomy slugs. However it is only displaying the first category and not all the related categories. I know this is fairly simple and is to do with [0] but I can't figure out how to change it.               $getslugid = wp_get_post_terms( $post->ID, 'opd_taggallery' );      $getslug = $getslugid [0]->slug;     echo $getslug;


title: Front end URL to restore a post/page

text: I was wondering if a url exists where one can click on a link and would automatically populate in the edit post of the most current revision. revision.php?action=restore&revision={newestcurrentrevisionID} doesn't seem to work. all it does is brings me to the revisions page. Am I supposed to link to post.php? what would the action be?


title: Change font-size within a shortcode

text: I have a simple shortcode like this....               function myshortcode( $attributes, $content = null ) {         extract( shortcode_atts( array(             'class' => ''         ), $attributes ) );                return 'This is the content : ' . $content . ';     }     add_shortcode('my_shortcode', 'myshortcode');      This works great and if I use the following in a post...               [my_shortcode]This is the content that I want to display[/my_shortcode]      But what I want to do now is vary the font size of the content for example...               [my_shortcode]This is the [25px]content[/25px] that I want to display[/my_shortcode]      I want this to change the word 'content' to 25px font size. Anyone know a way, maybe str_replace?


title: Any Short code Availble for Get Post List With Thumbnail Plugin?

text: Any Short code Availble for **Get Post List With Thumbnail** Plugin? or else how to Create Short code for this Particular plugin? Thank u in Advance.


title: Excluding a page with a certain name from wp_page_menu

text: A client of mine has a WP multisite network of sites which all use the same template. This template uses wp_page_menu. I just added a mobile version of the template by using a certain plugin. It will use the same pages as the desktop version of the website, but the client has requested a different landing page. The problem is that if I create a new page to facilitate this landing page, it will show up in the code generated by wp_page_menu. Since all sites in this network uses the same template and the page will have different page IDs on different sites, I cannot exclude it manually in the wp_page_menu function. I was thinking that if I could exclude the post by title or category name instead of by ID, this might work. But I don't know how to do that. Please help?


title: Add class to before_widget from within a custom widget

text:
I have a simple custom widget that asks for its width (that is used later in the front end). The width field is a select dropdown, so a user have predefined options. I will have many instances of my widget, each will have its own width setup. Now, in my widget code I have the following code:               echo $before_widget;      which results in:

      What I'd like to do is somehow hook into `$before_widget` and add my own class (the specified width from the select dropdown). So, I want the following markup:

      And if there is no class specified then I want to add `class="col480"`. How do I achieve this? Thanks for help! Dasha


title: Login "Lightbox" for specific category content

text: There's a specific category on my website that should be restricted to teachers only using login. However, I don't want to hassle the teachers with the not so welcoming admin Wordpress offers. I would like to offer a "lightbox" that's basically a login that doesn't automatically forward to the admin, but only makes the teachers category content available. Do you know any plugin that allows that? Thanks, Sarit


title: How can I extend Quick Edit option with 2 more fields

text: I wonder if WordPress gives me the ability to add 2 fields (`input` and `textarea`) in the `Quick Edits` of **Tags**. Actually these 2 fields I want to add in `Quick Edit` which are available in **Edit** Tag page, but I want to display these 2 fields in `Quick Edit` so I'll able to access them easily. Please check image to get more idea: ![](http://i.stack.imgur.com/cOKyS.png) Is there any way to do this?


title: Multiple og:image for Facebook

text: I've actually been searching on this site for the answer to this question for quite some time. Looking for a way to 'echo/print' multiple og:images for facebook. What I have here used only 'the_post_thumbnail'               function fb_image() {     if (is_single()) {         global $post;         $feature_image = get_the_post_thumbnail($post->ID);         $doc = new DOMDocument();         $doc->loadHTML($feature_image);         $imageTags = $doc->getElementsByTagName('img');              foreach($imageTags as $tag) {                 $image_url = $tag->getAttribute('src');         }     }     ?>          <meta property="og:image" content="<?php echo $image_url; ?>" />     <?php }     add_action('wp_head', 'fb_image');


title: Upload Image Not accessible

text: I'm getting a 500 error when trying to access the full version of any image. As soon as it's uploaded to the server, it becomes 'unavailable', and each file cannot be accessed/deleted/anything - like Wordpress is holding on to the file somehow. However, any thumbnails work fine. We have tried:   * Changing permissions on the server   * Allowing media to be put into date and month folders, and to not be.   * Changing the folder that images get put into. We're running a Windows 2008 install. Everything else seems to work but this. As I mentioned, the thumbnails are all fine. Any ideas?


title: custom walker wp menu last element

text: I have a menu list with many subitems that contain submenus as well (at the moment some reach 4th level). How can I put on each last descended ul of each li element a class ".last"? for example I have               MENU      PASTA       SUBITEM 1 (.last)        ITEM 1.1        ITEM 1.2       SUBITEM 2 (.last)        ITEM 2.1        ITEM 2.2      PIZZA       SUBITEM 3        SUBITEM 3.1 (.last)         ITEM 3.1.1         ITEM 3.1.2      DESSERTS       SUBITEM 4        SUBITEM 4.1         SUBITEM 4.1.1 (.last)          ITEM 4.1.1.1          ITEM 4.1.1.2       SUBITEM 5 (.last)        ITEM 5.1        ITEM 5.2


title: Network created blogs URL

text: I'm building a blog network where people can register their blogs. As default if my domain is domain.com and if user creates a blog, the URL will be domain.com/mynewblog/ Now I would like that all blogs would be under /blogs subfolder/slug. So each time when user creates a new blog, it will be under /blogs slug, like this: domain.com/blogs/mynewblog domain.com/blogs/anotherusersblog Propably I could achieve this my altering the htaccess file. But I'm not really comfortable with that and I have been going through the WP settings but don't find any solution for this. Is there? What should I do? Thanks.


title: Export wordpress table to excel

text: I have created PHP scripts before to export a database table to .xls format like this:               $select = "SELECT * FROM tracking";     $export = mysql_query ( $select ) or die ( "Sql error : " . mysql_error( )  );     $fields = mysql_num_fields ( $export );     $file = 'export';     for ( $i = 0; $i < $fields; $i++ )     {     $header .= mysql_field_name( $export , $i ) . "\t";     }     while( $row = mysql_fetch_row( $export ) )     {     $line = '';     foreach( $row as $value )     {         if ( ( !isset( $value ) ) || ( $value == "" ) )         {             $value = "\t";         }             else         {             $value = str_replace( '"' , '""' , $value );             $value = '"' . $value . '"' . "\t";         }             $line .= $value;      }      $data .= trim( $line ) . "\n";      }      $data = str_replace( "\r" , "" , $data );      if ( $data == "" )      {      $data = "\n(0) Records Found!\n";      }          $filename = $file."_".date("M-d-Y");          header("Content-type: application/octet-stream");     header( "Content-disposition: filename=".$filename.".xls");     header("Pragma: no-cache");     header("Expires: 0");     print "$header\n$data";      What I'd like to know is how to "convert" this to wordpress format using the $wpdb class? I can get the initial query down to actually select the data from the table I want, but I get lost in some of the semantics of the wpdb class. I also wanted to know where I would put this code in wordpress, so if say a user clicks on a link, it would run this query and download the .xls file? Any help is greatly appreciated! This site is great!


title: Multiple Loops Meta Data

text: I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. > `pods_product_grps`: (p_high, p_med, p_low, m_type, group_id) > > `product_variant`: (cogs, area, img_min, img_max, product_sku, grp_id) Post are connected in **1 to many relationship** where `group_id==grp_id` So when displaying both the archive of `pods_product_grps` and the single post that has a subloop of each `product_variant` I need to display the calculated price based on a function I created. The archive post only displays the lowest calculated price of the child variants. Right now in my function, I have dummy variables to calculate the final price, but I need those to be populated automatically. So I think I need to use this function:               get_post_meta(get_the_ID(),$key, true);      but do I need to run that function for each key I need to define, or is there a way to make the key value an array and then return the values as individual variables.               //used in calculations-- dummy data     $p_high= 3.2; //get_post_meta(get_the_ID(),$key, true);     $p_med= 1.3;     $p_low =1.1;     $cogs= 11.53;     $img_count =3; //number of selected images between $img_min and $img_max     $img_cost= 10; //defined in settings page     $area= 40;     $client_lvl; //defined in user meta          //used in product display     $product_sku      I am not including the price calculation here, but it is in my other questions, and I can post it if needed. I am assuming that after my function, I would then create an action hook for it to display in the content. Would these variables extractions need to happen within the actual loop of say (`single-pods_product_grps.php`) or would including them in the function itself work and then call via the action?


title: How to redirect root blog to a specific one in multilang WP?

text: After installation I've got a default root blog '/'. Then I've created a new one '/en'. I really don't want to use the default blog. How can I redirect all accesses from / to /en ?


For some reasons I'm having this error appears in my dashboard Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'admin_init' was given in /home/devromot/public_html/wp-includes/plugin.php on line 405 has anyone came across that before? if so do you know where problem might be?


title: prevent post submission

text: I'm using a meta-box for custom post type. I have three problems:   1. WP seems to run the function that I attached to the "save_post" action, every time a new post is opened for editing or reloaded. Is there a way to prevent it from running?   2. WP saves the post even when I add "return false" after validation fails. Is there another way of doing it?   3. how can I validate the built-in WP title field? (I assume it is sent as $_POST['something']) TIA for your help.


title: how to randomly list 5 authors with at least 3 published posts

text:
Bit of a newbie here... As the title states, I am trying to generate a list of 5 random users (taken from authors, editors and administrators) who have published at least 3 posts each. (Also, I would like to exclude the author whose user ID is 4.) I think I have managed to do all this (hacking together various solutions gratefully taken from useful previous posts here in wordpress.stackexchange!) but I am not sure if this is the best solution or if it's coded correctly. I use this feature on many pages throughout my website and am worried it might be too db query intensive.               <?php     global $wpdb;     $min_posts = 3;      $user_ids = $wpdb->get_col("     SELECT `post_author`      FROM       (SELECT `post_author`,          COUNT(*) AS `count`          FROM {$wpdb->posts}         WHERE `post_status`='publish'           GROUP BY `post_author`)      AS `stats`     WHERE `count` >= {$min_posts} AND post_author !=4;");     shuffle($user_ids);          for($someNumber = 1; $someNumber <= 5; $someNumber++) {     $user = get_userdata($user_ids[$someNumber]); ?>                <?php echo get_avatar( $user->ID, '60' );?>           <h7><a href="<?php echo get_author_posts_url( $user->ID ); ?>">             <?php echo $user->display_name ;?></h7>
     <?php     }     unset($user_ids);     ?>      Any help truly appreciated, many thanks!


title: Boldy theme  - Regarding the images above the boxes

text:
Hello I am using the Boldy theme for my Wordpress website. I have a problem with the boxes (all 3 of them). All these three boxes have a "read more" that takes the user to another page, and above these boxes there is a small image. Now I want the images for each box to take the user to another page as well, but how can you make each image to turn them into a link in wordpress? Here is my home.php this might help.               <?php get_header(); ?>
                      <?php if(get_option('boldy_slider')!=''){                      $page_data = get_page(get_option('boldy_slider'));                              $content = $page_data->post_content;                              echo $page_data->post_content;                      }else{?>
                              This is the slider. In order to have items here you need to create a page in which to insert the images, simply one after another, setting up the link to point at ( if needed ) and text captions in the Title field. Then select the page as the "slider page" in the Theme Options Page. Make sure your images are 960px x 370px.
                      <?php }?>
                 <div style="width:960px; margin:0 auto; background:url(<?php bloginfo('template_directory'); ?>/images/bk_shadow_slider.png) 0 0 no-repeat; height:50px;">
                                                   <?php if(get_option('boldy_blurb_enable')=="yes" && get_option('boldy_blurb_text')!=""){ ?>

                      <a href="<?php                       if(get_option('boldy_blurb_page')!=""){                          echo get_permalink(get_option('boldy_blurb_page'));                      }elseif(get_option('boldy_blurb_link')!=""){                          echo get_option('boldy_blurb_link');                      } ?>"><img src="<?php bloginfo('template_directory'); ?>/images/but_blurb.png" alt="" />                      <?php echo get_option('boldy_blurb_text'); ?>

                 <?php }?>                                                                     <?php $box1=get_post(get_option('boldy_home_box1'));                            $box2=get_post(get_option('boldy_home_box2'));                            $box3=get_post(get_option('boldy_home_box3'));                             if(get_option('boldy_home_box1')!= null && get_option('boldy_home_box2')!= null && get_option('boldy_home_box3')!= null){?>

<?php echo $box1->post_title?>
                          <?php echo apply_filters('the_content', $box1->post_content);?>                          <a href="<?php echo get_option('boldy_home_box1_link')?>">Read more »

<?php echo $box2->post_title?>
                          <?php echo apply_filters('the_content', $box2->post_content);?>                          <a href="<?php echo get_option('boldy_home_box2_link')?>">Read more »

<?php echo $box3->post_title?>
                          <?php echo apply_filters('the_content', $box3->post_content);?>                          <a href="<?php echo get_option('boldy_home_box3_link')?>">Read more »


title: What is the importance of mod_rewrite?

text: If my hosting provider does not provide mod_rewrite mode. What thing will get effect on my wordpress? I bought a hosting, they claim they does not provide it. I have installed WP and the web is running. I dont know what features I am missing. The output of following command does not have mod_rewrite anywhere.               <? php phpinfo(); ?>       I put following contents in my .htaccess file. And mydomain.com/google.html redirect to google.com.               Options +FollowSymLinks     Redirect /google.html http://www.google.com      That means mod_rewrite is working? And my hosting representative does not know this. Thanks.


title: Has anyone developed a anti-spam plugin to simply allow users to BLOCK whatever they wish to, but one that will also go easy on IP addresses?

text: I'm new here xD I'm thinking of developing a plugin to allow users to block ANY spammy traces (IPs, Email addresses, Website URLs, phone numbers, phrases, etc etc) from those evil spammers. BUT, after some research, I've found that these evil idiots use random IP addresses, which means the plugin could result in blocking legit users (which isn't cool). So, this is my idea: The plugin is installed and activated on the domain `bob.com.` `Mr Robot` then decides to pay a visit to `bob.com` and begins spamming (posting useless, silly comments). The robot uses Website URL: `www.mypornsite.com` and email: `jimmy@g_mail.com` with IP: `123.123.123.15.` Then the victim (manager at `bob.com`) decides to block the website url, email address and IP used in the spammy content from `Mr Robot`. But because that IP could be random, we could be blocking legit users. SO, The IP does not actually get blocked. What actually happens is, a user with the same ip as Mr Robot's will be able to access the site just like anyone else would. BUT if ANY user visits bob.com and posts a comment containing the blocked email, website url or any other blocked material, then the IP of that user will be blocked for a day, and the comment will not go through (`bob.com` manager wont see it, as if it never happened). After 24/hours of the comment being posted, the IP will then be allowed full access to the site. Actually, maybe I shouldn't allow it to block complete access, instead, just to block submitting any forms on the domain? Anyway guys, my question is, is there any other plugin out there that will do EXACTLY this. I know there are a few IP blockers, email blockers and so on... But any like the one I've described above? Feel free to give any tips if you wish to. Thanks


title: What is the recommended behavior for the post formats?

text: I will be modifying a theme to add post types to it here soon. I know there are post formats and I realize I could make the behavior be whatever I want. However, I would like them to be used for how they were intended. So for instance, on a link type, if I click the title should it go the the item I linked to? If there is no title, should it be the title of the link? The codex seems to try to explain this, but I am not fully understanding what it is saying. In my searches, I am not seeing a detailed "this is what we recommend" listing. Any additional direction would be appreciated.


title: WP_Query search by multiple meta key and distance

text: I am having two meta keys, longitude and latitude, and what I am trying to do is the equivalent of the google store location algorithm for distance, in wp_query: > SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( > radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) > ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT > 0 , 20; What I am trying to do, is get a list of custom post types (stores) that contain long/lat (custom fields), and having an x distance (it's for a store locator, like google's example). I have already done it with $wpdb way, but I am looking for a wp_query because I want the paging and the extra filtering by using/removing an add_filter() directive to the page. Is it possible to execute such complex query, or should I stick to $wpdb method?


title: Safe to disable wptexturize?

text: To optimise the speed of my platform (beyond caching, database optimisation, JPEG compression, CSS sprites etc), it has come to my attention that disabling the `wptexturize()` function may give some minor results. We can disable this function by using this script (written by our own "observer of everything" toscho):               foreach ( array (             'bloginfo'         ,   'comment_text'         ,   'comment_author'         ,   'link_name'         ,   'link_description'         ,   'link_notes'         ,   'list_cats'         ,   'single_post_title'         ,   'single_cat_title'         ,   'single_tag_title'         ,   'single_month_title'         ,   'term_description'         ,   'term_name'         ,   'the_content'         ,   'the_excerpt'         ,   'the_title'         ,   'nav_menu_attr_title'         ,   'nav_menu_description'         ,   'widget_title'         ,   'wp_title'         ) as $target )     {         remove_filter( $target, 'wptexturize', 40 );     }      My question is, how safe is it to disable `wptexturize()`? When is this function being used? What should I consider when disabling it? The codex page gives an overview but doesn't detail when it is being used.


title: Current location plugin

text: What plugin would you suggest that will show my current location (in GoogleMaps) at one single post (a post that gets updated each time I change a location). I don't need a location for each of my blog posts, only a location for that one post. Updating my current location should be as easy as possible, preferably I would just have to input city name but would also have the ability to write coordinates if GoogleMaps doesn't recognize a city name.


title: Faster way to put images into a blog post by using Add Media dialog

text: One of the most time consuming things for me in blogging with Wordpress is adding images to the blog post. For each image, the user needs to click first "Add Media" button. Then, the user waits for the appearance of the "Add Media Dialog". Then he clicks "Media Library" tab in the dialog to see all the images he previously uploaded. Then he waits for the appearance of the "Media Library" form. So, there are two latencies that waste time:   1. Appearance of the Add Media dialog   2. Appearance of the Media Library form Every time, these two visual components are the same in the same blog post. So actually, there might be a way to cache these two components once and present them to the user instantly. I wonder if there is a faster way to put images into Wordpress blog posts where I will be able to specify meta data about the image such as caption, alignment, and size?


title: Get total posts found, but while using limit for pagination? get_posts

text: I have a ton of posts that I need to get the IDs of based on a custom taxonomy search. As it's used for pagination, I also need to get the total posts without a limit, but I'm not sure how. I use the following get_posts to find them:               $args = array('posts_per_page'   => $limit,                   'offset'           => $offset,                   'category'         => '1',                   'orderby'          => 'post_date',                   'order'            => 'DESC',                   'post_type'        => 'attachment',                   'post_status'      => 'inherit',                   'suppress_filters' => true,                   'tax_query' => $search_terms, // Fairly complex search array                 );     $attachments = get_posts($args);      But the trouble comes when I want to build a paging system based off of these results - I need to get the total posts without the limit in place. I could do the same search again and exclude $limit, but due to the sheer number of posts (300k+) it's extremely slow especially when I only need the total number of posts and not all their information. Even get_posts seems a bit too heavy for something as simple as just getting attachment IDs. I tried building a good old fashion MySQL query to handle it, but handling taxonomies is done so much cleaner with the above method and I couldn't seem to get it working right. Any advice would be greatly appreciated! Thank you!


title: Add pubDate to Nextgen gallery RSS feed

text: I want to add the `<pubDate>`tag to the NextGen gallery RSS feed, but I can't figure out how, the date I want to put in the tag is the gallery creation date, I have used `date(DATE_RSS)` but that will make all the RSS items to have the same date, I have tried also with `get_the_time()`but that doesn't work, maybe NextGen have a variable that I can tap into? Thank you for your help.


title: Archive of year for some categories using the featured image

text: I know that it should be quite easy to do but I can't seem to figure it out. Firstly, I have a category, with some sub-categories. I would like to have a page that displays all the post made in that year, from within those categories using only their featured images. However, I haven't added featured images for all the posts and would like it to default to set images for each category if it doesn't have a featured image. In addition, I would also like to have the post name and the publication date as the link title. Sorry for being so demanding. I'm almost there. I can display a featured image with the link and attributes I want but I can't seem to get the fallback image working. Here is the code I have. I know it must be a simple elementary mistake. I will need to add more ElseIf statments.               <?php query_posts('cat=81&year=2011'); ?>                         <?php while (have_posts()) : the_post(); ?>                             <?php if ( has_post_thumbnail()) ; {                             <a href="<?php the_permalink(); ?>"><?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );?><img src="<?php echo $url; ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" height="90" width="180" />;                             }                             else if(in_category(91))                             {                             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" >;                                  <?php endif; ?>                         <?php endwhile; ?>      Any help would be greatly appreciated. TIA


title: Using Ajax call in jQuery doesn't work in widget

text: So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is that it outputs the whole homepage in the #results div rather than just the results figure:


title: Gallery set to "Media file", showing as attachment page

text: I am using WP 3.5.1 and lightbox plus 2.5.5 I have my lightbox set to "Use for WP Gallery" Lightbox is working successfully on one of my posts with a single image, but on another post I have 3 images and they are set to "media file" but when I go to the post, they are navigating to the attachment page instead, thus lightbox is not working. Any thoughts on why its navigating to the attachment page even though the gallery has been set to media file? I have tried recreating the gallery with no success as well as reuploading the images. Gallery example --> http://santacruzsurvivors.com/2013/01/20/aquaponics- construction-part-2/               Notice: get_theme_data is deprecated since version 3.4! Use wp_get_theme() instead. in /home/www/santacruzsurvivors.com/wp-includes/functions.php on line 2839          Notice: Undefined variable: supported in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Warning: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 166 in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Notice: Undefined index: page in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/administrator.php on line 16          Notice: Undefined variable: format in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 456     Notice: Undefined variable: class in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 359     class="single single-post postid-30 single-format-standard logged-in admin-bar no-customize-support content-r" layout='2'>


title: How to Create a Custom Panel and Fields in Post Page [Plugin]

text: I would like to write a custom plugin that adds a custom panel below the post compose panel that will have a few fields and a submit button. JS will kick-in to submit content to the database, without saving or interfering with the post save/submit mechanism. The purpose is to save data to be used and quickly access while writing a post. I could do a plugin settings page, but I don't like the idea of using two screens when it can be done at the same place :) I saw the Custom Fields plugins, but they add value to a post while I want something more flexible that is created while writing a post but not necessarily linked to this post. I can't seem to find how to do this... Thanks!


title: How to add stylesheets only to pages with specific shortcode?

text: I'm running a function on pages where the shortcode `[make-me-a-map]` is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the stylesheets to only those pages in a similar fashion. **functions.php (Current)**               add_shortcode("make-me-a-map", "create_new_map");     add_action("wp_head", "style_my_new_map");          function create_new_map () {         global $new_map_called_for;         $map_called_for = true;              wp_register_script('make-a-new-map', get_template_directory_uri() . '/js/new-map.js', array('jquery'), '0.1', true);         wp_enqueue_script('make-a-new-map');         }          function style_my_new_map() {         global $new_map_called_for;         if ($new_map_called_for == true) {             $tDir = get_template_directory_uri();                  // Echo stylesheets because wp_register_style & wp_enqueue_style don't work atm             // And add_action('wp_enqueue_script', 'style_my_new_maps') with those functions would add style to all pages             // Not just the ones with [make-me-a-map] shortcode             echo "<link rel='stylesheet' href='", $tDir, "/css/new-map.css' />", PHP_EOL;                  // Echo Javascript straight to page (couldn't do it with wp_enqueue_script) to let js code know the template directory             echo '<script type="text/javascript">var templateDir = "', get_template_directory_uri(), '";</script>', PHP_EOL;             $map_called_for = false;         }     }      This doesn't seem to be working unfortunately. The styles are being added to all pages. I didn't use wp_register_style & wp_enqueue_style because this bug is still adding `<Link />` tags to the footer from those functions. I could have used `add_action("wp_enqueue_scripts", "style_my_new_map")` instead of `add_action('wp-head', "style_my_new_map")` but as far as I can see and have checked, there's no difference? Still adds the stylesheets to all pages. So my question is actually in two parts: :)   1. Why is the current functions.php not working and adding styles to all pages? I'm not sure if it's the `global` call or the `if` statement...   2. What's the best way for me to add the stylesheets to the header of only the pages that the above shortcode is used on, assuming I will not know the page ids, etc? Thanks in advance! P


title: get_comment_author_link not working properly

text: I have this snippet:               <a href="<?php bloginfo('url'); ?>/writer/<?php echo get_comment_author_link(); ?>"><?php echo get_comment_author_link(); ?>      I am displaying the username of the author but it's weird because it works well on the posts... Beneath the post, the username is linked like `/writer/username`, which is fine, but beneath the comment, the username is linked like `/writer/Username`. So for example, a user is called Blackboy 3 , than beneath the post it gets `/writer/blackboy-3`, beneath the comment it gets `/writer/Blackboy 3`. This makes a problem... Because if there is a post called `Blackboy 3`, than the link beneath the comment gets me to the post instead of the `author page`. Why is this? And how can I solve it?


title: Is there a wp-config.php option or constant that I can set to allow me to download nightly / beta builds?

text: ### Nightly Builds or Beta Releases? I like using the `/wp-admin/update-core.php` utility to update wordpress. But I'd like to be able to use it to download beta releases or nightly builds. Does anybody know of a way to enable this? Perhaps a constant or option in `wp-config.php`?


title: How to hide certain tags from the_tags()?

text: I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone tell me how to do this?


title: Remove tabs from buddypress groups and members pages

text: Basically if you see the picture below there are 5 tab items in my groups page: ![Screenshot](http://i.stack.imgur.com/S7L7w.png) Now, I want to be able to remove some of them. I want to be able to remove "Members" and "Send Invites" (for instance). This is on the frontend groups page. When you select a group and go to view it. I don't want to edit core files really, is there any other way to do this? Maybe a remove_action? Thank you.


title: Developing Themes on WordPress, Looking for Excellent Tutorials

text: I am a beginner at WordPress. I know html, asp, a little PHP and I'm familiar with WordPress. I want to be an WordPress expert. So far I know WordPress involves designing themes, making plugins and customized websites. Please let me know of any other things I need to do. Please provide links of some excellent tutorials( free to access, not want to buy) ..to get started with WordPress from beginner to expert.


title: post-excerpt not one of the options under screen options

text: I want to turn the post-excerpt function on but it doesn't even show as an option under 'screen options' for posts. How do I get it to display as a check box under screen options? I have tried inserting the code...// Change what's hidden by default... into the function.php but this causes problems. Perhaps I am not inserting the code into the correct part of the file or something or have left something vital out?


title: Next & Previous (Pagination in this case) Not Appearing

text:
I am using a custom page template for my portfolio. The code is calling the correct number of posts per page but for some reason the pagination links won't show up :-S My query               <?php          $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 2));      ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>     <?php            $custom = get_post_custom($post->ID);         $screenshot_url = $custom["screenshot_url"][0];         $website_url = $custom["website_url"][0];     ?>      The entire markup               <?php     /*     Template Name: Portfolio     */     ?>          <?php get_header(); ?>

              <?php              $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 2));          ?>         <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>         <?php                $custom = get_post_custom($post->ID);             $screenshot_url = $custom["screenshot_url"][0];             $website_url = $custom["website_url"][0];         ?>               <a href="<?php the_permalink() ?>">               <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'thmb-portfolio' ); } ?>                    <?php the_title(); ?>                        <?php my_excerpt('short'); ?>                                           <?php endwhile; ?>                 <?php if (function_exists("pagination")) {         pagination($additional_loop->max_num_pages);     } ?>

          <?php get_footer(); ?>


title: Is there any global functions.php file which works for any theme?

text: Is there some global kind of functions.php file that works for any theme? The problem is here: When I change a functions.php file in any theme, I need to take care of two changes: First, I need to take care of the updates of that theme. Second, I need to take care of changing the theme of the site. So, instead of making changes in the functions.php of a theme, is it possible to make changes in some functions.php file that is independent of any theme?


title: Custom post type single display is ommited

text:
I've created a custom post type: `tutorials` using generatewp.com generator and registered it with `register_post_type()`. I'm querying the list of tutorials in a custom page template like that:               <?php $query = new WP_Query('post_type=tutorial'); ?>     <?php if($query->have_posts()) : ?>       <?php while($query->have_posts()): the_post(); ?>         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
<?php the_excerpt(); ?>
       <?php endwhile(); ?>     <?php endif; ?>      To target single tutorial template I've created a file `single-tutorial.php`, placed a loop inside it, and fired the tutorial permalink in the browser. The `single-tutorial.php` file is ommited from Template Hierarchy and goes directly to index.php. The premalink is for example: `http://example.com/tutorial/tutorial-name/`. `index.php` content is loaded instead of `single-tutorial.php` Why is that? Any help very appreciated.


title: Downloads Gallery plugin?

text: I am designing a blog for a software vendor. They have a number of downloads available, both their own, and also from their clients. Downloads are usually tools that can be bolted onto the main software products. They want to have a slick interface to be able to search and download these items. I am looking for Wordpress plugins that might fit the description? What we are after, could be something like this, or like this. i.e. A thumbnail, name of tool, and maybe a user rating (not essential). Hovering over the tool would provide more info. Flexible on how it looks and feels, even something similar to Wordpress Plugins directory might work. Any clear plugin winners out there? :EDIT: Sounds like I should be looking at Custom Post Types. From what I have read so far, looks good, but still looks like I will need to write a fair bit of code to get what I want.   - Would love to be proved wrong --> perhaps there is a custom post template for what I am after?   _(I will research further)_


title: How to get parents of custom taxonomy, as what get_category_parents() do?

text: I have a custom taxonomy 'portfolio category', while i need to show all hierarchy categories of a portfolio post, for example the post is under `topcat -> childcat -> yetchildcat`, i want to show 'topcat, childcat, yetchildcat' on the post page, but `get_the_terms only` return '`yetchildcat`', how do i get all?


title: How to do admin CRUD & Pagination

text: I am wondering how might I create an admin page to do CRUD. I know how to add a basic/options page to the admin menu. But I want to go further, how might I manage data (CRUD) and for the index/listing page, I will need pagination, can someone point me in the right direction?


title: How to determine if an admin is logged in outside the loop

text: I need to be able to tell if an admin is logged in ouside of the loop. This is needed for some php files that are part of a WP site but do not use `require( '../wp-load.php );` What I need to do is keep the Google Analytics tracker JS from firing for logged in admins, but track everyone else. How do I find out if an admin is logged in outside of the loop? Checking the WP logged in cookie? Or must I use `wp-load.php`?


title: How to disable category without deleting?

text: Is there a plugin or some php code to do this: I want to disable some categories from the category box on the add/edit message page. I don't want to delete the categories and I want to leave the disabled categories to the previously assigned posts.


title: Shortcode not displaying HTML within the function

text:
I am working on a function that displays all authors but it appears I am doing something wrong the HTML within does not display until the bottom of the page separate from the output.               /* Add shortcode to display authors */     function all_authors() {     global $wpdb;          $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users where ID not in(1)");          $retval = '

';     foreach($authors as $author) {     $retval .= '
';     if(userphoto_exists($author->ID))         echo userphoto($author->ID);     else     $retval .= get_avatar($author->ID, 96);     $retval .= '
'.the_author_meta('display_name', $author->ID).', '.the_author_meta('tagline', $author->ID);     $retval .= '

'.the_author_meta('description', $author->ID).'

'.the_author_meta('phone', $author->ID);     $retval .= ' | ID).'" target="_blank">'.the_author_meta('user_url', $author->ID).'

';     }     $retval .= '

';     return $retval;     }          add_shortcode('myauthorbox', 'all_authors');


title: Intelligent Search Filtering

text: I need some help with a search plugin: WP Custom Fields Search. I have three drop down menus: 1. City 2. Suburb 3. Cuisine What I need is so that when you select a City, it automatically moves the 2. Suburbs to relevant to that city. 3. is a custom field ie. there can be chinese restaurants in any city. suburb so it doesnt matter but only certain suburbs in certain cities... So how do I filter it any ideas?


title: Form Value of drop down category + Translation of 'show option none'

text: I am building a form where a user can submit an article from the front end.. So far so good... To this form i am doing some submission check using javascript.. When i get to check if a category is choosen This is the line the retrives categories in the form:               <?php wp_dropdown_categories('show_option_none=---------------->&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1'); ?>      I dont know how to check it.. what is the value being sent to wordpress? Also.. Can i change this:               show_option_none=---------------->      into somthing i can translate using the regular tranlation method aka __() or _e()?? Thanks guys


title: Get the most repeated post contents from a search?

text: In my site the posts content is always the name of a school, so if I search for Chicago I get a lot of posts with different schools as content. What I want to do is to get the Schools with the most posts, so I could display this somewhere:               School A - 4     School B - 3     School C - 2     School D - 2      (The number at the right is the number of posts the school has) So what I need to get the most repeated post contents from a particular search including the ones that don't appear in first results page. I don't know how complicated it can be so if there is no simple way I would be very grateful for just being pointed towards the right direction, so I later figure out how to do it. My site is made with wordpress and the posts are on a SQL database. Please ask if it's not clear or for any more info. Thanks


title: How do I display the function the_content in this loop?

text:
I have this loop in my wordpress site which displays the latest posts with their titles, I want to display the post content after the title. I normally retrieve it with the function get_the_content but I cannot make it work in this case. This is the loop:                  while ( $q_query->have_posts() )        {              $q_query->next_post();         $question = get_post($q_query->post);        $loophtml = $loophtml . "
" . "ID) ."'>" . $question->post_title . "";        $loophtml = $loophtml . "" . get_comments_number($question->ID) . " comentarios ·&nbspID) ."'>Comentar";        $loophtml = $loophtml . "
";        }      Anyone knows how I could do it? Thanks


title: Make Images appear in the same order as in media browser using get children?

text: I would really like my images to display in the same way I've ordered them in the media browser. What am I doing wrong?               $images =& get_children( array('post_parent' => $post->ID,                                                    'post_type' => 'attachment',                                                    'post_mime_type' => 'image',                                                    'orderby' => 'menu_order',                                                    'order' => 'asc' ));


title: How to use wp_footer() on a 404 page?

text: I am designing my 404 error page, for which I created a separate header and of course I need a separate footer. As for the latter, instead of creating a new one, would be enough for me to ensure the`wp_footer();` to be just before the closing body? Or is there something in the `get_footer()` function that makes it necessary?


title: new line after the_content

text: Trying to properly indent a theme I wondered if it would be possible to create a new line `"\n"` directly after `<?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'mytheme')); ?>`? Edit: At the person who did a -1 on this topic, could you perhaps explain which part of > This question does not show any research effort; it is unclear or not useful > (click again to undo) I didn't follow?


title: Programmatically Creating Page using $wpdb and getting 404 error

text: ## EDIT: Turns out I had a permalink issue that was causing the 404 error. ### Original Posting below: I am creating a page programmatically using $wpdb->insert() and the resulting page returns a 404 error. ### A few things to note   * I am using a $wpdb object to create the page because I am creating it on a separate WordPress website, so wp_insert_post() doesn't work, because it would insert the post into the website I making the call from. Basically I have a network of websites, and I am creating a post on one site from a different site.   * I am creating a custom post_name (slug) value for the page. So, when I add the page programmatically, everything in the database looks just as if it were added via the WordPress Admin Area. I can even go to that website's WordPress Admin area, and edit the post. However, if I go to view the page it throws a 404. Now, if I "update" the post from the WordPress Admin area, the 404 goes away. If I create a post programmatically and create it from the WordPress Admin area, and then look at the database columns, they are the EXACT same values (or appear to be). Why would one work, and one wouldn't? Also I'm using permalinks ( ~~nothing custom, just one of those predefined choices~~ ). ### This is the wpdb insert call I'm using...               $post = array(         'post_author' => 1,         'post_date' => date('Y-m-d H:i:s'),         'post_date_gmt' => date('Y-m-d H:i:s'),         'post_content' => '',         'post_title' => 'My Page',         'post_name' => 'my-page',         'post_excerpt' => '',         'post_status' => 'publish',         'comment_status' => 'open',         'ping_status' => 'open',         'post_modified' => date('Y-m-d H:i:s'),         'post_modified_gmt' => date('Y-m-d H:i:s'),         'post_parent' => 0,         'post_type' => 'page',         'comment_count' => 0     );          $wpdb->insert(         'wp_posts',          $post,         array( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' );     );


title: How to show posts of an columnized different categories on the same line or row?

text:
I use a custom query retrieving the two categories of the post type, each column show only 6 posts of the category, if was more use pagination. Than I like to do is to show each post on each column on the same line or row, this just for design purposes, I thought than the query must count for the first two post, put on two divs (for example) and then put the next two, and the next later, until complete the sixth row to paginate if there are more. Really appreciate any comment or idea to solve this, didn't really know how to do. Here is the custom query I use:               <?php                     // for a given post type, return all                     $post_type = 'evento';                     $tax = 'categorias-eventos';                     $tax_terms = get_terms($tax);                     $post_counter = 0; // reset so we can generate columns                      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                              if ($tax_terms) { ?>
                                  <?php foreach ($tax_terms as $tax_term) {                              $args = array(                             'post_type' => $post_type,                             "$tax" => $tax_term->slug,                             'post_status' => 'publish',                             'posts_per_page' => 6,                           //'posts_per_page' => -1,                           //'paged' => $paged,                             'orderby' => 'title',                             'order' => 'ASC',                             'caller_get_posts' => 1                             ); // END $args                                  $my_query = null; // clear the query variable                             $my_query = new WP_Query($args);                                  if( $my_query->have_posts() ) { ?>

<?php echo $tax_term->name; ?>

                                      <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                                     <div class="retailer_wrap retailer_id-<?php the_ID(); ?>">
<?php the_title(); ?>

<?php echo get_post_meta($post->ID, 'eventdate', true);?>

<?php echo get_post_meta($post->ID, 'eventplace', true);?>

                                 <?php $post_counter++; ?>                                      <?php if ( 0 == $post_counter % 6 ) { ?>

                         <?php } // END if $post_counter ?>                       <?php                       endwhile;                       //wp_pagenavi( array( 'query' => $my_query ) );                      } // END if have_posts loop                     wp_reset_query();                        } // END foreach $tax_terms ?>
                 <?php } // END if $tax_terms                 ?>


title: Why am I timing out when using the Menu Editor?

text: I'm using a more or less fresh local install of WP 3.3.1. A few days ago I set up a couple menus (Appearance > Menus) without a hitch. Today I tried creating a new menu and add a page to it, but the page was never successfully added to the menu; the spinner just went on forever. I thought maybe the menu name was conflicting with one I had deleted earlier, but I can no longer add pages to new or existing menus. The same goes for custom links; I just get the spinner even after waiting 15 minutes. I only have one plugin enabled, Advanced Custom Fields 3.0.6, which I disabled to no avail. I have no custom post types or taxonomies. There are about 15 pages total with very little content on them, so WP isn't getting stuck sifting through a bunch of data. Any other ideas?


title: How to retrieve alt attribute for an attachment (uploaded image)?

text:
I have some IDs of attachments (images, not from current post). How to I get the alt attribute for those images? I have tried to look into wp_get_attachment_image_src and wp_get_attachment_metadata but couldn't find the alt attribute stored in neither of those this is where I'm looking for the alt:               while(the_repeater_field('featured_pics')): //this is an array of IDs         $image_id =  get_sub_field('featured_pic'); // this function gets an individual ID from array         $image_attr = wp_get_attachment_image_src(get_sub_field('featured_pic'), 'medium');         echo '
'.wp_get_attachment_image($image_id, 'thumbnail').'
';      endwhile;


title: retrieve all emails as database in wordpress to view all sent emails

text: I have a wordpress CMS website,having contact us page to send email.. can i keep track for the use of this page by sender name,subject, attachment at wordpress admin panel or any other way?? anybody have idea How to get database of all received emails from WordPress site's Contact Us Page?


title: filter wp_query result with custom field values

text: I'm getting started with advanced custom fields. I have a category field (main_category) where the categories given below are selected using the radio buttons.               1. Electronics     2. Programming     3. Design      where there are sub categories for these categories. they are set using the conditional radio buttons for each category. the sub categories are indexed, the fields are given ion brackets,               Post Type: article     Field Name: Category     Field key : main_category          1. Electronics - - - - - - - - (electronics)             Linear Electronics - -      (elect_linear)             Computer Networks- - -      (elect_networks)             Microwave Engineering-      (elect_microwave)             MicroProcessors- - - -      (elect_micropro)     2. Programming - - - - - - - - (programming)             ObjectiveC - - - - - -      (prog_objc)             Pythion  - - - - - - -      (prog_python)             JavaScript - - - - - -      (prog_js)             PHP  - - - - - - - - -      (prog_php)     3. Design     - - - - - -  - - (design)             Illustrator  - - - - -      (desgn_ai)             Photoshop   - - - - - -     (desgn_ps)             After Effects   - - - -     (desgn_ae)             Cinema 4d   - - - - - -     (desgn_cf)      the WP_Query was made,               $articles = array(       'numberposts' => -1,       'post_type' => 'article',       'meta_key' => 'main_category',     );               $query_articles = new WP_Query( $articles);      it returned an array $query_articles which contains all the posts., how can I filter through the array $query_articles ? so that I would add 'tagged in php' for the articles in the php sub category.? what i could do in my knowledge was to query arrays with different categories..               $electronics = array(       'numberposts' => -1,       'post_type' => 'article',       'meta_key' => 'main_category',       'meta_value' => 'electronics'     );     $programming = array(       'numberposts' => -1,       'post_type' => 'article',       'meta_key' => 'main_category',       'meta_value' => 'programming'     );     $design = array(       'numberposts' => -1,       'post_type' => 'article',       'meta_key' => 'main_category',       'meta_value' => 'design'     );                    //query variables     $query_electronics = new WP_Query( $electronics);     $query_programming = new WP_Query( $programming);     $query_design = new WP_Query( $design );      but the sub categories always messed up and also it eats up lots of resource. ps. this is for a blog i'm developing in localhost. thanks for any help and comment.


title: reorder a WP_Query, using a dropdown

text: I have the following loop used to display posts by category & I would like to to re-order them based on a dropdown selector               if (!isset($qry))         $qry = new WP_Query(array('category_name'=>$GLOBALS['city'],'order'=>$orderby));              if ($qry->have_posts($orderby)) {         $do_the_post = null;              if (is_single($orderby)) {             $do_the_post = true;         } else {             $qry->the_post($orderby);             $do_the_post = false;         }              $user = get_userdata($post->post_author);      So far, using some code I found here I have:               if( isset($_GET['o']) && $_GET['o'] != '')         {         $order = $_GET['o'];         switch($order)         {             case 'date-asc': $orderby = 'order=ASC';                 $msg = 'Date Ascending';                 break;             case 'date-desc': $orderby = 'order=DESC';             $msg = 'Date Descending(default)';                 break;             case 'date-mod': $orderby = 'orderby=modified';                 $msg = 'Date Modified';                 break;             case 'title-asc': $orderby = 'orderby=title&order=ASC';                 $msg = 'Title A-Z';                 break;             case 'title-desc': $orderby = 'orderby=title&order=DESC';                 $msg = 'Title Z-A';                 break;             case 'comment': $orderby = 'orderby=comment_count';                 $msg = 'Comment Count';                 break;         }         }         else         {             $orderby = 'order=DESC';             $msg = 'Date Descending (default)';         }                           <div id="sorter-container">                 <select id="order-by">                     <option value="date-desc" <?php echo (!isset($order) || $order == '' || $order == 'date-desc')? 'selected="selected"':''; ?>>Date Desc. (default)</option>                     <option value="date-asc" <?php echo ($order == 'date-asc')? 'selected="selected"':''; ?>>Date Asc</option>                     <option value="date-mod" <?php echo ($order == 'date-mod')? 'selected="selected"':''; ?>>Date Modified</option>                     <option value="title-desc" <?php echo ($order == 'title-desc')? 'selected="selected"':''; ?>>Title Desc.</option>                     <option value="title-asc" <?php echo ($order == 'title-asc')? 'selected="selected"':''; ?>>Title Asc.</option>                     <option value="comment" <?php echo ($order == 'comment')? 'selected="selected"':''; ?>>Comments Count</option>             </select>             </div>      //JQUERY                   <script type="text/javascript">             var orderby = jQuery('#order-by');             var str;             orderby.change(function(){             str = jQuery(this).val();             window.location.href = "<?php echo home_url(); ?>/gallery/?o="+str;         });         </script>      Is calling $orderby as the order is not working - my PHP is rudimentary at best, but can anyone tell me what's wrong here? Thanks...


title: Top 30 Songs using Custom Post Type

text: I have successfully created a Top 30 songs ranking via custom post type. Now im stuck with adding "Peak Position" post meta. I don't know how to program it. Peak Position is the position where the song ranked for a couple of weeks. For example, Song 1 has been ranked 5 for 10 weeks and then down to 6 position for 3 weeks.. so the Peak Position for Song 1 is 5 since it lasted for 10 weeks. Now i'm stucked thinking how can i save its peak position using post meta. Can anyone suggest?


title: Way to force media uploader use custom image size

text: I've implemented media uploader to my custom category image plugin and was wondering can I somehow force it use my custom image size I've set only for categories. ![enter image description here](http://i.stack.imgur.com/TxWqw.png) ... So in screen shot above, I'd like Size column only contain "Category Image (80 x 80)" and automatically be selected. The way I've added that 'Category Image' to the list is shown below               add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' );          function custom_image_sizes_choose( $sizes ) {           $custom_sizes = array(               'category-image' => 'Category Image'           );         return array_merge( $sizes, $custom_sizes );       }      If in that function I only return `$custom_sizes` it will affect every media uploader context, eg. Posts->Add Media, and not only when setting up my category image. Here's how I've implemented Media Uploader in my plugin               add_action( 'admin_init', 'cat_image_options_setup' );          //------------------------------------------------     // Setup category image media picker     //------------------------------------------------     function cat_image_options_setup() {         global $pagenow;         if ( 'media-upload.php' == $pagenow || 'async-upload.php' == $pagenow ) {             // Now we'll replace the 'Insert into Post Button inside Thickbox'              add_filter( 'gettext', 'replace_thickbox_text' , 1, 2 );         }     }          //------------------------------------------------     // Replace the media picker button text     //------------------------------------------------     function replace_thickbox_text( $translated_text, $text ) {          if ( 'Insert into Post' == $text ) {             $referer = strpos( wp_get_referer(), 'cat_image_settings' );             if ( $referer != '' ) {                 return __( 'Add as a category image', 'ddr' );             }         }              return $translated_text;     }      Any way to achieve that? Thanks! PS. If someone knows better way to implement that media uploader, please let me know. Now it somehow uses the old media uploader window, and not the same as in Posts->Add Media.


title: Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)

text: I have a custom post type named "tours" and a custom taxonomy named "tour_type". "tour-type" taxonomy is hierarchical. In "tour-type" taxonomy, parent terms are limited to "eco-tours", "daily-tours", "package-tours" & "tailor-made- tours". All terms except "tailor-made-tours", have children. I'm trying to reach a permalink structure like below for my tour post type: > /parent-tax/child-tax(if exist)/custom-post-type-name For example it would end up like this: > mysite.com/eco-tours/diving-and-rafting/coast-to-coast/ > > Or like this (for "tailor-made-tours"): > > mysite.com/tailor-made-tours/margoon-waterfall/ I read lots of tutorials and solutions which lead me to these parts of code:               $tours_args = array(         'labels'                => $tours_labels, //Some Labels         'public'                => true,         'menu_position'         => 10,         'query_var'             => true,         'rewrite'               => array('slug'=>'%tour_type%'),         'supports'              => $custom_post_types_supports,         'hierarchical'          => true,     );     register_post_type('tours',$tours_args);               add_filter('post_type_link', 'filter_post_type_link', 10, 2);     function filter_post_type_link($link, $post)     {         if ($post->post_type == 'tours')         {             /*...             Some codes which make $term equal to "parent-tax/child-tax"             ...*/                  $link = str_replace('%tour_type%', $term, $link);         }         return $link;     }               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');     function mmp_rewrite_rules($rules) {         $newRules  = array();              $newRules['eco-tours/(.+)/(.+)/?$']         = 'index.php?post_type=tours&tour_types=eco-tours&custom_post_type_name=$matches[2]';         $newRules['daily-tours/(.+)/(.+)/?$']       = 'index.php?post_type=tours&tour_types=daily-tours&custom_post_type_name=$matches[2]';         $newRules['package-tours/(.+)/(.+)/?$']     = 'index.php?post_type=tours&tour_types=package-tours&custom_post_type_name=$matches[2]';         $newRules['tailor-made-tours/(.+)/?$']      = 'index.php?post_type=tours&tour_types=tailor-made-tours&custom_post_type_name=$matches[1]';              return array_merge($newRules, $rules);     }      Now, permalinks which are shown in post type edit pages, are showing the right url, but when I open each of them, they show an archive page of "tour" post type... What did I drop in my codes?! :(


title: Safest way to bulk delete post revisions

text: One of my clients is on a rather large blog in terms of number of posts and traffic. I'm trying to get her database down to a manageable size, and one thing that's bulking up is literally tens of thousands of post revisions. I've already set Wordpress config to limit the number of revisions in the future to two:               define('WP_POST_REVISIONS', 2);      But I want to delete all existing revisions. **Question 1** : Is it safe to directly delete all rows in the wp_posts table that have a post_type of revision? (I've seen conflicting answers on this—but I'd love to be able to just do it this way if it's safe). **Question 2** : _…and this is only relevent if I should **NOT** just do the straightforward delete from question one:_ I found this answer where songdogtech provides a database query to safely delete, but (1) it's specifically in answer to a multisite question (this is a single site) and (2) I have just upgraded the site to 3.6, which included database changes. (So, I'm not skilled enough in reading database queries to know exactly what's going on there and if it would work for a single site in WP 3.6


title: Store subscription details for users in Wordpress

text: I want to store subscription details of several category for users. how to store this to wp database. i am beginner to wordpress. whether i want to create new table or can i use meta ,taxonomy or some thing?


title: Changing Link Attributes for Wp_Link_Pages

text: I'm wondering if there is any way to change the actual link itself for wp_link_pages. So right now, I have a simple code to display the pagination for a post, it looks like this: `<?php wp_link_pages( array( 'before' => '<div class="link-pages">' . __('Pages:', 'muimedia'), 'after' => '</div>',) ); ?>` It displays the Post pagination like so: Pages: 1 2 3 Page one links two page one, page two links to page 2 etc. Now, I would like to add an attribute called `fromwhere=news"` to the pagination permalinks. So page 1, 2, and 3 pagination links would look like so.. `mysite.com/somepost/post?fromwhere=news"` instead of just `mysite.com/somepost/post` I really hope this is possible, and if anyone could help me out, it would really mean a lot to me! And happy new years!!! :)


title: Plugin Add New Installer failing

text: I recently transferred my Wordpress Site to a new host. I have almost everything working, except for the plugin auto installer. If I search for a plugin and install it, it works just fine. If I try to upload my plugin from my computer, I get this error message: Download failed. A valid URL was not provided. I can manually install the plugin through my FTP client, Cyber Duck, by uploading the folder and activating it in the plugins list. I have set all my permissions to 777 on my plugins folder. I do not see anything in my server error logs period. I've had a lot of problems with setting permissions with the transfer, so I think that may be it. Can someone help? Thanks!


title: Removing buttons from the html editor

text: I've been searching the codex, and I'm probably overlooking something somewhere, but could someone tell if it would be possible to remove a button/quicktag from the WordPress html editor? http://i.stack.imgur.com/dZBTT.png


title: Is the current Theme version number cached somewhere?

text: I need access to my Theme's version number a number of times on each Admin Page view. Right now I'm using `get_theme_data` which in turn parses the Theme's `style.css` file via `get_file_data`, so `style.css` gets parsed multiple times. Is there a built-in caching mechanism for this data? Or should I just build a thin _in-process_ caching wrapper around `get_theme_data`? Thanks!


title: How to create a plugin that only operates on the home page?

text:
I have a plugin that I only want to execute when the home page is being viewed. How would I stub out my plugin in order to make this happen? This is does not work...                <?php      /*      Plugin Name: My Test Plugin      */                if ( is_home() OR is_sticky() )      {       add_filter( 'the_content', 'my_function' );      }           function my_function( $content )      {        echo "hello world".$content;      }           ?>      This is my original code, but it executes the filter on every page. Which seems overkill to me, since I only want the plugin to run on the home page anyway.                add_filter( 'the_content', 'wpse6034_the_content' );      function wpse6034_the_content( $content )      {       if ( is_home() ) {        $content .= '
Hello World!
';       }       return $content;      }


title: If taxonomy show class of active

text:
I have a nav which I would like to detect if an li should have a class of active or not. I usually do this for a normal page like this:                   <li <?php if ( is_page('about')) { echo ' class="active"'; } ?>>                                 <a href="<?php bloginfo('url'); ?>/about">About
      However I'm doing this on a taxonomy page and I would like to detect the name of the taxonomy term. So I have 4 terms, `design`, `illustration`, `motion` and `photography`. How would I go about adding a class to the li of the active taxonomy term? Here is what I have so far but its wrong:               <li <?php if ( is_taxonomy('illustration')) { echo ' class="active"'; } ?>><a href="<?php echo site_url(); ?> /talcat/illustration">Illustration
      **Update:** I have changed `is_taxonomy` to `is_tax` and then defining my taxonomy name and term. However this still isnt working. Here is my update coded:               <li <?php if ( is_tax( $Talcat, $illustration)) { echo ' class="active"'; } ?>>


title: How can a single line in a blog post take down my server?

text: I've been trying to write a post about a simple Windows Powershell script for the last few hours, but when I try to preview the post with the script included, it takes down my server. Unfortunately the server isn't mine to control (it's hosted by 34sp.com) so I'm limited in what I can do to diagnose the issue - I'm not sure where I'd start anyway. The problem _seems_ to stem from including the following lines in the post :               <pre>         $camera_getid.Parameters.Add("@CameraGUID", [System.Data.SqlDbType]"NVarChar").Value = $guid;     </pre>      I'm having trouble narrowing down the problem precisely, since every time it happens, my server is down for about 5-10 minutes. Has anyone seen anything similar?


title: wordpress theme backend admin only

text: Does anyone know of a theme that completely removes all uses and aspects of the frontend. So the sole use of the site will be in the admin section. to use as a portal for something like a school or internal government uses.


title: How wp_enqueue_script works?

text: I am trying to get scripts via `wp_enqueue_script();`. I have tried this in header but WordPress is not importing any script. I am using like this `wp_enqueue_script('jquery');` http://codex.wordpress.org/Function_Reference/wp_enqueue_script Is any other step needed for importing script via WordPress?


title: list posts of two post types in a single template

text: I have two post types. One is `post` & other one is `event`. Both sharing same categories & tags. I am listing the posts by `archive.php`. Now I am listing the posts as general by two different templates like `archive.php` / `archive- event.php`. But now I want to list them in a single template with mixing the posts and order by date. So any one would help me in this regard.


title: Show all post of a taxonomy with one specific term not working

text: I have a custom post type "restaurants" and a taxonomy "location", so I can get the restaurants for one location by URL. On the taxonomy page for one specific location (CityA) I want to display all post types from restaurants and the taxonomy term "CityA". However, Wordpress also gives me posts with taxonomy terms "CityB" or "CityC" in the very same query. Have a look:               $args = array ( 'post_type' => 'restaurants', 'tax_query' => array ( 'taxonomy' => 'location', 'field' => 'slug', 'terms' => 'citya' ), 'order_by' => 'title', 'order' => 'ASC' );          $query = new WP_Query ( $args );     while ( $query -> have_posts () ) {         $query -> the_post();         echo get_permalink($post->ID;     }      This gives me ALL posts of post_type "restaurants". And yes, the slug for CityA is definetely "citya", I double checked all arguments.


title: tb_show is not defined in advance custom field

text: I am using the plugin: Advanced Custom Fields. For several more images, I used it to add images using the image input field. Now, when I edit a post, I can't edit/add new image into the image field using the plugin. Using Firebug, it shows a `js` error: > Uncaught ReferenceError: tb_show is not defined But the same fields work, when I add a new image using those fields.


title: wp-admin won't "remember me" in Chrome & Firefox

text: When I login to wp-admin, I tick the box to "remember me", so I don't have to login again next time. However, if I close the wp-admin tab, and reopen wp-admin in a new tab, I have to login again. Alternatively, if I browse to another website, and then return to wp-admin, I have to login again. This happens in Chrome and Firefox. It doesn't happen in IE9 - in IE9 I am remembered. In wp-config.php, 'WP_HOME' & 'WP_SITEURL' are set to the same value. Any


title: Wordpress schedule posting not working

text: I have Wordpress 3.5.1 and I use Bluehost hosting service. When I schedule posts after that time passed, WP posts dashboard shows "Missed schedule" message under the date. Then I checked my `wp-config.php` has `define('DISABLE_WP_CRON', true);` there's no such a define line. Then I added `define('DISABLE_WP_CRON', false);` under the database lines. After that I added following code to my `.htaccess` file.               <Files "wp-cron.php">     Allow from All     Satisfy Any     </Files>      But still this issue not fixed. What is the reason? Is it my hosting company issue or my WP issue? How do i fix it?


title: Filters on Login Page

text: I am trying to modify the login page using built in filters. The add_actions are working as expected, but I cannot get the filters to work. This is the code that I have in my functions.php:               add_filter( 'login_form_top', 'filter_top_login' );     function filter_top_login( $content )     {         return 'This is what I want it to say!';     }      but it doesn't seem to be doing anything when I load the wp-login.php page. What am I doing wrong?


title: What PHP Needed to Make One Loop with Multiple Styling?

text: I understand that there is a way to have the loop display multiple ways on one page without using multiple loops... Or in other words something like:               <?php if (have_posts()) : while (have_posts()) : ?>     <!-- Code for the First Post -->     <?php else: ?>     <!-- Code for Posts 2-4 -->     <?php else: ?>     <!-- Code for Posts 5-12 -->     <!-- stuff to close loop -->      Problem is that I don't really know php well, and I have no idea how to have it count posts and how to tell it for the first post do X, for posts 2 through 4 do X, and for posts 5 through 12 do X... If anyone can point me to a clear tutorial or let me know what PHP is necessary, I'd really appreciate it. Thanks in advance!


title: jQuery Tree View and wp_list_pages

text: I'm looking to use the jQuery TreeView script on wp_list_pages to get a nice collapsable-tree effect going. The script requires that I add some classes to the list elements such as:               <ul id="red" class="treeview-red">      So I tried putting this in my template: First, load scripts on my template page via wp_enqueue_script()               wp_enqueue_script("av_jquery_tree");     get_header();      Where "av_jquery_tree" is defined in a plugin:               function av_jquery_tree() {     wp_register_script('jquery.treeview', get_template_directory_uri() . '/js/jquery.treeview/jquery.treeview.js', array('jquery'), '1.0' );     wp_register_script('jquery.cookie', get_template_directory_uri() . '/js/jquery.treeview/jquery.cookie.js', array('jquery'), '1.0' );     wp_enqueue_script('jquery.treeview');     wp_enqueue_script('jquery.cookie');     }     add_action('wp_enqueue_scripts', 'av_jquery_tree');      Second, In order to add the class and id to the first ul element on the page, I just insert this script above the call to wp_list_pages:               <script>         jQuery(document).ready(function(){         jQuery("ul").first().attr("id", "red").addClass("treeview-red");         });     </script>      Unfortunately, my output is just a bunch of red lines across wp_list_pages. Also keep in mind that I'm using the Suffusion Theme, which preloads jquery.


title: Move one option value into another option

text: I have 2 existing options that I want to move into an existing 3rd option. What is the best way to go about this? Here's the scenario: I have 2 options in existance:               get_option( 'license_key' )     get_option( 'license_key_status' )      I also have another option set that already exists with data already in it:               get_option( 'my_theme' )      The my_theme option contains multidimension arrays:               $options = get_option( 'my_theme' );     $value = $options['key']['value']      I want to take license_key and license_key_status, move them into these 2 values:               $license = $options['key']['license']['license']     $status = $options['key']['license']['status']      Then delete license_key and license_key_status


title: Filtering the post list in the admin area

text: How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to filter my event post type in a way that you'll only see upcoming events at first, being still able to see all events. I came across this question but it would be a dropdown instead of these links. ![filters](http://i.stack.imgur.com/HRuUG.png) [edit] So what I want is to have a link `Past events` next to the `Published` link instead of using the standard dropdown menus. [edit2] I eventually did use a dropdown, based on this answer: http://wordpress.stackexchange.com/a/45447/28916


title: Custom Post Type Tags Showing Under Regular Post Tags

text: I have a CPT of Projects that uses the post_tag feature. My CPT tags are also showing up in my regular blog post area under Tags. I added a new "regular" post tag and it also showed up in the CPT Projects tag list. How do I keep these separate? I have CPT specific tag cloud being used on a page, so it can't show tags from regular posts. Thanks. Code is below:               function projects_register() {          register_post_type('projects', array(            'description' => 'Projects',         'show_ui' => true,         'menu_position' => 5,         'exclude_from_search' => false,         'labels' => array(             'name' => 'Projects',             'singular_name' => 'Projects',             'add_new' => 'Add Project',             'add_new_item' => 'Add New Project',             'edit' => 'Edit Project',             'edit_item' => 'Edit Project',             'new_item' => 'New Project',             'view' => 'View Project',             'view_item' => 'View Project',             'search_items' => 'Search Projects',             'not_found' => 'No Project found',             'not_found_in_trash' => 'No Project found in Trash',              ),         'supports' => array('title', 'editor', 'thumbnail', 'excerpt'),         'public' => true,         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => true,         'rewrite' => array('slug' => 'projects', 'with_front' => true),         'taxonomies' => array('category', 'post_tag'),         'has_archive' => true         )      );          register_taxonomy( 'project', 'projects', array( 'hierarchical' => true, 'label' => 'Projects Categories', 'query_var' => true, 'rewrite' => true ) );            }          add_action('init', 'projects_register');


title: Making a Comment on a page without being on that page?

text:
I have a built a Wordpress site that enables comments on pages and I am using them as _reviews_ , what I would like to do is for someone to be able to make a comment on a page without being on that page. http://universitycompare.com/university-guide/anglia-ruskin-university/ On the link above, the top right, there is a link that says **_have your say about a university_** , it would be good to have a HTML form and then a dropdown box of all the child pages of **university-guide** ; which is where all the universities are stored, and then I can put my comments.php file into this. So my HTML form appears and when a page is picked from a dropdown box, the comment will then be assigned to that page. Any help or direction? * * * New Question for Toscho: Below is your tweaked plugin to fit into my website, as you can see I have added the select option **yearSelect** and need this to appear when the comments appear. How would I go about doing this? - Could you provide ay help please?                   <?php     /* Plugin Name: haveyoursay */          /**      * Call the form in your template with:      * do_action( 'wpse_67527_comment_form' );      */     add_action( 'wpse_67527_comment_form', 'wpse_67527_comment_form' );          /**      * Create a review form.      *      * @return void      */     function wpse_67527_comment_form()     {         $select_id = 'page_select';         $url = 'http' . ( is_ssl() ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];         $url = esc_url( $url );         ?>     <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post">
Leave us your student perspective

             <?php _e( 'Name' ); ?>                 <input id="author" name="author" type="text" size="40" />

             <?php _e( 'Email' ); ?>                  <input id="email" name="email" type="text" size="40" />

             <label for="<?php echo $select_id; ?>">

                 Pick a university from the list:                             <?php             // Ordered by page name automatically             wp_dropdown_pages(                 array (                     'name' => 'comment_post_ID',                     'id'   => $select_id,                     'child_of' => 2,                 )             );             ?>

Please select your year of study:            <select name="yearSelect">         <option value="1st">First Year</option>         <option value="2nd">Second Year</option>         <option value="2nd">Third Year</option>         </select>

             <textarea name="comment" cols="45" rows="8"></textarea>

             <?php             wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment_disabled', FALSE );             ?>             <input type="hidden" name="redirect_to" value="<?php echo $url; ?>" />             <input type="submit" style="margin:15px 0px 0px 0px; padding:4px 10px;" />
     </form>         <?php     }          add_filter( 'comment_post_redirect', 'wpse_67527_redirect' );          /**      * Strip '#comment-number' from redirect url.      *      * @param  string $url      * @return string      */     function wpse_67527_redirect( $url )     {         $parts = explode( '#', $url );         return $parts[0];     }     ?>


title: Adding new tab to WordPress editor next to visual and text tab

text: Hi, The topic title says it all, I want to add another tab next to visual and text tab. So far I found this topic here: Add new tab next to Visual and Html in wordpress text editor? and this New editor tab on WordPress edit page But it doesn't help me much. Is there any other way to add another tab to default WordPress editor, instead of creating new one?


title: How to perform a search inside a specific taxonomy category

text: My problem is this: I have 3 **custom taxonomies** , let's say **'author'** , **'title'** and **'editor'** , each one applied to regular posts. Let's say I have post_1 that has in the 'author' field 'jorge borges' and post_2 that has 'ray bradbury'. I'm trying to have a search form with a drop down menu containing the three taxonomies and a text field, so that if I select, i.e., 'author' and search for 'jorge borges', the result will be post_1. The other two taxonomies should work like this as well. I couldn't find anything similar, as many questions concern the creation of a drop down menu with all instances of a taxonomy, which is not what I want. I want a drop down menu with taxonomy categories, not values. So how do I do that?


title: Pull random comment from specific post, display on homepage with shortcode

text:
I'm trying to display a random comment from specific posts on my homepage, using the solution that was provided here: http://stackoverflow.com/questions/11790239/random-comments-on-page- wordpress/11790460#11790460 It works, but it pulls a random comment from a random post, instead of selecting the post I point at with the shortcode. Does anyone know how to fix this?               add_shortcode( 'randomComment', 'randomComment_handler' );          function randomComment_handler($post_id) {     extract( shortcode_atts( array(         'post_id' => '0',         ), $atts ) );     $out = "";     $comments = get_comments("post_id=$post_id&status=approve");     if ($comments) {         $ndx = mt_rand(0,sizeof($comments)) - 1;          $comment = $comments[$ndx];         $out = "

".$comment->comment_author."

".$comment->comment_content."

";     }     return $out;     }      and the shortcode:               [randomComment post_id="463"]


title: Change site template from php

text: What is the argument to pass to switch theme, when I have the result of `wp_get_themes()`?                $args = array(             'allowed' => true      );           $themes = wp_get_themes(  );           foreach ($themes as $theme) {                    $argument_to_pass_to_switch_theme = ??????           }


title: Returning or use form data using a hook?

text: I have built a plugin that allows a user to submit forms to a third party API via an API call. I'm wondering if it's possible to add in a hook right before (or after) the data gets sent to the third party, and return it for use in a function. Ideally, a user could define there own function and hook into the hook I have set, grab the data and use it how they please, or manipulate it before it gets sent off to the API.               if(!empty($p['form_data']))         {         parse_str($p['form_data'], $fd);         if(!empty($fd['list-id']))             {             // Create and store the variables needed to add a new subscriber                     $email  = false;             $lid  = empty($fd['list-id'];             $api  = 'api_key';             $mv = array();             $optin  = 'true';          // Add custom hook, to capture user submitted data     do_action( 'get_form_data', $p['form_data'] );             }         }      And then ideally the user could write a function to use the data (basic example).               function catch_user_data( $data ) {         $user_email = $data['email'];         update_user_meta( '1' , 'user_email', $user_email );     }     add_action( 'get_form_data' , 'catch_user_data' );      I'm sure I'm doing something wrong here as the data doesn't get updated on form submission. Is the hook written wrong?


title: Changing permalink of custom category

text: I've tried reading up on past posts here but my head is just spinning. My problem is I'd like to change my permalink structure for a custom full width posts under a custom category. For example, my permalink structure for posts is `example.com/04/2013/postname` and for my custom posts I'd like the permalink structure to be `example.com/categoryname/postname`. What's the easiest way to accomplish this?


title: How-To: wpdb Insert Record With Date

text: I am writing a plugin where I need to pre-load some data in the custom tables that I create upon Activation. My inserts have run fine thus far until I attempt to insert a record with a DATE datatype. Can someone please tell me what I have wrong here? Database Table Definition:               $sql =  "CREATE TABLE IF NOT EXISTS " . $wpdb->prefix.SSM_ACADEMIC_YEAR_TABLE. " (                       id mediumint(12) NOT NULL AUTO_INCREMENT,                       academicyear VARCHAR(200) NOT NULL,                       begin_date date NOT NULL,                       end_date date NOT NULL,                       created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,                     PRIMARY KEY (id));";              $wpdb->query($sql);      Database Insert:               $current_year = array(                 'academicyear' => '2012 - 2013',                 'begin_date'   => date('Y-m-d', '2012-08-14'),                 'end-date'     => date('Y-m-d', '2013-05-31')             );                  $wpdb->insert($wpdb->prefix.SSM_ACADEMIC_YEAR_TABLE, $current_year);      I have tried many different methods like just using => '2012-08-14' but that doesn't work either. I'm sure there's some syntax I am either missing or I have wrong.


title: Show User Their Password

text: I've got a few automated scripts that run to notify users of certain updates to the application, etc... and for one in particular, I need to be able to display the users `user_login` and their password. How do I show the user their password if it's encrypted?


title: How to remove this filter?

text: I can't remove a filter that added by media-tags plugin. it was originally added this way:               add_filter( 'attachment_fields_to_edit', 'mediatags_show_fields_to_edit', 11, 2 );      I tried to remove it this way:               remove_filter( 'attachment_fields_to_edit','mediatags_show_fields_to_edit', 11, 2 );      Where I did wrongly? How can I remove this filter?


title: How to group posts by months and add pagination?

text: I want to group by posts by months. Like this:   **January 2014**   Post name   Post name   **December 2013**   Post name   **November 2013**   Post name   Post name   Post name   Post name   I need to have 10 months per page, each month can have any number of posts. I use WordPress kriesi pagination to add pagination into the website.


title: Wordpress custom permalinks not working on OS X localhost

text: When changing premalinks, none of the pages and links are not working except home page :( ![enter image description here](http://i.stack.imgur.com/0X4gW.png) Result are shown below. Thanks in advance. ![enter image description here](http://i.stack.imgur.com/2Tw2h.png)


title: how to handle forms in multiple pages?

text: I have a simple contact form that I set up to display on multiple pages using a shortcode and a widget but since I need to form to post back on the same were it's displayed I'm not sure how to accomplish this. I was thinking about writing a function and plug it to the `wp_head` hook but I'm not sure if it's correct, is there a better way to do this? Thanks in advance.


title: Make a WP instance go to the 404 page of another WP instance

text: I have two Wordpress instances: One is in '/' The other one is in /commerce I would like that, when somebody goes to `/commerce/nonexistingpage` or some route that does not exist, the user gets redirected to the 404 page of the WP in /. How can I do that? Do I need to touch `.htaccess`?


title: Use [shortcode="value"] instead of [shortcode att="value"]?

text: With shortcodes that have only one attribute, it would be much easier from a content-editing perspective to use, for example, `[icon="myicon"]` instead of `[icon whichicon="myicon"]`. Is this possible in Wordpress? Is it problematic?


title: Can I change header.php of current theme through a plugin function?

text: I need to add some html into the header.php but instead of directly changing the header.php of my theme or creating a child theme, how can I do it with just actions and/or hooks?


title: How can I display the parts of custom posts?

text:
I have a custom post type called Testimonial that includes custom fields "name", "title" and "bank". I would like to display each of these items on a page. Here's what I have so far:                   <?php         while ( $loop->have_posts() ) : $loop->the_post();           the_title();           echo '
';           the_content();           echo '
';         endwhile;         ?>      This gives me something close to what I want but I don't know how to get at the actual fields individually. How do I do that?


title: Hook/Filter before and after comments

text: I'm writing a plugin that needs to display a custom link immediately near the comments. I have the option in the plugin admin to display before or after. I'm familiar with the comments_array, but that doesn't allow me to just add a string of html just before the comments or just after the comments but before the comment form.               the_content     -- ?? custom link before ?? --     comments_array     -- ?? custom link after ?? --     comment_form


title: posts_nav_link on single post template

text: I have a post type called `journal` and on the `single-journal.php` template I am querying the rest of the `journal` posts like so:               <?php query_posts( array(          'posts_per_page' => 4,          'post_type' => 'journal',          'paged' => ( get_query_var('page') ? get_query_var('page') : 1 ),     ));     ?>      This works great but displaying the navigation: `<?php posts_nav_link(' ',' ','load more posts +'); ?>` is linking to `/journal/POST_TITLE_HERE/page/2` where I want to display `/journal/page/2` (as it shows on the `journal- archive.php` template), if this is at all possible? Any suggestions would be greatly appreciated!


title: How to update WordPress from the latest trunk

text: I read somewhere that I can set a constant in the wp-config.php to update WordPress from the latest trunk version and not the stable version. Stupid as I am, I can't find the site anymore where it was written. I know I could also update with SVN, but I thought the autoupdater was a smarter version.


title: How to get the average of the values from the comment meta

text: I used the _comment meta_ to add a simple **rating** system. The user can post a rate from the comment form from where I added 3 dropdown comment meta. The rating is working well, reflecting the ratings together with the comment written by the user. My only problem now is this: how can I get the average of all the ratings posted? I need the average to be placed on the post content. My rating system rates the following:   * Price,    * Packaging,    * Quality.  I want an average for each rate:   * Average Price Rate,    * Average Packaging Rate, and    * Average Quality Rate. Thank you so much!