title: Link to Second Level Admin Page

text:
I have created a plug-in with an Admin Menu that displays a list of artists saved into the database in a custom table. This page is a "master" page and I am trying to figure out how to link the artist name to a "details" page all in the backend. From the codex and other books I have determined that the second level pages should be like the top level pages in that it will be a function that displays the content. I cannot figure out how do I "link" to that callback function. I add the first level page with this:               add_submenu_page('ppmtalentexpo', 'TARSTE II', 'TARSTE II', 'administrator', 'tarste2submenu2', 'jwg_talentexpo_options2_page');      and diplay the first level with this:               function jwg_talentexpo_options2_page() {         global $wpdb;              $cnt = 0;         $rows = $wpdb->get_results("SELECT * from ppm_tarste2_bands ORDER BY band_name");         //echo '
'; echo var_dump( $rows ); echo '
';         $retHTML = "

 PPM Talent Expo Administrator -- TARSTE II

";         $retHTML .= "
";         $retHTML .= "
" . count($rows) . " registered.
";         for( $c = 0; $c<count($rows);$c++ ) :             $retHTML .= "
";             $retHTML .= "" . $rows[$c]->band_name . "";             $retHTML .= "
Contact: " . $rows[$c]->band_contact_person . "	";             $retHTML .= "band_email . "'>EMAIL";             if( $rows[$c]->band_url != '' && $rows[$c]->band_url != 'n/a' ){                 $retHTML .= " | band_url . "'>WEB	";             } else {                 $retHTML .= "	";             } // end if             $retHTML .= "" . formatPhone($rows[$c]->band_contact_phone) . "	";             $retHTML .= "";             switch( (int) $rows[$c]->status ){                 case 1:                     $retHTML .= "Registered";                     break;                 case 2:                     $retHTML .= "Selected";                     break;                 case 3:                     $retHTML .= "Face-Off";                     break;                 case 4:                     $retHTML .= "Winner";                     break;             } // end switch             $retHTML .= "	";             $retHTML .= "
";         endfor;         $retHTML .= "
";         $resHTML .= "
";         echo $retHTML;     } // end function      So, within the for loop I am trying to link to the details page of each registered artist in the second $retHTML line with an anchor tag. My plan is to create a function to display the details of that artist. Again, what do I put in the anchor tag OR is there a better way to do what I am trying? Thanks in advance for any guidance or help provided, Jon


title: wp_nonce_field displaying twice

text:
I have `wp_nonce_field` in my code but it's creating two instances to the html code for some reason, one where I'd expect it and another at the start of the entry. Is this correct or am I doing somehthing wrong. It's creating a validator error. One thing I'm doing a bit different is that the form is being output via a shortcode, but I wouldnt have expected that to cause a problem. I have checked the rest of the code and it is the case the `wp_nonce_field` is "working twice" for some reason ... here is the relevant portion of the code                     (rest of form code precedes this)                 $formDisplay .= $commentErrorDisplay;           $formDisplay .= '<input id="submitContact" type="submit" value = "Send" />';           $formDisplay .= wp_nonce_field('contact-form');           $formDisplay .= '<input type="hidden" name="contact-submitted" id="contact-submitted" value="true" />';           $formDisplay .= '
'.$feedback.'';           $formDisplay .= '</form>';           $formDisplay .= '
';                     return $formDisplay;      **Edit** : I think I've discovered it, though in fact I still dont fully understand, but that's probably just a general lack of knowledge on my part. The codex says > Return Values (string) Nonce field. so I thought that meant that as it returned a nonce field as a string that I could just append it to $formDisplay ( 3rd line of my code) but apparently not. I think it must both display the nonce field AND return it or something. I'm sure there's nothing strange about it's operation but it's probably worth leaving this question up here just in case someone else falls for the same mistake.


title: Autocomplete for taxonomy input boxes on a front end form

text: I have created a simple frontend form to allow users to submit posts - similar to the tutorial here - **http://voodoopress.com/** . I also have a couple of custom taxonomies which i have as text input boxes on my form. This is all working but i was wondering if there is anyway i can have all the fields including Post Title and the taxonomies to auto suggest existing values? thanks


title: Adding pretty query parameters

text: A custom post type named shooting has a field (with ACF) with plenty of images. Those are listed on the `single.php` of the CPT and one of those images is displayed in full-ish size. I currently have URLs like `shooting/foo-bar/?image=1` where 1 is the index (not ID) of the image that should be displayed large. Is there a way to get prettier URLs like `shooting/foo-bar/1` with WordPress? Or would I have to write a custom rewrite-rule for that?


title: How to link post titles on page A to its posts on page B?

text: I set and reversed the order of a list of post titles on my front page with:               <?php     global $post;     $args = array( 'category' => 6 );     $myposts = get_posts( $args );     $reverseposts = array_reverse( $myposts, true);     foreach( $reverseposts as $post ) : setup_postdata($post); ?>     <?php the_title(); ?>     <?php endforeach; ?>      Now I'm not being able to find the proper "a href" line to link those titles to its posts called in another temp file. I hardcoded:               <a href="<?php bloginfo('template_url'); ?>/category6"><?php the_title(); ?>      but I guess there's a proper way to get "category6" dynamically. Any help would be most appreciated. Thx in advance.


title: Proper use of wp_enqeue_style

text: I have the following code in my functions.php file. It works, but I am wondering if this is best practice for including styles in wordpress. Also do I need to register the style with wp_reister_style, since it works without and why do I need to do so?               <?php     function mrskitson_load_styles(){     if (!is_admin()){     wp_register_style('main', get_template_directory_uri() . '/style.css');     wp_enqueue_style('main', get_template_directory_uri() . '/style.css');     }//if not admin ends     }//function mrskitson_load_styles ends     add_action('get_header', 'mrskitson_load_styles');     ?>


title: Drop down menu's not saving using Custom Meta Boxs in WordPress

text: I am playing with custom meta boxes within WordPress and when trying to modify a drop down menu and saving the option it doesn't save. If I use the default template it saves the option fine.               case 'select':     echo '<select name="', $field['id'], '" id="', $field['id'], '">';     foreach ($field['options'] as $option) {     echo '<option value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';     }     echo '</select>';     break;      Below is my modified version to allow 3 drop menus to be displayed:               case 'champbans':     echo '<select name="', $field['id'], '_team1ban_1" id="', $field['id'], '_team1ban_1">';     foreach ($field['options'] as $option1) {     echo '<option value="', $option1['value'], '_team1ban_1"', $meta == $option1['value'] ? ' selected="selected"' : '', '>', $option1['name'],  '</option>';     }     echo '</select>';     echo '<select name="', $field['id'], '_team1ban_2" id="', $field['id'], '_team1ban_2">';     foreach ($field['options'] as $option2) {     echo '<option value="', $option2['value'], '_team1ban_2"', $meta == $option2['value'] ? ' selected="selected"' : '', '>', $option2['name'], '</option>';     }     echo '</select>';     echo '<select name="', $field['id'], '_team1_3" id="', $field['id'], '_team1_3">';     foreach ($field['options'] as $option3) {     echo '<option value="', $option3['value'], '_team1ban_3"', $meta == $option3['value'] ? ' selected="selected"' : '', '>', $option3['name'], '</option>';     }     echo '</select>';     break;      There are no errors being displayed and I can not spot the error after spending the past 2 hours looking at it. Any help or guidence is much appreciated.


title: How to have a next page for post?

text: I have a theme installed but my problem is that the theme doesn't provide a next page function. So if I have 20 posts, and I put 10 in the _Blog pages show at most_ in Reading Setting of Wordpress Setting, it only shows the 10 posts and then I can't anymore see the remaining posts on my home because it doesn't have any next button. I want to have a next page button so that the users can still view the other posts by clicking the next button. How can I do this? Need help. Asap! Thank you!


title: Get entire page content (generated HTML in browser)

text: I'm looking for a filter that provides the full page generated in WordPress - including the head section with meta tags, body, styling and dynamic content. the_content() and the_excerpt() do work only for the dynamic part and the request filter seems to work only for SQL queries (or not)? I would like to filter some data in the entire page in all links or buttons. How can I do this?


title: placing the media uploads in a subdirectory

text: Hi I want all my uploads to be uploaded to a subdomain on my site instead of 'wp-content/uploads' I created a subdomain `cdn.mysite.com` and i want all the uploads to go there instead. I want my uploads to be `cdn.mysite.com/uploads/year/month/mediafile` Just as the uploads automatically create a folder for the uploads i want it to do the same when uploading to the subdomain. How can I accomplish this. EDIT: I found this plugin that is suppose to place the image path options back on wordpress but I'm not so sure i should use it, I don't know if it actually works, I don't want to mess anything up http://wordpress.org/extend/plugins/wp-original-media-path/installation/ Also I found this tutorial of how to do this from the wp-config.php file but it's only explaining changing the name of the folder not changing the path as in placing a subdomain. http://www.techgyd.com/how-to-change-media-uploads-folder-in-wordpress-3-5/17/ I want to try the second option, editing the wp-config.php file but I don't know how to edit that line of code for subdomains, also I'm afraid that if we do figure out how to add the subdomain option to the wp-config file that when I upgrade wordpress it will disappear and my images may mess up. What should I do?


title: twenty twelve theme widgets not working

text: For both Twenty Twelve 1.1 and a child theme based on Twenty Twelve, widgets cannot be added. If I go to appearance > widgets, there is no widget area to drag widgets into. I have reinstalled the latest Twenty Twelve theme, and switched to it, but the issue remains. Wordpress v3.5.1


title: What's a good way to unenqueue all scripts for a single template page?

text: I've found that my attachment templates are inheriting the enqueued scripts for single posts. My first instinct was to unenqueue these scripts one-by-one or to do an `is_attachment()` check before enqueueing them at all. It strikes me that a more robust way to do this might be to simply be to remove any and all enqueued scripts for that page type; that way, I don't have to update code in multiple places if I add or remove an enqueued script in the future. Offhand I can't find a way to do this. What's a good way to unenqueue all scripts for just a single page?


title: Batch upload to create posts each with one image, headline, and body text

text: I've been handed 300 images, 300 headlines, and 300 paragraphs by a client. Is there a way for me to place all of this in a CSV file (or other format) and upload the whole shebang into a fresh WordPress install in one operation? I don't have php skills so I need a simple solution if there is one. Thanks.


title: Turn off skeleton css responsive but the site not show the whole entire

text: after turn off skeleton responsive media query and made the site not responsive but the site not show the whole entire it's only show the left side of the site, I would like to make it preview entire like the desktop preview , below is link for I'm talking about, please help!! http://d.pr/i/rPD9 Best regards, Decneo


title: How to validate datepickers before publish

text: I have two datepickers in my post: 1. start_date and 2.end_date Basically, I need to check if end_date is greater than start_date before I can proceed to publish. From a previous solution here, I used this piece of code:               add_action('save_post', 'validate_meta');     function validate_meta($post_id)     {         $post = get_post( $postid );         if ( $post->post_type !== 'subtask' ) return;              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )            return $post_id;              $start_date = get_field('start_date', $post_id);         $deadline = get_field('deadline', $post_id);         $start_date = strtotime($start_date);         $deadline = strtotime($deadline);              if($start_date < $deadline)             $validated = true;         else             $validated = false;              if(!$validated) {             dashboard_redirect();             wp_delete_post($post_id, true);         }         else             return $post_id;     }      It kinda works but I have two problems: 1. It redirects to the `post` post type, 2. I need it to simply output an alert message


title: Adding content to archive and taxonomy pages on custom post types?

text: I have a custom post type named "Products" and a taxonomy called "Usage". On my "Products" landing page I'd like to have custom content that can be edited via WYSIWYG by the client. Same goes for the taxonomy landing page. My thought was to create fake Pages and just pull the content via ID into my archive- products.php and taxonomy-usage.php templates but I was curious if there was a better way to handle it.


title: Update tags to 10,000+ posts with wpdb?

text: I have over 10,000 posts on a site which all need to have a tag added to them. WP_Query is either running out of memory or timing out on my server and in the past running large queries with this function, i've had my MySQL query limit reached with similar functions I know I can't use WP_Query and wp_set_post_tags efficiently, and i'm sure it can be done with wpdb without as many queries to the database. There's only one tag which needs to be added to each post. How can it be done with a wpdb query?


title: Search for Author and Custom Post Type

text: I have searched questions and answers similar to mine but with no luck finding the answer I need. I have authors (about 8,000) and I have custom post types (about 15). I need my search function to allow queries for an author and CPT. This url structure "/?s=%20&author_name=joesname" returns all posts across CPT's. But if I add "&post_type=blogs" for the full url to filter for the CPT "/?s=%20&author_name=joesname&post_type=blogs" it does not filter for just blogs. I need to do this for every author and CPT. This has been driving me crazy for weeks. Any help would be greatly appreciated.


title: Template with Custom Post Type (Custom Tables) does not work

text: I'm using a Custom Post Type (CPT) `my-project` stored in a custom table MY_PROJECT. Here is the CPT registering code:                   $labels = array(             'name' => __( 'Projects ' ),             'singular_name' => __( 'Project' ),                         // other labels         );              $args = array(             'labels' => $labels,             'description' => __( 'Projects Management' ),             'public' => true,             'show_ui' => true,             'show_in_nav_menus' => true,             'show_in_admin_bar' => true,             'menu_position' => 100,             'capability_type' => 'post',             'hierarchical' => false,             'has_archive' => true,             'supports' => false,             'publicly_queryable' => true,             'query_var' => true,             'rewrite' => array( 'slug' => 'project', 'with_front' => false ),         );              register_post_type( 'my-project', $args );      As you can see I don't use any fields from Wordpress (`'supports' => false,`) as I'm using my own fields and insert them in my custom table; but I set `post-name` and `post-title` in `wp_posts` table when creating a new CPT `my- project`. I want to display all my fields using basic template twentyeleven, I found that I have to add this code in `themes/twentyeleven/functions.php`:               add_filter( 'pre_get_posts', 'my_get_posts' );     function my_get_posts( $query ) {         if ( is_home() )         $query->set( 'post_type', array( 'my-project' ) );     return $query;     }      => First question: is there another way to register my CPT to display it/ is that the best place to write this? Then I created 2 files in `themes/twentyeleven/`: 1 `archive-my-project.php` (should display list of `my-project`) 2 `single-my-project.php` (should display one `my-project`) => Second question, using "Preview before modification" button in admin will display a list of all my CPT `my-project` (only the title). It should be only one project, and wordpress should use `single-my-project.php` file right? The URL is ok: `http://localhost/wordpress/project/project1/`. And clicking on one of the title will display "Nothing found" page... I tried to edit`single-my- project.php` content to display "TEST" string but nothing changed... => Third question: slug (which I set to `project`) is used only in the URL and nowhere else, is that right? Nothing to do with file names `single-my- project.php` (ok) / `single-project.php` (not ok)? Please note I've read about Template_Hierarchy Thanks for your help, Xavier


title: Show WP content on different PHP Sites

text: we are about to start developing a big dynamic web project (Probably on ZF2) which will have some modules&tabs to act as CMS module (displaying news, galleries, posts etc). Let's assume we have five tabs on main menu, one or two of those tabs will contain this CMS related content. Now my question is, **is it possible to use Wordpress' Admin panel to add content but display it on a different site (not as iframe or widget), if yes how can we do that**. **Additional note over comment:** There will be user interaction on Zend Application's interface, user must have ability to interact with the content comes from WP side. For example, if he/she changes the topic(category) related news/post must be listed. Which means, ZF2 must make queries to WP Engine. A screenshot papper of my scenerio is below, please share any idea ![enter image description here](http://i.stack.imgur.com/uF6Hr.jpg) Thanks in advance


title: User needs to login first before accessing website

text: _**In my application, users have to login first before accessing the website._** So now what I am doing, I have created one custom login page. How can I redirect a user to the login page if he/she is not logged in yet. Should i customize wp-login.php for login? Which is better way, **1.** Redirect user to login page or **2.** wp-login.php


title: Multiple Galleries in WordPress 3.3.1

text: There are a good plugin, that allows user to make several galleries in one post not using manually "include" attribute. http://wordpress.org/extend/plugins/multiple-galleries/ But after upgrading on 3.3.1 core version of WordPress this plugin don't work anymore. (I suggest this is because of changes in file post manager.) Does anybody know the way to fix that? Maybe there is another plugin that realize this function?


title: add_action hook for links.php page

text: What is the definite hook which identifies links.php page (add, edit, delete, etc. Blogroll Links), and only this page? Any help would be appreciated. Thanks, cadeyrn EDIT Sorry, I forgot to mention, I need this hook in the admin area. I have a plugin, that brakes an other one, because both are triggered by the admin_menu add_action. Therefore I need an add_action point that is only valid for the admin menu's link edit/add/delete part.


title: Hard-coding a shortcode as the last menu item in primary navigation?

text:
I have Genesis framework installed with a child theme. My client wants their themes "shopping cart" shortcode to be the last menu item, in their primary nav, no matter how many menu items there is. _The shortcode:_               echo do_shortcode('[shopping_cart]');      _Current code:_                       $nav_output = sprintf     ( '
%2$s%1$s%3$s
', $nav, genesis_structural_wrap( 'nav', '
', 0 ), genesis_structural_wrap( 'nav', '
', 0 ) );                  echo apply_filters( 'genesis_do_nav', $nav_output, $nav, $args );              }          }      _Current output:_


title: How do I filter the search results order?

text:
Is there a way I could have my search results show Pages first and posts after the pages? My site is a business site with a blog, as opposed to the blog being primary. The static pages have all the "here's what we do" stuff and ideally they would come up first if someone was searching for various services. The blog posts are more light in tone, but they're more recent so they come up first. The search loop is from the Kubrick theme:               <?php if (have_posts()) : ?>

<?php _e('Our Search Results', 'kubrick'); ?>

          <?php while (have_posts()) : the_post(); ?>          <div <?php post_class(); ?>>     <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>"        rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?>
<?php the_excerpt(); ?>
          <?php endwhile; ?>          <?php else : ?>
<?php _e('No luck. Try again?', 'kubrick'); ?>
     <?php get_search_form(); ?>          <?php endif; ?>      Could I put something in there to specify that any result from a "page" would be listed before results from a "post". Or does WP not actually distinguish between pages and posts at that level? Since the static pages are "static" I could use ID's maybe? Thanks!


title: Events filter using wpdb for queries

text: I'm a WordPress (PHP) developer, however I have not done a lot of complex MySQL queries. I am working on an events website and want to create filters: User should be able to filter events by the following criteria: TODAY, TOMORROW, THIS WEEKEND, NEXT 7 DAYS, CHOOSE YOUR DATES. Meta data used to filter events is below and can be found in the post meta db table in the meta_key column.               start_date     end_date     times     recurring_event     days     sold_out     cancelled      This is how the table looks like:               id post_id  meta_key         meta_value     1   12      start_date       20140923     2   22      days             a:4:{i:0;s:6:"monday";i:1;s:9:"wednesday";i:2;s:6:"friday";i:3;s:8:"saturday"}                3   12      end_date         20141003     4   78      recurring_event  0     5   34      times            24 Hours     6   12      days             a:2:{i:0;s:6:"monday";i:1;s:7:"tuesday";}     7   67      start_date       20140906     8   45      end_date         20141108      What MySQL queries can I use to get events for Today, Tomorrow, Weekend and 7 days. I found a similar answer to what I seek on: How do I list the next 7 days and any events (cpt) contained in those days               $today = date("o-m-d");     $future = strtotime ( '+6 days' , strtotime ( $today ) ) ;     $future = date ( 'o-m-d' , $future );     $event_query = new WP_Query(       array(         'post_type'   => 'event',        'meta_key'    => 'event-date',        'orderby'     => 'meta_value',        'order'       => 'asc',        'meta_query'  => array(          array(           'key'     => 'event-date',           'value'   => array($today,$future),           'compare' => 'BETWEEN',           'type'    => 'DATE'             )            )          )        );          for ($i=0; $i<7; $i++){     $thedate = strtotime ( '+'.$i.' day' , strtotime ( $today ) ) ;     $thedate = date ( 'o-m-d' , $thedate );     echo $thedate;     // loop thru all posts and check $thedate against your date meta     // and output if it matches     // then rewind_posts(); to set it up for the next day     }      Using $wpdb how can I list only events for today or tomorrow checking the dates between start_date and end_date?


title: Adding a Nav menu to post admin

text: i want insert a dropdown menu with list of menus, that i've created in nav- menu.php, to post-admin... For example, when i'm creating a post, i want insert a menu "Paul" in a post (only a post that i want) selecting a menu at right sidebar of Admin-Post. I've copied the rows:               add_action( 'init', 'register_my_menus' );     function register_my_menus() {         register_nav_menus(             array(                 'primary-menu' => __( 'Primary Menu' ),                 'personal-menu' => __( 'Personal Menu' )             )         );     }       in a post.fields.php that i've created, don't work. :( Link to existing code. Can you help me in that fantastic problem? :( ps: Sorry for my bad english Francesco


title: WordPress CMS Inquiry

text: I'm pretty familiar with WordPress and have used it on various projects both as a blog as well as a fully-functional CMS using custom post types, etc. I am about to embark on a project for a client that includes a site that displays a few clothing pieces. Each piece will also display its different color options (ex: The "XXX" shirt will come in Black, Red and White and should be able to view colors when you click on a color swatch). There will be 30 products, give or take a few, but this number is pretty set in stone.. There won't be the situation in which 20 more products will need to be added. So my first inclination was just to make a custom post type called "clothing" and create each clothing piece. From there, I would create each piece's color option as a child page of the parent clothing piece page. I know there are various ways to approach a project like this but I wanted to get some input and maybe some recommendations on how to go about with something like this.


title: How to offset thumbnails to the center?

text: I made few thumbs size. But some of them make total resize of original pict or make new with specified sizes from right bottom corner. Is this posible to centrilize thumbs? I meen to make new thumb with specified size but with offset to center / centilize them?               add_theme_support( 'post-thumbnails' );           if ( function_exists( 'add_image_size' ) ) {          add_image_size( 'last-posts-thumb', 0, 160);         add_image_size( 'last-posts-thumb-4-3', 120, 160, true);         }


title: The capability edit_theme_options is not giving capabilities to add an item to menu

text: I want to give a user the capability to add pages to the menu. So I gave him the `edit_theme_options` capability using the `User Role Editor` plugin. This gives him the capability to see Appearance - Menus, see the structure and also add pages to the menu, or so it seems. Because although the system allows him to add the item to the menu structure and move it to the right position when he presses 'Save Menu' the system just says that the menu was saved, but the new item is not there in the menu. It seems that Wordpress is just acknowledging the request and discarding it in reality. It works OK with Admin so I presume this might be some permission issue. Is there any other capability I need to give the user for menu editing to work?


title: Loop Problem: Displays same set of post for all categories

text:
So, I have 2 loops, one inside the other. The first to get the category titles, the second to display a few recent post from that category. Problem: Category titles display fine, but the recent post for each category are the same. What I end up with is this: Category-1 Post-1, Post-2, Post-3 Category-2 Post-1, Post-2, Post-3 Category-3 Post-1, Post-2, Post-3 etc.. CODE:               $catArgs = array(     'orderby' => 'name',     'order' => 'ASC',     'exclude' => '106'     );          $postArgs = array(     'orderby' => 'date',     'order' => 'DESC',     'showposts' => '4',     );               $categories = get_categories($catArgs);     if($categories){     foreach($categories as $category) {             $my_query = new WP_Query($postArgs); ?>
<a href="<? echo get_category_link( $category->term_id );?>" title="<? echo $category->cat_name; ?>"><? echo $category->cat_name; ?>
<? echo category_description( $category->term_id ); ?>

                     <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<? the_post_thumbnail(); ?><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                     <?php endwhile; ?>
      <? } ?>     <? } ?>      Thanks!!


title: How to use "Cases" instead of "IFs" for conditional logic

text: Recently I've been developing sites for WordPress that are both increasingly complex but also have much higher rates of traffic. I remember when I was learning the ropes from another about PHP, that in cases of optimisation, "cases" are a better option than "IFs", as they put less load on the server. I've successfully been able to use "cases" in some functions, but when it comes to use in files like single.php, then I've failed miserably. So I thought I'd push it out to the community to find out how simple IF logic inside WordPress loops, can be optimised with "cases". My code below basically checks whether the content being loaded is for one of six custom post types, and depending on which post type it is, then different parameters are fed into the custom functions.               if (is_singular('news')) {         terms_by_order('news_category', array(3623));         if( false != get_the_term_list( $post->ID, 'news_column' ) ) {             echo ' | ' . get_the_term_list($post->ID,'news_column', ' ', ' ', '' );         }     }           /* <!-- if sport --> */     if (is_singular('sports')) {         terms_by_order('sports_category', array(3623));         if( false != get_the_term_list( $post->ID, 'sports_column' ) ) {            echo ' | ' . get_the_term_list($post->ID,'sports_column', ' ', ' ', '' );         }     }           /* <!-- if opinion --> */     if (is_singular('opinion')) {         terms_by_order('opinion_category', array(3623));         if( false != get_the_term_list( $post->ID, 'opinion_column' ) ) {             echo ' | ' . get_the_term_list($post->ID,'opinion_column', ' ', ' ', '' );         }     }           /* <!-- if life --> */     if (is_singular('life')) {         terms_by_order('life_category', array(3623));         if( false != get_the_term_list( $post->ID, 'life_column' ) ) {             echo ' | ' . get_the_term_list($post->ID,'life_column', ' ', ' ', '' );         }     }           /* <!-- if culture --> */     if (is_singular('culture')) {         terms_by_order('culture_category', array(3623));         if( false != get_the_term_list( $post->ID, 'culture_column' ) ) {             echo ' | ' . get_the_term_list($post->ID,'culture_column', ' ', ' ', '' );         }     }               /* <!-- if community --> */     if (is_singular('community')) {         terms_by_order('community_category', array(3623));         if( false != get_the_term_list( $post->ID, 'community_column' ) ) {             echo ' | ' . get_the_term_list($post->ID,'community_column', ' ', ' ', '' );         }     }


title: Is there a WordPress plugin that can post to Google+?

text: I am using WP to Twitter on my WordPress blog to trigger a tweet every time I post something. Obviously this is for Twitter only, I need something to post on Google+ too.


title: Are there any "YouTube-styled" commenting systems for WordPress?

text: I'm looking for a commenting system that allows users to like/dislike each other's comments with the highest liked comments automatically rising to the top, much like YouTube's commenting system. Anybody know of something like this?


title: How to filter a dd/mm/yyyy date from a custom field in a query

text: I'm trying to build a query in order to sort some posts by a date custom field, where the dates are formatted dd/mm/yyyy. It works by querying the database directly with `get_results` like in this example :               $querystr = "         SELECT *         FROM wp_posts, wp_postmeta         WHERE wp_posts.ID = wp_postmeta.post_id         AND wp_postmeta.meta_key = 'my_cutom_date'         AND wp_posts.post_status = 'publish'         AND wp_posts.post_type = 'post'         ORDER BY STR_TO_DATE(wp_postmeta.meta_value, '%d/%m/%Y') ASC     ";      But, I would like to transpose this behavior to a `WP_Query`, using a `posts_where` filter. I got as far as this :               $args = array(         'post_type' => 'post',         'post_status' => 'publish',         'posts_per_page' => 10,         'meta_key' => 'my_custom_date'     );           function filter_orderby( $orderby = '' ) {           global $wpdb;         $orderby .= " ORDER BY STR_TO_DATE($wpdb->postmeta.meta_value, '%d/%m/%Y') ASC ";         return $orderby;     }          add_filter( 'posts_orderby', 'filter_orderby' );      But it doesn't seem to return anything. what am I missing ?


title: Set generic reservation form for custom post type

text: I want to create a simple reservation (reservation.php) form for a custom content type (houses), i have created the reservation.php in the theme directory. The question is: How can i link to this general reservation form from the custom post type and pass the post id via `POST` or `GET`, so i can retrieve some information like post title, taxonomy, and so on. A plus would be do this with a nice permalink like `mysite.com/lake-house/reservation/`


title: Cookie value cannot be read until I've logged into the WP admin

text: Once logged into the WP admin, I can refresh the front-end and see my cookie's value outputted as "hello world". If I log out of the admin, then refresh my front-end, the cookie's value is now "nothing", as seen in my example function. This only happens when I'm viewing the website online. When testing locally, I can read the cookie without being logged into the WP admin. Any ideas? Here's my test function for setting the cookie               function test_cookie() {         setcookie( 'test-cookie', 'hello world', time()+1209600, '/');     }     add_action( 'init', 'test_cookie' );      Here's the function for outputting the cookie's value onto the page               function output_test_cookie() {              if ( isset( $_COOKIE['test-cookie'] ) )             echo $_COOKIE["test-cookie"]; // should output hello world, but only does this when logged into WP admin         else             echo 'nothing';     }     add_action( 'template_redirect', 'output_test_cookie' );


title: Add New Post (Custom Post Type) Deletes 1 Post's Custom Meta Data

text: function save_details( $post_id ){       if ( wp_is_post_revision( $post_id ) )         $post_id = wp_is_post_revision( $post_id );          update_post_meta( $post_id, "testimonyname", $_POST["testimonyname"] );     }       add_action('save_post', 'save_details', 10, 1);       I have a custom post type with a custom field, but after adding several i noticed that the data in the custom field was missing from some previous entries. I filled them in again and it looked fine. Then i clicked the Add New button just once and 1 of my posts has it's custom meta data deleted. However, it doesn't happen every time i click Add New. I have tried this solution but to no avail               if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )      Any help would be much appreciated, Thanks, Ashley


title: Is it possible to tell if a user is logged into Wordpress from looking at the cookies which are set?

text: Is it possible to tell if a user is logged into Wordpress from looking at the cookies which are set on a site? If not, how could I add hooks to the login success and logout actions and set my own cookies?


title: jQuery Ajax decompose WP_Query

text:
I am working on a Ajax search field where I want to load links to products matching with my search query. My problem is that I don't know how I can get the titles and the permalinks from the query object in jQuery. **HTML:**               <form method="post" class="searchbox outline" role="search" action="<?php echo esc_url( home_url( '/' ) ); ?>">         <input type="text" name="s" class="s" autocomplete="off" placeholder="<?php _e( 'What are you looking for?', 'gtp_translate' ); ?>" />

Result

         <input type="submit" name="search" value="<?php _e( 'Search', 'gtp_translate' ); ?>" />     </form>      **Jquery:**               // Ajax search box         $('.searchbox .s').keyup(function() {             var s = $(this).val();             if( s.length > 0 ) {                 $.ajax( {                     type: 'post',                     url: gtp.ajaxurl,                     dataType: 'json',                     data: {                         action: 'gtp_ajax_search',                         s: s,                        },                     success: function(data) {                         $('.results').show().append(data);                     }                 });             } else {                 $('.results').hide()             }         });      **Ajax function action in functions.php**               // Ajax search     add_action( 'wp_ajax_gtp_ajax_search', 'gtp_ajax_search' );     add_action( 'wp_ajax_nopriv_gtp_ajax_search', 'gtp_ajax_search' );     function gtp_ajax_search() {         if( isset( $_POST['s'] ) ) {             $s = $_POST['s'];             $args = array(                 's' => $s,                 'posts_per_page' => 5,                 'post_type' => 'products',             );               $results = new WP_Query( $args );             echo json_encode( $results );         }              die;     }


title: Conditional tag for attachment posts

text: In Wordpress single.php post pages are both for media attachments (e.g. http://domain.se/postname/imagename/) and blog post pages. What conditional tag can I use to determine if a post is not a media attachment but a normal blog post? The reason why I want to determine this is because at the moment I have customized the single.php file to with additional fields that I need for the single post blogposts and as it is now the customized fields show up empty on the media attachment pages too which looks bad.


title: How can I hide children of draft pages using wp_list_pages()?

text: I'm displaying a simple sitemap with _wp_list_pages();_               $args = array(         'sort_column' => 'menu_order',         'title_li' => '',         'post_status'  => 'publish'     );          wp_list_pages( $args );      The problem is that by default this also shows the published children of draft pages, like so : > Page 1 (published) -> displayed > > --- Page 2 (draft) -> not displayed > > ------ Page 3 (published) -> displayed What I would like to achieve is : > Page 1 (published) -> displayed > > --- Page 2 (draft) -> not displayed > > ------ Page 3 (published) -> **not** displayed I suspect a custom Walker would do the trick, but I could never really understand how those work.. Is there a way to hide those child pages without having to set them all to draft ? **Edit** : To clarify, let's try some imagery. So you have a tree with the complete hierarchy of your pages. We are climbing up the tree. The moment we encounter a a draft branch, we cut it down. Naturally all the other branches attached to it further along are also discarded (no matter if they are drafts or not). I hope that explains it better. Here is an example with a somewhat deep hierarchy : > Page 1 (published) -> displayed > > --- Page 2 (draft) -> not displayed <- **Cut here and exclude all further > children** > > ------ Page 3 (published) -> not displayed > > --------- Page 4 (published) -> not displayed > > ------------ Page 5 (draft) -> not displayed > > --------------- Page 6 (published) -> not displayed


title: Fill empty custom field with other custom field

text: i have a product listing website, all products are uploaded from csv. i have a two custom field named "old_price" and "new_price". Sometimes there is no discount (new_price) , so the field be empty. i would like to store the value of "old_price" in "new_price" , If "new_price" is empty. **its important that it get stored in database automatically, No alternate Solution please.** thanks in advance.


title: How do you display the number of a post in a query?

text: I want to display the number of a post beside each post title in a query, such that it literally appears like this:   1. Post title one in query   2. Post title two in query   3. Post title three in query How do I do this? * * *               <?php          function ngtj_get_some_posts( $category_name )     {         // set the criteria          $args = array(             'numberposts' => 10,              'post_type' => array('feature', 'post')         );         // return the object array of the posts.         return get_posts( $args );     }     ?>            <?php wp_nonce_field('update-options') ?>                    <?php               $posts_returned = ngtj_get_some_posts( 'CATEGORY_NAME' );                    foreach ( $posts_returned as $post_returned )     {           echo $post_returned->post_title.'<input style="text-align: center;" type="text" name="postnumber" size="1">'.$post_returned->ID.'<br>'.$post_returned->current_post.'<input type="hidden" name="page_options" value="post_one" />';                    }     ?>


title: The main Loop is not starting in a custom blog template page

text:
I made a custom template for the blog section of my page. I even set post page to **Blog**. I created a custom post type called Page Content and the posts are retrieved in the `#feature` div. But the main posts (written in the Posts panel) are not being shown (`#blog` div) Any suggestions to solve this? EDIT: I just saw this in the webkit inspector:               Fatal error: Cannot use object of type WP_Query as array in /home/alex/www/wpa/wp-includes/query.php on line 2555      (I'm using the Starkers theme) code: **home.php:**                  <?php         /**          * Template Name: Blog          * @package WordPress          * @subpackage Prominent          * @since Prominent 1.0          */         get_header(); ?>

                         <?php // Retrive custom post type with a custom taxonomy assigned to it                         $posts = new WP_Query('post_type=page_content&page_sections=Slider (Front Page)&order=ASC') ?>                         <?php while ( $posts->have_posts() ) : $posts->the_post(); ?>                             <?php the_content(); ?>                         <?php endwhile; ?>                         <?php wp_reset_query(); ?>

                     <?php // Retrieve blog entries (The Loop)                     get_template_part( 'loop', 'index' ); ?>

         <?php get_footer(); ?>      index.php:               <?php     /**      * The main template file.      *      * This is the most generic template file in a WordPress theme      * and one of the two required files for a theme (the other being style.css).      * It is used to display a page when nothing more specific matches a query.      * E.g., it puts together the home page when no home.php file exists.      * Learn more: http://codex.wordpress.org/Template_Hierarchy      *      * @package WordPress      * @subpackage Starkers      * @since Starkers 3.0      */          get_header(); ?>                      <?php                 /* Run the loop to output the posts.                  * If you want to overload this in a child theme then include a file                  * called loop-index.php and that will be used instead.                  */                 get_template_part( 'loop', 'index' );                 ?>          <?php get_sidebar(); ?>     <?php get_footer(); ?>      loop.php:               <?php     /**      * The loop that displays posts.      *      * The loop displays the posts and the post content.  See      * http://codex.wordpress.org/The_Loop to understand it and      * http://codex.wordpress.org/Template_Tags to understand      * the tags used in it.      *      * This can be overridden in child themes with loop.php or      * loop-template.php, where 'template' is the loop context      * requested by a template. For example, loop-index.php would      * be used if it exists and we ask for the loop with:      * get_template_part( 'loop', 'index' );      *      * @package WordPress      * @subpackage Starkers      * @since Starkers 3.0      */     ?>          <?php /* Display navigation to next/previous pages when applicable */ ?>     <?php if ( $wp_query->max_num_pages > 1 ) : ?>             <?php next_posts_link( __( '← Older posts', 'twentyten' ) ); ?>             <?php previous_posts_link( __( 'Newer posts →', 'twentyten' ) ); ?>     <?php endif; ?>          <?php /* If there are no posts to display, such as an empty archive page */ ?>     <?php if ( ! have_posts() ) : ?>
<?php _e( 'Not Found', 'twentyten' ); ?>

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyten' ); ?>
             <?php get_search_form(); ?>          <?php endif; ?>          <?php         /* Start the Loop.          *          * In Twenty Ten we use the same loop in multiple contexts.          * It is broken into three main parts: when we're displaying          * posts that are in the gallery category, when we're displaying          * posts in the asides category, and finally all other posts.          *          * Additionally, we sometimes check for whether we are on an          * archive page, a search page, etc., allowing for small differences          * in the loop on each template without actually duplicating          * the rest of the loop that is shared.          *          * Without further ado, the loop:          */ ?>     <?php while ( have_posts() ) : the_post(); ?>          <?php /* How to display posts in the Gallery category. */ ?>              <?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
                 <?php twentyten_posted_on(); ?>          <?php if ( post_password_required() ) : ?>                     <?php the_content(); ?>     <?php else : ?>     <?php         $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );         $total_images = count( $images );         $image = array_shift( $images );         $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );     ?>                         <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?>
<?php printf( __( 'This gallery contains %2$s photos.', 'twentyten' ),                             'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',                             $total_images                         ); ?>
                          <?php the_excerpt(); ?>     <?php endif; ?>                          <a href="<?php echo get_term_link( _x('gallery', 'gallery category slug', 'twentyten'), 'category' ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?>                     |                     <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'twentyten' ), '|', '' ); ?>          <?php /* How to display posts in the asides category */ ?>              <?php elseif ( in_category( _x('asides', 'asides category slug', 'twentyten') ) ) : ?>                  <?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>                 <?php the_excerpt(); ?>             <?php else : ?>                 <?php the_content( __( 'Continue reading →', 'twentyten' ) ); ?>             <?php endif; ?>                          <?php twentyten_posted_on(); ?>                     |                     <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'twentyten' ), '| ', '' ); ?>          <?php /* How to display all other posts. */ ?>              <?php else : ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
                 <?php twentyten_posted_on(); ?>              <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>                 <?php the_excerpt(); ?>         <?php else : ?>                 <?php the_content( __( 'Continue reading →', 'twentyten' ) ); ?>                 <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>         <?php endif; ?>                          <?php if ( count( get_the_category() ) ) : ?>                         <?php printf( __( 'Posted in %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>                         |                     <?php endif; ?>                     <?php                         $tags_list = get_the_tag_list( '', ', ' );                         if ( $tags_list ):                     ?>                         <?php printf( __( 'Tagged %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>                         |                     <?php endif; ?>                     <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'twentyten' ), '| ', '' ); ?>                  <?php comments_template( '', true ); ?>              <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>          <?php endwhile; // End the loop. Whew. ?>          <?php /* Display navigation to next/previous pages when applicable */ ?>     <?php if (  $wp_query->max_num_pages > 1 ) : ?>                     <?php next_posts_link( __( '← Older posts', 'twentyten' ) ); ?>                     <?php previous_posts_link( __( 'Newer posts →', 'twentyten' ) ); ?>     <?php endif; ?>


title: Which is the most well coded and semantically correct naked/blank Wordpress theme (based on Wordpress coding standards)?

text: I've be using Starkers for a while but I wonder if there are blank/naked themes with better code, files, and folder organization (based on Wordpress coding standards)?


title: Add title for previous and next posts to Yoko Theme

text:
Help! I want to change my "Previous" and "Next" post links to use the actual post titles. I have done all kinds of online research and code manipulation without any success. I am using the Yoko theme. Here is my current single.php code. What do I need to update it to be? My website is www.thelawstudentswife.com
          <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>                  <?php get_template_part( 'content', 'single' ); ?>                  <?php comments_template( '', true ); ?>                  <?php endwhile; // end of the loop. ?>
<?php previous_post_link( '%link', '' . _x( '←  Previous Post', 'Previous post link', 'yoko' ) . '' ); ?>

<?php next_post_link( '%link', __('') . _x( 'Next Post →', 'Next post link', 'yoko' ) . '' ); ?>


title: Use custom header as WordPress header

text: My site is running on site say : www.xyz.com   My blog is at say : http://www.xyz.com/blog I have one header implemented in my main site, I want to use that header file as a worpress header. Is there any way I can do this?


title: Functions.php: Exclude Category from "Blog"

text: So it's quite obvious to how exclude certain categories from within a template, but I don't want to have to modify 4 templates so that they ignore a certain category. Is there a way that I can exclude a category from showing up within the "blog" set within the Reading settings? I'm assigning the blog to a Page named "Blog" ... but obviously archives and searches are going to need to be blind to this one exceeded category too. I'd just do much rather do it within `functions.php`


title: wp_nav_menu: check if the list item has children and add a class to anchor link

text:
I'm trying to add a class to anchor links of children element in wp_nav_menu both for pages and posts. Is there a way to modify the Nav Menu Walker and do so? Basically my custom walker looks like this:               class Main_Nav extends Walker_Nav_Menu {             function start_lvl(&$output, $depth) {                 $indent = str_repeat("\t", $depth);                 $output .= "\n$indent
\n";             }             function start_el(&$output, $item, $depth, $args) {                      if( $depth == 0) {                         $output .= "
";                 }                                if( $depth == 1) {                         $output .= "
";                 }                 $attributes  = '';                 ! empty( $item->attr_title ) and $attributes .= ' title="' . esc_attr( $item->attr_title ) .'"';                 ! empty( $item->target )and $attributes .= ' target="' . esc_attr( $item->target ) .'"';                 ! empty( $item->xfn )and $attributes .= ' rel="' . esc_attr( $item->xfn ) .'"';                 ! empty( $item->url )and $attributes .= ' href="' . esc_attr( $item->url ) .'"';                      $title = apply_filters( 'the_title', $item->title, $item->ID );                      if (/* THE MENU ELEMENT HAS CHILDREN */) {                         $item_output =                          ""                         . $title                         . ' ';                 }                      else {                         $item_output =                          ""                         . $title                         . ' ';                 }                      $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth);              }          }      As you see I don't know what the proper condition instead of `/* THE ELEMENT HAS CHILDREN */`. Thank you. **UPDATE** Thanks to Tamil I updated the code as follows:               class Main_Nav extends Walker_Nav_Menu {             function start_lvl(&$output, $depth) {                 $indent = str_repeat("\t", $depth);                 $output .= "\n$indent
\n";             }             function start_el(&$output, $item, $depth, $args) {                      if( $depth == 0) {                         $output .= "
";                 }                                if( $depth == 1) {                         $output .= "
";                 }                 $attributes  = '';                 ! empty( $item->attr_title ) and $attributes .= ' title="' . esc_attr( $item->attr_title ) .'"';                 ! empty( $item->target )and $attributes .= ' target="' . esc_attr( $item->target ) .'"';                 ! empty( $item->xfn )and $attributes .= ' rel="' . esc_attr( $item->xfn ) .'"';                 ! empty( $item->url )and $attributes .= ' href="' . esc_attr( $item->url ) .'"';                      $title = apply_filters( 'the_title', $item->title, $item->ID );                      global $wpdb;                 $query = $wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status ='publish' AND post_type='nav_menu_item' AND post_parent=%d", $item->ID);                 $child_count = $wpdb->get_var($query);                      if($child_count > 0) { /* THE MENU ELEMENT HAS CHILDREN */                      $item_output =                          ""                         . $title                         . ' ';                 } else {                         $item_output =                          ""                         . $title                         . ' ';                 }                      $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth);              }          }      No luck though :(


title: How to check my WordPress.org site MySQL queries generating items?

text: My WordPress site generate hughes MySQL queries. As a result of that I got "Error establishing connection to database". I use a shared hosting. When I check error logs on my host (cpanel) it shows some plugins generate huge errors. When I'm asking it from that plugin developer, he mention that it should be your theme issue, because of that plugin not generate MySQL queries. So how do I check all of my blog MySQL queries generating items (theme, plug in, etc)? If those plugins generated errors as a result of my theme issues, can I fix them without changing theme? I'm not familier with coding. :( . Thanks!


title: modify wordpress custom field value - strip character if exists

text: Does anyoone know if its possible to check a custom field value for a character such as a currency symbol and then remove it from the field value so that the field contains a numerical value, not an alphanumercial / text value ? If so, what would be the best approach for this ? The field auto updates so it would need to be some kind of regular conditional test and modification - is there a way to attach the test to trigger when the field updated ? Maybe this would require some kind of field mapping ?


title: General Setting Allow Multiple Email Notification

text: WordPress Version: WordPress 3.2.1 Settings -> General http://www.example.org/wp-admin/options-general.php I would like to have multiple email address in the Email Address textbox. I tried abc@abc.com, xyz@xyz.com, after I save it. It become abc@abc.comxyz@xyz.com How can I allow multiple email on that field? We need this function because we have multiple admin in the website.


title: WordPress MultiSite Paste from Word Tool Does not work

text: We're using multisite and pages/posts will not paste from word using the paste from word tool. I've tried everything imaginable, disabled theme (no plugins or network plugins enabled) We've tried paste in the editor, paste within plain test, paste within paste from word. We've created a new site (which works) then copied the content from this post page into the original site. Nothing works at all. Has anyone else had this issues, and if so, found a solution? Summary:   * 'Paste from word' tool does not work   * 'Paste as plain text' tool does not work   * Using the aforementioned tools works when creating a new site; however, it does not work in the original site if you copy and paste from the new site to the original site(hopefully that makes sense)   * no network activated plugins are enabled   * no local plugins enabled What it's doing: the content pasted into the editor, once you hit Publish, Update, or Save Draft - any action to save- the content all vanishes. Making a whole new site is a solution, but it's not really an answer to the problem I'm facing so while i realize that's a bandaid I'd like to resolve this issue properly. Thanks to anyone who may have any insight!


title: Displaying child page content of a certain parent

text: What I would like to do is to create a WP loop that will display info from a child page of an adult page ID, so the Page ID is 2. I would like to pick a page ID to display what page. So that way I could display information from another child page on an alternative page. Owen


title: Is it safe/recommended to use wp_enqueue_script function outside the functions.php file?

text: I created multiple post formats, and when i use an audio post format, i want to include some additional javascript for the audio player. So, i include the content-audio.php like this:               <?php while ( have_posts() ) : the_post(); ?>         <?php get_template_part( 'blog/content', get_post_format() ); ?>     <?php endwhile; ?>      This loads the blog/content-audio.php as expected:               <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>         <?php         $att_args = array(             'post_type'      => 'attachment',             'numberposts'    => 1,             'post_status'    => null,             'post_parent'    => $post->ID,             'post_mime_type' => 'audio',             'orderby'        => 'menu_order'         );         $attachments = get_posts( $att_args );         if( $attachments ): ?>             <?php wp_enqueue_script('mediaelement-js'); ?>             <?php foreach( $attachments as $attachment ): ?>                 <?php $attachmenturl=wp_get_attachment_url($attachment->ID); ?>                 <audio id="player2" src="<?php echo $attachmenturl; ?>" type="audio/mp3" controls="controls"></audio>                <?php endforeach; ?>         <?php endif; ?>         <?php the_title(); ?>     </article>      Can i use the wp_enqueue_script() function inside this file? It's working fine, but i'm curious if this is the right way to do it.


title: Testing for addon plugin activated

text: I am creating a plugin which will also have a few addons. I am adding settings tabs for the addons, but I want to make a conditional check in the main plugin to prevent those tabs from showing if the addon plugin is not active. There is the function is_plugin_active() which can be used easily for this check, but what if the user decides to change the folder name of the plugin? Then the check will not work correctly? Should I implement some kind of other more robust check?


title: Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script

text: I think i've almost got my head around this ajax is Wordpress business, thoroughly ejoying learning it but i'm now totally stumped. First up is the nasty bits! I have these in my main plugin file:               wp_enqueue_script( 'function', plugin_dir_url( __FILE__ ) . 'function.js', array( 'jquery', 'json2' ) );     wp_localize_script( 'function', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );          add_action('wp_ajax_nopriv_pfxconversion', 'pfxconversion');      Here is what's is function.js               $(document).ready(function() {              $("#convert").click(function () {                     var from = $("#from").val();                     var to = $("#to").val();                     var amount = $("#amount").val();              //Make data string          var dataString = "amount=" + amount + "&from=" + from + "&to=" + to;                   $.ajax({                type: "POST",                action: pfxconversion,                url: MyAjax.ajaxurl,                data: dataString,                success: function(data){                     $('#result').show();                      //Put received response into result div                 $('#result').html(data);                }              });         });     });      and here is the function that I know works perfectly outside of Wordpress.               function pfxconversion () {     //Get Posted data     $amount = $_POST['amount'];     $from = $_POST['from'];     $to = $_POST['to'];          //make string to be put in API     $string = "1".$from."=?".$to;          //Call Google API     $google_url = "http://www.google.com/ig/calculator?hl=en&q=".$string;          //Get and Store API results into a variable     $result = file_get_contents($google_url);          //Explode result to convert into an array     $result = explode('"', $result);          ################################     # Right Hand Side     ################################     $converted_amount = explode(' ', $result[3]);     $conversion = $converted_amount[0];     $conversion = $conversion * $amount;     $conversion = round($conversion, 2);          //Get text for converted currency     $rhs_text = ucwords(str_replace($converted_amount[0],"",$result[3]));          //Make right hand side string     $rhs = $conversion.$rhs_text;          ################################     # Left Hand Side     ################################     $google_lhs = explode(' ', $result[1]);     $from_amount = $google_lhs[0];          //Get text for converted from currency     $from_text = ucwords(str_replace($from_amount,"",$result[1]));          //Make left hand side string     $lhs = $amount." ".$from_text;          ################################     # Make the result     ################################          echo $lhs." = ".$rhs;exit;     }      The problem is I don't get the result from my function / ajax request printed out in the #result div Any help is greatly appreciated. **Edit** I'm now getting a -1 value in #result, after changed my js from $ to jQuery - Firebug was reporting an error ($ is not a function). **Edit 2** I'm pretty certain I have the action right now but i'm still getting an output in #result of -1:               jQuery(document).ready(function() {              jQuery("#convert").click(function () {                     var from = jQuery("#from").val();                     var to = jQuery("#to").val();                     var amount = jQuery("#amount").val();              //Make data string          var dataString = "amount=" + amount + "&from=" + from + "&to=" + to;                   jQuery.ajax({                type: "POST",                url: MyAjax.ajaxurl,                data: "action=pfxconversion"&dataString,                 success: function(data){                jQuery('#result').show();                      //Put received response into result div                 jQuery('#result').html(data);                }              });         });     });


title: Send automatic email to user after wp_create_user

text: So, here is some code I came up with -- It works, but now I need it to send the username and password it generated to that email address automatically ?? Also the first and last name isn't recording ?? Thanks!!               require('wordpress/wp-blog-header.php');          $user_email = trim(isset($_POST['payer_email']) ? $_POST['payer_email'] : "");     $user_name = trim(isset($_POST['first_name']) ? $_POST['first_name'] : "");          $user_id = username_exists( $user_name );     if ( !$user_id ) {         $random_password = wp_generate_password( 12, false );         $user_id = wp_create_user( $user_name, $random_password, $user_email );     } else {         $random_password = __('User already exists.  Password inherited.');     }


title: Solution for Wordpress URL structure changes and 301 redirects?

text: After a major site review, we've created a new link and category structure to better accommodate URLs and content for the long-term. While we roll out the change, we need to avoid broken links and SEO issues because our category structure is changing. While best practice is to implement a 301 redirect, is there a solution to automatically redirect all previous categories? Or at least handle it in an efficient way within Wordpress Admin? **Why this isn't a duplicate:** This is focused on category changes, not just a few changed URLs. Thanks.


title: Plugin to restrict non-admin user to existing tags

text: Is there a plugin that would restrict non-admin users to only existing tags? I could have used categories for this, but it will be difficult to display with a large population (~1000) of tags.


title: Wordpress custom URL htaccess not working

text: I am having a URL in wordpress which needs to be changed. `http://www.somedomain.com/site/other-jobs/view/?action=view&title=php- developer&JOB_ID=158` I want to make this URL to look something like this: `http://www.somedomain.com/php-developer/158` I tried putting htaccess rule:               RewriteEngine On     RewriteRule ^([^/]*)/([^/]*)$ /site/other-jobs/view/?action=view&title=$1&JOB_ID=$2 [L]      But this is not working, can anyone help me in this?


title: What is the difference between wp_register_sidebar_widget and register_widget?

text: What's the difference between them and when should we use each one ? I'm using `wp_register_sidebar_widget` right now and it's working fine but I've seen a lot of tutorials online on how to create a widget using register_widget and a class, most of my widgets doesn't need options so should I stick to `wp_register_sidebar_widget` or should I use `register_widget` even if I don't have a form ? thanks in advance.


title: Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?

text: The context is the [caption] shortcode found in media.php which contains `img_caption_shortcode` img_caption_shortcode also includes these lines:                $output = apply_filters('img_caption_shortcode', '', $attr, $content);      if ( $output != '' )      return $output;      I'm trying to manipulate the output the caption shortcode and it struck me that I could filter the function or I could add_shortcode to replace it - is there any difference? and if so what would are the tradeoffs? Many thanks in advance.


title: admin_enqueue_scripts not rending JS file correctly

text: I'll keep this short and sweet, I want to load a JS file in the admin panel as part of my plugin, and through tons of research I have a few different options that have all ended with the same problem that no one else seems to be experiencing so finally I'm posting for a solution here. When I use the following code I get an error:               function register_scripts(){         wp_register_script('payee',plugins_url('iBudget/modules/payee/payee.js',__FILE__));     }     function payee_init($hook){         wp_enqueue_script('payee');     }          add_action ("admin_print_styles-post.php", "payee_init");     add_action ("admin_init", "register_scripts");      ERROR: /wp- content/plugins/iBudget/modules/payee/iBudget/modules/payee/payee.js/?ver=3.3.1:1 **Uncaught SyntaxError: Unexpected token <** No matter how I attempt to enqueue the scrip I get this error even though the JS file simple says: alert("test"); Now the interesting nugget is this, if I include the JS directly in the function everything works fine:               function payee_init($hook){     ?>     <script>         alert("test");     </script>     <?     }     add_action ("admin_print_styles-post.php", "payee_init");      Basically I need to know why this error is coming up, I believe I'm loading the script correctly for what I need but not sure why this conflict is there and not even sure where else to look for a solution. Thanks guys!


title: Remove WordPress Toolbar buttons

text: Is there anyway to remove the 'W' icon from the WordPress toolbar located at the top, when Authors login? I know that an author can uncheck an option for an individual user, but we need to do this for all users?


title: Save the Post ID from wp_insert_post($post); into a text file?

text: I'd like to create some posts using wp_insert_post and then save the created posts' Titles and ID's into a text file for future reference. How could this be done?


title: How to style current page number (wp_link_pages)?

text: When a post is split on more pages TwentyTen theme use the native function `wp_link_pages` to display a navigation page bar at the end of post. I am trying to style those elements for my theme, but unfortunately it seems that the current page number cannot be styled. I imagine that I should override the `wp_link_pages` function but I am still learning the basic of WP programming. Can you help me identifing the steps to follow to solve this problem?


title: Any Cool Wordpress Theme Editor?

text: I am looking for wordpress theme editor, Is there any Cool Wordpress Theme Editors available for free??If you have worked with share your experiences here .. And also the links to download them with why is that editor is the best one or better one ??


title: Embed a page within WordPress dashboard?

text: We're using Facebook Comments for the comment functionality on our WordPress blog. I thought it'd be nice to embed the page with Facebook Moderation tools on the WP Dashboard. That way, we can immediately see who commented on what when we log in. I've looked for the functionality to embed an html page in a dashboard widget but I haven't managed to find something. Does anybody know if this is possible?


title: List users with the most total posts view

text:
I'm asked by my friend to create a widget for his multiauthor blog. He wants to list 3 authors with the most total post view from their posts. I've got the job done for the post view using post metadata. But I'm confused on querying the authors with that criteria. Any idea? Thanks for the help. [update] I'm using this codes and its work. Is there any simpler version?                   global $wpdb;         $topuser = array();              // query all posts by each user         $users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");          foreach ( $users as $user ) {                    $query = get_posts( array('author' => $user->ID ));             $counter = 0;                  // get each post of a user             foreach ( $query as $post ){                 $views = absint( get_post_meta( $post->ID, 'post_views_count', true ) );                 $counter += $views;             }             $topuser[] = array( 'id' => $user->ID, 'views' => $counter);             wp_reset_query();         }              // function to sort array based on views count         function sortViews($a, $b) {             return $b['views'] - $a['views'];         }         usort($topuser, 'sortViews'); // sort the array         $output = array_slice($topuser, 0, 3); // slice the array by limit 3              // output the result: user, total postview count, latest post         foreach ($output as $user){             $profile = get_userdata($user['id']);             $query = get_posts( array('author' => $user['id'], 'numberposts' => 1 ));                  echo '
' . $profile->user_nicename .' ('. $user['views'] .')
';                         foreach ( $query as $post ){                 echo 'post_name . '">' . $post->post_title . '';                 echo get_post_meta($post->ID, 'post_views_count', true);             }         }


title: Not sure the best way to save custom plugin data

text: Doing my first plugin with 3.1 Everything is great, but I need to store the data now. My data is sufficiently complex that it requires custom tables (as opposed to options). So now I am wondering how I save the data. Normally, I would just create a processing page to handle it, but that doesn't seem like the best way within the WP API. How do I go about saving my form data from my plugin settings page into my custom tables? Thanks! EDIT: To clarify, I know how to code it, I am not sure architecturally the best way to do it.


title: Force category choice before creating new post?

text: How can I force the user to first choose a category before continuing to the editor when creating a new post? I want to set some default content, but this is based on the category, so I need to know that before showing the editor (unless I do some fancy Ajax stuff, but in this case I don't want to do that).


title: Escaping date string in url with wordpress

text:
I am creating a Wordpress page that searches through posts based on a date variable that is set through a _GET variable. I want to make sure that I am doing this in the best way possible and that I sanitize the input correctly, I haven't worked with sanitizing php much. Here is the code I have and it functions properly. The format I need the variable in is "Monday December 17 2012" Is there more I should be doing to sanitize the GET variable? Let me know if I need to explain anything further. Thanks in advance!               if ( isset ( $_GET['new_date'] ) ) {     $display_date =$_GET['new_date'];     } else {     $display_date = date( 'l F j Y');     }          $next_date = date('l F j Y', strtotime('+1 Day', strtotime($display_date) ) ) ;     $prev_date = date('l F j Y', strtotime('-1 Day', strtotime($display_date) ) ) ;     ?>

<?php echo $display_date ; ?>
     <a class="prev-day" href="<?php echo $_SERVER['PHP_SELF'] . '?new_date=' . urlencode($prev_date);?>"><?php echo $prev_date; ?>     <a class="next-day" href="<?php echo $_SERVER['PHP_SELF'] . '?new_date=' . urlencode($next_date);?>"><?php echo $next_date; ?>


title: Appending a GET-Variable to wp_nav_menu

text: I'm creating a menu with the wp_nav_menu() function. Now I'd like to add a GET variable to the end of ever link in the menu, like this: www.mysite.com/page/?variable=123 Is there any way I can do this when using wp_nav_menu? Thanks for your suggestions


title: Or operators in PHP

text: can anyone advise what i'm doing wrong here? I'm trying to load a jQuery function IF the page isn't using a template OR if it's not a single OR if it's not an archive. I have the below...               <?php if ( ! is_page_template('modelPages.php') || ! is_archive() || ! is_single ) { ?>      But it doesn't seem to work... HOWEVER if I remove the or operators and subsequent rules, the function doesn't load (which is correct) on the modelPage.php templates. How should i be writing this rule? Thanks


title: Which asset URLs are acceptable in a "vanilla" MU install?

text: Wordpress appears to let content be addressed by many URIs in an MU install. For example:                example.com/wp-content/blogs.dir/5/files/picture.jpg      example.com/bob/files/picture.jpg      example.com/bob/wp-content/blogs.dir/5/files/pictures.jpg      All appear to route to the same place. Are there more aliases? Which one is canonical? Are any of these accidental? Are there relevant filters?


title: Edit Imported advanced Custom Fields from wordpress Dashboard

text: I have imported advanced custom fields from one of my other site and now I want to add few more options to those fields but I can't figure out how to do it via **Dashboard**? I have imported the field using **php** export/import option of the plugin. Is there anyway that imported fields shows up in Field Groups section in Dashboard?


title: Duplicated CSS files using wp_enqueue_style()

text: I've noticed that in the source code of my website there is Font Awesome loaded five times. Loaded versions are 3.2.1, 4.0.1, 4.1.0 and more. Shortcodes plugins, page builders, the theme and/or plugins designed to load Font Awesome like Better Font Awesome load its own version of this. The theme I'm using loads it this way:               wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css', array(), '4.1.0' );      But its previous version used to use this:               wp_enqueue_style( 'themename-fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css' );      Plugins use various hooks and formats:               wp_enqueue_style( 'pluginname-fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css', array(), '4.0.1' );     wp_enqueue_style( 'pluginname-fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css' );     wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css', array(), '3.2.1' );     wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css' );      I'm developing a plugin and I initially wanted to load Font Awesome with this:               wp_enqueue_style( 'my-plugin-name-fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css', array(), '4.1.0' );      But then I came to conclusion that the most correct way to load it would be this:               wp_enqueue_style( 'fontawesome', get_template_directory_uri() . '/css/fontawesome/font-awesome.min.css', array(), '4.1.0' );      Can someone confirm what would be the best naming standard for loading this in my plugin and if it's possible at all to stop other plugins from loading their versions of that if my version is the newest one? I don't want to have Font Awesome loaded 5 times (30kB each) and some older versions should not be loaded but I'd like to keep using the theme, shortcodes plugins and page builders that I'm currently using.


title: How to delete outdated, wrongly sized images in _wp_attachment_metadata?

text: I've got several custom image sizes for my blog. One of these is setup as `add_image_size( 'slide', 640, 290, true );`. These are used in a header slideshow. My problem is I've upped the dimensions of this size **after** many of them were originally created, and many of the attached post images are too small to be cropped to these new values (i.e. not even 640px in the first place). So when I call up images of this size, many of them are of the old dimensions (e.g. `s:5:"slide";a:4:{s:4:"file";s:52:"6a00d8341c630a53ef011570180a91970b-800wi-300x290.jpg";s:5:"width";s:3:"300";s:6:"height";s:3:"290";}`. I can't use images that are this small, but no correctly sized image are overwriting these, as per above. The desired behavior is that no image would be stored for `size` slide instead of the old, small ones. How can I delete these image entries in _wp_attachment_metadata? Do I do delete everything in the `sizes` sub-array and regenerate everything?


title: Conflict in function to allow single post template based on category

text: I've used Justin Tadlock's great function for category specific custom post templates many times, where you can use **single-cat-id.php** for single posts belonging to a specific category. I just ran into a problem though working on a new site that needs to use the **single-{posttype}** template for a custom post type. The function seems to prevent the custom posts from using **single-{posttype}** template. **Here's the applicable code:**               /* Define a constant path to our single template folder */     define(SINGLE_PATH, TEMPLATEPATH . '/single');          /* Filter the single_template with our custom function*/     add_filter('single_template', 'my_single_template');          /* Single template function which will choose our template*/     function my_single_template($single) {         global $wp_query, $post;          /* Checks for single template by category. Check by category slug and ID */     foreach((array)get_the_category() as $cat) :              if(file_exists(SINGLE_PATH . '/single-cat-' . $cat->slug . '.php'))             return SINGLE_PATH . '/single-cat-' . $cat->slug . '.php';              elseif(file_exists(SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php'))             return SINGLE_PATH . '/single-cat-' . $cat->term_id . '.php';          endforeach;          /*Checks for default single post files within the single folder */     if(file_exists(SINGLE_PATH . '/single.php'))         return SINGLE_PATH . '/single.php';          elseif(file_exists(SINGLE_PATH . '/default.php'))         return SINGLE_PATH . '/default.php';          return $single; }      Any thoughts on how to modify the following code to allow both the original function of **single-cat-id** as well as **single-{posttype}**?


title: Is there any way of copy/pasting, duplicating, or auto-generating posts for fast testing?

text: I always find myself creating posts every time to test layout or design. For example, I create stuff like: > Content 1 > > Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy > nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut > wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit > lobortis nisl ut aliquip ex ea commodo consequat. 6 times. Is there a fast way of copy pasting posts, duplicating them or auto-generating them, perhaps?


title: Display images uploaded to post on the post edit screen

text: Does anyone know if it is possible to display an image which has been associated with a post on the post edit page without clicking on the media gallery and selecting the drop down option 'uploaded to this post'. This would be similar to how the featured images feature works, but it would display all images associated with the post.


title: Masonry imagesLoaded javascript error

text: After enqueing scripts as per WP codex and WP Beginner tutorial the site has a Javascript error: Uncaught ReferenceError: imagesLoaded is not defined Many others also have this problem. Link: http://www.wpbeginner.com/wp-themes/how-to-use-masonry-to-add-pinterest- style-post-grid-in-wordpress/


title: Translate database content using __($message) function

text: I've written a plugin that allows users to add information in the database. It runs well but I can't translate the information using WPML. This is a simple example of the problem: $message = 'test'; // here I get the information of the DB   __($message, 'my-plugin'); Is there a way to workaround this problem? I don't know if we can use a variable instead of a string to translate. When I analize the widget in the Admin panel it don't show the string to translate. This example works in WPML because is a string: __('test', 'my-plugin'); Thanks in advance.


title: URL Rewriting from a Plugin based on custom values

text: I am developing a plugin where Admin can integrate the plugin to a page where newly added products will be shown.. So, let's say user add the plugin to a page named `my-page`. So, the main content of the plugin will be shown in `mysite.com/my-page/` Users can upload products and their uploaded products will be shown in `mysite.com/my-page/user/user-name` The admin will have the ability to add custom fields to the products. If admin create a custom field named `category`, `mysite.com/my-page/category/category- name` will show all the products with the `category`, `category-name`. All the pages will also have pagination support to restrict products per page. So, I need to create a rewrite rule on fly, every time Admin create a new custom field. I know how to rewrite URL and add custom query variables but in this case I don't know the page name where it will be inserted and custom fields will be inserted in the database. So, basically I need dynamic URL rewriting. Is this kind of rewrite possible?


title: Localization: Textdomain of Child teme

text: I am creating a series of WP child themes which are dependent of a parent theme which I will be using as a framework. I need to have these themes (both parent and children) localized. from http://codex.wordpress.org/Function_Reference/load_theme_textdomain I understood I need to add the following to my theme:               add_action('after_setup_theme', 'my_theme_setup');     function my_theme_setup(){         load_theme_textdomain('mytextdomain', get_template_directory() . '/lang');     }      this goes in the functions.php, I suppose however, what about children themes? functions.php of a children theme overrides functions.php of a parent theme should textdomain ("mytextdomain") of the child theme be the same as parent theme or be different (and also call load_theme_textdomain function with a different function name (see above code "my_theme_Setup()")? what is the correct way of localizing both a parent and child theme? thank you for clarifying this :)


title: Rewrite rules in .htaccess get overwritten?

text: I'm not able to make it work by adding custom rewrite rules into `functions.php` or adding custom permastructures either. I have this code in my `.htaccess` that is working fine.               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     # BEGIN IPHONE RULES     RewriteRule ^mobile/([^/]+)$ mobile/index.php?action=$1 [QSA,L]     # END IPHONE RULES     # BEGIN PDF RULES     RewriteRule ^certificates/30-Days-Certificate-([0-9]+)$ pdf/index.php?type=30day&period=$1 [QSA,L]     RewriteRule ^certificates/12-Month-Certificate$ pdf/index.php?type=12Month [QSA,L]     # END PDF RULES     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      But every once a while it gets refreshed to defaults and I lose the iPhone and pdf rules. The mobile is called like this `/mobile/progress?userId=22&date=2011-02-21` where `progress` is the action and the others are just query vars. On the `.htaccess` is working fine but I can't manage to make it work by adding custom rules. Any help will be much appreciated.


title: Plug-in for gallery with thumbnails?

text: Does anyone know of a galley plug-in which would have this kind of functionality?               -------------------------------------------     |                                         |     |                                         |     |                                         |     |                                         |     |                                         |    <-image shows whatever thumbnail is clicked     |                                         |     |                                         |     |                                         |     |                                         |     |                                         |     -------------------------------------------     -----  -----  -----  -----  -----  -----     |   |  |   |  |   |  |   |  |   |  |   |    <-thumbnails     |   |  |   |  |   |  |   |  |   |  |   |     -----  -----  -----  -----  -----  -----      Ideally, it would allow separate galleries on each page. And load the pictures when you click a thumbnail, without reloading the whole page.


what are the differences between wp_users and wp_usermeta tables? i use wp-email-login plugin and i just noticed that if a user change his email in the profile page it saved in the wp_usermeta table and not in the wp_users table, this is a problem cause the user have to use the first email to login successful, if he use the new (changed) email he can't get access. does anyone here can explain me why and how i can save the user email in the wp_users table? thanks a lot


title: Shared User Tables on 2 WordPress Sites; "Main" Site and "Discuss" using P2?

text: Hoping to benefit from the experience of others. This question is really multiple potential questions so I'm hoping someone can steer me to the best solution to keep me from all the trial and error. ### Background So I have set up a WordPress v3.0.3 site currently with about 20 users and about 25 pages of content and I realize I needed a discussion forum for which I think the **P2 Theme** will work really well. I installed another copy of WordPress in the `/discuss/` subdirectory and then went about trying to share the user tables by setting `CUSTOM_USER_TABLE` and `CUSTOM_USER_META_TABLE` only to find that setting those constants are not sufficient because of issues with the `COOKIE_DOMAIN` and `COOKIE_PATH`, issues with capabilities that would require hacking core to fix, and it seems lack of support from the core team for multiple sites with the same user tables. So I fear heading down a rabbit hole of lost time trying to make this work. So I thought maybe Multisite would be the solution which is unfortunately something that I've had very little experience with yet. However it seems that I can't just convert to multisite _(according to @EAMann)_ but instead need to create a new install and then rebuild from there. Not knowing what that will break _(i.e. will my users roles and capabilities transfer? Will the members plugin I'm using work? Are there any other concerns?)_ I'm also afraid to take that path unless I know it'll work well. ### Summary So in summary, what's the best way to get a site set up to have a main site and to use the P2 Theme for discussions in a subdirectory of the main site, to be able to use one user database and ideally to have a single login? _(though single login is the least important consideration at the moment.)_ Thanks in advance for the help.


title: How to edit comment_reply_link

text: I was editing a wordpress theme. Where i need to replace default wp login link with custom login link. Problem is, `comment_reply_link()` function is returning the default link. And i dont want to edit wp-include/comment-template.php Is there any other way, so that without manipulation of any wordpress file i can replace the default login url. I already had tried               apply_filters('login_url', $login_url,get_permalink());      before `calling comment_reply_link()`. But it is not filtering resulting URL.


title: Add filename to attachment page url

text: I wan to change my premalinks to attachment pages from `http://example.com/.../attachemnt/something` to `http://example.com/.../attachemnt/something/something.jpg` It should simply add filename but with nice url, I tried with add query arg() but this builds url query like `?name=something.jpg`. Is there solution to achieve this without hard coding anything to wordpress?


title: How to Configure Events List in Wordpress to Disappear Event Once Date is Past

text:
I currently have some code setup to display upcoming events set by the admin based on the date of the event. The upcoming events are sorted by the next upcoming event, starting from the top, and then going down. I've limited it to just two. But, when the start of the day comes (e.g. midnight of event date), the event disappears. **I'd like the event to still show through midnight of the next day (e.g. the start of the next day).** Right now, the event is disappearing the second that the day of the event comes... Does anyone know how to change this with the current code that I have?

Upcoming Events
     <?php     //The Query     query_posts(array(     'posts_per_page' => 2,     'meta_key' => 'event_date',     'meta_value' => date('Y-m-d'),     'meta_compare' => '>',     'orderby' => 'meta_value',     'order' => 'ASC'     ));          //The Loop     $count = 0;     while ( have_posts() ) : the_post(); $count++;     //The Title     $title = $post->post_title;     $event_datee = get_post_meta($post->ID, 'event_date', true);     ?>

<a title="<?php echo $title; ?>" href="<?php the_permalink(); ?>"><?php echo $title; ?>

     <div class="month m-<?php $dtes = get('event_date'); $timestamp = strtotime($dtes); echo date('n', $timestamp); //month ?>">
     <div class="day d-<?php $dtes = get('event_date'); $timestamp = strtotime($dtes); echo date('d', $timestamp); //day ?>">
     <div class="year y-<?php $dtes = get('event_date'); $timestamp = strtotime($dtes); echo date('Y', $timestamp); //year ?>">

<?php the_excerpt(); ?>

     <?php endwhile; ?>
      Thanks for your help!


title: Incorrect search results in search.php – issue triggered by using `define('BodyID', 'search'); the_post();` in search.php

text:
I have a problem where the page title is not picked up in search results. I've narrowed the problem down to the following line of search.php in my custom theme. `define('BodyID', 'search'); the_post();` When I include the above line, page titles are not picked up in search results, and when I take those lines out and run a search query I get the expected search results. Any idea why this could be interrupting the search? The full code for search.php is below.               <?php     define('BodyID', 'search'); the_post();     include(TEMPLATEPATH."/inc/header.php"); ?>

                 <?php if ( have_posts() ): ?>
Search Results for '<?php echo get_search_query(); ?>'

                 <?php while ( have_posts() ) : the_post(); ?>

<a href="<?php esc_url( the_permalink() ); ?>" title="Permalink to <?php the_title(); ?>" rel="bookmark"><?php the_title(); ?>
<a class="more-link" href="<?php esc_url( the_permalink() ); ?>" title="Permalink to <?php the_title(); ?>" rel="bookmark">Read more…

             <?php endwhile; ?>
             <?php custom_page_navi(); ?>             <?php else: ?>
No results found for '<?php echo get_search_query(); ?>'

Please try another search, or return to the home page.
             <?php endif; ?>

<?php     include(TEMPLATEPATH."/inc/footer.php"); ?>      And here's the relevant part of header.php which sets the body ID. This is the top few lines.               <?php     # Create Body ID     (BodyID == "" || BodyID == "BodyID") ? $body_id = "page" : $body_id = BodyID; ?>     <!DOCTYPE html>     ...      Thanks.


title: Add theme support custom header will not hide text?

text: I am having problems with `add_theme_support('custom-header');` I can change the Header Text color but I **can't hide** my Header Text when I leave unchecked **"Show header text with your image"** inside admin panel (obviously it should hide header text if unchecked). I have no idea should I add some specific CSS for this to work or do I have to change my functions.php? Any thoughts or suggestions? My functions.php for header support looks like this:               //Code for custom header support     $defaults = array(     'default-image'          => '',     'random-default'         => false,     'width'                  => 750,     'height'                 => 100,     'flex-height'            => true,     'flex-width'             => true,     'default-text-color'     => '#FF0000',     'header-text'            => true,     'uploads'                => true,     'wp-head-callback'       => '',     'admin-head-callback'    => '',     'admin-preview-callback' => '',     );     add_theme_support( 'custom-header', $defaults );      CSS looks like this:               a:link, a:visited{     text-decoration: none;      color: #000000;     }          a:hover{     color: #5f5f5f;     }          h1{       font-size: 54px;     }          #header  h1{     position:absolute;     z-index:1;     padding:0px;     margin:0px;     }


title: Making pages in a menu appear conditionally

text: How do I make a page (dis)appear conditionally in a menu? I had something like this in mind:               if(condition)          //show_page_in_menu      I would prefer an answer that doesn't incorporate an external plugin.