How to display custom taxonomy and terms using/creating plugin template

I am working on a plugin which requires a custom taxonomy and 3 terms (Personal, Group & Pets). I already have the taxonomy set up with terms and some sample posts. I've created a template for my custom taxonomy which currently shows the same output for each category(term). I need the output to display only the posts within the current selected term. So if viewing from `example.com/user_image_category/group/` \- it should display only the posts for "group". **Please note** I'm trying to do this without touching the theme folder. And, I apologize if the code is a bit... gross, to say the least. I've pieced together a few things I've found but have fixed quite a bit - I usually deal with themes and SMALL plugins. plugin function:               add_filter('template_include', 'sui_user_image_cat_template', 99);                  custom taxonomy / category     function sui_user_image_cat_template( $template ) {         if ( is_tax('sui_image_category') ) {             $new_template = plugin_dir_path(__FILE__) . 'templates/taxonomy-user_image_category.php';             if ( '' != $new_template ) {                 return $new_template;             }         }         return $template;     }      `taxonomy-user_image_category.php`:               <?php     /**      * user_images_category taxonomy archive      */          get_header();           ?>

Contest Photos:

       <?php         // put these in UL LI format if time allows              $terms = get_terms('sui_image_category');         foreach ($terms as $term) {           $term_link = get_term_link($term, 'user_images');           if( is_wp_error($term_link) )             continue;           echo '' . $term->name . ' ';         }       ?>

     <?php     $c = 1; //init counter     $bpr = 3; //boxes per row                 $args = array(         'post_type' => 'user_images',         'post_status' => 'publish'           );            $posts = new WP_Query($args);              if($posts->post_count){                foreach($posts->posts as $user_image){             $user_info = get_userdata($user_image->post_author);                 $user_image_cats = get_the_terms($user_image->ID, 'sui_image_category');                  foreach($user_image_cats as $cat){               $user_image_cat = $cat->name;             }                  $post_thumbnail_id = get_post_thumbnail_id($user_image->ID);            ?>           <div class="contest-entry" id="post-<?php echo $post_thumbnail_id ?>">
               <?php echo wp_get_attachment_link($post_thumbnail_id, 'medium'); ?>

♥

                 <a href="<?php echo get_term_link($cat) ?>">                   <?php echo $user_image_cat ?>

<?php echo $user_image->post_title ?>
             <?php echo $user_info->user_login ?>
                <?php if($c == $bpr) : ?>

                <?php $c = 0;             endif;           ?>         <?php           $c++;         }         };          ?>

          <?php get_footer(); ?>


How to pass an array as attribute of shortcode to work properly shortcode parser?

`echo '[test attr="'.json_encode(array('test'=>'my[][dfd]dfds[][][')).'"]';` //How to safe pass the array as attribute in shortcodes ?


Switch from Beta to Stable workaround

So, I am currently running the WordPress 3.5-beta2-22265 version on a new site i'm testing. Now, it's about time to go live and I was wondering what should I do in order to get back to the stable version, avoiding the re-installation process all over again. If I stick to this beta release for now and delete the Beta Tester plugin, can I upgrade to the stable 3.5 version of WP when it hits the release? Is anything else I should worry about?


Date calculations from 2 custom fields

We are struggling to find a way to calculate a time difference between two dates saved as custom fields on WP. We are actually using two different plugins: a) Easy Content Types b) Advanced post list With the first we have created a series of custom fields containing start (ecpt_data-consegna) and end (ecpt_data-dismissione) dates, and we would like to find a way to show the time difference between those dates - shown as XX years, XX months, XX days - in a cell of a table generated through the Advanced Post List plugin. Please note that shall the eding date be missing, the difference should be calculated between the starting date and the current date (now). After much chatting with both plugins' developers, we came to a standstill. Currently we have developed a custom PHP function to handle the date calculations as follows:               function calculateDiff() {     $start_date = new DateTime(get_post_meta( get_the_ID(), 'ecpt_data-consegna', true ));     $since_start = $start_date->diff(new DateTime(get_post_meta( get_the_ID(), 'ecpt_data-dismissione', true )));          if($since_start->days == 0) {             $since_start = $start_date->diff(new DateTime());     }          return $since_start->y . ' years, ' . $since_start->m . ' months, ' . $since_start->d . ' days'; }      But when we put this APL shortcode inside one of the APL-generated cells:               [php_function name="calculateDiff"]	      The result is a broken web page, cut off before the generation of the table itself. And when we try to use this code instead:               <?php echo calculateDiff();?>	      The result is a blank cell. We have also tried to call the function directly (outside APL) and the result is always a blank. So there must be something wrong somewhere... Any help would be greatly, greatly appreciated!


Create pages for authors

I have a pretty good question here. I would like to create a hidden page on my wordpress blog for each user as they are registered. I already have most of the code of what needs to be put on the page with a simple shortcode. All I need is something to actually make the page. Here is some of my code.               <?php     function added($user_id)     {     global $wpdb;          // Create a page for the user with certain settings     // WHAT DO I PUT HERE!?     }     add_action( 'user_register', 'added' );          function author_page($atts, $content = null)     {         // Some code here on what to output on the page...     }     add_shortcode( 'author', 'author_page');     ?>      Well, that's pretty much what I've got with about 350 lines of code in the author_page function and some other stuff that the plugin will do. All I need to do, is in the `// WHAT DO I PUT HERE!?` bit, I need some code that will allow me to create a page, under the subheading authors, make it not seen on the dropdown of that menu page, and then put the shortcode `[author id="1 or whatever it is"]Some description of the Author, or could be left out...[/author]` on the page.


Settings API - creating reusable form elements?

I have a set of settings fields:               (...)     add_settings_field( 'Option1', 'Option 1', 'textarea', 'page1', 'plugin_options');       add_settings_field( 'Option2', 'Option 2', 'textarea', 'page1', 'plugin_options');      add_settings_field( 'Option3', 'Option 3', 'text_input', 'page1', 'plugin_options');       add_settings_field( 'Option4', 'Option 4', 'text_input', 'page1', 'plugin_options');     (...)         All tutorials and Codex state that I have to create separate rendering functions for each settings field, but wouldn't be it much easier to create just basic functions for all input fields like checkbox, radio button, textarea etc. and reuse them? I believe it will work smoothly if I'll be able to pass fields id to these functions, but I'm not sure how?               function textarea() {         $options = get_option('my_settings');         echo "<textarea id='[how to get ID?]' name='my_settings[[how to get ID?]'>{$options['how to get ID?']}</textarea>";     }


Breadcrumbs - get the author?

I have my own function called breadcrumbs(). In it I call is_author() to determine whether I am on an author page. If true I would like to know _which_ author's page I am on. I tried the_author(), but nothing came up. I looked through the WP codex also. Can someone please help?


How to create rewrite endpoints it in author.php?

i'm trying to separate categories/subcategories in author.php so they each have their own endpoint link. It's very similar to this question BUT for the life of me I can't enable the plugin provided: How to set up sub-categories for author pages? The solution provided was this: https://gist.github.com/705545 I've downloaded the file, it's instructions say "enable this plugin" ... but when i put it in wp-content/plugins folder it doesn't show up on the list. I've tried putting it in a folder, and just putting the .php file in plugins folder. But it doesn't show up on the list. **How can I enable this?** or if you have any other ideas on how to achieve these results i'd greatly appreciate it. Thank you!


Get multiple custom type posts at once in edit.php?post_type request

I'm planing a custom post type functionality for my theme and need to be able to display more than just one `post_type` in a admin overview table. That request I imagine might look like `edit.php?post_type[]=theme_slide_nivo&post_type[]=theme_slide_other`. Haven't actually tried that but i'm pretty confident it won't work. So guys, is it possible to achieve such result without hacking core?


problem with implementing widget via the_content()

hey guys, I really need you help with this one. I'm using the subscribe2 Plugin (for email subscriptions). I want to show the signup form as a widget. The plugin author recommends doing it the following way.               $content = apply_filters('the_content', '<!--subscribe2-->');     $content = remove_filter('the_content', 'page_route');     echo $content;      this works fine, except for the fact that I'm additionally using the mingle plugin (kind of a social network plugin). Whenever I'm on a page of the mingle plugin (like /login, /register, /activity, etc.) the widget with the subscribe form suddenly displays the exact same content as the pages itself? Just weird! Any idea why that could happen? Or how I could prevent that! I really need a solution for that! edit: all filters mingle applies...               add_filter('get_avatar', array($this,'override_avatar'), 10, 4);     add_filter('get_comment_author_url', array($this,'override_author_url'));     add_filter('mngl-show-powered-by', array(&$this, 'show_powered_by'));     add_filter('the_content', array( &$this, 'page_route' ), 100);     add_action('wp_enqueue_scripts', array(&$this, 'load_scripts'), 1);     add_action('admin_enqueue_scripts', array(&$this,'load_admin_scripts'));     register_activation_hook(MNGL_PATH."/mingle.php", array( &$this, 'install' ));          // Used to process standalone requests (make sure mingle_init comes before parse_standalone_request)     add_action('init', array(&$this,'mingle_init'));     add_action('init', array(&$this,'parse_standalone_request'));     add_filter('request', array(&$this,'parse_pretty_profile_url'));          add_action('phpmailer_init', array(&$this, 'set_wp_mail_return_path'));     add_action('phpmailer_init', array(&$this, 'set_wp_mailer'));     add_action('admin_init', array(&$this, 'prevent_admin_access'));          add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));     add_filter('mngl-notification-types', array( &$this, 'add_notification_types' ));          add_filter('mngl-notification-types', array( $this, 'add_notification_types' ));     add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));     add_action('user_register', array(&$this, 'add_default_friends') );     add_filter('mngl-activity-types', array( &$this, 'add_activity_types' ));


limit selection of custom taxonomies to one?

I have a site with CPT (short for custom post type) "bagp_deals" and custom taxonomies "ba_locations" and "ba_cats" basically Its post type of "Deals" with "Location" and "Categories" as hierarchical taxonomies. On the default edit screen i want to limit the selection to just one of each (one location and one category) and i'm trying to do that with JQuery, i notice that the field custom taxonomy of ba_locations is named "tax_input[ba_locations][]" and so far i have this code:               jQuery("input[name=tax_input[ba_locations][]]").click(function () {         selected = jQuery("input[name=tax_input[ba_locations][]]").filter(":checked").length;         if (selected > 1){             jQuery("input[name=tax_input[ba_locations][]]").each(function () {                     jQuery(this).attr("checked", false);             });             jQuery(this).attr("checked", true);         }     });      witch is suppose to limit the checkbox selection to one. For some reason i can't get this to work. **The Question** So the question is why isn't this working ? or do you have a better solution to limit the selection to just one? any help is appreciated. ## update: this is the working code i used:               jQuery("input[name=\"tax_input[ba_locations][]\"]").click(function () {         selected = jQuery("input[name=\"tax_input[ba_locations][]\"]").filter(":checked").length;         if (selected > 1){             jQuery("input[name=\"tax_input[ba_locations][]\"]").each(function () {                     jQuery(this).attr("checked", false);             });             jQuery(this).attr("checked", true);         }     });


How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code               <?php echo do_shortcode("[standout-css3-button href='<?php     get_post_meta($post->ID, 'church-website-url', true); ?>']Church     website[/standout-css3-button]"); ?>      Does anyone know of some way to make this idea work? Thanks in advance.


Categories will only display links to posts

Hey I'm currently using the Titan theme for my website and I want each category to display each FULL posts for that particular category, but with my theme Titan this is not a option. I only get links for my categories. I don't know what pages and code to edit to change this. Right now I only get this when you click on a category. http://femalerappers.net/category/patwa/ A temporary fix for me has been to create pages and use the [[ post # ]] code in each individual page to display what I want on each page. Hope you can help so I can just use my categories and they automatically update on each category with full posts instead of just links. Thank you!


Multisite and domain name without www

I have a standard wordpress install at www.mydomain.co.uk. When I go to enable multisite I see the message: We recommend you change your siteurl to mydomain.co.uk before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like www.mydomain.co.uk but any links will not have the www prefix. I have an A record for mydomain.co.uk pointing to the web server IP. I also have the following vhost entry:               <VirtualHost *:80>         ServerAdmin myemail         DocumentRoot "/opt/bitnami/apache2/htdocs/mydomain.co.uk"         ServerName www.mydomain.co.uk         ServerAlias mydomain.co.uk         ErrorLog "/opt/bitnami/apache2/logs/mydomain-error.log"              <directory /opt/bitnami/apache2/htdocs/mydomain.co.uk>             Options FollowSymLinks             AllowOverride All             allow from all         </directory>     </VirtualHost>      I can view the site at http://www.mydomain.co.uk but not http://domain.co.uk so I think I am missing a configuration step. I haven't messed with multisite DNS in a while. Can anyone tell what I've missed? Wordpress version is 3.7.1 on an Amazon EC2 instance (i.e. not shared hosting)


Advanced WordPress search form based on custom taxonomy and custom meta value

I would appreciate if someone could help me out with the following issue. Here is the thing. I created two select boxes so I could filter and display posts from a custom post type based on two values - custom taxonomy and custom meta value. Here is the code that unfortunately won't render my posts.               <?php         $area = $_GET['area'];         $menu = $_GET['menu'];              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $args = array(             'post_type' => 'restaurants',             'posts_per_page' => 10,             'paged' => $paged,             'tax_query' => array(                 array(                     'taxonomy' => 'zones',                     'field' => 'slug',                     'terms' => explode(',', $area)                 )             ),             'meta_query' => array(                 array(                     'key' => 'zones',                     'value' => $menu                 )             )         );              $the_query = new WP_Query( $args );     ?>      I am developing a food online ordering system based on WordPress. My search form has two select boxes - Where do you live? and What do you want to eat? So when a user selects Where do you live? value, the form should filter posts based on that value (i.e. custom taxonomy). Users of my site can also select a value from the other select box What do you want to eat? and the form should be able to update posts based on that as well. Any hint or help would be greatly appreciated. Thanks a bunch!


How to query posts to include specific pages of one post type, and all pages of another post type?

I'm having trouble figuring out how to query all posts from the post type "events", as well as including four specific pages in the loop. If I use the "include" parameter, it only returns the specified pages. I figure I can use "exclude" to keep out what I don't want, but that's 50+ pages. Is there a more elegant way to do this?


Plugin (smart archives reloaded) crashed site / no access on admin panel

During a clean up of my plugins inside of WordPress i deactivated the: smart archives reloaded plugin. Next up: a fatal error when i refreshed the page.               Fatal error: Class 'SAR_Generator' not found in wp-content/themes/waldorf/functions.php on line 469          Plugin: Smart archives reloaded      So i couldn't access the site and also the wp-admin / control panel anymore. Before the clean up i downloaded the whole folder for a backup.   * i replaced this folder with the backupped version: no change   * replaced functions.php / wp-admin & wp-includes: no change   * checked my wordpress version: 3.5.1 downloaded a fresh wordpress 3.5.1 folder and replaced those wp-admin & wp-includes with the ones on the ftp: no change.   * followed this "Tutorial"   * Renamed plugin folder & add comments on error section in functions.php But all of those solutions didn't solve the problem Codes: SAR_Generator error in functions.php:               class SAR_Custom_Generator extends SAR_Generator {         // The list         protected function generate_list() {             $months_long = $this->get_months();                  $list = '';             foreach ( $this->get_years_with_posts( 'desc' ) as $year ) {                 foreach ( range( 12, 1 ) as $i ) {                     // Get post links for current month                     $post_list = $this->generate_post_list( $year, $i, "\n\t\t" );                          if ( !$post_list )                         continue;                          // Set title format                     if ( $this->args->anchors )                         $el = "h2 id='{$year}{$i}'";                     else                         $el = "h2";                          // Append to list                     $list .=                     html( $el, $months_long[$i] . ' ' . $year );                          $list .= html( 'ul', $post_list );                 } // end month block             } // end year block                  return html( 'div id="smart-archives-list"', $list );         }     }


doesn't save custom taxonomy terms

Have a little problem with wp_set_post_terms. there are 2 plugins: 1.there custom type               add_action('init', 'create_modification_type' );          function create_modification_type() {         register_post_type( 'modifications',             array(                 'labels' => array(                     'name' => __( 'Модификации' ),                     'singular_name' => __( 'Модификация' ),                     'add_new' => __( 'Добавить новую модификацию' ),                     'add_new_item' => __( 'Добавить новую модификацию' ),                     'edit' => __( 'Редактировать' ),                     'edit_item' => __( 'Редактировать' ),                     'new_item' => __( 'Новая' ),                     'view' => __( 'Показать' ),                     'view_item' => __( 'Показать' ),                     'search_items' => __( 'Искать' ),                     'not_found' => __( 'Ничего не найдено' ),                     'not_found_in_trash' => __( 'Корзина пуста' ),                 ),                 'description' => __('Модификации, отражаемые в Ресурсах.'),                 'public' => true,                 'show_ui' => true,                 'publicly_queryable' => true,                 'exclude_from_search' => false,                 'menu_position' => 20,                 'supports' => array(                          'author',                         'trackbacks',                         'custom-fields'             ),                 'can_export' => true,             'taxonomies' => array('metka')             )         );     }      and custom taxonomy for this custom type:               add_action( 'init', 'create_car_taxonomies', 0 );            function create_car_taxonomies(){         $labels = array(           'name' => _x( 'Мои Метки', 'множественное имя' ),           'singular_name' => _x( 'Моя Метка', 'одиночное имя' ),           'search_items' =>  __( 'поиск моей метки' ),            'all_items' => __( 'все мои метки' ),           'parent_item' => null,           'parent_item_colon' => null,           'edit_item' => __( 'редактировать мою метку' ),           'update_item' => __( 'обновить мою метку' ),           'add_new_item' => __( 'добавить мою новую метку' ),           'new_item_name' => __( 'моя новая метка' ),           'separate_items_with_commas' => __( 'Мои Метки' ),           'add_or_remove_items' => __( 'добавить или удалить мою метку' ),           'menu_name' => __( 'Мои Метки' ),         );              register_taxonomy('metka', 'modifications', array(           'hierarchical' => false,           'labels' => $labels,           'show_ui' => true,           'query_var' => true,           'rewrite' => array( 'slug' => 'nothing' ),          'show_admin_column' => 'true',        ));           }       in 2nd plugin: i try to insert post:               $i=1;     $newtable=$wpdb->get_results("SELECT * FROM modification_table limit 1");            foreach ($newtable as $myrow)     {          $zapros="SELECT brand,model,modification FROM modification_table where kod='$i'";     $result=mysql_query($zapros);          $row=mysql_fetch_row($result);       $title=$row[0].' '.$row[1].' '.$row[2];          $my_post = array(            'post_title'=> $title,            'post_status' => 'publish',            'post_author'=> 1,            'post_type' => 'modifications',           'post_content' => ''       );            $post_id=wp_insert_post($my_post);          wp_set_object_terms($post_id, 'метка','metka', true);      wp doesn't save this tag. why??what's wrong? please,help


Best practice to update the file header.php

I would like to know, what is the best practice for updating the `header.php` file: From within WordPress editor: Appearance > Editor **or** Directly in the `header.php` file itself (in the www_root)?


Change success message in plugin Theme my login

I am using theme my login plugin and want to replace message when people registered and it's redirect back to login page with displaying message at the top of the form. **Message:** `Your registration was successful but you must now confirm your email address before you can log in. Please check your email and click on the link provided.` I want to replace this message.


Removing custom post type from link search results

I have created a custom post type and disabled it from appearing in search results. However when I add a link from a normal post, I still get these entries from my custom post type available to link to in the internal linking box (at the bottom when of the popup when you click the link button in the editor). How can I disable the custom post type from displaying entries there as well?


Lack of composite indexes for meta tables

Why `wp_commentmeta` table does not have a composite index `(comment_id, meta_key)` by default? I believe it's the only useful index for that table, am I wrong? Instead, it has a strange set of indexes:               mysql> show create table wp3_commentmeta;     ...     PRIMARY KEY  (`meta_id`),     KEY `comment_id` (`comment_id`),     KEY `meta_key` (`meta_key`)     ...      The same thing about `wp_postmeta`.


Plural/singular URL schema challenge for section Page template combined with single Custom Post Type template

I'm coming back to WordPress after quite a hiatus (and it's not my normal CMS framework), and I'm working with custom post types for the first time. I'd like to have 2 **page** templates that support section pages with URLs such as:   * mydomain.com/apples/   * mydomain.com/oranges/ And then have 2 **single post** templates -- one for an _apples_ **custom post type** , and one for an _oranges_ **custom post type** \-- that support URLs such as:   * mydomain.com/apples/foo   * mydomain.com/oranges/bar But when I created templates such as:               page-apples.php     single-apples.php      …I found that the **page** URL was rendering fine but single post URLs were returning 404. I realised that, when registering the custom post types, adding `'with_front' => false` as an argument of `rewrite` enabled **single post** URLs to render, but then of course the section page URL didn't! The solution I have at the moment is to register the custom post types in the singular form of the custom post keyword, so now I have:               page-apples.php     single-apple.php      Which means the corresponding URL schema has to be a mixture of plural (for the section page) and singular (for the custom post type):   * mydomain.com/apples/   * mydomain.com/apple/foo I can live with this if I have to, but I'd rather have the URL schema be consistently plural. I'd be grateful of any suggestions for how to do things differently. * * * **Update:** as requested, here's an example of how I'm registering one of the custom post types (in the singular form but with a plural Admin menu label)…               register_post_type( 'apple', array(       'labels' => array(         'name' => __( 'Apples' )       ),       'taxonomies' => array('category'),       'public' => true,       'rewrite' => array(         'slug' => 'apple',         'with_front' => false       ),       'has_archive' => true     ));


Custom Post Types for Support Ticket plugin?

I am about to write a (quite simple) plugin for support tickets, where a user signs up, adds one or more sites, and adds support tickets under each of the sites. My question is about how to structure this without relying on other plugins for functionality:   * The user signs up and gets a new role (such as 'Customer').   * When the Customer adds a Site, that Site is only visible to the Customer and noone else. A Site would be a Custom Post Type, I suppose.   * When the Customer adds a Ticket to a Site, that is only visible to the Customer. Tickets would be CPT's as well, I suppose. In terms of best practice, am I right to use authors and roles for visibility and CPT's for Sites and Tickets? And how do I create the relationship between Site and Ticket? I know there is a Post 2 Posts plugin, in addition to others (like CPTR), that manage relationships between post types, but I would much prefer to avoid relying on others for core functionality in this plugin. **Edit:** I'm trying to see if somehow custom taxonomies could play a role in this puzzle, but I don't see how it can fit in. Any suggestions are welcome.


Find out when a user was created and display varied content depending on time since creation

I am looking to display different content after a user registers. Is there a way to find out the registration date and then if it's been 1 day display one thing, but if it's been 2 days display something else? Something like this, but based on the registration date and not a post entry date:               <?php if (strtotime($post->post_date) > strtotime('-30 days')): ?>        //Text for posts created in the last 30 days     <?php endif; ?>


Best practice to create required pages

Some times, when we work on custom wordpress themes, we need required pages. For example - custom login page. Some times, when user change slug, page template or something else - it a very difficult to find. Or user can delete this page :) Also this can be problem, when you have custom links for this pages on another pages. I want to find solution for manage this. I can paste our code that we use for this.


How to use media upload on theme option page?

I want implement upload logo to my theme option page. Currently I follow this code What I have done for now load a related jquery for the media upload               function load_only() {         add_thickbox();         wp_enqueue_script('jquery-option', get_template_directory_uri() . '/admin/js/jquery.option.js', array('jquery','media-upload','thickbox','jquery-ui-core','jquery-ui-tabs'), '1.0');     }      Question How to implement the upload form using existing media upload?               <input id="theme_options_upload" type="text" name="theme_options_upload" value="<?php esc_attr_e( $options['theme_options_upload'] ); ?>" />     <input type="button" name="just_button" value="<?php esc_attr_e('Upload'); ?>" />      I want to know   1. How to link the button to `media-upload.php`   2. After we upload image and click `Insert into Post` button on media-upload the image will place into field `name="theme_options_upload"` Let me know.


Show a user their recently viewed posts

I am working on a project that showcases a number of products, so I'd like to add a "recently viewed product" selection that keeps track of the last 5 or so viewed products or posts. I saw this plugin but its 2 years old and as of now doesn't look to be supported. Any ideas?


What is the Difference in bones_comments() and comments.php

I started to use Bones HTML5 Wordpress Starter Theme, but a little confuse with some built-in function in bones, There is `function bones_comments()` in functions.php but I cannot find anywhere on the files where this function is used or called. And I take a look at the code in the function it just looks like some code to output wordpress comments, and yet there is comments.php for comment_template() in wordpress. So really confuse why bones add the bones_comments() function and not use it. and what is the difference between bones_comments() and comments.php


WordPress Displaying Thumbnails Vertically

WordPress is displaying my thumbnails vertically and VERY LARGE. Specifically it's displaying WooCommerce product page thumbnails vertically and VERY LARGE. Can't seem to figure out why or what piece of code is responsible for this happening. I already went into WordPress settings > Media, and made sure thumbnail sizes were correct at 150x150. Also tried disabling every plugin minus WooCommerce and that also didn't do the job. This is on a cloned version of the main site that I deployed for testing/development purposes. The address is `http://192.34.63.150` (That is the address directly to the site. The issue presents itself when you go to a page such as `http://192.34.63.150/shop/directioner/)` Here in an image of the issue: ![enter image description here](http://i.stack.imgur.com/XfYVL.jpg)


Wordpress comments title

This code:               <?php comments_template( '', true ); ?>          Outputs:               <h3 id="comments-title">       <h2>          12 Responses to My Post.       </h2>     </h3>     (comments template)      I don't know where this h2 tag comes from. I want to get rid of that. And customize my comments-title (so there will be h4 instead of h3 and "comments" instead of "Responses". How to achieve that?


comments hooks on custom post type

First, this is what I want to achieve: I want to add a comments hook on a CPT which is asking users to be registered and logged in to be able to post a comment. And after the user is logged in to display two custom fields before the comment field. My discussion settings are not set to * _Users must be registered and logged in to comment *_ because on my default blog posts I don't want to force users to register in order to comment. Here is what I've did till now :               function debate_comment_fields( $fields ) {           if( is_singular( 'debate' ) ) {            // these are the custom fields which I want to display before the comment field          $fields['first'] = '
' .                           __( 'HTML5' ) .                           '' .                           '<input id="first" name="category" type="radio" value="'.get_post_meta($post->ID, 'agree', true).'" />
';                   $fields['second'] = '
' .                             __( 'FLASH' ) .                             '' .                           '<input id="second" name="category" type="radio" value="'.get_post_meta($post->ID, 'disagree', true).'" />
';              return $fields;               }          else {                   return $fields;     }               }      add_filter('comment_form_default_fields','debate_comment_fields');        I've looked through the CODEX, and I found this `comment_form_must_log_in_after` but this is not helping me because I need first to add a hook which is asking user to log in. I've looked also into mytheme/comments.php here is a snippet:
              <?php if ( have_comments() ) : ?>
                      <?php                     printf( _n('%d comment', '%d comments', get_comments_number(), 'outbox' ),                         number_format_i18n( get_comments_number() ) );                 ?>

                 <?php                     wp_list_comments( array( 'callback' => 'outbox_comment' ) );                 ?>
                  <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through? If so, show navigation ?>
 <?php echo get_previous_comments_link( __( 'Older Comments', 'outbox' ) ); ?>

<?php echo get_next_comments_link( __( 'Newer Comments', 'outbox' ) ); ?>
                          <?php endif; ?>              <?php endif; // have_comments() ?>              <?php             // If comments are closed and there are comments, let's leave a little note, shall we?             if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :         ?>
<?php _e( 'Comments are closed.', 'outbox' ); ?>
         <?php endif; ?>              <?php comment_form(); ?>      This is the 'must_log_in' :                       'must_log_in'          => '
' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',      Any idea on how can I achieve this? Thank you!


'paged' in wp_query doesn't work

I try to add a code to my wordpress blog show previous posts(in a previous page). I try this code but it don't work:               <?php     $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;     $args = array(         'offset' => 1,         'cat' => -22,         'paged'=>$paged     );     $recent = new WP_Query($args);     while($recent->have_posts()) : $recent->the_post();     // here some code to view     <?php endwhile; ?>

<?php posts_nav_link('∞','next page','previous page'); ?>

     <?php wp_reset_query(); ?>      it's doesn't work in `http://mydomain.com/page/2`


How to add multiple featured image in meta box in post editor?

I would like to add multiple featured image in meta box in post editor area apart from default available featured image. I have added the meta box but i have no idea on adding the featured image functionality.               function another_image_custom_meta() {         add_meta_box('another_meta', __('Another Image'), 'another_image_callback', 'another','side');     }          add_action('add_meta_boxes', 'another_image_custom_meta');      Where another in fourth field is my custom post type.               function another_image_callback($post) {         wp_nonce_field(basename(__FILE__), 'another_nonce');         $p_stored_meta = get_post_meta($post->ID);         ?>              <p>            Another featured image         </p>              <?php     }      Above functions works fine it show the meta box. How can i add the link with image upload and save it as featured image to the corresponding post. Like default featured image i want the same function here. can anyone help?


Edit specific text on a static page

I'm kinda stuck with my Wordpress development. I must say, I'm a noob at this right now but trying to get more knowledge of this. In Wordpress admin, there is this text editor for editing the content on a static page. (in my case) On this static page I've got, I have several div's which contain content. My question is, can I update the text in these div's separately in the text editor? If so, how can i achieve this? I have already been looking in the codex, but I'm not really able to find the right solution for what I'm trying to achieve. Any answer will be highly appreciated. (I know I did not post any code, I'm just looking for a direction to go)


sliding/fading header plugin or approach suggestion

i need advice in implementing rotating header (has fade or slide effect) in my theme. I'm building a theme based on Thematic and I'm looking for a good approach on how to implement the header. I have 2 option, I can use a Plug or I can inject the header in my functions.php. Help me decide on best way to do it. The are Pros and Cons on its approach, **Plugin Pros** : Easy to Install--no codes needed, client friendly-has an admin interface, **Plugin Cons** : not usually what you looking for.. sometime you you just work on what's available out there.. **functions.php Pros** \-- You have full control of the design. **functions Cons** : no admin interface -- it would be hard for clients to update. **Header Example:** **www[dot]haardtline[dot]de** \- (blind effect) **www[dot]sweetsinthecitychicago[dot]com** \- (fade effect ) **www[dot]collaborative-coaching[dot]com** \- (sliding effect) I'm looking for an approach where i can re-use it to other project. where I can just tweak the dimensions and effect. For the clients it's easy for them to maintain. * * * I apologize for confusion The simplest question I could think is. How do you do it on your client? What is the best and well used approach... Do you use a plugin? what plugin? or code it? (in coding it, my one problem is the admin interface, I need my functions.php to generate an admin interface where user can easily upload images and set some settings.) Thanks!


Need Help Finding a Wordpress E-Commerce Plugin That Utilises Custom Post Types

I am currently in the middle of developing quite an extensive and complicated record label website that uses post types and a whole bunch of relationship mapping to map post types to one another. Part of the major functionality of the site is a store. Because I have an "Artists" post type called "artists" I would like to use a store plugin that offers variations as I will be dealing with physical and digital music sales, as well as selling merchandise and would like to use a plugin that takes advantage of custom post types. I would like to be able to relate one or more items to a particular artist in the "artist" post type so that I don't have to make the client enter the artists names again, thus having to different locations storing the same data. I've taken a look at MarketPress created by WPMU Dev, but it seems as though support for variations isn't quite there yet. WP E-Commerce 3.8 (currently in beta) by Instinct supposedly uses custom post types, but to me it doesn't appear to be using custom post types whatsoever, but rather it's own interface. I also tried PHPPurchase as well, but out-of-the-box it uses pages instead of post types. I did find a tutorial telling you how to supposedly use custom post types with it, but it hardly seemed like true post type integration, the tutorial is located here. If you have a way I can relate my artists post type to any pre-existing shop plugins for Wordpress, that would be awesome too and I wouldn't mind having to add in different code to relate the two. Commercial and free solutions welcomed.


Page as Archive page

I'm having some trouble understanding the logic, I'll try to explain. Let's say I want to have a Video section. This is how I (want to) do it.   * I make a custom post type called "Videos";   * I make a template to show the video items, call it tpl-videos.php;   * I make a normal page called "Videos", and select the tpl-videos.php as my page template; Ofcourse, this works, UNLESS you are using some kind of pagination, let's say PagNavi. Whenever I go to page 2, I get an error 404. Reason being: my CPT has the same name as my page. So I have to change one of them, wich I don't want, 'cause that's weird. If I do that, it will most likely be "Video-items" as CPT, and "Videos" as page. But that's not what I want for my URL's: That will make site.com/videos/video- items/my-video-item, but I want site.com/videos/my-video-item. The correct way is making an archive-videos.php. But, with an archive page I cannot take advantage of the normale page stuff, like Metaboxes, Thumbnails etc etc. Is there a way to make archive pages behave as pages, without making custom options for each archive page? **Edit:** There was a misunderstanding regarding my use of Blog as a CPT. Blog can be anything: videos, galleries, whatever. Question updated.


Custom query with orderby meta_value of custom field

Aa you know, as of WP3.0 there are options for custom advanced queries, which is great. As of this, some query parameters of custom fields like meta_key, meta_value were deprecated for the new meta_query parameter (see here) I try to have a pretty simple query with the new syntax, query posts by a certain post_type (services) that contains a specified meta_key (order_in_archive)- this is going well as expected. But - I want to orderby the query by the meta_value, and with no success. This is my query -                  query_posts(         array(  'post_type' => 'services',             'order' => 'ASC',             'orderby' => 'meta_value',             'meta_query' => array(                 array('key' => 'order_in_archive'))         )     );      I tried orderby also by meta_value_numeric and meta_value, but in any case the results are being ordered by the publication date (as regular posts do). Anyone know how can this be done? Thanks


Using wp_schedule_single_event with arguments to send email

I'm trying to schedule a pseudo cron job to send an email after a set amount of time utilizing a WordPress plugin. So far, I've been able to make this code run when I hard code the email address and message into the 'email_about_coupon' function; however, when I try to send the arguments to the function, the email is never sent. By using the Cron GUI plugin (http://wordpress.org/extend/plugins/cron-view/installation/), I'm able to see that the cron job is registered even with the arguments. I believe that I'm doing something incorrectly that does not allow the arguments to be used properly within the function at the time that it is run. Here's what I have:               function schedule_email_cron($post_id)     {         // Get the UNIX 30 days from now time         $thirty_days = time() + 60; // (30 * 24 * 60 * 60)         $post = get_post($post_id);         $email = get_the_author_meta('user_email', $post->post_author);         $args = array('email' => $email, 'title' => $post->post_title);         wp_schedule_single_event($thirty_days, 'email_about_coupon_action', $args);      }          add_action('save_post', 'schedule_email_cron', 1, 1);          add_action('email_about_coupon_action', 'email_about_coupon', 1, 1);          function email_about_coupon($args)     {         // Email text         $text = "
Your coupon titled, ".$args['title']." is expiring soon. Please visit ".get_bloginfo('siteurl')."/registered/ ".get_bloginfo('siteurl')."/registered/ to renew your coupon.
";              // Email headers         $headers = array(             'From: '.get_bloginfo('name').' <'.get_bloginfo('admin_email').'>',             "Content-Type: text/html"         );         $h = implode("\r\n",$headers) . "\r\n";              // Send email         wp_mail($args['email'], 'Renew Your Coupon Now!', $text, $h);     }      As always, thanks so much for your help!


Close Fancybox, sumbit form data and redirect

I have a Wordpress and WooCommerce site for a client, and to create a little twist on the customizing on a product I have a external html-page opening in a FancyBox iFrame using Easy FancyBox plugin (http://wordpress.org/plugins/easy- fancybox/). Now when the user is done with the form inside that iframe, which sends data using GET to the checkout form, I want the FancyBox to close and move the user to the cart/checkout page. At least close the box and reload the page so that I can show the user a message that the product was added. How would I do that? I'm rather new to this kind of stuff. Do I need to ad some kind of jQuery/JavaScript to a file and then call it somehow from the submit button?


wordpress 3.9 remote token auth

I came across the following code here https://gist.github.com/trepmal/2968439 Currently the remote authentication is token based. So when the user logs in a token is generated validating the user. I haven't come across any good documentation in implementing remote authentication with Wordpress. Is there any good code samples or tutorials in doing this.


force login and redirect to custom login page

I am really desperate, looking for a solution for days now. I need to achieve: restricted access for logged in users only not logged in users need to be redirected to a custom login page I am on a multisite setup the closest solution yet, is the following piece of code but it only protects 1 page, in this scenario it is the home page (e-mover.ch/distributor) because the multisite is using subfolders, so the main url is e-mover.ch/distributor. So if someone is going to this url, he will see the custom login page (haendler-login) but he could ignore it and just hit one of the menu items and will get access. I need the entire website restricted to logged in users and I want them to use the custom login page, which is "haendler-login". I have tried some plugins but I always got redirect loop errors when using custom login plugins in combination with restricted access plugins. This is why I am looking for a "non-plugin" solution. Any help is welcome. This is the closest I could get:               if ( !is_user_logged_in()  ) {     $url_uri = $_SERVER['REQUEST_URI'];          //redirect shop page.     if ( $url_uri == '/distributor/' ) {         wp_redirect( home_url( '/haendler-login' ) );     }     }      Cheers Mark


Wrap description and sub menu in a wrapper

I am trying to add a wrapper to description and sub-menu in wordpress using walker class, Description will only be shown for the first menu so the structure will look like this **EDIT** > I have been able to add a wrapper div to description but not to sub-menu and > menu description together so I am seeking assistance with adding a wrapper > div to menu description and sub-menu(if any)

             Menu 1

Menu description Goes here.

Kitchen

      This is the code I am currently using               class Description_Walker extends Walker_Nav_Menu     {     public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 )         {             $classes     = empty ( $item->classes ) ? array () : (array) $item->classes;                  $class_names = join(                 ' '             ,   apply_filters(                     'nav_menu_css_class'                 ,   array_filter( $classes ), $item                 )             );                  ! empty ( $class_names )                 and $class_names = ' class="'. esc_attr( $class_names ) . '"';                  $output .= "
ID' $class_names>";                  $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        ) .'"';                  // insert description for top level elements only             // you may change this                  $description = ( ! empty ( $item->description ) and 0==$depth  )                 ? '

' . esc_attr( $item->description ) . '

' : '';                      // $description = ( ! empty ( $item->description )  )                 // ? '' . esc_attr( $item->description ) . '' : '';                  $title = apply_filters( 'the_title', $item->title, $item->ID );                  $item_output = $args->before                 . ""                 . $args->link_before                 . $title                 . ' '                 . $args->link_after                 . $description                 . $args->after;                  // Since $output is called by reference we don't need to return anything.             $output .= apply_filters(                 'walker_nav_menu_start_el'             ,   $item_output             ,   $item             ,   $depth             ,   $args             );         }     }


Custom Meta Title for Custom Post Type

I have several custom post types that need to display different values within `<title></title>` in the header. I understand for the home page, posts, categories, and pages you can use..               if (is_home()){ }     elseif (is_category()){}         elseif (is_single() ) {}     elseif (is_page() ) {}      My question is, how would I do the same for individual CPTs (eg. songs, videos, news..etc)


How to identify WordPress language updates?

How can I clearly identify the WordPress language file that triggers the language update notification? In the current situation I don´t want to auto-update - I tried to manually update the WordPress core language files, but I still have the language update notification. Thanks!


WP uploading file

I create a WP post option box, it has upload form to get image from media library. When I add media from main editor, insert image but it doesnt show on main editor. Image show on the box. What is the issue? How to fix? I want they become seperate upload form. Thank you Please view image below for better understand. The code are below. ![enter image description here](http://i.stack.imgur.com/WHsNd.png) This is the code from option box:               require_once WG_PATH.'/includes/upload.php';     abc_setting_logo($voucher_logo);     abc_setting_logo_preview($voucher_logo);      And upload file:               function abc_options_setup() {         global $pagenow;         if ('media-upload.php' == $pagenow || 'async-upload.php' == $pagenow) {             // Now we'll replace the 'Insert into Post Button inside Thickbox'              add_filter( 'gettext', 'replace_thickbox_text' , 1, 2 );         }     }     add_action( 'admin_init', 'abc_options_setup' );          function replace_thickbox_text($translated_text, $text ) {           if ( 'Insert into Post' == $text ) {             $referer = strpos( wp_get_referer(), 'abc-upload-settings' );             if ( $referer != '' ) {                 return __('I choose this!', 'abc' );             }         }              return $translated_text;     }          function delete_image( $image_url ) {         global $wpdb;              // We need to get the image's meta ID..         $query = "SELECT ID FROM wp_posts where guid = '" . esc_url($image_url) . "' AND post_type = 'attachment'";           $results = $wpdb -> get_results($query);              // And delete them (if more than one attachment is in the Library         foreach ( $results as $row ) {             wp_delete_attachment( $row -> ID );         }        }          /********************* JAVASCRIPT ******************************/     function abc_options_enqueue_scripts() {                  wp_enqueue_script('jquery');                  wp_enqueue_script('thickbox');             wp_enqueue_style('thickbox');                  wp_enqueue_script('media-upload');             wp_enqueue_script('abc-upload');          }     add_action('admin_enqueue_scripts', 'abc_options_enqueue_scripts');               function abc_setting_logo_preview($url_logo) {         ?>
             <img style="max-width:100%; padding-top:5px;" src="<?php echo esc_url( $url_logo ); ?>" />
         <?php     }          function abc_setting_logo($url_logo) {         ?>             <input id="upload_logo_button" type="button" class="button" value="<?php _e( 'Upload Image', 'abcroupbuy' ); ?>" />         <?php     }


Displaying One Custom Post Type's Content On Single Post of Another Custom Post Type

I'm currently building a college football blog and I have 2 custom post types: `conference` and `team`. Each `conference` post type will be a horizontal list consisting of each teams' logo and will be displayed on every `single` `team` post so long as the team is in the respective conference. It will look virtually identical to this: ![Horizontal List for Conference Post Type Example](http://i.stack.imgur.com/NRPTR.png) Using the ACF plugin, I've given each `team` post type a _Conference_ field from which the user can select the conference the team belongs in. ![Conference for Team Post Type](http://i.stack.imgur.com/bmYzG.png) Each `conference` post has the respective `HTML` already for its content. My question is how do I proceed to make what I just described a reality using `PHP`? I'm a `PHP` newb so if the answer is obvious, please forgive me. The website from which I got this idea is D1ARugby.com. The example of what I'm trying to achieve is as follows: ![D1ARugby.com Team Page Example](http://i.stack.imgur.com/briuX.png) Any help would be greatly appreciated! Thank you! # UPDATE Here's the current template I'm using for my single-team post. It works for conferences whose name is just a single word and not multiple words.               <?php         // get team posts         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $team_args = array(             'posts_per_page'   => 1,             'post_type'        => 'team',             'post_status'      => 'publish',             'suppress_filters' => true,             'paged'            => $paged         );         $conf_args = array(             'posts_per_page'   => 1,             'post_type'        => 'conference',             'post_status'      => 'publish',             'suppress_filters' => true,             'paged'            => $paged         );              $teams = get_posts($team_args);         $conferences = get_posts($conf_args);              foreach($teams as $team) : setup_postdata($team);     ?>
                  <?php foreach($conferences as $conf) : setup_postdata($conf); ?>
                 <?php                     $conference_name = get_post_meta( get_the_id(), 'conference', true );                     $conference = get_page_by_title( $conference_name, OBJECT, 'conference' );                 ?>
<?php echo $conference_name; ?>
                 <?php                      if ($conference) {                         echo apply_filters( 'the_content', $conference->post_content );                     }                 ?>
             <?php endforeach; ?>
      I can figure out why it will display for conferences named "California" and "West" but it won't display for conferences named "Big Ten" or "Red River." Any ideas as to why this is happening would be greatly appreciated. Thanks everyone!


Do shortcode that is inserted in a textarea is not displaying properly

In the dashboard, I'm using a textarea to get user input. I'd like them to be able to use shortcodes anywhere in that textarea. Here's my current function:               function slp_getwelcome() {                          $slp_welcome = get_option('slp_welcome');            $slp_welcome_sc = do_shortcode( $slp_welcome );              return $slp_welcome_sc;          }      This partially works. If I have this text in the textarea: > Lorem ipsum dolor sit amet, consectetur [location] adipiscing elit. Donec > sit amet quam id eros fringilla. The above function outputs this: > Abbott, CALorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit > amet quam id eros fringilla. Where "Abbott, CA" is the proper result of the `[location]` shortcode. So the shortcode is called, but it returns at the beginning of the textarea content. How can I fix this? Here's the shortcode logic:               function get_location() {          global $post;         $location = strip_tags( get_the_term_list( $wp_query->post->ID, 'locations', '', ', ', '' ) );         echo $location;      }      add_shortcode('location', 'get_location');      A second shortcode reacting the same, despite the use of `return`:               function get_service() {          $servive = single_post_title() ;         return $service;     }      add_shortcode('service', 'get_service');


How to modify admin headers

I'm trying to create a theme settings export script that base_64 encodes the theme options and lets the user download them as a text file. I've seen a post (What is the best way to export and import theme options?) that involves checking the query vars and then redirecting the user using the 'template_redirect' action. However, it would appear like this action is only available on the frontend of the site (not in the admin). Adding the action to my constructor for the options framework doesn't do anything. I'm able to get my function to fire by tying it to 'admin_init', but by that time the headers have already been sent (and I'm unable to specify a Content Description). I get a bunch of "Cannot modify header information" warnings and my export string is dumped to the browser instead of being downloaded. Is there a way I can add a redirect in the WordPress admin, similar to 'template_redirect', that would let me modify the header information before the default headers have been printed?


How can I assign different email address for each product I am selling by woocommerce?

I am selling products from different companies and when some one make an order I want it to be send it to that company product belong to. I am using woocommerce but it just letting me to have one email address. would you please let me know how can I achieve this? is there any other plugin that will do this for me? Thanks in advance for your help


get-posts pull 2 levels of sub pages

The template structure is: **a** Product index (parent page) **b** Product category (sub parent page) **c** Product single (page) They're all Pages, not Posts. **1** On index page, to pull out the page title from each category page, and all the products inside each category. Like below: (h2)cat 1(/h2) (li)product 1(/li) (li)product 2(/li) (li)product 3(/li) (h2)cat 2(/h2) (li)product 4(/li) (li)product 5(/li) (li)product 6(/li) ... **2** On category page, to pull out all the products inside the category **3** On single page, to just display the product **Can anyone help me to write the code for the index template please?** FYI - below is the code for category template, which works well.               <?php $args = array(         'numberposts' => -1,         'post_parent' => $post->ID,         'post_type' => 'page',         'orderby' => 'none',         'order' => 'ASC'     );     $postslist = get_posts($args);     foreach ($postslist as $post) : ?>
             <a href="<?php the_permalink(); ?>">
<?php the_title(); ?>

     <?php endforeach; wp_reset_postdata(); ?>


Rewrite CPT permalinks with 'Post 2 Posts' connection

I have 2 CPTs titled **'Songs'** & **'Artists'** that are connected (Artists → Songs) via **Posts to Posts** Currently, the permalink structure for **'Songs'** is `www.my- site.com/songs/%postname%` What I would like is to rewrite the permalink for 'Songs' and have the connected artist included, such as..               www.my-site.com/songs/%connected-artist%-%postname%      I am unfamiliar with `$wp_rewrite` at the moment so my attempts to achieve this are futile. Any suggestions/direction are appreciated. I will update this with code of my own as I attempt to work this out.


jQuery Live Form Validation in Wordpress

I'm trying to implement the form validation that can be found at: http://www.geektantra.com/2009/09/jquery-live-form-validation/ I can get the demo above working, but when I implement it on my wordpress site no validation occurs. The page where it's implemented is here: http://www.melbournemeditationcentre.com/meditation-courses/course- registration/ You'll see that the neccesary scripts are included:   1. jquery.validate.js?ver=3.8   2. jquery.js?ver=1.10.2   3. form-validation.css?ver=3.8 as well as the necessary code in the head:               jQuery(function(){             jQuery("#firstname").validate({                 expression: "if (VAL.match(/^[A-Za-z '-]{3,20}$/) && VAL) return true; else return false;",                 message: "Required."             });         });      etc.... As far as I can tell, the form itself is all okay. Still no validation.


Select default taxonomy on dropdown

I have the following code for adding a dropdown box with a new taxonomy currently the default when I create a new post is **None**. Is there a way I can define a default, for example **News**.               function create_theme_taxonomy() {         if (!taxonomy_exists('type')) {             register_taxonomy( 'type', 'post', array( 'hierarchical' => false, 'label' => __('Article Type'), 'query_var' => 'type', 'rewrite' => true ));         }     }          function add_type_box() {         add_meta_box('type_box_ID', __('Article Type'), 'article_type', 'post', 'side', 'core');         remove_meta_box('tagsdiv-type','post','core');     }        function add_type_menus() {         if ( ! is_admin() )             return;         add_action('admin_menu', 'add_type_box');     }     add_type_menus();          // This function gets called in edit-form-advanced.php     function article_type($post) {              echo '<input type="hidden" name="taxonomy_noncename" id="taxonomy_noncename" value="' .                  wp_create_nonce( 'taxonomy_type' ) . '" />';         // Get all type taxonomy terms         $types = get_terms('type', 'hide_empty=0');      ?>     <select name='post_type' id='post_type'>         <!-- Display types as options -->         <?php              $names = wp_get_object_terms($post->ID, 'type');              ?>             <option class='type-option' value=''             <?php if (!count($names)) echo "selected";?>>None</option>             <?php         foreach ($types as $type) {             if (!is_wp_error($names) && !empty($names) && !strcmp($type->slug, $names[0]->slug))                  echo "<option class='type-option' value='" . $type->slug . "' selected>" . $type->name . "</option>\n";              else                 echo "<option class='type-option' value='" . $type->slug . "'>" . $type->name . "</option>\n";          }        ?>     </select>         <?php     }


Test if a post exists by category and date

I would like to check outside of the loop, if a certain post exists in a specific category and from a specific date. The function `get_posts()` \-- if I get it right -- allows me to check, if there are posts in a specific category, but does not allow to test, if there is one on a specific date. The other way I tried is by testing the spefic URL by using the permalink. The permalink has the format: `http://www.homepage.de/yyyy/mm/dd/?cat=id`. But this URL is valid anyway, if it shows a post or the message "Nothing found." So I can't check the URL for a 404 or something. Now I ran out of ideas? Any help? Thanks in advance and all the best, Marius


jQuery UI inside widget on admin page

I have created a widget that has quite a few settings, and so I am trying to create a tabbed menu (using jQuery UI) inside the widget settings of the admin page. The problem is basically that tabs don't happen (i.e. the a tags just appear on the top and the related divs underneath them). This is a shortened version of the widget:               add_action( 'admin_enqueue_scripts', 'load_my_admin_js' );          function load_my_admin_js($hook)     {     $my_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );     if( 'widgets.php' != $hook )             return;     wp_register_script( 'my_adminjs_script', plugins_url( '/adminjs.js', __FILE__ ) );      wp_register_script( 'jqui', 'http://code.jquery.com/ui/1.10.0/jquery-ui.js',false,'' );      wp_register_style( 'jquistyle', 'http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css',false,'' );              wp_enqueue_script('my_adminjs_script');     wp_enqueue_script('jqui');     wp_enqueue_style('jquistyle');     }          class my_widget extend WP_Widget {          //constructor     //front end stuff          //admin page:     function form($instance) {       ?>

Nunc tincidunt

Proin dolor

Aenean lacinia

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis.

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringieuismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lt nec, luctus a, lacus.

          <?PHP     }               }      And this is my js:               jQuery(document).ready(function($)    {          $( "#tabs" ).tabs();          });      Can anyone see where this is going wrong?


update_user_meta updates to a wrong ID

**Background Problem** The site I'm working right now uses custom front-end forms for content, terms and user editing and creation. Access to wp-admin is blocked for non administrator. All of them uses basic wp_ajax functionality. On the user editing form, the function updates the user data using `wp_update_user()` and saves the meta field using `update_user_meta()`. Just now i found out that one of the saved meta field is saved to another user ID (mine, administrator) by someone else. The code wasn't changed because it works, even after I updated the overwritten user meta, using the same function. **Code** Here is the stripped code that saves the meta field.               add_action('wp_ajax_edit-author', 'process_edit_author');          function process_edit_author() {          global $current_user;     if ( empty($_POST) || !wp_verify_nonce($_POST[$current_user->user_login],'edit-author') ) {         echo 'You targeted the right function, but sorry, your nonce did not verify.';         die();     } else {                   $profile_upload = $_FILES['profile-picture'];              if ($profile_upload['name'][0]) {             $profile_picture = attach_uploads($profile_upload);             update_user_meta( $current_user->ID, 'profile-picture', $profile_picture[0]);         }              wp_redirect($return);         exit;              die();     }     }      The `attach_uploads()` saves the uploaded file as attachment. The first file attachment ID then is saved to the user meta. **Analysist** So far I can only tell that the image is uploaded by someone else's account, because the author of the attachment is not me. **Need Help** Does anyone have found this problem? Where and how should I debug this problem? How can I prevent this to happen again? Thank you in advance .


Page not appearing under its Parent

If I add a page with the name 'Bottle Project' and give it the parent 'Other Projects', the page appears at http://richardclunan.com/other-projects/bottle- project \-- so that looks right. ...but if I mouse over the menu item 'Other projects' at http://richardclunan.com , the item 'Bottle Project' doesn't appear. And if I click on 'Other projects', then it doesn't appear either. How can I make it so users can navigate to 'Bottle Project' from the menus on my site -- specifically that 'Bottle Project' appears under the menu item 'Other projects'...?


Prevent Wordpress from abbreviating-long-slugs...-in-the-admin

On post edit pages, when a slug exceeds a certain number of characters, Wordpress abridges it with an ellipsis (`...`). For example, if my slug is `i-want-to-be-able-to-see-this-slug`, it appears on the edit page like this: > **Permalink:** `http://example.com/2012/i-want-to-be-a...-see-this-slug/` [ > Edit ] Can I prevent Wordpress from doing this? I like to be able to see (and copy) a full URL without obfuscation, so I'm dying to find out how to get rid with this feature.


Divert traffic when site down

Any bright ideas on how to fallback to an HTML page "Website Offline" when the main box holding the Wordpress multi-site is down? Real scenario; fully operational SAAS built on cloud vps. Cloud VPS has issues, emergency rebuild of SAN, our box goes offline. Is there a way to direct traffic to a specific page in the event of melt-down?


Add character count to custom metabox

I know of a way to add a character counter to the excerpt metabox in WP, but I would like to add a character counter to a custom metabox. The following script is getting the counter in the metabox, which has tabs, but it isn't counting. Any help would be great. Thanks, it's my first question in StackExchange.               jQuery(document).ready(function(){         jQuery("#bgnp-metabox-tabs").after("
Excerpt length: <input type=\"text\" value=\"0\" maxlength=\"3\" size=\"3\" id=\"bgnp-metabox-tabs\" readonly=\"\"> character(s).
");         jQuery("#feed").val(jQuery("#excerpt").val().length);         jQuery("#bgnp-metabox-tabs").keyup( function() {             jQuery("#bgnp_metabox_tabs").val(jQuery("#excerpt").val().length);         });     });      The counter appears in all of the tabs, but I only want it in the tab "#feed"


Why none of the plugins that have ajax doesn't work in my website?

This is my website. I installed many plugins but if a plugin have ajax, then it doesn't work in main page. can anybody help me?!?


Woocommerce, ordering products by default on shortcode pages

In my woocommerce store I have a Sale Products page. In this page I use the shortcode to display the products on sale               [sale_products per_page="40" columns="3"]      In the store the products are ordered according to their position in a list in the backend (accessible via the Products->sort products link). This sorts them on normal category pages but on a shortcode page they are sorted by title. I know there is an `orderby` attribute I can add but is there an argument that will achieve this?


Where do I go to change the position of the style.css?

My CSS style.css file is in my theme folder. I would like to put it in a CDN. How do I change the link element that loads the css? I am using as a base the 2013 wordpress theme.


Not getting the Correct JSON response from Ajax Request

I am trying to save data from backend with ajax. But its returning data in HTML as well. But i want only JSON data.                           //////////////////////////////////                 // Do Ajax Request to Add the Data                 $('#add_link').prop('disabled', true).next('span').show();                 $.ajax({                     url: ajaxurl,                      type: 'post',                      data: {action: 'ub_add_link', link: $.trim(link.val()), sDate: sDate.val(), eDate: eDate.val()},                      dataType: 'json',                      success: function(response) {                              $('#add_link').prop('disabled', false).next('span').hide();                         $('#link, #startDate, #endDate').val('');                     }                 });      Here is my `wp_ajax_ub_add_link` and `wp_ajax_nopriv_ub_add_link` actions whos call the `ubAddLinkCallback()` method               function ubAddLinkCallback() {                  $param = array();             $link_opt = get_option("_uButton_links");                  $url = esc_url($_POST['link']);             $s_date = esc_attr($_POST['sDate']);             $e_date = esc_attr($_POST['eDate']);                       $param[] = array(                 'link'=>$url,                  'start_date'=>$s_date,                  'end_date'=>$e_date             );                       if( $link_opt !== FALSE ) {                 $ret = array_merge($link_opt, $param);                 update_option("_uButton_links", $ret);             }             else {                 update_option("_uButton_links", $param);             }                            ////////////////////////////////             // Caching System             if( get_transient("_UB_Links") ) {                 delete_transient("_UB_Links");                 set_transient("_UB_Links", $ret);             }             else {                 set_transient("_UB_Links", $param);             }                            //////////////////////////////////             // For Response Purpose             $data = '
';             $data .= '
';             $data .= '
';             $data .= ''.( $link_opt == FALSE ? 1 : count($link_opt) + 1 ).'. 	';             $data .= ''.$url.'	';             $data .= ''.$s_date.'	';             $data .= ''.$e_date.'	';             $data .= 'delete	';             $data .= '
';             $data .= '
';             $data .= '
';                       echo json_encode(array('status'=>'y', 'data'=>$data));             exit();         }      But its returning the result like the attachment where i don't know from where the `<style>` tag comes, because of this style tag my sent data not converting into json. ![enter image description here](http://i.stack.imgur.com/6avJB.png)


how to call uninstall.php

i am newbie in wordpress... i have created my plugin... now i am creating uninstall.php file for uninstall my plugin... this is my code of uninstall.php               if(!defined('WP_UNINSTALL_PLUGIN'))       exit ();           //here i am droping my table and options...      i don't know how to call uninstall.php? from where to call? from where i can uninstall my plugin... i know register_uninstall_hook() but when it get triggered? Thanks in advance


Content in footer file

I swear I've done this before, but I am drawing a blank on it now... I'm trying to get it so that I can have editable content in my footer.php file. So that I (or the user) can update the content within the pages area. But I can't remember how to go about it, or if I need to do a widget instead?


How to output WordPress feed in a non-WordPress site?

I'm trying to get contents from a blog of mine. Suppose it's `example.com`. I've used the php script below in my non-WordPress website trying to get contents from a WordPress blog.               $content = file_get_contents('http://blog.example.com/feed/');     $clean = str_replace( ']]>', '', str_replace('<![CDATA[', '', $content) );          $feed = simplexml_load_string( $clean );          for($i = 0; $i < 4; $i++) {                          echo '
';       echo '
';       echo 'channel->item[$i]->link . '" style="color:#f6a236;">';       echo $feed->channel->item[$i]->title . '
';        echo ''.$feed->channel->item[$i]->description.'';       echo '
';     }      However, this code doesn't work. Someone can say me why and how is possible to output WordPress feed in a non-WordPress site?


Updating User Meta with SQL Query

I have a Wordpress site that needed to have 9,000+ users imported to set up a Directory Listing. I imported them from an existing MySQL (non-wordpress) database and everything imported just fine. Usernames, passwords and display names (MD5 hashed, but I tested and WP will change the password to phpass on the first login). Thing is... They have all been imported with a user role of NONE. I need to change this to Subscriber. Now, I can get into my phpMyAdmin and I can see the field wp_capabilities in the wp_usermeta table. I can see that my admin accounts are a:1:{s:13:"administrator";b:1;} and I know that Subscribers are a:1:{s:10:"subscriber";b:1;}. I can also see that there are many values entered into each user_id. Question is? How can I write a bulk MySQL command to add in the value _wp_capabilites='a:1:{s:10:"subscriber";b:1;}'_ into each user_id except 1, 2 and 3 ie. the newly imported users? Thanks in advanced!


Looking for a multi user calendar

We have a team of real estate sales reps. We would like an admin to assign accounts to each sales rep, allow the rep to create appointments, and have the calendar viewable to anyone. Ideally we would like to embed the calendar on our web site (Wordpress). If there is nothing free, we would be willing to spring for a proprietary package. I already found this plugin http://wordpress.org/extend/plugins/event- calendar-scheduler/ which looks to be exactly what we need, unfortunately it doesn't work on our site. Events can be scheduled but do not show up, and there are blank and the daily view shows up blank.


What is the best way to provide plugin users with a way to customized the styles

I'm working on a plugin to be release to the public, it is a very simple plugin that includes a single html element in the page html. I can do many things to allow users customize its appearance: 1\. Let them override a default CSS that is includes as a plugin configuration (on a management screen) 2\. Require that they modify their styles.css (not a very good idea for this plugin) And probably a fee more option 1 seems like the most user Friendly, since it allows any admin to modify the style without need of accessing code. But I wonder if there might be a better way? Is it possible to provide a default CSS file for the plugin that would be theme independent and would be editable through a management screen? The styling needs to persist regardless of chosen theme. Any thoughts?


What is the etiquette on  extending a plug-in

I recently played with a plugin which I liked a lot, but felt it was missing something. So as first stage I went and wrote a tiny plugin (my first), that just added the needed feature - meaning, that the original plugin still had to be installed for something to work. Now I gave credit to the authors for doing most of the job, but I have to think of the future, what happens if they decided to stop developing that plugin or don't resolve issues regarding it. My plugin will stop working or will potentially become incompatible with future Wordpress versions. Would it be ethical for me to just avoid the issue alltogether by copying their code into mine and renaming the plugin functions? This of course causes other problems, but now they are my problem to resolve. What say you?


How to change permalink structure for custom post type and it's taxonomies?

_This is a repost of an earlier question I had, but I like to go into more details now to be able to fully solve this._ So again, with (normal) posts changing the permalink is as easy as going to Settings > Permalink and by changing it to anything you like such as the broadly used `%category%/%postname%.html`. This all works. If only this was as easy for the custom post type and it's taxonomies as well. So this is what I like to accomplish.   1. http://mywordpress.com/portfolio.html \- Display all posts in all categories.   2. http://mywordpress.com/portfolio/music/ \- Display all posts in this category.   3. http://mywordpress.com/portfolio/music/trance/ \- Display all posts in this (child) category.   4. http://mywordpress.com/portfolio/music/trance/Tiesto.html \- Display the post. What I got so far is the following:   1. First I created a `custom_post_type` named **project** and a `taxonomy` **project_category**.   2. I created a page Portfolio and gave it a Page Template that will list all of the `post_type = project` posts. How can I add .html to the permalink of pages? It now links to http://mywordpress.com/portfolio while I want http://mywordpress.com/portfolio.html. This should solve the first issue.   3. Then things will get tough, because we don't know by forehand how many subcategories there, maybe there are even none. So the structure we are after is `portfolio/(CATEGORY PATH FROM TOP TO CHILD)/post.html`. I am still stuck at this point. I think I should somehow get the last category added to the path and pass that along the **project_category** , which should lead to a taxonomy.php file where I can process it properly.   4. I haven't tackled this neither but it should have something to do with `%postname%.html` at the end of something. I hope my problem is clear and that there are brave developers which will help me tackle this problem which has already keep me busy for four FULL days!


In Wordpress, how do you make several different editors for a single page?

I have a homepage that has many different parts to it. So a s single editor can get convoluted very quickly. Is there a way to break it up so that many editors attribute to this single page? If so, what's your technique?


Sidebar not displaying on custom-page.php

Ok, I registered a new sidebar and have added some functionality to my theme so you can choose which sidebar to display from the back-end (using meta fields). It's working on all pages, except on a custom-page.php I created. I've tried just about anything and can't get my head around why my selected sidebar isn't displaying on page.php (default sidebar is displaying), but not on custom-page.php. I might be overlooking something minor, but for now it's doing my head in. Any help would be greatly appreciated.


How to set back-end language per user?

I would like to use the english interface for the back-end but I would like to set it to native language for an editor. I know WPML has this feature, but I don't want to install the unsupported WPML just for this reason. What I am looking is a tiny plugin which gives a switchbox for the user profile page for setting the back-end language. Is there such a plugin?


List custom posts by custom taxonomy

I'm trying to create a template which will read a tag from the page, then display all the custom posts which share that tag. So for example, I have a custom post type called 'block', and a taxonomy on the block which is called 'appearson', and a tag of that taxonomy called 'products'. I also have a products page, which shares the 'appearson' taxonomy, and also has the tag 'products'. I want the products page template to read its appearson tag, then find the custom posts associated with that tag. This is what I'm trying:               <?php $terms = get_the_terms( $post->id, 'AppearsOn' );?>               <?php     $args = array(     'post_type' => 'block'     'tax_query' => array(     array(             'taxonomy' => 'appearson',             'field' => 'id',             'terms' => '$terms'         )       )     ); ?>          <?php $the_query = new WP_Query( $args ); ?>          <?php while ( $the_query->have_posts() ) : $the_query->the_post();?>      It's not happy with this. Any pointers as to what I'm doing wrong? Blindingly obvious, I'm sure, but my 4 month old baby girl has stolen my brain. Many thanks Rob EDIT Actually ignore some of that. I'm now doing this:               <?php $terms = get_the_terms( $post->id, 'appearson' );?>               <?php     query_posts( array( 'post_type' => 'block', 'appearson' => $terms->name ) );     if ( have_posts() ) : while ( have_posts() ) : the_post();     ?>      So the bit I'm stuck on is getting 'appearson' => $terms to work. Any idea? ta Rob Final edit: Sorted it:               <?php $blocktaxonomy = wp_get_object_terms($post->ID, 'appearson');     $blocktaxonomy  = $blocktaxonomy [0];     query_posts( array( 'post_type' => 'block', 'appearson' => $blocktaxonomy ->name ) );          if ( have_posts() ) : while ( have_posts() ) : the_post();     ?>


Hide password protected posts

If I create a post and set the visibility to "password protected", it still shows up on the front page and in the feeds. Is it possible to hide posts from general view altogether, but still allow quick access to some people without creating an account for them? (This is in WP 3.0.4)


Best Way to Display Posts by Tag (not category)

I've been researching this, but there are so many choices I'm confused. What I would like to do is display two loops on a static page that:   1. the first loop displays all posts with the tag "featured"   2. the first loop displays the thumbnail as well   3. the second loop displays all other posts, excluding the ones already featured There seems to be many options, some wrong, some seemingly too complicated. Is there a best practice for doing this? Thanks!


How can you change the permalink for pages?

When I set my permalink to '/%category%/%postname%.html' this will work for all the posts, but the pages still don't have a .html at the end. Is there a way I can fix that?


WP_Query not getting all posts, just tagged posts

I'm trying to create an archive page that grabs every post submitted. At the moment, I have this, which doesn't work:               <?php             $args = array ();        $query = new WP_Query( $args );          if ( $query->have_posts() ) {       while ( $query->have_posts() ) {         $query->the_post();?>                  <div class="post">               <?php first_item() ?>                    <?php       }     } else {       // no posts found     }          // Restore original Post Data     wp_reset_postdata(); ?>      However, if I change the array to:                  $args = array (       'tag'                 => 'films',     );      It starts receiving all posts tagged as films. How come this is only working with tagged posts, and not for **every** post? I do have a loop on the front page and on custom page, so could they be conflicting?


Get markup for post without loading into the template

I am writing a shortcode plugin that displays posts according to some parameters passed into the shortcode. I have the `wp_query` to get the posts and now I am trying to get the markup for the posts according to the theme's template files. In essence, get_template_part is exactly what I want... except that it directly loads the markup into the template. I want to get the markup for the content, perform a little post-processing and then return the markup for the shortcode. Essentially,               $listings = new WP_Query(...);     while ( have_posts() ) {         $markup .= get_template_part('content', $post->post_type);     }     return $markup      Except this obviously isn't the way that `get_template_part` works. How do I get the markup for a post without rendering the markup into the page?


Force modified contributor role to be re-approved on edit?

I gave the Contributor role edit_published_posts capability. Contributor submits a post, Admin publishes it. Now Contributor can edit it without approval. Is there a way to force it to be re-approved by Admin?


How to add multiple checkbox elements to media attachments?

Based on solved question from: How to add a checkbox element to attachments editor with example Theres an example of multiple Checkboxes, for example: Colors, patterns, etc... A grouped list but using checkboxes? Tips to save and remember checked options on edit? Thanks in advance.


Why is minimum_args protected?

Why is `$wp_xmlrpc_server->minimum_args` protected? It seems like as much of a utility method as `$wp_xmlrpc_server->login`. Is there some other way to sanitize the inputs for length or do I have to write my own method?


Theme requires allow_url_include = on in php.ini

I don't even know where to start with this one. I'm using a theme that requires me to override server php.ini settings in my own php.ini with `allow_url_include = on` That setting at very least seems to be a security risk, according to many (and my webhost) at most it requires some other users on some other hosts to add that line to their own php.ini files or some theme features won't work. (Some popular hosts like Bluehost have `allow_url_include = on` as default.) Anyone know where in the theme functions to look to a) find what requires `allow_url_include = on` and b) how to start working on it to change it? Any of these types of constructs the culprit? 1)               <?php include "scripts/scripts-google.php";         global $wpdb; ....      2)               <?php     define('ABSPATH', dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/');     include_once(ABSPATH.'wp-config.php');      3)               <?php include "scripts/scripts-upload.php"; ?>      4)               function pg_inner_custom_box_1() {         $dir = dirname(dirname(__FILE__));         include($dir.'/admin/gallery/display_galleries.php');     }      5)               <a href="http://www.domain.com/presets/     <?php echo str_replace("-", "_", $presets->preset_name); ?>.jpg" id="single_image">     <img src="http://www.domain.com/presets/     <?php echo str_replace("-", "_", $presets->preset_name); ?>_sm.jpg" style="width:225px;" />      6)               RSS Feed (please include http://)     <input type="text" name="social_rss" size="50" value="<?php echo $social_rss; ?>" />


How to display following posts titles in separate div's on a separate webpage

**Intro:** I have a webpage that is not part of wordpress. I have incorporated the wp blog posts, by putting The Loop in the page's code. This works, it displays the current posts and their following posts up to 3, which is what I set in the wp general options. On this, non-wp, webpage, I have a sidebar, dubbed "history". Within history I have multiple div boxes, each that I want to contain the last, then next last, and continuing until these divs run out of room in the history div. This is meant to be a dynamic list (with custom images, irrelevant to the question) of blog post titles, a history of posts. **What I have so far:** On the first div, in history, I have copied the code from The Loop (that I had copied onto this non-wp webpage). At the top of the page I have "php require('mydomain/xdirectories/home/wp-blog-header.php'). I am able to display the title (and link) of the most recent post and that post's date. These are the only things I want. Here is what the code looks like (this is the first box/div, the second and so on are identical except for the php):

                         <?php the_time('F jS, Y') ?>

                                                                               <a href="<?php the_permalink() ?>" target="_blank" rel="bookmark" title="Permanent Link to                              <?php the_title_attribute(); ?>">                             <?php the_title(); ?>

      Above is one div, box, that I want to have many of, only with the entry titles of each previous post. **Problem:** I cannot figure out how to have the next title, link, and date for any wp blog posts past the first. **Question:** How can I get the functions/"php codes" to input into each following div so that it can dynamically generate the second post title, date, and link. Then the third, and so on. Please note, I understand very little of php. I have tried using "the function" codes but it displays nothing. I've put different "php require('x/x/x.php') but more often than not there is an error. What wp page can I refer to with php that has the functions I need? How can I use those? I need: title, date, link to that post of all the previous posts, dynamically generated so the topmost div always displays the more recent, etc. Edit: to clarify, I'm looking for a wp php function I can use such as "post title x" where x is the number of the post behind the first. For example, the second box will have "post title 2", the third "post title 3" so it will generate that post title, date, link. I am sorry if this question is amateurish. Thank you.


Gravatar Hovercards (Jetpack) jQuery error

I've tried searching for the problem here and also went through the trouble deactivating one plugin after the other. I still can't figure out what's going on, so maybe somebody here has an idea? Suddenly I get a Javascript error: ![enter image description here](http://i.stack.imgur.com/wcOmB.jpg) It's caused by Jetpack's Hovercards. I suppose that in a recent Jetpack update they changed something in their Javascript code that is now causing the issue. The error only occurs on single.php, so I suppose it's a conflict with another script. At first I thought it could be Adsense, but I have Adsense code in my sidebar as well and there the hovercards are working fine (unless I have the single.php open). The only other script in there are things I haven't updated in a long time. Sharing buttons scripts:

<a href="http://twitter.com/share" class="twitter-share-button"           data-url="<?php the_permalink(); ?>"           data-via="zoomingjapan"           data-text="<?php the_title(); ?>"           data-related="zoomingjapan: Admin of Zooming Japan"           data-count="horizontal"     data-lang="en">Tweet

 <g:plusone size="medium" callback="plusone_vote"></g:plusone>

     <a href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" target="blank"><img src="<?php bloginfo('template_directory'); ?>/images/facebook-share.jpg" alt="Share this article on Facebook" />

     <fb:like href="<?php echo get_permalink(); ?>" show_faces="false" layout="button_count"></fb:like>
      And here from my function.php:               function add_my_javascripts() {         /* If this is the admin area of WordPress, don't do anything */         if( is_admin() )             return;              /* Register all of our scripts */              wp_register_script('jquerytools', 'http://zoomingjapan.com/wp-content/themes/alltuts/js/jquery.tools.min.js', array('jquery'));         wp_register_script('tab-renamer', get_template_directory_uri() . '/js/tab-renamer.js', array('jquerytools'));         wp_register_script('jquery-ui-perso', get_template_directory_uri() . '/js/jquery-ui-personalized-1.5.2.packed.js', array('jquery', 'tab-renamer'));         wp_register_script('jquery.form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'));         wp_register_script('jquery-slides', get_template_directory_uri() . '/js/slides.min.jquery.js', array('jquery'));         wp_register_script('my-slider', get_template_directory_uri() . '/js/my-slider.js', array('jquery', 'jquery-slides'));         wp_register_script('tooltip', get_template_directory_uri() . '/js/tooltip.js', array('jquerytools'));         wp_register_script('scrollable', get_template_directory_uri() . '/js/scrollable.js', array('jquerytools'));         wp_register_script('sliding_tabs', get_template_directory_uri() . '/js/sliding_tabs.js', array('jquerytools'));         wp_register_script('sprinkle', get_template_directory_uri() . '/js/sprinkle.js', array('jquery', 'jquery-ui-perso'));         wp_register_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'));         wp_register_script('contact-form', get_template_directory_uri() . '/js/contact-form.js', array('jquery', 'jquery.form'));         wp_register_script('welcome_back', get_template_directory_uri() . '/js/welcome_back.js', array('jquery'));                   /* Enqueue the ones that need to be enqueued */         wp_enqueue_script('my-slider');         wp_enqueue_script('tooltip');         wp_enqueue_script('scrollable');         wp_enqueue_script('sliding_tabs');         wp_enqueue_script('tab-renamer');         wp_enqueue_script('sprinkle');         wp_enqueue_script('custom');         wp_enqueue_script('contact-form');         wp_enqueue_script('welcome_back');                         }     add_action('wp_enqueue_scripts', 'add_my_javascripts');      I finally found the culprit! It's one of my plugins! I need this plugin, so I won't toss it. Could you help me how to fix this problem?               //Подключаем jQuery     function jcp_jquery() {         if ( comments_open() && ( is_single() || is_page() ) ) {             wp_deregister_script('jquery');             wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js"), false, '1.6.3');             wp_enqueue_script('jquery');         }     }     add_action('wp_head', 'jcp_jquery', 8);      The plugin is loading an old jquery version from an external source. I don't have the jquery.min.js in my function.php yet, so how can I replace the code above? Do you have any idea what could be causing the problem? Here's my blog for reference.


How to build a post and comment editing form in a page?

This plugin enables you to submit a custom post type called 'Questions' using a form that can be embeded in a page via shortcode. Is there a way of accomplishing the same, but this time, building a form and embedding it on a page to edit this custom post type and comments? (it doesn't have to be a shortcode). Reference picture: ![enter image description here](http://i.stack.imgur.com/FRSLL.png)


Create a network of sites

I understand that WP3 integrated MU-WP inside the core, so now is "pretty easy" create a network of sites. However, I have some questions about this, because at my work we want to create a network, but already we have some sites, and I don't know how this could affect our current infrastructure.   1. I read that, for a network or sites, wordpress impose certain rules in the url generated. is this true? because if is, it could destroy ten years of google indexing in our site... :(   2. Could we managed differents themes for every site in the network?   3. And finally, in a networks of site, we could manage the register user in a separated way, or all the user of the net have the same access to the rest of the network? Thanks in advance.