title: Wordpress loop is not working

text:
Can anyone tell me why this wordpress blog is looping the header and banner over and over? It seems like instead of just looping the post it is looping the whole page. This code is inside of my content.php file. Any help would be greatly appreciated. Here is a link to my blog: http://testing.printlabelandmail.com/blog/               <?php     /**     * The default template for displaying content.     */     get_header(); ?>

<a href="<?php echo esc_url( home_url( '/' ) ); ?   >">        PRINTLABELANDMAIL.COM
         <button type="button" class="navbar-toggle" data-toggle="collapse" data-    target=".navbar-ex1-collapse">                    </button>

          <?php          $defaults = array(     'theme_location'  => '',     'menu'            => 'main-nav',     'container_id'    => 'nav',     'container_class' => 'navbar navbar-default navbar-shrink',     'container'       => 'div',     'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',     'container_id'    => '',     'menu_class'      => 'menu',     'menu_id'         => '',     'echo'            => true,     'fallback_cb'     => 'wp_page_menu',     'before'          => '',     'after'           => '',     'link_before'     => '',     'link_after'      => '',     'items_wrap'      => '
%3$s
',     'depth'           => 0,     'walker'          => ''     );          wp_nav_menu( $defaults );          ?>

          <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('blog-banner')) :     else : ?>

Widgetized Area

This panel is active and ready for you to add some widgets via the WP  Admin

          <?php endif; ?>

                          <article <?php post_class('box  box--md  blog--post  push--bottom-sml'); ?>>          <?php the_post_thumbnail('thumbnail', array('class' => 'img-responsive push--bottom')); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php _e('posted by'); ?> <?php  the_author(); ?>

<?php the_category(',') ?>

          <?php the_content('

Read More

'); ?>          <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>           <?php edit_post_link('Edit', ' | ', ''); ?>

<

1

2

>

<?php previous_post_link('<< %link') ?>

<?php next_post_link(' %link >>') ?>

     <?php get_sidebar(); ?>


title: SQL query to check whether a meta key is set or not for a post in post_meta table

text: Condition: some post have meta_key 'status'. Please help me in with this condition: sql query for those post who don't have meta_key 'status'


title: Ability to set character limit in BuddyPress?

text: I would like to limit characters in BuddyPress posts to certain limit . Ex: Set it to the limit of 150 ... just like twitter's 140. Googled about it and found nothing. Does any one have Idea on this? Thanks


title: Widget on home page displays wrong time compared to same widget on inside pages

text:
I am trying to use the timely events calendar and I have the upcoming events widget on my home page widget area. The time that displays is not the time I have selected. When I put the same widget to a different widget area that displays on the inside pages, the time is correct. Is there some kind of time setting that a widget area needs to register? Or an issue with the page template? thanks this is the code on the page template:

<?php _e("This is a widgeted area which is called Homepage Bottom 3.", 'genesis'); ?>

                 <?php endif; ?>
      code in functions.php:               genesis_register_sidebar(array( 'name'=>'Homepage Bottom 3', 'description' => 'This is a widgeted area which is called Homepage Bottom 3.', 'before_title'=>'
',     'after_title'=>'
'      ));      I am using the All in one event calendar by timely


title: Rotating background images with admin options

text: I recently saw an admin panel that had options to set background images for a page. The option was found on from clicking pages and then a "main page". Under the description was a form that allowed you to upload up to 5 different images. You could reorder them etc. This in turn uses those images to rotate through background images on the "main page" I was wondering how you would replicate this? I'm a huge wp noob when it comes to editing admin stuff. If it's a just bunch of PHP hooks and stuff no problem, but I have a feeling it's more than that. I realize one solution is to create a post and then attach a bunch of images to that post, but the client saw this panel and wants something just like it. Where they can change the images from the page configuration (which makes sense). As for the delivery end (the css and javascript) that's no problem, I'm just wondering about this piece right here. here's the setup: ![enter image description here](http://i.stack.imgur.com/TqafF.png) Any help would be phenomenal. Thank you Example of the result http://www.honolulufurniturecompany.com


title: How to order posts tag by tag?

text: I want to order my posts by tags with only one WP_Query() In my WP_Query I would like to display 2 posts with tags `portrait` 2 posts with tags `paysage` 2 posts with tags `portrait` 2 posts with tags `paysage` 2 posts with tags `portrait` 2 posts with tags `paysage` Etc... And I need to order these posts by recents. What is the query to do that ? Thanks PS : Sorry I cannot use code because I'm with my iPhone.


title: How to retrieve attachments from child pages of a specific Page?

text: How would I retrieve attachments from all **subpages** of a specific Page ID? Example: SPECIFIC PAGE   * Child (with attachments)    * Child (with attachments)    * Child (with attachments)  I'm currently using this code to retrieve all attachments site-wide, however I would like to limit this to only pull images from all children of a specific Page.               <?php     $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null );      $attachments = get_posts( $args );     if ($attachments) {         foreach ( $attachments as $post ) {             setup_postdata($post);             the_title();             the_attachment_link($post->ID, false);             the_excerpt();         }     }     ?>      Almost there using this code below:               <?php          $mypages = get_pages('child_of=19');     foreach ( $mypages as $mypage  ) {     $attachments = get_children(array('post_parent' => $mypage->ID, 'numberposts' => 1, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'rand'));               if ($attachments) {              foreach ( $attachments as $post ) {                  setup_postdata($post);             the_title();             the_attachment_link($post->ID, false);             the_excerpt();         }     }     }     ?>      However, there are two remaining issues:   1. Limiting the amount of **total photos** pulled. Using 'numberposts' only limits the amount of images pulled from each post   2. Randomization. Orderby => rand only randomizes the images within each post. I would like to randomly shuffle the order for everything.


title: Nested Queries using meta_query

text:
I'm trying to build a query that lists posts of a custom type with specific custom field values. Then I need to list children of each of those posts within the post, and those children also need to be filtered by specific custom field values. Here's my current code, which isn't working. Any help would be greatly appreciated. Thank you!               <?php         $args = array(             'post_type' => 'clients-placements',             'posts_per_page' => -1,             'post_status' => 'publish',             'order' => 'ASC',             'meta_query' => array(                 array(                     'key' => 'type',                     'value' => 'Client'                 ),                 array(                     'key' => 'featured',                     'value' => 'yes'                      )             )                                );         $the_query = new WP_Query( $args );          ?>              <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>                  <?php get_template_part( 'content', 'clients' );?>
         <?php             $args = array(                 'post_type' => 'clients-placements',                 'posts_per_page' => -1,                 'post_status' => 'publish',                 'order' => 'ASC',                 'post_parent' => $post->ID,                 'meta_query' => array(                     array(                         'key' => 'type',                         'value' => 'Placement',                     ),                     array(                         'key' => 'featured',                         'value' => 'yes',                          )                 )                );             $the_query = new WP_Query( $args );                   // The Loop             while ( $the_query->have_posts() ) : $the_query->the_post();                 echo '
';                 the_title();                 the_content();                 echo '
';             endwhile;                   ?>
            <?php endwhile; ?>


title: Make 'Howdy, [name]' function as log out button

text: I have been customising the `admin bar` in version 3.3 to only have certain custom links with the following added to `functions.php`:               function mytheme_admin_bar_render() {     global $wp_admin_bar;          $wp_admin_bar->remove_menu('site-name');     $wp_admin_bar->remove_menu('new-content');     $wp_admin_bar->remove_menu('updates');     $wp_admin_bar->remove_menu('comments');     $wp_admin_bar->remove_menu('edit-profile');               $wp_admin_bar->add_menu( array(         'id' => 'reports',  'title' => __( 'Reports'),  'href' => __('xyz.html'),     ));     }     add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );      I'd now like to have the far right link that says Howdy, ..., function as a Logout button. Does anyone have any suggestions on how achieve this?


title: Specify ABSPATH in jQuery url

text: I'm building a custom jQuery form and I need to specify the siteurl in the url that loads /wp-admin/admin-ajax.php. I place this code in the template that has the form:               <script type="text/javascript">     jQuery('#newFeedbackForm').submit(ajaxSubmit);      function ajaxSubmit(){         var newFeedbackForm = jQuery(this).serialize();         jQuery.ajax({             type:"POST",             url: <?php get_bloginfo('siteurl'); ?> . "/wp-admin/admin-ajax.php",             data: newFeedbackForm,             success:function(data){                 jQuery("#feedback").html(data);             }         });         return false;     }     </script>      When I submit the form I get a **404 error** with all the form inputs in the URL. I'm thinking ajax isn't being called right to handle the form and apply the function of the hidden value:               <input type="hidden" name="action" value="addComment"/>      Working backwards, here is the addComment function:               function addComment(){     global $wpdb;          $topic = $_POST['topic'];     $name = $_POST['name'];     $email = $_POST['email'];     $no_results_comment = $_POST['no_results_comment'];          // EXTRA     $date = time(); // UNIX TIMESTAMP          if($wpdb->insert('wp_no_results_feedback',array(         'topic' => $topic,                                                               'name' => $name,         'email' => $email,         'no_results_comment' => $no_results_comment,         'date' => $date         ))===FALSE){             echo "Error";                    }else{             echo "Thanks for your feedback. We will get back to you shortly.";         }         die();     }     add_action('wp_ajax_addComment','addComment');     add_action('wp_ajax_nopriv_addComment','addComment');


title: List random posts on single page in the current category

text:
I would like to show 8 random posts on single page from same category.               <?php         global $post;         $categories = get_the_category();         foreach ($categories as $category) :         $args = array( 'numberposts' => 8, 'orderby' => 'rand', 'category' => $category->term_id);         var_dump($category->term_id);         $rand_posts = get_posts( $args );         foreach( $rand_posts as $post ) :         ?>
<?php the_post_thumbnail(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
         <?php endforeach; ?>         <?php endforeach; ?>      ..but if the post has 2 or more categories it lists 16/24/32 posts. I hope anyone can help to me. Thanks!


title: order event posts by multiple custom fields

text: My event date data is in 3 separate custom fields and I need to sort by entire date, including day, month, year. Right now it's sorting by month only. How can I change it to sort by not just month but full date? Here's my code:               $arguments = array(         'post_type' => 'post_events',         'post_status' => 'publish',         'paged' => $paged,         'meta_query' => array(             array(                 'meta_key' => 'eventsmonth',                 'orderby' => 'meta_value'             ),             array(                 'meta_key' => 'eventsday',                 'orderby' => 'meta_value'             ),             array(                 'meta_key' => 'eventsyear',                 'orderby' => 'meta_value'              )       ),         'meta_key'   =>  'eventsmonth',  // sorting by month         'orderby'    =>  'meta_value_num', // numeric value         'order'      =>  'ASC'      );


title: Modify taxonomy-$taxonomy-$term.php to include posts from all blogs in multisite

text: How should I modify the `taxonomy-$taxonomy-$term.php` template to include posts from all sites in the network? I've been looking into the `query_posts` method from the Custom Queries Codex article, and also into the `pre_get_posts` method, and while it is clear how to modify the query to include other parameters from WP_Query, it isn't clear how to include posts from all sites. I'm thinking something like this:               global $wp_query;          $all_blogs_ids = array();     $all_sites = wp_get_sites();     foreach ( $all_sites as $site ) {         $all_blogs_ids[] = intval($site['blog_id']);     }     $posts = array();     foreach ( $all_blogs_ids as $blog_id ) {         switch_to_blog($blog_id);         $query = new WP_Query(array($taxonomy => $term));              foreach ($query->posts as $post) {             $posts[] = $post;         }         restore_current_blog();     }          global $post;     foreach ( $posts as $post ) {         setup_postdata($post);              // Actual template functions and html here.     }      What's the best way to achieve this? ### Update Doing the following has allowed me not to worry about `setup_postdata`:               <?php     $GLOBALS['wp_query']->posts = array();     $GLOBALS['wp_query']->post_count = 0;          $posts = array();     $sites = wp_get_sites();          foreach ($sites as $site) {         switch_to_blog($site['blog_id']);                   // Get posts         $q_posts = get_posts(array(             'position' => 'event_highlights',             'posts_per_page' => -1         ));              foreach ($q_posts as $post) {             $posts[] = $post;         }              restore_current_blog();     }          $GLOBALS['wp_query']->posts = $posts;     $GLOBALS['wp_query']->post = $post;     $GLOBALS['wp_query']->post_count = count($posts);          // Rest of the template here      The only problem with this is tags like `the_permalink` and thumbnails, which don't fetch correctly.


title: How to tell if a script is being executed from a plugin, a theme or a child theme in WordPress?

text: I have a framework for WordPress that can be embedded into either a **plugin** , a **theme** or a **child theme**. In order to return proper URLs, the script needs to determine from where it is being executed. I believe I could do something like matching `__FILE__` against:   * `get_template_directory_uri()` (theme),    * `get_stylesheet_directory_uri()` (theme or child theme), or    * `plugin_dir_url( __FILE__ )` (plugin) Is there a better, more reliable approach than using `strpos()` to compare the above? How would I go about it?


title: How to send form data from WordPress (Meta Box) to an OData service?

text: I have created a form within a Meta Box on the 'Add New Page' screen. I want the data from this form to be sent to an OData service on a central server. I can see that OData is supported on PHP (http://odataphp.codeplex.com/) but it requires the **OData for PHP SDK** to be installed on the server. Because the server could be Windows/UNIX/LINUX/other I don't know if I can create a generic installation file to make it transparent for the user to install my plugin. What would be the best method of doing this?


title: Why this plugin is not working?

text: I am testing jQuery in my wordpress plugin. Two files 1. main_plugin.php 2. js_plugin.js (Both in the same directory HelloWorld).   CODE:   PHP FILE:               <?php     /*     Plugin Name: jQuery Test Plugin     Plugin URI: http://www.rabwahnetwork.net     Description: This plugin is a test     Author: Rana Faiz Ahmed     Author URI: http://www.rabwahnetwork.net     */          function load_my_script()     {         wp_enqueue_script( 'script-name', WP_PLUGIN_URL . 'HelloWorld/js_plugin.js', array("jquery"), false, true );     }          add_action( 'wp_enqueue_scripts', 'load_my_script' );      JS file:               jQuery('.entry-header').click(function(e) {         e.preventDefault();         jQuery(this).remove();     });


title: WordPress Loop: List All Posts by a Category & Subcategory

text: I want to display all post under a category and all subcategories under the parent categories. But couldn't find proper suggestion over forum or failed to understand the solution. It's possible to perform this tasks by manually adding add ID into query but for me, I need all to be autopopulated. Need suggestion.


title: get_posts() doesn't consider user permissions

text: I want to show a list of links to posts for the logged in user on my wp. So I started to do so:               $posts_array = get_posts( array( 'post_type' => 'download', 'post_status' => 'publish' ) );     //$posts_array = apply_filters( 'downloads_shortcode', $posts_array );     foreach($posts_array as $post) {         setup_postdata($post);         $title = "ID ) . ">" . $post->post_title . "";         echo $title;     }      But it seems like the function doesn't care about the user capabilities. I use a plugin called "Groups" to require a capability for viewing a post. Everywhere on the page the posts are hidden, if a capability is missing. I'm confused because wp uses get_posts() itself. How to achieve this? //through Ravs hint I was able to do this approach: I extended the plugin Groups:               add_filter( 'get_posts', array( __CLASS__, "get_posts" ), 1 );     /**      * Filter posts by access capability.      *      * @param array $posts      */     public static function get_posts( $posts ) {         $result = array();         $user_id = get_current_user_id();         foreach ( $posts as $post ) {             if ( self::user_can_read_post( $post->ID, $user_id ) ) {                 $result[] = $post;             }         }         return $result;     }      and applied the filter as I already experimented:               $posts_array = apply_filters( 'get_posts', $posts_array );      Thank you.


title: How to override shortcodes.php core file?

text: I would like to override/update to core shortcodes.php file. Build an array and send data differently to other functions, but my question is how to do that without editing the core file? Is there a best practice way overriding core files and/or functions?


title: Renaming wordpress login and get new password button

text: I am currently building custom wordpress admin login theme.Now I have an idea but not sure it is possible.I want to rename "Get New Password" to something "Get New". Is it also possible to rename "Log In " to "Go"?


title: (resolved) Uploading images from a custom page using blueimp uploader?

text:
I'm working with a frontend upload form that uses blueimp jQuery-File-Uploader to do all the heavy lifting ... but, after attempting to add the necessary WordPress functionality to blueimp I started running into some errors that I am unable to figure out. **Update / My code** HTML (the frontend form):               <form id="fileupload" action="" method="POST" enctype="multipart/form-data">                           Add files...                          <input type="file" name="files[]" multiple />

     </form>      JS (I'm using the same js that is used in the Basic Plus demo file) Just changing the url variable to the location of the UploadHandler.php file PHP (relative parts of my upload script ... I'm using the default UploadHandler script and trying to customize it for WordPress)               // Required WordPress files and hooks     require_once( $_SERVER['DOCUMENT_ROOT'] . "/wp-load.php" );     require_once( $_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/media.php" );     require_once( $_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/file.php" );     require_once( $_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/image.php" );          $upload_dir = wp_upload_dir();          global $current_user;     get_currentuserinfo();     $logged_in_user = $current_user->ID;          // Some default blueimp code          // First few lines of the __construct function     global $upload_dir;     $this->options = array(         'script_url' => $this->get_full_url(),         'upload_dir' => $upload_dir['path'] . '/',         'upload_url' => $upload_dir['url'] . '/',          // A lot more default script code          // The handle_file_upload function with WordPress customizations     protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,         $index = null, $content_range = null) {         global $logged_in_user;         $file = new stdClass();         $file->name = $this->get_file_name($uploaded_file, $name, $size, $type, $error,         $index, $content_range);         $file->size = $this->fix_integer_overflow(intval($size));         $file->type = $type;         if ($this->validate($uploaded_file, $file, $error, $index)) {             $this->handle_form_data($file, $index);             $upload_dir = $this->get_upload_path();             if (!is_dir($upload_dir)) {                 mkdir($upload_dir, $this->options['mkdir_mode'], true);             }             $file_path = $this->get_upload_path($file->name);             $append_file = $content_range && is_file($file_path) &&                 $file->size > $this->get_file_size($file_path);                  if ($uploaded_file && is_uploaded_file($uploaded_file)) {                 // multipart/formdata uploads (POST method uploads)                 if ($append_file) {                     file_put_contents(                         $file_path,                         fopen($uploaded_file, 'r'),                         FILE_APPEND                     );                 } else {                     move_uploaded_file($uploaded_file, $file_path);                 }             } else {                 // Non-multipart uploads (PUT method support)                 file_put_contents(                     $file_path,                     fopen('php://input', 'r'),                     $append_file ? FILE_APPEND : 0                 );             }             $file_size = $this->get_file_size($file_path, $append_file);             if ($file_size === $file->size) {                 $file->url = $this->get_download_url($file->name);                 if ($this->is_valid_image_file($file_path)) {                     $this->handle_image_file($file_path, $file);                 }             } else {                 $file->size = $file_size;                 if (!$content_range && $this->options['discard_aborted_uploads']) {                     unlink($file_path);                     $file->error = $this->get_error_message('abort');                 }             }             $this->set_additional_file_properties($file);         }              $attachment = array(             'post_mime_type'    => $file->type,             'post_title'        => preg_replace( '/\.[^.]+$/', '', basename( $file_path )),             'post_content'      => '',             'post_author'       => $logged_in_user,             'post_status'       => 'inherit',             'post_type'         => 'attachment',             'guid'              => $this->options['upload_url'] . $name         );              $attachment_id = wp_insert_attachment( $attachment, $file_path );              // Generate the attachment data         $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file_path );              // Update the attachment metadata         wp_update_attachment_metadata( $attachment_id, $attachment_data );              return $file;     }      **Updated Issue:** At first this seems to work ... but, when you check the `wp_posts database table` nothing has been added. Also, when looking in the `media library` it only shows the uploaded image (none of the other images, which are in the database) and the following errors appear in the `error_log`:               PHP Warning: strpos() expects parameter 1 to be string, object given in /Applications/MAMP/htdocs/wordpress/wp-includes/post.php on line 188     PHP Warning: preg_match() expects parameter 2 to be string, object given in /Applications/MAMP/htdocs/wordpress/wp-includes/post.php on line 188     PHP Catchable fatal error: Object of class stdClass could not be converted to string in /Applications/MAMP/htdocs/wordpress/wp-includes/post.php on line 189      I understand the fact that the variable that I'm calling is an object, not a string, but I'm unsure what to put in it's place. Any help is appreciated have tried everything I can think of. Really need to get this up and running ASAP! Thanks


title: Wordpress Jquery UI Spinner

text: I am trying to use jquery-ui spinner in my plugin. I had googled it, but not found any referrence that can help me out. It is also not written in the docs http://codex.wordpress.org/Function_Reference/wp_enqueue_script. Nor also only the word `spinner`. Is the current version of wordpress (3.8.1) include jquery ui spinner in its library? If so, how to use it on a plugin? Best Regards :)


title: Get value from post meta array, and add it as a category

text: I have a form that performs an AJAX hook that does several things, one of them is that it takes some form fields, adds them to an array, and adds that array as meta to the post that is created from the form. In the AJAX function, it looks like this:               // get form data array (we already have $post_id set)     $data_cf = $_POST['form_data'];     // update post meta (post is the newly created fundraiser from above)     update_post_meta( $post_id, '_cf_data', $data_cf );           // set some stuff from form data array     $data_cf_country = $data_cf['country'];     $data_cf_city    = $data_cf['city'];     $data_cf_state   = $data_cf['state'];      then I need to add each of the above to their respective categories/taxonomies for the post. Ex: the values could be United States, Chicago, Illinois, which would be added to Country, City, State. I have the taxonomies registered already for the post. I just can't seem to find out how to add the post to them at this step. Tips? Thanks!


title: Site running slow on new server?

text: I recently uploaded a website to a new 123-reg server on a single WP installation (www.moseleycoachsales.co.uk). I had developed the site on my own hosted multisite environment (http://test.digitalgroupmedia.com/moseley/). I had a nightmare uploading the website as the standard wordpress xml export/import facility that had always worked for me kept crashing crashing. In the end I managed to get the website live using this method (http://matteth.wordpress.com/2012/01/12/exporting-a-site-from-multisite-to- single-installation/) The live website is now very sluggish and nowhere near the speed it was on my test environment. I don't know if this is down to the new server, or if something has occurred in the website move (perhaps database related) that has created the issue? I'm not great with MySQl so don't really have the skill to diagnose this issue (if it even is the issue) and would really appreciate some help.


title: Does WP Have a Function To Generate .htaccess RewriteCond?

text: I know that I can edit .htaccess manually and add a RewriteCond statement inside, but I need to build a plugin that does this the proper way by using WP rewrites which then get pushed into .htaccess with flush_rewrite_rules(). I need RewriteCond in this case. Does WP have some obscure function that lets me push a RewriteCond statement into the .htaccess?


title: Link to page in category

text: I want to link to an archive page in WordPress, so like:               <a href="<?php page( 2 ); ?>">link      so if a for example a category page is shown, this link needs to go to the second page for that category.


title: Current theme broken - after server and domain migration

text: I'm migrating a Wordpress install and trying to get down the correct process for doing so. I've tried using the method I thought would work, but it didn't. My files and database are in place, but when I visit the wp-admin the theme manager tells me this - The active theme is broken. Reverting to the default theme. Unfortunately if you then re-activate it, it work's but loses all it's widgets etc. I've been using a search and replace function to change all the instances and options using the old domain with this script - http://interconnectit.com/124/search-and-replace-for-wordpress-databases/ Which is pretty cool. I'm just replacing               http://domain1.com      with               http://domain2.com      although even running this before I access the site doesn't seem to stop the problem of the broken theme and thus losing all the widgets. Anyone know how I can migrate this site without having the ass-ache of losing all the widgets (of which there are way to many to do manually).


title: Search CPT Title AND Meta

text:
I currently have a CPT I would like to search, the catch is I also need to be able to search the meta data for the CPT. I have the following code that currently searches the meta value needed but I can't seem to get it to search the title AND the meta data. Help would be greatly appreciated!               <?php     /**      * @package WordPress      * @subpackage themename      */          get_header();      $search = get_search_query(); ?>

<?php printf( __( 'Search Results for: %s', 'themename' ), '' . get_search_query() . '' ); ?>
                             <?php                                 // LOOP ARGUMENTS                                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                                 $args = array( 'post_type' => 'team_members', 'posts_per_page' => -1, 'paged' => $paged, 'orderby' => 'title', 'order' => 'ASC', 'meta_query' => array(                                         array(                                             'key' => 'memberFirstName',                                             'value' => $search,                                             'compare' => 'LIKE'                                             ),                                         )); // -1 Shows ALL Posts                                 $loop = new WP_Query( $args );                                 while ( $loop->have_posts() ) : $loop->the_post();                                      // CUSTOM CONTENT                                 $memberFirstName = get_post_meta($post->ID,"memberFirstName",true);                                 $memberPosition = get_post_meta($post->ID,"memberPosition",true);                                 $memberPhone = get_post_meta($post->ID,"memberPhone",true);                                 $memberEmail = get_post_meta($post->ID,"memberEmail",true);                                 $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail_name');                                 $imgURL = (isset($thumb[0]) ? $thumb[0] : get_template_directory_uri() . "/images/member_placeholder.jpg");                                      $postID = get_the_ID();                                 $terms = get_the_terms( $postID, 'service-type' );                                 foreach($terms as $term) {                                     if($term->parent == 14 ) {                                         $memberDivision = $term->name;                                     }                                     if($term->parent == 8 ) {                                         $memberDivision = $term->name;                                     }                                     if($term->parent == 3 ) {                                         $memberCity = $term->name;                                     }                                 }                             ?>
                                     <img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo urlencode($imgURL); ?>&h=79&w=79&zc=2">
                                              <?php echo $memberFirstName; ?> <?php the_title(); ?>, <?php echo $memberPosition; ?>
                                         <?php echo $memberDivision; ?>, <?php echo $memberCity; ?>
                                             <?php echo $memberPhone; ?>                                             <a href="mailto:<?php echo $memberEmail; ?>">Email

                                            <?php /* END WHILE AND RESET QUERY */ endwhile; wp_reset_query(); ?>
                             <?php $total_pages = $loop->max_num_pages;                                      if ($total_pages > 1){                                          $current_page = max(1, get_query_var('paged'));                                          echo paginate_links(array(                                     'base' => get_pagenum_link(1) . '%_%',                                     'format' => '/page/%#%',                                     'current' => $current_page,                                     'total' => $total_pages,                                 ));                             }   ?>

                     <?php if ( dynamic_sidebar('team-sidebar') ) : else : ?><?php endif; ?>

               <?php get_footer(); ?>


title: How are terms connected with posts in database?

text: In a multi-site environment, I have a special need to get post terms (on a custom taxonomy) without the expensive operation of "switching blogs". I thought I might write my own query to get terms for a given post on a given blog. I'm looking through the three tables:               wp_3_terms     wp_3_term_relationships     wp_3_term_taxonomy      Yet I cannot see where there is a connection to post_id in any of these. So the question: How do terms link with a given post in the database? If I can know that, I can do the rest.


title: Set Transient expiration

text: I have a page that displays a random post every day. In order to change post every 24 hours I use `set_transient('totd_trans_post_id', $totd[0]->ID, (60*60*24));` What I'm wondering is this:   * Does the countdown (60*60*24) start as soon as I have inserted and saved the code?   * If yes: What happens if I let the code run for 23 hours, and then decide to "update" the code. Will the countdown restart?   * If no one visits the site for 48 hours, will the expiration still take place? Or does someone have to visit after 24 hours to "run" it?


title: Make 2 different WooCommerce checkout pages?

text: I'm wondering whether it's possible to make 2 different checkout pages for 2 different products? If a buyer chooses the product #1, he/she will be redirected to the checkout page #1. If he/she chooses the product #2, he/she will be redirected to the checkout page #2. These 2 checkout pages have some same fields and some different fields. Some same fields are optional on the checkout page #1 but are mandatory on the checkout page #2. Any help is appreciated. :)


title: 'jQuery is not defined Error' appearing in load-scripts.php

text: I'm writing this question having already found a solution, in order to see whether other people have encountered this problem. I was having a problem on the back end of a site I am building in wordpress in which all the jquery scripts that I tried to load using the native wordpress handles (i.e. jquery-ui-core, jquery-ui-sortable, etc) were not loading. If I checked the state of those script handles using the wp_script_is() function, it showed that they were registered, enqueued, but not printed. At the same time my load-scripts.php file was registering an error: "jQuery not defined'. It turns out that this problem has something to do with a new feature added in Wordpress 3.5 that attempts to concatenate all javascript requests into a single call. This feature, however, was causing conflicts for some reason with some plugins. That at least is what Kevin Leary has reported here. The solution that Leary describes is to disable this feature by adding the following line to the wp-config.php file (after the line defining the ABSPATH):               define('CONCATENATE_SCRIPTS', false);      Does anyone understand why this bug is occurring? And is this a bug in the new version of Wordpress?


title: Proper way to hook wp_get_attachment_url

text: I am trying to hook `wp_get_attachment_url()` with my custom implementation. I am trying to get my post images and any other static data from the Amazon S3 and I was wondering if I can configure the URL with my Amazon bucket URL. This is what I was trying to do               add_filter('wp_get_attachment_url', 'custom_get_attachment_url', 1, 1);          function clrs_get_attachment_url($post_id = 0) {     // change URL for Amazon bucket     }      but this is not working as expected as I am getting `$post_id` as `0`. How to do it in a proper way?


title: Verify Registration email on local host windows 7 xampp

text: I am very new to word press development. I have set up xampp and successfully installed wordpress on my localhost with my admin account. I need to create a registration for the users to register in my website. I have used various plugins for registration. One of my plugins says a registration was successful and a confirmation mail will be sent. How can I check or activate to send mail confirmation to check whether it works fine.


title: Advice on how to build multiple cross-tagged content types

text: From those who are more experienced with WP, I could use some advice on how to best set up a local history site to do the following:   * There will be a list of _articles_ on different historical topics. Each will be tagged with the _people_ who appear in the article, the _organizations_ discussed, and maybe other metadata like _events_ or _places._   * Each _person_ should have his/her own page that shows all the _articles_ the person is mentioned is, all the _organizations_ the person is a member of, and maybe also all the _events_ they attended or _places_ they lived/frequented.   * Each _organization_ should list all the _people_ who were its members, and maybe also all the _events_ it threw and _places_ it met. And so on... I think you get the point... basically I have 3-5 sets of content that need to be tagged to each other in flexible ways. I'm not sure how best to accomplish this.   * Out of the box tags and categories don't link to each other (plus it's painful to create custom tag and category pages), though they seem like they ought to be the more natural fit.    * Then I thought I could create a custom post format for each of the non-article content types (people, orgs, events, places) and then using the plugin Advanced Custom Fields 4.3.8 I could shoe-horn all the tags in there, but that seems pretty hideous, and it's not clear it would even work since it seems to want everything to be 1:1. I know this isn't the best fit for StackOverflow, but I feel like this use- case isn't so unique that there isn't a clear architectural recommendation or even an existing plugin. Thanks so much!


title: Difference between the 4 Built in RSS Feeds?

text: Can somebody give me an explanation on the differences between the 4 different built in RSS Feeds and why / when I should choose one over the other? Why does WordPress incorporate 4 different ones instead of focusing on 1 universal one? The feeds include: 1) RDF/RSS 1.0 feed 2) RSS 0.92 feed 3) RSS 2.0 feed 4) Atom feed WordPress RSS Feeds Codex


title: How can I implement a simple post editor?

text: I want a simple post editor for WordPress, it should be something like tumblr editor or the stackoverflow editor. My questions:   1. Is there any plugin I can use? (I just can't find it)   2. If no plugin, how can I implement it? Is there any example? (I saw one site has such editor using WordPress, but they have reworked their site now)


title: How to get clean code for a gallery?

text:
I want clean code for a gallery, like:

      Currently my code is coming out like this:


title: Store SNS share value via function.php

text: I am trying to store SNS share value + comment count on my postmeta, DB. I put code below to accomplish this task,               function get_sns_share($post_ID=0) {          $url1=get_permalink($post->ID);         $src = json_decode(file_get_contents('http://graph.facebook.com/' . $url1));         $share_count = $src->shares; // facebook commnet + comment like + share + like         $my_var = get_comments_number( $post_id ); // comment count         $social_score = $share_count + $my_var + $tweet; // social score sum             if ($social_score > 999) $social_socre = 999;              return $social_score;          update_post_meta($post_id, '_social_score', $social_score);     }      The problem is this code certainly do works every field other than update_post_meta. It seems it does not add add post meta field to my database, thus I cannot get any value from there. Your help would be much appreciated.


title: Where can I find documentation on what characters are allowed in user names and why?

text: I would love to be able to use spaces in usernames, but this does not seem possible. Is there a writeup in the codex or somewhere that explains what characters are allowed and why it was restricted to that set or is it just alphas only and suck it up? If I want users to use something other than a username with no spaces, is my only real option a plugin that allows users to login with their email addresses instead, but still requires an alpha only username at account creation? Oh, and I am on a WPMU/network site.


title: Show message in media-new.php

text:
I'm wondering if there's a way to show a specific message when user uploads a file using the `wp-admin/media-new.php` script. So far I have this:               function my_uploads_notice(){         global $pagenow;         if ( $pagenow == 'media-new.php' ) {              echo '

MY NOTICE

';         }     }     add_action('admin_notices', 'my_uploads_notice');


title: Where is the Leave a Comment link set

text: I have a self hosted WordPress blog and use the Isabella Theme from BluChic. The initial installation of this was set up via an auto installer that the host provider offered. I moved the blog from one domain to another and in the process took the initial install and moved all the files. I had to do some changes in the db export to update the url to get everything working. Everything works fine apart from the submit link for the Leave a Comment button. Does anyone know where this link is stored? I have all the files downloaded locally and have access to the database but so far I have no luck finding where this link is set. The problem is the link is there but it points to the old domain address, even though all of the other links updated. This is the only link giving me hassle. It appears when you press post on the comment edit box that is popped up after clicking Leave a Reply Any help on its location would be much appreciated!


title: Is it possible to make specific posts editable by all authors?

text: I have a Q&A site in which people can ask experts different questions. Some questions are addressed to a specific expert so I insert the post under their authorship. However, there is also a General option which should allow all the experts to answer the question. Is there a way to open specific posts to all users which has a role of author?


title: Wordpress excerpt for specific posts in category

text: Is there any way to create "more" link for excerpt only for posts in a specific category? For example only posts in "news" category should have a more link. If there's no option for that, maybe posts in specified WP Query? I am using this code for creating "more" link for excerpts but it works for _all_ posts:               function excerpt_read_more_link( $output ) {        global $post;        return $output . 'ID ) . '">more';     }     add_filter( 'the_excerpt', 'excerpt_read_more_link' );      toscho thak You for reply. I will check Your solution, but I remeber that I used this code:               if (in_category('news')) {      function excerpt_read_more_link( $output ) {        global $post;        return $output . 'ID ) . '">more';          add_filter( 'the_excerpt', 'excerpt_read_more_link' );     }      and this didn't work :-/


title: How do I sort a custom post type admin column using two meta keys?

text: I have created a custom post type along with custom columns. One of my columns displays a date range such as "12/05/2012 - 11:00 am to 12/15/2012 - 1:00 pm". This is a concatenated string using a combination of four fields: `startDate`, `startTime`, `endDate`, `endTime`. So far I have been able to make this column sortable based upon the `startDate` meta_key, but I would like to extend this such that it's sorted by the `startDate` and then by the `startTime`. ### Currently   * 12/23/2012 - 7:00 pm   * 12/05/2012 - 11:00 am   * 12/05/2012 - 2:00 pm   * 11/30/2012 - 1:00 pm ### Need   * 12/23/2012 - 7:00 pm   * 12/05/2012 - 2:00 pm   * 12/05/2012 - 11:00 am   * 11/30/2012 - 1:00 pm This is my progress from what I've gathered over the internet so far, but it does not sort by time:               add_filter( 'request', 'event_column_orderby' );          function event_column_orderby ( $vars ) {              if ( !isset( $vars['orderby'] ) || isset( $vars['orderby'] ) && 'datetime' == $vars['orderby'] ) {             $vars = array_merge( $vars, array(                 'orderby'       => 'meta_value',                 'order'         => 'ASC',                 'meta_query'    => array(                     array(                         'key'   => 'rqp-event-startDate'                     ),                     array(                         'key'   => 'rqp-event-startTime'                     )                 )             ));         }              return $vars;     }


title: Post Comments with Ajax in Wordpress

text:
I use this code to post comments with ajax on my WP blog. It works fine but I display the comment form on my homepage so the plugin only works for the first post (first comment form). I want it to work for all the forms. Here is my code:               if (typeof jQuery != 'undefined') {       jQuery('document').ready(function($){         var commentform=$('#commentform');         commentform.prepend('

');              var statusdiv=$('#comment-status');              commentform.submit(function(){           var formdata=commentform.serialize();           statusdiv.html('
Processing...
');                var formurl=commentform.attr('action');                $.ajax({             type: 'post',             url: formurl,             data: formdata,             error: function(XMLHttpRequest, textStatus, errorThrown){               statusdiv.html('
You might have left one of the fields blank, or be posting too quickly
');             },             success: function(data, textStatus){               if(data=="success")                 statusdiv.html('
Thanks for your comment. We appreciate your response.
');               else                 statusdiv.html('
Please wait a while before posting your next comment
');                 commentform.find('textarea[name=comment]').val('');             }           });                return false;          });       });     }


title: Display posts where date field matches current month?

text: I have a loop which displays all the posts of the "events" post type on my site. Each of these posts has a custom date field "event_date", which I sort the display of the loop by. I would like to simplify my post management by only display posts which match the current month; that is, as of today (Dec.30) all the December posts display but on January 1, all the January posts display. Note this is not post date, it's the value of the field (when the event takes place). I want to keep the month's worth of posts up ll month even when their date passes -- so always the complete month. Most of the posts I found here with search are dealing with the post date, whereas I need to use the value of this custom field instead. Thanks. My current query:               $args = array( 'post_type' => 'hh_event', 'posts_per_page' => -1,'orderby' => 'meta_value', 'meta_key' => 'event_date', 'order' => 'ASC'  );                 $the_query = new WP_Query( $args );      To add to this, the field is a custom field made with the Advanced Custom Fields plugin, and the date is save by this as yymmdd.


title: How to add a class when there's no sidebar?

text: I would like to add a class to a page template's body if the sidebar is not defined. How can I do that?


title: Can't create tables with my plugin

text: Here is the code:               <?php          /*       Plugin Name: MyPluggin       Plugin URI: http://localhost/       Description:        Version: 0.0.2       Author: localhost       Author URI: http://localhost/       License: GPL2      */               function crear_tablas() {              global $wpdb;                   require_once(ABSPATH . 'wp-admin/includes/upgrade.php');                   $table_name_1 = $wpdb->prefix . "usuarios";         $consulta_1 = "create table $table_name_1(                     count bigint unsigned not null  primary key auto_increment,                     ID bigint not null references wp_users(ID),                     puntosDisponibles bigint unsigned default 1000                 );";              dbDelta($consulta_1);                   $table_name_2 = $wpdb->prefix . "deportes";         $consulta_2 = "create table $table_name_2(                     ID int unsigned not null  primary key auto_increment,                     nombre tinytext                 );";              dbDelta($consulta_2);              $table_name_3 = $wpdb->prefix . "ligas";         $consulta_3 = "create table $table_name_3(         ID int unsigned not null  primary key auto_increment,         nombre tinytext     );";                  dbDelta($consulta_3);                   $table_name_4 = $wpdb->prefix . "equipos";         $consulta_4 = "create table $table_name_4(         ID int unsigned not null  primary key auto_increment,         nombre tinytext,         apodo  tinytext,         deporte int unsigned not null references deportes(id),         liga    int unsigned not null references ligas(id)          );";                  dbDelta($consulta_4);                  $table_name_5 = $wpdb->prefix . "eventos";         $consulta_5 = "create table $table_name_5(         count bigint unsigned not null  primary key auto_increment,         ID  bigint unsigned not null references wp_posts(ID),         localID int unsigned not null references equipos(ID),             visitanteID int unsigned not null references equipos(ID),         goleslocal  int unsigned,         golesVisitante  int unsigned,         fecha DATE not null,         hora  TIME not null,              status  int unsigned default 0          );";                  dbDelta($consulta_5);              $table_name_6 = $wpdb->prefix . "apuestas";         $consulta_6 = "create table $table_name_6(         count bigint unsigned not null  primary key auto_increment,         eventoID bigint unsigned not null references   wp_posts(ID),         puntosJugados   bigint unsigned not null,         userID  bigint unsigned not null references wp_users(ID),          fecha DATE not null,         hora  TIME not null,              resultado int unsigned not null,         porcentaje float(4,2),         estado int unsigned not null default 0     );";                  dbDelta($consulta_6);          }                                   function instalar_sistema_apuestas () {         crear_tablas();         //crearCategorias();         //crearPaginaPerfil();           }          register_activation_hook(__FILE__,'instalar_sistema_apuestas');                                        ?>         No tables were created:               mysql> show tables;     +------------------------+     | Tables_in_wordpress |     +------------------------+     | wp_commentmeta         |     | wp_comments            |     | wp_links               |     | wp_options             |     | wp_postmeta            |     | wp_posts               |     | wp_term_relationships  |     | wp_term_taxonomy       |     | wp_terms               |     | wp_usermeta            |     | wp_users               |     +------------------------+     11 rows in set (0.00 sec)


title: Upload more than one media files with a post

text: I am not sure if this has been asked to community before. I 'd like to have more than one upload custom fields with WP post. Could anyone please suggest if there is any plugin available for it OR if I can achieve it by using WordPress native feature. Thanks,


title: Is it possible to find out what theme a specific web site is using?

text: I just want to know is there a way to find out (by inspecting links or etc.) to find out what theme a specific web site is using? P.s. I do not own the sites that I want to check. Regards,


title: How long does a deprecated function live in core?

text: I'm curious to find out the process/philosophy behind removing deprecated functions from core. The Codex says this: > These functions below have been deprecated. That means they have been > replaced by new functions or are no longer supported, and may be removed > from future versions. Since 'may be removed' is a bit ominous and somewhat unclear, I have the following questions.   1. What is the criteria for deletion of a deprecated function? (i.e. version gap, time-frame, security risk, etc...)   2. Is the deletion of a function communicated to the public officially?  For example: `get_postdata()` has been deprecated since 1.5.1 and doesn't have an official Codex page. Is there a reason this is still around other than to support older versions of WordPress?


title: Subpages return 404 error

text: I set permanent link as http://site.com/%postname%/. I'm talking about this type of pages: http://codex.wordpress.org/Pages_Screen. All first level pages work fine. But subpages don't. For the first level page I get url like this: http://site.com/page/. For the second level page - http://site.com/page/subpage/. If I use permanent link http://site.com/?p=123 or http://site.com/2012/02/29/sample-post/, subpage works fine then. How does make it work with http://site.com/%postname%/ mask? Added:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      **Update:** **I found the reason. It is a post_type field in the wp_posts. But I cannot find out where this field is saved?**


title: WordPress Dashboards: slowness and timeouts

text: On a single server, we have a number of single-site WordPress installations (which have been around for many years and have worked fine 'til now) and one newer multi-site installation that has been working fine for a few months. They are all connected to separate databases on a separate MySQL server in the same data center. In the last week or so, the dashboards on ALL of these installations will intermittently load extremely slowly or timeout altogether (depending on the browser -- Chrome seems to give up sooner than Firefox), to the point of being unusable. When one of the dashboards is showing the problem, all of the other dashboards on the same server do the same. When one is working, all are working. This will happen at any point during the login or dashboard-using process. The actual reader-facing blog pages work fine at these times, and the other non-WordPress pages on the server all work fine. A WordPress installation on a separate server but connected to the same MySQL server also works fine during these times. It's only the dashboards on this one server. I've tried disabling nearly all of our plugins (the ones not needed to keep the blogs minimally functional, like Akismet and Google Analyticator). I've tried upping the PHP memory limit. No luck with any of this. Our host has been trying to help me but is also at a loss. Any ideas would be greatly appreciated!


title: Renaming child-theme folder fixed wp-admin blank

text: Weird thing happened. I have a WP instance, and I wanted to have a local copy. I copied all the files, created the DB from a dump, and everything seemed to be working fine. However, when going to `wp-admin`, BLANK SCREEN. I renamed the child-theme from `alterna-child` to `alterna-child2` and then I could login. I deactivated the alterna-child theme, and then activate it back, but if I logout, I can't access the admin either. I am confused, because in the live site this is not happening. Any thoughts? EDIT: I have tried removing all the files from the theme, and I can see that the file that creates the conflicts is functions.php, which contains the following:               include(WP_CONTENT_DIR . '/graduates_functions.php');      And yes, I have `graduates_functions.php`


title: Divide Loop Into Days & Categories

text:
If you could help, I'd greatly appreciate it, because I'm halfway there, but I'm currently stuck! The site I'm working on needs to have it's posts, within the loop, divided up by days, and then under those days, be divided up by categories. Currently, I have the days working, but can't for the life of me get the categories divided under the days. Here's what I basically have at the moment as far as layout goes:
Wednesday, July 30, 2014
     <POST ONE>     <POST TWO>     <POST THREE>
Tuesday, July 29, 2014
     <POST ONE>     <POST TWO>      It's great that it's working and the days are divided, but like I said, I need those days to be divided into categories as well. For example, I need something like this:
Wednesday, July 30, 2014

Columns
     <POST ONE>
Links
     <POST TWO>     <POST THREE>
Tuesday, July 29, 2014

Columns
     <POST ONE>
Links
     <POST TWO>      Currently, this is what my loop looks like:
                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                     <?php if( $current_date != get_the_date('l, F j, Y') ){                         echo '
'.get_the_date('l, F j, Y').'
';                         $current_date = get_the_date('l, F j, Y');                     } ?>                     <?php get_template_part(THEME_LOOP."post"); ?>                 <?php $counter++; ?>                 <?php endwhile; else: ?>                     <?php get_template_part(THEME_LOOP."no","post"); ?>                 <?php endif; ?>                 <?php customized_nav_btns($paged, $wp_query->max_num_pages); ?>
      Once again, like I said, any help would be greatly appreciated! Thanks for taking a look! **UPDATE:** I've been messing around and I think I'm almost there. This should be working, but I can't get any posts to spit out. Would someone mind taking a look and let me know what's going wrong? Thanks! Here's my current loop now:
                 <?php                 $_start=(floor($wp_query->query_vars['paged'])-1)*5;                 if($_start<0){$_start=0;}                      for($_d=$_start;$_d<$_start+5;$_d++) {                     $_today=date("l, F j, Y", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                     echo "
$_today
\n";                 ?>

Columns

                            <?                               $_year=date("Y", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $_mon=date("m", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $_day=date("d", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $the_query = new WP_Query( 'year=' . $_year . '&monthnum=' . $_mon . '&day=' . $_day.'&category_name=Column-2' );                               while ( $the_query->have_posts() ) : $the_query->the_post();                                 global $wpdb;                                 $comments = $wpdb->get_results("SELECT DISTINCT(comment_content) FROM $wpdb->comments WHERE comment_post_ID ='".get_the_ID()."' AND comment_approved = '1'");                                 $_count = count($comments);                                 $_comment='';                                 if($_count==1)                                   {                                   $_comment=' (1 comment)';                                   }                                 elseif($_count>1)                                   {                                   $_comment=" ($_count comments)";                                   }                                 $excerpt=str_replace("\n",' ',get_the_excerpt());                                 echo "".get_the_title()."                                                                              <fb:comments-count href=".get_permalink()."></fb:comments-count> — ".get_the_author()."
\n";                  endwhile;                               wp_reset_postdata();                             ?>                             <?php                             if(function_exists('show_columns'))                                {                               show_columns(30,$_d);                               }                             ?>

News

                           <?php                                $_year=date("Y", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $_mon=date("m", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $_day=date("d", mktime(0, 0, 0, date("m")  , date("d")-$_d, date("Y")));                               $the_query = new WP_Query( 'year=' . $_year . '&monthnum=' . $_mon . '&day=' . $_day.'&cat=-3,-2204' );                               while ( $the_query->have_posts() ) : $the_query->the_post();                                 global $wpdb;                                 $comments = $wpdb->get_results("SELECT DISTINCT(comment_content) FROM $wpdb->comments WHERE comment_post_ID ='".get_the_ID()."' AND comment_approved = '1'");                                 $_count = count($comments);                                 $_comment='';                                 if($_count==1)                                   {                                   $_comment=' (1 comment)';                                   }                                 elseif($_count>1)                                   {                                   $_comment=" ($_count comments)";                                   }                                 $excerpt=str_replace("\n",' ',get_the_excerpt());                                 echo "".get_the_title()."                                                                              <fb:comments-count href=".get_permalink()."></fb:comments-count> — ".get_the_author()."
\n";                                                         endwhile;                               wp_reset_postdata();                            ?>
                             <?php                                 if(function_exists('show_daily_links'))                                  {                                 show_daily_links(30,$_d,1);                                 }                               ?>

                    <?         if($_d==$_start)     #     if(false)           {     ?>          <?           }     ?>               <?         }     ?>
     <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }      else { ?>
<?php next_posts_link('Next Page »') ?>

<?php previous_posts_link('« Previous Page') ?>
     <?php } ?>


title: Wordpress landing page displaying vague HTML links

text: ![Wordpress landing page](http://i.stack.imgur.com/inR8R.jpg) I uploaded all the wordpress files from my local computer to the server via ftp and changed the wp-config.php file. The wordpress landing page is shown in the image. It is diplaying 'Sports Loyalty' and some other links which are part of the files uploaded in some other folder on that server. Wordpress has not been installed prior to this. What is exactly happening? Are the plug-in files clashing or something? What is the possible solution to this?


title: Export Header and Footer

text: I want to export the header and footer from WordPress as HTML with same the design: CSS, images, JavaScript files. But not main content page. I want to do this, because I will use the same design in the future. Can any one give ideas for my requirements?


title: Second loop pagination changes URL, not content

text:
I'm reasonably new to WordPress and I believe I am missing something conceptual here. I have assigned a static post to be my front page. My front-page.php template begins with a standard loop:               <?php if (have_posts()) : ?>                     <?php while ( have_posts() ) : the_post(); ?>
<?php the_title()?>
                 <?php the_content(__('Continue Reading'))?>         <?php endwhile; ?>         <?php wp_reset_postdata();?>         <?php else : ?>
Not Found

<?php _e("Empty Text Here."); ?>
     <?php endif; ?>       This successfully outputs the content of my post. Great. Now I am attempting to insert a second loop below this that will output a finite list of other posts followed by a pager. The pager shows up and when it is clicked the page reloads as expected, but the content remains unchanged. Here is my second loop?               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args=array(         'paged'             =>  $paged,         'posts_per_page'    =>  2,          'post_type'         => 'type_here'     );     $wp_query = new WP_Query($args);?>     <?php if ( $wp_query->have_posts() ) :?>         <?php while ($wp_query->have_posts() ) : $wp_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
         <?php endwhile;?>         <?php wp_pagenavi(); ?>         <?php wp_reset_query(); ?>     <?php else: ?>         <?php echo 'Empty Text Here';?>     <?php endif;?>      My taxonomy pages all paginate perfectly so I'm thinking my mistake is programmatically subtle or conceptually flagrant. Is it not possible for a post template to feature a secondary loop with its own pagination? Given that pagers generate a loop agnostic URL I am guessing that WP assumes that only the original loop qualifies for paging? > http://mysite.com/page/2/ Thanks for your help!


title: Wp_query: sort by PHP variable

text: Here is my problem: For my articles, I use a custom post type "exhibitions" and posts for all other news. I am displaying them in one query ['post_type' = array('exhibitions','posts')]. The **orderby parameter** for posts should be their _publish date_ , for exhibitions it should be _custom meta value_ (end date of the project). That way, posts would be displayed in following order:   1. Exhibition 1 (publish date: 2.1. 2013, end date: 4.4. 2013)   2. Post 1 (publish date: 13.3. 2013)   3. Exhibition 2 (publish date: 1.4. 2012, end date: 1.3. 2013)   4. Post 2 (publish date: 28.2. 2013) ## Define PHP variable from date (posts) and end-date meta value (exhibitions) and then sort by it? I came up with an idea to define PHP variable (end-date meta value for exhibitions, publish date for posts) and sort the wp_query by that. Am I going in the right direction or not? If so, how to incorporate the variable to wp_query? I've found some related articles/questions, but none of them helped me so far. ## Orderby filter? Orderby filter sounds also as the way to go: Orderby filter @Wordpress.org forums Thanks! /// Johaness's solutions is pretty much what I was aiming for. Here is my slightly modified function:               function save_sort_meta( $post_id ) {     $prev_val = get_post_meta( $post_id, 'sort_date', true );     /* set value only if not set yet (i.e. if this is a new post and not an update ) */     if ( 'exhibitions' === $_POST['post_type'] ) {             $my_meta = get_post_meta( $post_id, '_my_meta', true );         $datum_end_hidden = $my_meta['datum-end-hidden'];         update_post_meta( $post_id, 'sort_date', $datum_end_hidden);     } else {         /* using time() assuming "end_date" is a unix timestamp, adjust if not */         update_post_meta( $post_id, 'sort_date', time());     }     }     add_action( 'save_post', 'save_sort_meta' );      And here's my query:               $args = array(     'showposts' => '22',     'post_type' => array('post','exhibitions'),     'post_status' => 'publish',     'meta_key' => 'sort_date',     'order' => 'DESC',     'orderby' => 'meta_value_num'     );      For some reason, "post" posts stay in the end of the wp_query (although when I echo custom value "sort_date", it shows correctly and is larger than exhibitions, that should stay "bellow"). Does it have some connection with my removal of checking the update of the post? I did it, because I want to change values on update as well. ## Edit: Code above works! Okay, I found out where was the problem - it's quite embarassing. :) The "end date" meta value of "exhibition" post types was provided by jQuery UI Datepicker - which saves the date in miliseconds. All I needed to do was to divide $datum_end_hidden by 1000. :) Thank you VERY MUCH!


title: Set up the link in a reply to the parent comment?

text: I'm styling chronological order comments. I found this snip on this WordPress Answers site from here               comment_reply_link(        array_merge(          $args,            array(              'reply_text' => __( 'Reply ↓',              'themetextdomainname' ),              'depth' => 1,              'max_depth' => 2      )));      So my reply button appears just like I want on non-nested comments. I just need the last piece to include the link back to the parent comment. So where do these following lines go; I'm assuming in the callback function, but exactly where?               $pcom = get_comment($comment->comment_parent);     echo 'comment_parent).'">This is a reply to '.$pcom->comment_author.'';


title: Issue with Custom Roles in Multisite

text: So I've been going through hell with Custom Roles. I will try to be as descriptive as possible, to highlight my issue. Before anyone mentions it - I would like to avoid using a plugin, since that, to me, is overkill of what I view to be a simple problem. What I want: 3 Roles - Admin, Lesser Admin, User What I originally attempted: I removed the two roles Author & Contributor, to leave Administrator, Editor, and Subscriber. That worked no problem. I am having a problem with the next piece - to rename the remaining roles. I originally just did the most common suggestion               global $wp_roles;     $wp_roles->roles['editor']['name'] = 'Lesser Admin';     $wp_roles->role_names['editor'] = 'Lesser Admin';      for the last two roles (I kept Admin the same because it was close enough). But this didn't work. No matter what hooks I attached to it (I put it under `add_action('init',...)` but that did not work. So I tried to be fancy and wrote my own code to handle this.               function permissionsModification(){         $blogs = wp_get_sites();         $current_blog = get_current_blog_id();              foreach($blogs as $blog):                  switch_to_blog($blog['blog_id']);                  if(get_role('author') !== null)                 remove_role('author');                  if(get_role('contributor') !== null)                 remove_role('contributor');                  $toChange = array(                 'editor' => array('lesser', 'Lesser Admin'),                  'subscriber' => array('user', 'User')             );             foreach($toChange as $old => $new):                      $role = get_role($old);                 if($role !== null):                          if(get_role($new[0]) === null)                         add_role($new[0], $new[1], $role->capabilities);                          $users = get_users(array('role'=>$old));                     foreach($users as $user):                         $user->remove_role($old);                         $user->add_role($new[0]);                     endforeach;                          $opt = get_option('default_role');                     if($opt === $old)                         set_option('default_role', 'administrator');                          remove_role($old);                 endif;                  endforeach;              endforeach;              switch_to_blog($current_blog);     }     add_action('init','permissionsModification');      The Good News: It did succeed in renaming the roles, and the old roles were gone. Bad News: An extremely strange bug is occurring. I am getting "Undefined Index: Name" errors everywhere in Capabilities.php. I searched the database (have phpMyAdmin access), and found that in one of the sites - the subscriber role was still there! I thought it might have something to do with default roles, so since registrations are prohibited I set it to administrator to test, but still no dice (although it did set that to the default role). Viewing the network admin user panel shows an "empty" space for where a role should be, and if you inspect the element it has the value subscriber. So I am pretty certain that the subscriber role's name got deleted and that's where the errors are coming from. Now, the interesting part - I walked through this code line by line with `print_r` riddled everywhere - and the subscriber role is indeed getting deleted. But I have no idea how it's getting added back in. I wonder if this has to do with the fact that this is a multisite wordpress, since the subscriber role only is present in one table. But I am still a bit lost on how to fix it. Any advice would be much appreciated.


title: Child theme not working properly

text: There's a theme that I want to customise and when I use a child theme in it's most basic form, the main navigation bar disappears, the fonts seem different and there's a few other oddities. The problem theme is PR Pin (http://wordpress.org/themes/pr-pin). My child theme literally only has the style.css file containing my child them name, the template and the import of the parent theme's css.               /*      Theme Name:   Custom Theme for sallymustang.com (pr-pin)      Template:     pr-pin     */          @import url("../pr-pin/style.css");      I don't know why activating the child breaks the parent when there's nothing changed. Any help?


title: Deep Nested Custom Rewrite and Custom Taxonomy

text: I'm trying to get my custom taxonomy to nest deep categories, and then also pull up the post. Each post always needs to be three categories deep:               example.com/thinger/cat_1/cat_2/cat_3/post_name_here      I've set up my custom taxonomy and post type like so:                   function thinger_register() {              $labels = array(             'name' => __('Thingers', 'post type general name'),             'singular_name' => __('Thinger', 'post type singular name'),             'add_new' => __('Add New', 'Thinger'),             'add_new_item' => __('Add New Thinger'),             'edit_item' => __('Edit Thinger'),             'new_item' => __('New Thinger'),             'view_item' => __('View This Thinger'),             'search_items' => __('Search Thingers'),             'not_found' =>  __('Nothing found'),             'not_found_in_trash' => __('Nothing found in Trash'),             'parent_item_colon' => ''         );              $args = array(             'labels' =>$labels,             'public' => true,             'publicly_queryable' =>true,             'show_ui' =>true,             'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' >= false,             'menu_position' => null,             'supports' => array('title','editor','thumbnail','revisions')           );               register_post_type( 'thinger' , $args );     }              add_action('init', 'thinger_register');              function create_thinger_taxonomies() {              $labels = array(             'name'              => _x( 'Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Categories' ),             'all_items'         => __( 'All Categories' ),             'parent_item'       => __( 'Thinger Category' ),             'parent_item_colon' => __( 'Thinger Category:' ),             'edit_item'         => __( 'Edit Category' ),             'update_item'       => __( 'Update Category' ),             'add_new_item'      => __( 'Add New Category' ),             'new_item_name'     => __( 'New Category Name' ),             'menu_name'         => __( 'Categories' ),         );              $rewrite = array(             'slug'              => 'thinger',             'with_front'        => false,             'hierarchical'      => true         );              $args = array(             'hierarchical'      => true,             'labels'            => $labels,             'show_ui'           => true,             'show_admin_column' => true,             'query_var'         => true,             'rewrite'       => $rewrite,         );              register_taxonomy( 'thinger_category', array( 'thinger' ), $args );          }         add_action('init', 'create_thinger_taxonomies', 0 );      On the back end it works perfectly. I can make posts and categories without fail. When it comes to the URL's, they only work as `example.com/thinger/post_name_here`. So I added the follower customer rewrites to try and fix that:                   add_rewrite_rule( '^thinger/(.+?)/(.+?)/$', 'thinger.php?posttype=$matches[2]', 'top' );         add_rewrite_rule( '^thinger/(.+?)/(.+?)/(.+?)$', 'thinger.php?taxonomy=$matches[3]', 'top' );         add_rewrite_rule( '^thinger/(.+?)/(.+?)/?$', 'thinger.php?taxonomy=$matches[2]', 'top' );            add_rewrite_rule( '^thinger/(.+?)/(.+?)/(.+?)/(.+?)$', 'thinger.php?taxonomy=$matches[3]&post_name=$matches[4]', 'top' );      Which seems to work when I query just the categories. I can use the taxonomy.php file to do what I have to depending on what I'm looking at just fine. Seems to be that thinger.php never gets called for anything. When I add the post_name on the end, I get an error 404 page. Am I using the rewrites incorrectly here? Basically what I'm trying to do is use the taxonomy.php page to display the "thingers" that fall into that category or sub-category, and when there is a post_name on the end have it show that one "thinger". P.S.: I'm using the Monkeyman Rewrite Analyzer, but I don't exactly understand what it's telling me, and I don't want to use a plugin to do this for me. I would like to learn how this works in and out.


title: WPTouch Mobile does not display posts

text: I use the WP Touch Mobile plugin for the mobile version of my website. However, no posts are displayed on the static pages. Does anyone know to fix this bug ? Thanks for your help


title: How to assign custom field an unique number?

text: I have created a CPT for a client who will use this to manage payments. Their database currently has assigned ID for each of their clients. I have imported the data in a custom field for them. The question is when they add a new client I want to make sure the during the save/update process it checkes to see if the custom field is a duplicate and to display an error message. I believe part of my solution is here: http://codex.wordpress.org/Plugin_API/Action_Reference/save_post But I am stuck as to exactly how that works for my case.... cpt = kerk custom field = wpcf-id


title: Can display previous post with or without wp_pagenavi

text: I use Wordpress with the free version of Pageline platform theme. I figured out that the "previous/next entries" links are displayed on the main page but not on my others static pages. I tried to use the wp_pagenavi plugin. Then, I can see the links at the bottom of the page of which the post number is higher than the one displayed. However, when I click on the link, the same posts are displayed while the number page in the URL title changes. Anyone can help me to fix that ? Thanks for your help


title: How to add username in toolbar link?

text: I installed a plugin and want to add the link of the plugin in the toolbar. But I have an issue with the url. The url shows fullname, but I need to show username. I tried replacing `fullname` in the code with `id` and `domain`. But it did not work.               <?php              function wsi_menu2(){         global $bp, $wp_admin_bar;              // Only show if viewing a user                  // Provides: <body text='black'>     $bodytag = str_replace("Admin", "", $bp->loggedin_user->fullname);              $wp_admin_bar->add_menu( array(             'parent' => 'my-account',             'id'     => 'FacebookInviteFriends',             'title'  => 'Album',             'href'   => 'http://mysite.com/members/'.$bodytag.'/album/',              'onclick' => 'FacebookInviteFriends();'         ) );       }            function wsi_menu3(){         global $bp, $wp_admin_bar;              // Only show if viewing a user                  // Provides: <body text='black'>     $bodytag = str_replace("Admin", "", $bp->loggedin_user->fullname);         $wp_admin_bar->add_menu( array(             'parent' => 'my-account-friends',             'id'     => 'my-account-friends-social-invites',             'title'  => __( 'Send Social Invites', 'buddypress' ),             'href'   => 'http://mysite.com/members/$bp->loggedin_user->fullname/album/',              'onclick' => 'FacebookInviteFriends();'         ) );         $wp_admin_bar->add_menu( array(             'parent' => 'my-account',             'id'     => 'FacebookInviteFriends',             'title'  => 'Album',             'href'   => 'http://mysite.com/members/'.$bodytag.'/album/',              'onclick' => 'FacebookInviteFriends();'         ) );       }      Any idea how to make this work for username?


title: Disabling WP MultiSite breaks registration

text: I am trying to remove / disable MultiSite following the instructions here - http://wpmututorials.com/how-to/how-to-disable-multisite/ I am able to successfully disable MultiSite however it breaks the registration system. After disabling the MultiSite when I click ‘Complete Sign Up’ the registration page refreshes and comes back blank, just with the heading ‘Create an Account’ no registration form is on the page. If I refresh this page it loads up again as a normal registration page. No activation emails are being sent. I have tried all basic troubleshooting steps and have narrowed down to the point that I can say editing following code breaks the registration. `define('WP_ALLOW_MULTISITE', true);` Whether I change 'true', to 'false' or remove the code or comment out the code, registration system breaks. If I restore the code and re upload wp- config.php, registration starts working. I will be grateful for any guidance provided. Thank you very much


title: shortcodes - style them or change/remove the square brackets?

text: I sometimes use for the clients, plugins that are based on wordpress shortcodes,they do offer a lot of options for the clients to play with like adding tabs galleries and so on. But I see that the appearance of the shortcode itself is still a bit confusing to them. so is there a way to customize them like instead of `[gallery]content here...[gallery/]` it will be something like : `open gallery... end of gallery` and with out the square brackets?


title: Retrieve Plugin Settings and insert into XML string

text: Apologies for any confusion as I'm completely out of my depth here: I've been trying to write a plugin which will send form data as XML to a CRM using SOAP. The basic plugin works fine, but I would like to make it more modular, allowing different users to add their own credentials to the sent data. I've followed all the instructions to create an Admin settings page, the data is written into the WP database, now I would like to pass those variables into my message. I've tried using:                   $options = get_option($this->option_name);      at the top of the page, then inside the message, inserting this:                   $xmlInputData='<?xml version="1.0" encoding="utf-8" ?><data><settings><origin="'.echo $my_options['origin'];.'" username="'.echo $my_options['user'];.'" password="'.echo $my_options['password'];.'" /></settings><enquiries><lead productName="Appointment Booking"><customer><name>'.$_REQUEST['first-name'].' '.$_REQUEST['last-name'].'</name><email>'.$_REQUEST['email'].'</email><postcode>'.$_REQUEST['postal'].'</postcode><houseNumber></houseNumber><address></address><city></city><region></region><tel>'.$_REQUEST['phone-number'].'</tel><mobile></mobile><notes></notes></customer></lead></enquiries></data>';      but the code is flagged as having syntax errors. I'm trying to escape the XML to insert the PHP but I don't have enough experience of this. Can anyone help me to understand where I'm going wrong? I've been tinkering with this for a while now but desperately need this to work soon. Thanks in advance.


title: Using a dropdown to alter an option value on plugin settings page

text:
I'm trying to implement a dropdown menu on my plugin's settings page. When the user selects a choice from the dropdown and presses the Save Changes button, I need the choice's value to be appended to the value of an option stored in the WP database. Any ideas how to do this? The option is plugin_options['embedded_url']. Let's say the user chooses Calculator2...then plugin_options['embedded_url'] = 'http://www.google.com?id=signing".               <?php     // Creates an option group, a main settings section on the settings page, and an input field for the URL.     add_action('admin_init', 'plugin_admin_init');     function plugin_admin_init() {         register_setting('plugin_options', 'plugin_options', 'plugin_options_validate');         add_settings_section('plugin_main', 'Main Settings', 'plugin_section_text', 'plugin');         add_settings_field('plugin_url', 'URL to embed: ', 'plugin_setting_url', 'plugin', 'plugin_main');         add_settings_field('plugin_query', 'Query to add: ', 'plugin_add_query', 'plugin', 'plugin_main');     }          // Adds a description of the main settings section.     function plugin_section_text() {     echo '
Change the embedded URL. Must begin with http:// or https://
';     }          // Adds the custom URL input field and saves the URL as the value for key     'embedded_url'.     function plugin_setting_url() {         $options = get_option('plugin_options', array('embedded_url' => 'http://www.google.com')); // Default value for 'embedded_url'         echo "<input id='plugin_url' name='plugin_options[embedded_url]' size='40' type='url' value='{$options['embedded_url']}' />";     }     // Adds dropdown menu     function plugin_add_query() {         $options = get_option('plugin_options');         echo '
<select><option value="">CalculatorDefault</option><option value="?id=signing">Calculator2<option value="?id=SFDCalculatorFlow">Calculator3</option></select>
';     }


title: How to Display an Image Uploaded through a Meta Box in a Template?

text: I am just learning to create a meta box to upload a file in `wp- content/uploads` folder through this code:               //display image meta box     function display_image_box() {         global $post;         wp_nonce_field( plugin_basename( __FILE__ ), 'wp_custom_noncename' );         echo '<input id="post_media" type="file" name="post_media" value="" size="25" />';     }          //upload image      function update_custom_meta_data( $id, $data_key, $is_file = false ) {         if( $is_file && ! empty( $_FILES ) ) {             $upload = wp_handle_upload( $_FILES[$data_key], array( 'test_form' => false ) );             if( isset( $upload['error'] ) && '0' != $upload['error'] ) {                 wp_die( 'There was an error uploading your file. ' );             } else {                 update_post_meta( $id, $data_key, $upload );             }          }       }     //save image     function save_custom_meta_data( $id ) {         if( ! wp_verify_nonce( $_POST['wp_custom_noncename'], plugin_basename( __FILE__ ) ) ) {             return;         }          if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {             return;         }          update_custom_meta_data( $id, 'post_media', true );     }      add_action( 'save_post', 'save_custom_meta_data' );          //register script     function register_admin_scripts() {         wp_register_script( 'custom_admin_script', get_template_directory_uri() . '/js/admin.js' );         wp_enqueue_script( 'custom_admin_script' );     }     add_action( 'admin_enqueue_scripts', 'register_admin_scripts' );      This is working and the file uploads nicely but I can't display it because I'm getting an array like this:               [post_media] => Array     (         [0] => a:3:{s:4:"file";s:81:"E:wampwwwtestchild/wp-content/themes/twentyeleven/uploads/2012/12/coffee_star.jpg";s:3:"url";s:60:"wp-content/themes/twentyeleven/image/2012/12/coffee_star.jpg";s:4:"type";s:10:"image/jpeg";}     )      How can I display the image in my template?   In addition, how to save the URL ( `wp- content/themes/twentyeleven/image/2012/12/coffee_star.jpg` ) only as meta data?


title: Display all posts of current viewing tag

text: I'm having problems getting all related posts of the current viewing tag. Does anyone know how you can do this dynamic? I want to create a own kind of 'archive' page for this.


title: How to exclude certain files from the plugin editor?

text: Is there a way to tell WordPress not to list certain files of my plugin in the Plugins -> Editor screen?


title: Permalinks, Rewrites, Get Variables, Oh My!

text: Ok, so I know it's a silly title, but it's exactly how I feel right now.. I've created some custom rewrites for WordPress and they work great, the only problem is that now I need to add pagination. My rules are messing with the pagination and vice versa. The page url will update when I click on a pagination link, but the query stays the same.. Here's what I have in my functions.php               // ADD REWRITE FOR VIDEOS -> GROUP     add_rewrite_tag('%group%','([^&]+)');          // ADD REWRITE FOR VIDEOS -> VALUE     add_rewrite_tag('%value%','([^&]+)');          // ADD REWRITE FOR VIDEOS TO ACCEPT GROUP & VALUE     add_rewrite_rule('^car-videos/group/([^/]*)/value/([^/]*)/?','index.php?page_id=40&group=$matches[1]&value=$matches[2]','top');      Here's my pagination code               <div class="pagination">                                 <?php $total_pages = $loop->max_num_pages;                                                if ($total_pages > 1){                                           $current_page = max(1, get_query_var('paged'));                                                echo paginate_links(array(                                                   'base' => get_pagenum_link(1) . '%_%',                                                   'format' => 'page/%#%',                                                   'current' => $current_page,                                                   'total' => $total_pages,                                                  'prev_text'    => __('Previous'),                                                 'next_text'    => __('Next')                                             ));                                           }                                    ?>                             </div>      Here's how I'm getting the group and value variables               $urlGroup = $wp_query->query_vars['group'];     $urlValue = $wp_query->query_vars['value'];      I use this in my WP_Query               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;      How would I rewrite the rule to allow for pagination? Is there something I'm doing wrong?


title: custom taxonomies on pages

text: i need some help how can i display custom taxonomies on selected pages? i mean i have 3 custom taxonomies location,duration & courses i have created three pages where i want to display the terms of these custom taxonomies, i have displayed it on my posts by using function               <?php echo do_shortcode("[terms]"); ?>      but same thing i want to make display on my pages also, how can i do that??????


title: What are best practices for configuring a server for Wordpress sites?

text: I hired a sysadmin to set up a VPS server for me and, unfortunately, it looks like things were not set up correctly. When trying to install and update plugins, I run into permissions errors all the time. WP Super Cache is the main issue as it causing my readers to run into 502 errors. Currently, my site does not load pagination (no Page 2, Page 3, etc..). **12/1 Update:** The apache server has restarted itself multiple times today and in the past 3 hours since my request to the host provider, all I've got so far is that they are monitoring it. And it has restarted since they began monitoring too... The sysadmin that set up the server mentioned that in order for it to work properly under DSO mode, wp-admin, wp-content and wp-plugins folders would need to be changed to 777 permissions. The only problem is that I still couldn't get a 3.0.2 upgrade to work under those settings today (504 timeout nginx error this time) so I'm still concerned about running it that way for many reasons. I've been told that if I run under PHP mode though (think that's right?), that I will hog up more RAM with queries, etc and I'm already at 60% usage in DSO mode. This doesn't make any sense to me because my blog ran a little slow but still ok without any downtime on shared hosting. I'm now on a very reputable VPS w/ 512MB ram and my site only gets 10-12k pageviews a day. The host said that they have tweaked the config to optimize ram so I don't think anything is set incorrectly. Still trying to figure out what is going on here. Developing.....


title: Roles & capabilities GUI that does not create separate table

text: After reviewing plugins that deal with user roles and capabilities I concluded that I might be better off just hardcoding my settings into my functions.php file. This actually worked out well for me in end effect but I kept running into an issues while I was finalizing the code. As I am sure many of you know (and I ended up finding out the hard way) any new capabilities added through code to an existing role which has been assigned to a user won't work. Rather it seems the role and associating capabilities are written into the database the first time the new role is assigned to a user. If I am incorrect with this assumption please let me know. In any case... I have been getting frustrated with dealing with things manually and although I don't like the idea of plugins, this specific situations has be believing a GUI might actually work very well. What I am looking for is a plugin or some non bloated code which essentially is just capable of reading the roles and their associating capabilities from the default wordpress database and outputs these values into a checkbox list. So, basically the ability to just select a role which in turn displays every default capability from wordpress as well as any custom capability which is assigned to any user... Then just a checkbox next to every capability assigned to that role. The admin could update the values by checking/unchecking applicable capabilities and one should have the ability to just enter a new capability by pasting the capabilities name into a text field. My logic here is that if this existed then your NOT adding ANY additional custom code to the database or anything that requires more resources. The key benefit here is that you finally have a simple way to deal with updating roles. What I am not sure about is if this same logic would apply to being able to manually change the capabilities for individual users... If anyone also knows the answer to this question pleaseclet me know.


title: Custom taxonomy listing page when no term set (all terms)

text: I've created a custom taxonomy "foo" with rewrite slug "foo" and query_var "foo". Say for example, I also have terms "bar" and "baz" in the "foo" taxonomy. At the moment, permalinks like `/foo/bar` and `/foo/baz` work fine, using my `taxonomy-foo.php` template. What I'd like to do is be able to hit `/foo` and retrieve all posts with a link to any "foo" taxonomy. Currently, this URL shows a 404. How can I achieve this? If I can somehow hook into the rewrite code and set a default term value (`'all'` for example) if missing, that might be a way to move forward but I'm not sure if this is possible. I'd preferably like to use the `taxonomy-foo.php` template file for the "catch all", dealing with the logic of showing posts from one or all terms in there. Cheers **Edit** : I've figured how to catch a request for `/foo` and set some defaults using `add_filter('request', ...)` though I had to use an existing term as using anything else generates a 404. Is there any way to avoid this limitation?