title: Javascript to open new window

text: I'd like to have a link open in a new pop-up browser window. In non-WordPress with JavaScript I would do it some like this (but I would add some underlink/color to make it look like a link).               <span      onClick="myRef = window.open('/Paid_Videos/AudioGenerator01.html','mywin',     'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');     myRef.focus()">My Video Blah Blah Blah</span>      In WordPress, this shows up on my page like this:               onClick="myRef = window.open('/Paid_Videos/AudioGenerator01.html','mywin',     'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');     myRef.focus()">My Video Blah Blah Blah       What can I do to make it work in WordPress?


title: Display search results within the same page

text:
# Problem I have a page on my site where I need to do additional searching within that page. I am using the default way of WordPress searching with `<?php get_search_form(); ?>` for my main header search, which works great. I created another HTML form on my page, not using the default PHP method, for the additional searching like so:               <form action="<?php bloginfo('siteurl'); ?>" id="searchform" method="get">
             Search for:             <input type="text" id="s" name="s" value="" />             <input type="hidden" name="post_type" value="photo_group" />              <input type="submit" value="Search" id="searchsubmit" />
     </form>      I use the `type=hidden` for getting the custom post type that I want to search through:               <input type="hidden" name="post_type" value="photo_group" />      which gives me a link that looks similar to:               http://mywebsite.com/?s=search&post_type=photo_group      # Question When I use the new search form created on the page, it uses the default search.php to display the results. How can I display the search results of the custom post type search, lets say in a `div` on the same page? I've tried creating a new page template that would display the results with no success, could this be the right way of doing it and I just did it wrong? # * **Edit** * I'm trying the solution of sanchothefat. Does this look right? This is my whole div for my search results and search query.

Search Photos:
         <form action="<?php the_permalink(); ?>" id="searchform" method="get">
                 Search for:                 <input type="text" id="search" name="search" value="" />                 <input type="hidden" name="post_type" value="photo_group" />                  <input type="submit" value="Search" id="searchsubmit" />
         </form>              <?php if( isset( $_REQUEST['search'] ) ) {             query_posts( array(             's' => $_REQUEST['search'],             'post_type' => $_REQUEST['photo_group'],             'paged' => $paged             ));                  if( have_posts() ) : while ( have_posts() ) :                 the_title();                 the_content();                                   endwhile; endif;                  wp_reset_query();              }         ?>
      I get 404 error page not found when running through the search.


title: Multisite multidomain

text: I have a wordpress multisite. I'm using a single domain, but **I want to use multiples domains. I want to allow the user choose a domain for his subdomain.** I was searching, but i don't found nothing about this... only a domain mapping plugin and is for singles sites.


title: How to achieve this permalink -> category-name/custom-post-type-name/post-name

text: I am trying to use categories to provide the structure for my site. I will create sections on my site called England, Wales, Scotland and Ireland . These will be categories. My posts will use custom post types - Video, Guide, Event, Clubs etc. So, if I create a post called 'Trouble down south' using the 'Video' CPT, attach it to the 'England' category, I would like the slug format to be: **category-name/custom-post-type-name/post-name** _e.g. mysite.com/england/video/trouble-down-south_ I would also like the following permalinks to work like so - **mysite.com/england/** \- show all posts in that category regardless of CPT **mysite.com/video/** \- show all Video CPT posts regardless of category Sticking with my example, I create my Video CPT like so:               add_action( 'init', 'register_cpt_video' );          function register_cpt_video() {              $labels = array(              'name' => _x( 'videos', 'video' ),                  some code...              );              $args = array(                   some code...                  'taxonomies' => array( 'category' ),                  some code...                  'has_archive' => true,             'rewrite' => array(                  'slug' => 'video',                  'with_front' => false,                 'feeds' => true,                 'pages' => true             ),             'capability_type' => 'post'         );              register_post_type( 'video', $args );     }      This almost does what I need. I get the correct listings at **mysite.com/england** (i.e category archive page) _and_ **mysite.com/video** (i.e CPT archive page) Unfortunately when I click through to the actual post, the slug shows as **mysite.com/video/trouble-down-south** I would like **mysite.com/england/video/trouble-down-south** I've tried using the following rewrite slug               'slug' => '%category%/video',      This does not work. **%category%** gets literally inserted into the url without being converted into the actual category name. I have searched this site for a solution but haven't found any. Most related answers seem to address appending taxonomies to the CPT slug. i.e **mysite.com/video/england/trouble-down-south** They seem to achieve this by explicitly prefixing the CPT name to the taxonomy rewrite slug which exploits the cascade-like nature of the rewrite rules (plus some other wizardry I don't understand.) Anyhow, nothing I have found has addressed my requirement of **category- name/custom-post-type-name/post-name** , plus the archive pages I require. Any ideas how to achieve my desired permalink structure?


title: Adding a 'mega menu' to my site without a plugin

text: Can anyone suggest the best way to go about adding a 'mega menu' to my wordpress navigation without using a plugin? The content in the mega menu itself does not need to be editable via the CMS HOWEVER does need to be active when the user hovers over a certain li in the main navigation. I've looked on Google but everything is geared towards the plugin route, which I'd liek to avoid. Thanks


title: Multiple homes for multiple languages

text: I want to have multiples homes, for use multiples languages. For do for example:               if($_SERVER['SERVER_NAME'] == 'en.bz6.org')         defime('WPLANG', 'en');     else         efime('WPLANG', 'es');


title: How to get the post-ID in my plugin?

text: I am trying to write a little plugin which allows me to add a different theme to each page. well.. still trying.. ;) code: http://pastebin.com/dP1GH43E When I put `return 'mytesttheme';` at the end it works just perfect! when I add an ID (`$page_theme = get_post_meta('66', [...]`) it also works.. when I write `echo $page_theme.', ';` before the return, it outputs: `, , , mytesttheme, mytesttheme, mytesttheme, mytesttheme,` The empty spaces are the problem I think. in wp-backend it shows "mytesttheme" as post meta content in wp-core post meta content box.. so the saving works as it should.. Any ideas how to solve the problem? :S


title: Posts vs Pages and categories

text: I am creating a largely static site for the collections/archives office of a library. Since I am expecting most content to be created once and slowly appended or modified over time, instead of regular posts, my first inclination is to make everything a page. On the other hand, I have pages/posts that exist in two or 3 categories that I would really love to be able to generate listings of and I cannot think of a good way to do this except by using categories and posts. I know that there is a plugin allowing you tag pages with categories, but get_posts does not always work when I do this. Is the fact that I have content that needs multiple categories and have overlaps with each other more important than the fact that this content should largely be static? I have an collection that is made up of sites dedicated to specific topics. If I made each of those mini sites a post type, I could then make the main page loop through those posts to create entries on the collections main page and now that as long as they were tagged properly, items would show up there. So, is static content the only determiner of whether something is a page or a post?


title: Remove fields from Media Uploader (frontend)

text: I am struggling removing/hiding fields of the Media Uploader that I use in a frontend form. I want to remove all 'meta-information' fields like 'Title','Caption','Description' etc. I got this snippet, but it does not modify anything in my Media Uploader window. Any ideas what could cause this problem? Also can someone point me to an overview of the field names? I would like to remove several others (e.g. "Tags" and "Categories" which were introduced to images by the JustifiedGrid plugin)               add_filter('attachment_fields_to_edit', 'remove_media_upload_fields', 10000, 2);     function remove_media_upload_fields( $form_fields, $post ) {              // remove unnecessary fields         unset( $form_fields['post_excerpt'] );         unset( $form_fields['post_content'] );         unset( $form_fields['post_title'] );         unset( $form_fields['description'] );         unset( $form_fields['url'] );         unset( $form_fields['image_url'] );              return $form_fields;     }      Thank you


title: Yearly category archive pagination broken

text:
I found code that will show posts by category and year, but then the pagination doesn’t work. The default WP widget “Category Archive" also has broken pagination and, in any case, I need to add the code to display programmatically, not in a sidebar widget. The url displays like this: > http://example.com/2013/?cat=11 but the pagination breaks because it is using > http://example.com/2013/?cat=11/page/2/ instead of > http://example.com/2013/page/2/?cat=11 which works perfectly to link to the next page. This is the code I am using from this question:               global $wpdb, $wp_locale;         $query = "select YEAR(post_date) AS `year`, count(ID) as posts from $wpdb->posts,  $wpdb->term_taxonomy, $wpdb->term_relationships              WHERE $wpdb->posts.post_status = 'publish'              AND $wpdb->posts.post_type = 'post'             AND $wpdb->term_taxonomy.term_id = 11             AND $wpdb->posts.ID = $wpdb->term_relationships.object_id             AND $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id             GROUP BY YEAR(post_date) ORDER BY post_date DESC";              $arcresults = $wpdb->get_results($query);              foreach ($arcresults as $arcresult):              $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);?>
<a href="<?php bloginfo('url') ?>/<?php echo $arcresult->year; ?>/?cat=11"><?php echo $text;  ?>
     <?php endforeach; ?>       Any ideas on how I can change the pagination links to put the `/page/#/` in the right place?


title: Wordpress Login and Register Link

text: I am finding difficulty in returning the wp_login_form() and register link at the same time. Here is my code which i am working to make shortcode. How to send the login_form and **_register link_** if user is **_not logged in_**?               function add_login_form() {         if(!is_user_logged_in()){             return wp_login_form();         }         else {             return;         }     }


title: Exclude empty fields from custom field calculation (Average)

text: I'm using some code I found online to calculate the average value across all posts for [a_custom_field]. Does anyone know how to exclude (from calculation) any instances where the custom field = 0 or if the custom field has not been filled in? Or maybe there's a better method to get the same result.                   global $wp_query;             $real_query = $wp_query->query; //save reall query             //create new query for all posts of the tag/category/whatever             $args = array_merge( $wp_query->query, array( 'posts_per_page' => '-1' ) );                  $average_q = new WP_Query($args);             $price_count = 0;             $total_price = 0;             while ($average_q->have_posts()){             $average_q->the_post();             $total_price = $total_price + get_post_meta($post->ID,'60mins',true);             $price_count = $price_count + 1;}                  wp_reset_query();             $average = $total_price / $price_count;                        echo 'The average is' . round($average);             query_posts($real_query);


title: How to stop the deduction in "wp_term_taxonomy" count, when the post is deleted?

text: In wordpress, the normal behavior is, when you delete a post, the system automatically performs a deduction of a post (-1) in `wp_term_taxonomy` table in `count` field from a taxonomy row which it belongs to. **FINAL RESULT** :   * Basically, I am looking to stop this behavior, where it could not perform the deduction when a post is deleted so I could build up the statistics. What I am looking for is a function which I could use to stop this behavior. Probably with the help of filter/hook at the end when the post is deleted.


title: Excluding a Custom Post Type with a specific tag using pre_get_posts

text: I have an archive page that lists a custom post type called 'event'. I have event posts with the tag 'regular', (the tag has an id of 53). I'd like to exclude these. I tried using pre_get_posts and then $query->set(('tag__not_in', array('53')) but I don't think tag__not_in will work with custom post types. Is there any way to fix this?               add_action( 'pre_get_posts', 'exclude_regular_tag');     function exclude_regular_tag( $query ){         if ( is_admin() || ! $query->is_main_query() )             return;         if ( is_home() ) {             return;         }              if ( is_post_type_archive( 'event' ) ) {             $args = array('53'); //id of 'regular' tag in custom post type 'event'             $query->set('tag__not_in', $args);             return;         }     }


title: conditional tags- how to use with shortcodes

text: I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery. I planned on using NextGen to house the images in stylist specific galleries, and using the NextGen shortcodes(ex: `[nggallery id=1]`) to determine which gallery gets shown on the specific page. After doing a bit of research, I think WP's conditional tags (I'm thinking `is_page( # )`) might be the best route to take for this, I'm just not sure how to integrate the conditional tags to specify/define the page and the NextGen shortcodes. Any tips, help, advice, etc. is greatly appreciated.


title: Maintaining plugin addons while upgrading

text: I'm developing a freemium wordpress plugin where "skins" will be available for purchase to customize the appearance of the plugin. If I commit an update to my plugin, it sounds like the contents of the "skins" folder inside of my plugin would be removed (since the skins don't come bundled with the core plugin), and the user would lose any skins they may have purchased. What can I do to circumvent this issue? Should I look into moving the skins folder temporarily while upgrading, or somehow utilize the database? Thanks!


title: order users with drag'n'drop?

text: There are many plugins out there that let you order Pages and/or Posts with drag and drop. Is there something similar to order users? Or if not, is it possible to create a plugin for that (i.e. are there sufficient filters, actions etc. in place?


title: Advanced Custom Fields: query posts filtered by multiple field values

text: I have the following: custom post type: q-and-a   custom taxonomy: q_and_a_category   taxonomy terms: design, engineering, project-management I'm creating three separate pages that filter the custom post types by their terms. I.e., one page for Design, one for Engineering, and another for Project Management. I'm accomplishing this with three separate page templates, like this:               <?php          $args=array(     'post_type' => 'q-and-a',     'q_and_a_category' => 'design' //the slug for the custom taxonomy term     );     $my_query = null;     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post();          ?>          <?php the_title(); ?>          <?php endwhile; }?>          <?php wp_reset_query(); ?>      But I'm trying to create a single page template where the taxonomy term is inputted via a "select" menu that I've set up using advanced custom fields. I tried following the ACF plugin tutorial for this, example 3: http://www.advancedcustomfields.com/resources/how-to/how-to-query-posts- filtered-by-custom-field-values Like this:               <?php           // args     $args = array(     'numberposts' => -1,     'post_type' => 'q-and-a',     'meta_query' => array(         'relation' => 'OR',         array(             'key' => 'q_and_a_category',             'value' => '%design%',             'compare' => 'LIKE'         ),         array(             'key' => 'q_and_a_category',             'value' => '%engineering%',             'compare' => 'LIKE'         ),         array(             'key' => 'q_and_a_category',             'value' => '%project-management%',             'compare' => 'LIKE'         )     )     );              // get results     $the_query = new WP_Query( $args );          // The Loop     ?>     <?php if( $the_query->have_posts() ): ?>          <?php the_title(); ?>          <?php endif; ?>          <?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>      When I try this, the page loads on the front end but no posts are displayed. Any suggestions? Thanks in advance.


title: wp_tag_cloud() and the_taxonomies() work but not the_tag()

text: wp_tag_cloud() and the_taxonomies() work in a widget I built but I can not get the_tags() to work. I want to display the tags assigned to the current post. I built a widget to do this. the widget works fine but as I mentioned, wp_tag_cloud() and the_taxonomies() will display. I have tried every possible code snippet I could find. Whats happening and do I display the posts tags?


title: Listing Specific Categories from Current Post with Depth

text:
I've been on this for sometime and been having a ton of issues to find a proper way to do what I'm trying to achieve. An Example would be as follows: I have a featured Image with a rollover and I want it to show a single category child from under the parent category that has a depth of 2 for the location. It would look something like this: > Places -> USA -> Washington D.C I am trying to achieve to just get the Washington D.C or whatever City would be selected in the post for the category. I would be reusing this in the loop for different information which each one might have their own depth and need to be in a list. At the moment I have been using this code, which does not work as intended since it will pull all the child categories under the specified parent.               <?php        foreach((get_the_category()) as $childcat) {          if (cat_is_ancestor_of('51', $childcat)) {             echo '
 cat_ID).'">'; echo $childcat- >cat_name . '
';             }         }      ?>      Any help would be super helpful i've been stuck on this for the past 3 days. Tried:               <?php        $categories = get_the_category();      if ( $categories ) :      $deepChild = getLowestCategory( $categories );       ?>      <a href="<?php echo get_category_link( $deepChild->term_id ); ?>" title="<?php echo sprintf( __( "View all posts in %s" ), $deepChild->name ); ?>"><?php echo $deepChild->name; ?>      <?php       endif;     ?>      with the function from the other post.


title: the paged param is allways 0

text:
I am listing a custom post_type called `ad` using `get_posts` wich works fine, Problem that I have is that I am not able to read the `paged` param, wich I need in order to enable pagination, The thing is that: `get_query_var('paged')` or `$paged` are allways `0` The url looks like this: `http://webiste.com/ads/?paged=2` I even tried to add to the `query_vars`               function query_vars($public_query_vars) {         $public_query_vars[] = "paged";     }     add_filter('query_vars', 'query_vars');      Any idea what am I missing here? -EDIT- This is what I am actually doing: In `functions.php`               function get_anunciantes($params,$debug = false) {         if ($debug ) {             echo '
 ';             print_r( $params );             echo '
';         }         $area_slug = $params['area_slug'];         $category_slug = $params['category_slug'];         if ( !empty ( $category_slug ) ) {             $category_params = array(                 'taxonomy' => 'category',                 'field' => 'slug',                 'terms' => array("$category_slug")             );           } else {             $category_params = array();         }         if ( !empty ( $area_slug ) ) {             $area_params = array(                 'taxonomy' => 'area',                 'field' => 'slug',                 'terms' => array("$area_slug")             );           } else {             $area_params = array();         }              if ( !empty( $area_params ) && !empty( $category_params ) ){             $tax_params = array(                 'relation' => 'AND',                 $area_params,                  $category_params             );         } else if ( !empty( $area_params ) ){             $tax_params = array($area_params);         } else {             $tax_params = array();         }              $today = time(); /* 1407375843 */         $current_page = $params['current_page'];         /*$ipp = 5;         $offset = $current_page * $ipp;*/         $myposts = get_posts( array (                 'posts_per_page'   => 5,                 'paged'     =>  $current_page,                 /*'showposts' => -1,*/                 'post_type' => 'ad',                 'post_status' => 'publish',                 'tax_query' => $tax_params,                 'meta_query' => array(                         array(                             'key' => 'wpcf-start-date',                             'value' => $today,                             'compare' => '<=',                             'type' => 'NUMERIC'                         ),                         array(                             'key' => 'wpcf-end-date',                             'value' => $today,                             'compare' => '>',                             'type' => 'NUMERIC'                         )                     )              )         );              $data = array(             'myposts' => $myposts,             'pages' => 6 /* static, i haven't done it yet */         );         return $data;               }      And in the Template `ads.php` that uses the page:
         <?php the_content(); ?>         <?php echo $area_slug.' > '.$category_slug; ?>
             <?php              $params = array(                 'area_slug' => $area_slug,                 'category_slug' => $category_slug,                 'current_page' => get_query_var('current_page')             );             $result = get_anunciantes($params,false);             $myposts = $result['myposts'];             foreach ($myposts as $mypost) { ?>

<a href="<?php echo get_permalink($mypost->ID ); ?>"><?php _e( $mypost->post_title ); ?>
                     <?php echo get_the_post_thumbnail($mypost->ID, 'thumbnail'); ?>
<?php echo $meta['wpcf-phone'][0]; ?>

             <?php } ?>
            Paged <?php echo get_query_var('paged'); echo '-'.$paged /* ALLWASY 0 */ ?>         <?php         for ($i = 1; $i <= $result['pages']; $i++) {             echo ''.$i.'';         } ?>


title: First article : single column; Other articles : 2 columns

text: I'm building a website (with Wordpress 3.6) and would like to put the news/articles arranged as follows:   * The first article was with the maximum size (one column);   * The following articles were arranged in two columns. Appears only 5 or 7 articles per page. How to do this?


title: WPML : how to pick a featured image only once for different languages?

text: I've got 3 languages on my site. Picking the same featured image 3 times for the 3 versions of each article is boring. Is there any way to do it only once ? (same for picking a tag)


title: Paginate Links not working

text:
For the life of me I cannot get Paginate links to display pagination, but using 'userp' in the url works for paging. I just need the links to show up.                   <?php     /**      * @package WordPress      * @subpackage themename      * Template Name: Vendors Page      */          get_header(); ?>     <?php          $url = $_SERVER['REQUEST_URI'];         $tokens = explode('/', $url);         $usernameCheck = $tokens[sizeof($tokens)-2];         if ($usernameCheck != 'vendors') {             $username = $usernameCheck;             $username = str_replace("-", " ", $username);         }              if(isset($_POST['gform_submit'])):     ?>              <? endif; ?>     <?php          $currentUserID = get_current_user_id();          $page = (!empty($_GET['userp'])) ? $_GET['userp'] : 1;         $per_page = 10;         $offset = ( ($page -1) * $per_page);     ?>

                          <?php the_post(); ?>
                          <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> role="article">
<?php if (!empty($username)) {echo $username; ?> Click Here To Edit Your Profile<?php }  else {the_title();} ?>
                              <?php if (!empty($username)) { ?>                               <?php                                 // WP_User_Query arguments                                 $args = array (                                     'exclude'        => array( 1 ),                                     'count_total'    => true,                                     'fields'         => 'all_with_meta',                                     'meta_query'     => array(                                         array(                                             'key'       => 'user_business',                                             'value'     => $username,                                             'compare'   => 'LIKE',                                         ),                                     ),                                      );                                      // The User Query                                 $user_query = new WP_User_Query( $args );                                      // The User Loop                                 if ( ! empty( $user_query->results ) ) {                                     foreach ( $user_query->results as $user ) { ?>                                 <?php if ( $currentUserID == $user->ID ) { ?>
<?php echo do_shortcode('[gravityform id="4" title="false" description="false"]'); ?>
<?php } ?>
                                     <?php if (isset($user->user_pic)) { ?>                                                     <img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic; ?>&w=235&h=147" title="<?php echo $user->user_business; ?>" alt="<?php echo $user->user_business; ?>" class="profilePic" />                                     <?php } else { $imgURL = get_template_directory_uri() . "/images/vendor_placeholder.jpg"; ?>                                                     <img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $imgURL; ?>&w=235&h=147&zc=2" title="<?php echo $user->user_business; ?>" alt="<?php echo $user->user_business; ?>" class="profilePic" />                                     <?php } ?>
Owner Name:
                                     <?php echo $user->first_name; ?> <?php echo $user->last_name; ?>

                                          <?php if ($user->user_address_show == 'Yes') { ?>
Address:
                                         <?php echo $user->user_address_street; ?>
<?php echo $user->user_address_city; ?>, KS <?php echo $user->user_address_zip; ?>

                                     <?php } ?>
Phone:
                                     <?php echo $user->user_phone; ?>                                          <a href="mailto:<?php echo $user->user_email; ?>" class="contactVendor">Contact Us Via Email
Markets We Attend:
                                     <?php if (isset($user->we_attend_east)) { ?>
East Wichita
Green Acres Market
<?php } ?>                                     <?php if (isset($user->we_attend_west)) { ?>
West Wichita
Sedgwick County Ext. Office
<?php } ?>                                     <?php if (isset($user->we_attend_delano)) { ?>
Delano in Wichita
Lawrence Dumont Parking lot
<?php } ?>                                     <?php if (isset($user->we_attend_derby)) { ?>
Derby, Kansas
<?php } ?>                                          <?php if (isset($user->attend_this_week_east) || isset($user->attend_this_week_wast) || isset($user->attend_this_week_delano) || isset($user->attend_this_week_derby)) { ?>
We will be at the                                      <?php if (isset($user->attend_this_week_east)): ?>East Wichita Market<?php if (isset($user->attend_this_week_west) || isset($user->attend_this_week_delano) || isset($user->attend_this_week_derby)): ?>,<?php endif; ?><?php endif; ?>                                     <?php if (isset($user->attend_this_week_west)): ?>West Wichita Market<?php if (isset($user->attend_this_week_delano) || isset($user->attend_this_week_derby)): ?>,<?php endif; ?><?php endif; ?>                                     <?php if (isset($user->attend_this_week_delano)): ?>Delano in Wichita Market<?php if (isset($user->attend_this_week_derby)): ?><?php endif; ?><?php if (isset($user->attend_this_week_derby)): ?> and<?php endif; ?><?php endif; ?>                                     <?php if (isset($user->attend_this_week_derby)): ?>Derby, Kansas Market<?php endif; ?>                                     this week!
                                     <?php } ?>
Items sold at market:

                                         <?php if (isset($user->product_1)){ ?>
<?php echo $user->product_1; ?>
<?php } ?>                                         <?php if (isset($user->product_2)){ ?>
<?php echo $user->product_2; ?>
<?php } ?>                                         <?php if (isset($user->product_3)){ ?>
<?php echo $user->product_3; ?>
<?php } ?>                                         <?php if (isset($user->product_4)){ ?>
<?php echo $user->product_4; ?>
<?php } ?>                                         <?php if (isset($user->product_5)){ ?>
<?php echo $user->product_5; ?>
<?php } ?>
                                          <?php if (isset($user->user_organic)){ ?>
Organic | Chemical Free
                                     <?php } ?>                                          <?php if (isset($user->user_producer)){ ?>
100% Producer
                                     <?php } ?>

About Us:

<?php echo $user->user_about; ?>

                                     <?php if (isset($user->user_profile_pic)){ ?>
View Our Photos
<?php } ?>                                          <?php if (isset($user->user_profile_pic)){ ?>
                                             <img src="<?php bloginfo('template_url'); ?>/images/user_pics_prev.png" class="prev"/>                                             <img src="<?php bloginfo('template_url'); ?>/images/user_pics_next.png" class="next"/>

<a href="<?php echo $user->user_profile_pic; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_profile_pic_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_profile_pic; ?>&h=134&w=119" alt="<?php echo $user->user_profile_pic_c; ?>" title="<?php echo $user->user_profile_pic_c; ?>" />
                                                          <?php if (isset($user->user_pic_1)){ ?>
<a href="<?php echo $user->user_pic_1; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_1_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_1; ?>&h=134&w=119" alt="<?php echo $user->user_pic_1_c; ?>" title="<?php echo $user->user_pic_1_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_2)){ ?>
<a href="<?php echo $user->user_pic_2; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_2_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_2; ?>&h=134&w=119" alt="<?php echo $user->user_pic_2_c; ?>" title="<?php echo $user->user_pic_2_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_3)){ ?>
<a href="<?php echo $user->user_pic_3; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_3_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_3; ?>&h=134&w=119" alt="<?php echo $user->user_pic_3_c; ?>" title="<?php echo $user->user_pic_3_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_4)){ ?>
<a href="<?php echo $user->user_pic_4; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_4_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_4; ?>&h=134&w=119" alt="<?php echo $user->user_pic_4_c; ?>" title="<?php echo $user->user_pic_4_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_5)){ ?>
<a href="<?php echo $user->user_pic_5; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_5_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_5; ?>&h=134&w=119" alt="<?php echo $user->user_pic_5_c; ?>" title="<?php echo $user->user_pic_5_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_6)){ ?>
<a href="<?php echo $user->user_pic_6; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_6_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_6; ?>&h=134&w=119" alt="<?php echo $user->user_pic_6_c; ?>" title="<?php echo $user->user_pic_6_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_7)){ ?>
<a href="<?php echo $user->user_pic_7; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_7_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_7; ?>&h=134&w=119" alt="<?php echo $user->user_pic_7_c; ?>" title="<?php echo $user->user_pic_7_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_8)){ ?>
<a href="<?php echo $user->user_pic_8; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_8_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_8; ?>&h=134&w=119" alt="<?php echo $user->user_pic_8_c; ?>" title="<?php echo $user->user_pic_8_c; ?>" />
<?php } ?>                                                          <?php if (isset($user->user_pic_9)){ ?>
<a href="<?php echo $user->user_pic_9; ?>" class="fresco" data-fresco-caption="<?php echo $user->user_pic_9_c; ?>"><img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic_9; ?>&h=134&w=119" alt="<?php echo $user->user_pic_9_c; ?>" title="<?php echo $user->user_pic_9_c; ?>" />
<?php } ?>

                                     <?php } ?>                                          <?php if (isset($user->user_twitter) || isset($user->user_facebook)){ ?>
Socialize With Us
<?php } ?>                                          <?php if (isset($user->user_twitter)){ ?>
                                             <img src="<?php bloginfo('template_url'); ?>/images/twitter_prev.png" class="prev"/>                                             <img src="<?php bloginfo('template_url'); ?>/images/twitter_next.png" class="next"/>
                                                 <?php echo do_shortcode('[twitter-user]'); ?>

                                     <?php } ?>                                          <?php if (isset($user->user_facebook)){ ?>                                         <iframe src="//www.facebook.com/plugins/likebox.php?href=<?php echo urlencode($user->user_facebook); ?>&width=588&height=590&show_faces=true&colorscheme=light&stream=true&show_border=true&header=true&appId=172839226207438" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:588px; height:590px;" allowTransparency="true">                                     <?php } ?>
                                      <?php } } ?>                                                                                <?php } else { ?>                                                           <?php                                 // WP_User_Query arguments                                 $args = array (                                     'exclude'        => array( 1 ),                                     'count_total'    => true,                                     'fields'         => 'all_with_meta',                                     'number' => $per_page,                                     'offset' => $offset,                                 );                                           // The User Query                                 $user_query = new WP_User_Query( $args );                                      // The User Loop                                 if ( ! empty( $user_query->results ) ) {                                     foreach ( $user_query->results as $user ) { ?>
                                             <a href="<?php bloginfo('url'); ?>/vendors/<?php echo str_replace(" ", "-", strtolower($user->user_business)); ?>">                                                 <?php if (isset($user->user_pic)) { ?>                                                     <img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $user->user_pic; ?>&w=235&h=147" title="<?php echo $user->user_business; ?>" alt="<?php echo $user->user_business; ?>" />                                                 <?php } else { $imgURL = get_template_directory_uri() . "/images/vendor_placeholder.jpg"; ?>                                                          <img src="<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo $imgURL; ?>&w=235&h=147&zc=2" title="<?php echo $user->user_business; ?>" alt="<?php echo $user->user_business; ?>" />                                                 <?php } ?>

<?php echo $user->user_business; ?><a href="<?php bloginfo('url'); ?>/vendors/<?php echo str_replace(" ", "-", strtolower($user->user_business)); ?>" class="viewProfile">View Profile
                                                     Item(s) sold at market:
<?php $productCounter = 0; ?>                                                         <?php if (isset($user->product_1) && $productCounter == 0) { $productCounter = 1; ?>
<?php echo $user->product_1; ?>
<?php } ?>                                                         <?php if (isset($user->product_2) && $productCounter == 0) { $productCounter = 1; ?>
<?php echo $user->product_2; ?>
<?php } ?>                                                         <?php if (isset($user->product_3) && $productCounter == 0) { $productCounter = 1; ?>
<?php echo $user->product_3; ?>
<?php } ?>                                                         <?php if (isset($user->product_4) && $productCounter == 0) { $productCounter = 1; ?>
<?php echo $user->product_4; ?>
<?php } ?>                                                         <?php if (isset($user->product_5) && $productCounter == 0) { $productCounter = 1; ?>
<?php echo $user->product_5; ?>
<?php } ?>
                                                     Market(s) we attend:<?php $marketCounter = 0; ?>                                                     <?php if (isset($user->we_attend_east) && $marketCounter != 2) { $marketCounter++ ?>
East Wichita
Green Acres Market
<?php } ?>                                                     <?php if (isset($user->we_attend_west) && $marketCounter != 2) { $marketCounter++ ?>
West Wichita
Sedgwick County Ext. Office
<?php } ?>                                                     <?php if (isset($user->we_attend_delano) && $marketCounter != 2) { $marketCounter++ ?>
Delano in Wichita
Lawrence Dumont Parking lot
<?php } ?>                                                     <?php if (isset($user->we_attend_derby) && $marketCounter != 2) { $marketCounter++ ?>
Derby, Kansas
<?php } ?>

                                      <?php } } ?>                                                            <?php } ?>                          <?php                     $page_args = array(         'base'         => get_permalink( get_the_ID() ). '%_%',         'format'       => add_query_arg(array('userp' => '%#%')),         'total'        => ceil($users->total_users / $per_page),         'current'      => $page,         'show_all'     => True,         'end_size'     => 2,         'mid_size'     => 2,         'prev_next'    => True,         'prev_text'    => __('« Previous'),         'next_text'    => __('Next »'),         'type'         => 'plain',     );          echo paginate_links($page_args);     ?>

                     <?php if (!empty($username)) { ?>
<?php if ( dynamic_sidebar('profile-sidebar') ) : else : ?><?php endif; ?>
<?php } else { ?><?php get_sidebar(); ?><?php } ?>

     <?php get_footer(); ?>


title: Pagination on with query_posts in custom post type template

text:
I know there about a thousand pagination issue questions on here, and I've looked at them, but I can't seem to figure out what's going wrong with mine. This is a loop on a custom post type archive template, but it should call ALL POSTS since I'm using it as a blog. At the very top of the template, is a query for a specific page, but I don't think that's what's causing the problem. What happens is that on the second page I get a 404 error.               <?php get_header(); ?>     <?php // query post #4606     $post_id = 4606;     $queried_post = get_post($post_id);     $title = $queried_post->post_title;?>     <?php echo $title;?>          <?php $post = $posts[0]; $c=0;     $args = array(         'post_type'=> 'post',         'posts_per_page' => 7,         'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1),         );     query_posts($args);     while (have_posts()) : the_post();     ?>          <?php $c++;     if( !$paged && $c == 1) :?>                     <?php if ( has_post_thumbnail()) : ?>                         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >                             <?php the_post_thumbnail('archive-featured-img', array('class' => 'aligncenter')); ?>                                              <?php endif; ?>                               <?php else :?>                                               <?php endif;?>     <?php endwhile; ?>               <?php if (  $wp_query->max_num_pages > 1 ) : ?>

<?php next_posts_link('Next Page »', 0); ?>

<?php previous_posts_link('« Previous Page', 0); ?>

     <?php endif; ?>     <?php     wp_reset_query();  // Restore global post data     ?>
<?php echo $title;?>
                     <?php echo $queried_post->post_content;?>                      <?php dynamic_sidebar( 'Main Blog Page Sidebar' ); ?>          <?php get_footer() ?>


title: How to make gravatar.com avatars conditional?

text: **Problem:** I am using custom avatars for registered users and my own locally-hosted image as the default gravatar. I want to stop WordPress making HTTP requests to check for gravatar.com images on every comment. Where my custom avatars are used, the scr result still includes a hashed link to gravatar.com with a redirect appended to the scr URI back to my own image. Even without using a custom default avatar, there are two HTTP requests sent out. For default avatars this looks like: http://1.gravatar.com/avatar/9cf9ecff0dd6eed9a1ea0948c61dc3c2?s=44&d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D44&r=G I neither want, nor need, this kind of bloat in my pages. **Goal:** What I want to do is to override the gravatars function in pluggable.php so that it only runs when a checkbox is checked. I have added a form field to my comments form so commenters can specify if they want to use their gravatar image from gravatar.com, their Twitter profile image, or (if left unchecked) if default, locally-hosted images apply. If the checkbox for gravatar.com avatars isn't selected then it shouldn't run at all. I'm stuck on how to tie the get_avatar function to run only if the checkbox input returns true.


title: Query users based on posts in Taxonomy A and Taxonomy B

text: When you are on the "sorority" OR "school" taxonomy page, ALL of the users in either the "sorority" or "school" taxonomy page display.               <?php     $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );     $term_parent = $term->parent;     $term_slug = $term->slug;     $user_query = new WP_User_Query(array(       'role'         => 'stylista',         // or whatever your target role is       'meta_key'     => $term_parent,        'meta_compare' => 'like',        'meta_value'   => $term_slug,          // or "%{$term->name}%" ?      ));      $users = $user_query->get_results(); ?>     <?php if (!empty($users)) {?>         <?php foreach($users as $user) : ?>                 <a rel="<?php echo $user->first_name; ?> of <?php echo $user->sorority2; ?>" href="<?php echo get_author_posts_url($user->ID); ?>"><?php echo get_avatar($user->ID, 70); ?>             <?php endforeach; ?>     <?php } else {?>     <?php }?>      What I am trying to do is display all users in BOTH "sorority" and "school" (on the search page, which pulls in search results from two taxonomies, "sorority" and "school"). This is the code I use to pull in the parent and term of each taxonomy - what I cannot figure out is how to pull in USERS who have posted (they also have post meta linked to the taxonomy) and tagged their articles as both Sorority A and School B.                 <?php         $available_taxonomies = get_taxonomies('','objects');         $output = ''; // and prepare our output buffer         if(count($_GET)>1){ // don't even bother if filter hasn't been submitted             foreach($available_taxonomies as $taxonomy){ //loop through all available taxonomies                 if(isset($_GET[$taxonomy->query_var]) && in_array($taxonomy->name, array('sorority')) ){ // and when you find one that's present in the current query              $output = "";                     $output .= $taxonomy->label.": "; // display the name followed by ":"                      $terms = preg_split('/[, +]/',urldecode($_GET[$taxonomy->query_var])); // and get all the terms (slugs) of that taxonomy present in the query (GET)                      foreach($terms as $term_slug){ // now loop through all the slugs                         $term = get_term_by('slug',$term_slug,$taxonomy->name); // and based on that slug, get the term object                         $output .= $term->name.', '; // and add the term's name to our output buffer followed by a comma (,)                                             }                     $output = rtrim($output, ", ")." | ";  // when we're finished with terms, remove the last comma                 }//endif             }//endforeach             echo rtrim($output, " | "); // when we're finished with taxonomies, remove the last '|'         } else {//endif               //If filter has not been submitted display the default title             wp_title( '|', true, 'right' );         }          ?>      **Any thoughts?**


title: Custom Login and Registration form in Ajax

text: How to create the custom login/Registration form using AJAX.


title: Set post_parent from URL params in post-new.php

text: I'm trying to create a set of buttons on wordpress Page post types that allow the end user to create a new page that is a sibling (same parent page) or a child page of the current page. In order to do so, i'm creating a link post-new.php and populating the parameter parent_id in the URL. In my functions.php, I've hooked wp_insert_post ... the problem I have now is how to actually set the post_parent on the $post object ... I dont see any Wordpress functions to do so; I've tried using wp_update_post ... but this doesnt seem to work for me ... here's the code in my functions.php:               add_action('wp_insert_post','grey_templater_set_post_parent',10,2);          function grey_templater_set_post_parent($postid,$post) {                  if ( ! $parentid = grey_get_post_parent_by_url()                     or 'auto-draft' !== $post->post_status )                     return;                  $mypage = array();             $mypage['ID'] = $postid;             $mypage['post_parent'] = $parentid;             wp_update_post( $mypage );          }          function grey_get_post_parent_by_url() {                  if (! isset( $_GET['parent_id'] ) )                     return FALSE;                  return array_map('sanitize_title', explode(',', $_GET['parent_id']));     }


title: Custom Taxonomy in plugin and template

text: I have a plugin that I am developing that is using custom post types and taxonomies. My question is this. How can I load the content/theme data from my plugin on to the page when the go to the custom url of the taxonomy? EDIT I am trying to use the plugin's template files and not the themes for my custom taxomony.


title: Does doing an export moves all my posts or just a copy of it?

text: I want to move from Wordpress hosting to self-hosting. I have installed wordpress on my self-host account. Now I want to play with it for a while with themes,plugins, etc. and see how it goes. So I am thinking of bringing all my post to my account. I would like my original blog on wordpress to work as usual for now until I am ready to redirect it to my own domain/host. **Question:** So when I use the Export facility (All post) will the posts get permanently removed from my blog or will it be just a copy of my posts?


title: Unserializeing multiple column values that are stored in one database results variable

text:
Lately i have created a custom template to search for data in a database, and also displaying it, by the use of checkboxes. So, a user can select multiple checkboxes to search data on and the query searches for the selected checkbox values. This all works and the queried data is being returned in a variable called $tmp. Though, some of the queried data is serialized data (uploaded with (yes, also) checkboxes) but some data are just regular strings (data that is uploaded with radio buttons for example). So a queried row can contain both serialized as unserialized data. To display each data of each column in a table, i used a `if(count($tmp))` and a foreach for every piece of data in the column(s). Though, as mentioned before, i have some serialized data that is being displayed now and obviously i only need the string of that serialized data. I have read something about unserializeing data and try'd a couple of things (one of them is showed in the code below) but i cant seem to get it to work + i don't really have much knowledge about the serialize/unserialize code. So the question is, how can i unserialize the data that is being queried, and should i make an if statement that only selects the serialized date and leaves the normal strings alone? (or perhaps this doesn't matter because the normal strings wont be unserialized anyway with the unserialize function?) The query code is as follows:               $tmp = $wpdb->get_results("             SELECT                 name_of_living_lab, location_of_living_lab, type_of_living_lab, theme_of_living_lab, stage_of_living_lab, living_lab_document                        FROM                            wp_participants_database                         WHERE                  location_of_living_lab REGEXP ('$criteria_location') AND theme_of_living_lab REGEXP ('$criteria_theme')              ORDER BY                  name_of_living_lab ASC         ");       I used by the way the REGEXP to select the string in the serialized data. **The PHP code that displays the queried data:**               if(count($tmp)>0){         for($i=0;$i<count($tmp);$i++){             echo "
";                   foreach($tmp[$i] as $key=>$value){                               echo "" . $value . "	";                                  }                        echo "
";         }     }      **The PHP code with which i try'd to unserialize the data:**               if(count($tmp)>0){         for($i=0;$i<count($tmp);$i++){             echo "
";                   foreach($tmp[$i] as $key=>$value){                      $mydata = unserialize($value);                          echo "" . $mydata . "	";                                 }                        echo "
";         }     }      The above code is not working. This returns blank values for the normal strings in the database and the word 'Array' for the serialized array values. *P.S. do i need to call the unserialize function in my custom template to use it? And how do i to this? Thank you in advance!


title: Activate other plugins with MobilePress

text: I am using MobilePress plugin to make a mobile friendly theme, i am also using wp-photo-album-plus [WPPA] plugin to make gallery The problem is mobile press deactivate all plugins. I need to activate albums plugin with MobilePress You can see example as below http://copticocc.org/site/?p=9601&Mobile&lang=en Thanks in advance


title: How to add element after every post in the loop, but not the last one

text: I have a pretty common loop:               global $wp_query, $wpdb;     if ( have_posts() )     {         while ( have_posts() )         {             the_post();                  get_template_part(                  'template_parts/content'                 ,get_post_format()             );         }     }     else     {         get_template_part( 'no_results' );     }      Now I need to add (for example) a `<hr />` after each single post, but not the last one. How would I determine if I currently got the second to last post in the current loop? Note: This should work for paged loops as well.


title: Conditonally check if Custom Meta Box has input

text: I currently display a URL from a custom meta box, but wanted to add a conditional check, so that if nothing has been entered, not to display the link text.               <a target="_blank" href="<?php $urlbox = get_url_desc_box(); echo $urlbox[0]; ?>">Visit Website »      At the moment, even when nothing is added to the URL Meta BOX, the _Visit Website_ text still appears within the post.


title: Get all user with both meta_value

text: I was wondering if there were any efficient way of fetching all user comparing two different meta_key. I am currently fetching all user compared to the first meta, then loop trough the user_id to compare the other meta. I actually need to count how many user have both values. Ex : 'MRC' => 'Mitis' AND 'sellable_online' => 'true'


title: How to get list of custom taxonomy terms and display count?

text: This is actually a three-part question. 1.) How do I get list all terms of my custom taxonomy (in this case, 'audiocat')? 2.) How do I display the count of each term? Example:               Rock (5)     Pop (3)      3.) How do I sort them according to their parent? Example:               Rock (5)       Subcategory (3)     Pop (3)       Sub category (1)      So far, I can get the list of all the terms from 'audiocat' but if they have more than one content, then it duplicates it. So I can't proceed to my second problem. Here's how I query them:               $audio = get_posts( array (         'paged' => get_query_var('paged'),         'post_type' => 'audio',         'posts_per_page' => 10,         'order' => 'ASC',         'orderby' => 'meta_value',         'taxonomy' => 'audiocat',     ));


title: How do I copy my Parent Templates to my Child Templates?

text: I'm trying to customize the Home Page of a Responsive Theme template. I had started with the Responsive theme and then found out that I had to do customizations on a child theme, so I downloaded the Responsive Child Theme from themeid.com and uploaded it to my website. When I first went to `Dashboard > Appearance > Editor` I saw that the CSS style sheet was missing most of the code and referring back to the Responsive theme, so I copied it all over because I had made some changes in font, font color, etc. BUT under Templates it says: > \-- This child theme inherits templates from a parent theme, Responsive. I need to edit the size of the widgets on the Home page and was told to copy `home.php` over. I can see that it's there, if I switch over to Responsive theme. How do I get all the templates over to my child theme. Someone said go to wp- content file. Where is that? I'm using Host Gator. Is it on their servers?


title: How does one suppress a 404 status code in a WordPress page?

text: I've got a WordPress site that includes pages pulled from a different database. The problem is that these other pages return a 404 status code. (The WordPress posts/pages are fine.) The 404'ed pages display fine, and I removed the "Page not Found" text from the title tag in WordPress. But Googlebot and W3C see the 404 header. So: wow does one tell Apache to suppress a 404 status? And will Apache override WordPress's 404 header? Does that make sense? What other info and things should I be looking at? Can I suppress the status code in .htaccess so I don't change WP core files?


title: Replacing WordPress menu functionality with a plugin

text: I asked this earlier on StackOverflow.com before realizing there was a StackExchange specifically for WordPress. Here is the link to the old question (for moderator deletion): http://stackoverflow.com/questions/6862887/replacing-wordpress-core- functionality-with-a-plugin I'm creating a WordPress plugin for a custom menu layout. I am well aware that I could just as easily implement this menu directly into the theme and I've read up quite thoroughly on the features and limitations of `wp_nav_menu()`, plus I have already tried and tested every plugin already created for replacing the default WordPress menu. I wish to use a plugin since my client will be implementing this on several different WordPress sites, many of which run on different themes - and most of those are themes which I did not create and I do not wish to re-write their code in case they update the theme in the future. When I've looked into a way to implement the menu into the theme I found that there are only two good methods since there is no hook or filter called at menu display time. The first is to change the theme to look for the plugin (this is similar to the method used by PixoPoint and many other menu plugins):               header.php:          if(function_exists('pixopoint_menu')){         pixopoint_menu();     } else {         wp_nav_menu();     }      The second method is a walker class:               plugin.php:          class my_walker_class Extends Walker_Nav_Menu {         function start_el(&$output, $item, $depth, $args) {             /*             *  Etc. Etc.             */         }     }          header.php:          wp_nav_menu( Array( 'walker' => 'my_walker_class' ) );      However as you'll note both of these methods require a modification to the standard header.php file. Ideally I would like to simply replace the `wp_nav_menu()` function if my plugin is loaded, as this would give my plugin support for the majority of themes without having to edit any of the theme files. Is there a good way to do this? Or is there a better way to write a menu plugin which I am not seeing?


title: How do I set up Debugging?

text: In my wp-config.php, I have:               // Enable WP_DEBUG mode     define('WP_DEBUG', true);          // Enable Debug logging to the /wp-content/debug.log file     define('WP_DEBUG_LOG', true);          // Disable display of errors and warnings      define('WP_DEBUG_DISPLAY', false);     @ini_set('display_errors',0);      However, the debug.log file is empty. It wasn't being created so I created it and then set its permissions to 666, yet it remains empty. Can anyone help me?


title: Export Posts in excel

text: How can i export post only with this data in excel :- Post title - Post URL - Author - publish Date Thanx


title: Appearance Menus Screen - menu item drop down menu not functioning

text: According to WP, there should be options to remove/edit each menu item on a menu under appearance, but this option isn't showing up for me in Chrome or Firefox. I have administrator control of the site and not sure why this isn't working. Suggestions? "Each Menu Item has a configuration arrow on the right side of the Menu Item title, that when clicked opens the configuration box. Click the arrow a second time closed the configuration box. If you don't see Link Target, CSS Classes, Link Relationship (XFN), and Description, then under Screen Options make sure those boxes are checked to expose them here."


title: Editable/removable number of checkboxes stored in plugin

text: To make things short, I am working on a WordPress plugin used in various projects (being converted from a solo script) that depending on the website, they may or may not have multiple checkboxes with numeric values attached to them within a form. What would be an approach I can take with adding or removing a number of items for use in said plugin? What about storing them, database-wise? (Certainly though I could have a table that has a `parent_id` and something like `checkbox_id` or something similar that would map to the plugin's options. The only issue may be removing said checkboxes in the future and having an 'unknown' checkbox listed.)


title: How to load css files in a specific order

text: I'm wondering if someone can help me with this. The theme I am working on has a custom theme options page where you can select various colors for the website. The problem is that the stylesheet it produces loads before the bootstrap and main stylesheet in header.php. I need this to load after those two. Is this possible to do?


title: 301 Redirect for Non-Date Based URL's

text: I'm wanting to redirect posts in WordPress that do not have a date based permalink structure to those that do. For example: domain/aprils-obx-race-recap-gnarly to: domain/2014/07/09/april-s-obx-race- recap-gnarly/ I should be able to do it with something like this right:               RedirectMatch 301 /20(.*)/(.*)/(.*)/$ http://www.mydomain.com/$3      Thanks for any help you can provide!


title: force http canonical tag on https pages

text: At present all https pages have their own canonical tags referencing https, which is incorrect, they should be referencing the http versions. e.g:               https://www.example.com      has the following canonical tag: `<link rel='canonical' href='https://www.example.com' />` How can we make the canonical tags on https pages use the http URLs?


title: How to modify how the_content outputs a link to an internal page

text: I like the default add link dialog in the wordpress editor. IT allows for easy linking to internal pages. I need to modify the output of those internal links. Right now its outputting:               my text      I need it to be:               my text      I need the linked page id to be set in a data attr. Is this possible with a action/hook Thank you


title: admin submenus not appearing

text: When I log into my wordpress site, i have a few problems. The submenus of the admin area do not appear when I am hovering over a menu. Also the Widgets area is completely messed up. Its very hard to use the widgets. I tried pasting define('SCRIPT_DEBUG', true); in my wp-config file but it does not help. I've also tried disabling all plugins and going back to the defalut theme. Please help me


title: How do I replace title with my plugin?

text: I am developing a plugin for WordPress 3.5. My blog's default title is "Test". Here is some code of my plugin:               add_filter('wp_title', 'my_replace_title');          function my_replace_title(){         return get_option('my_site_title');     }      The new title is "my website title". But it's out putting the result: "my website titleTest" How to replace old title with new title?


title: Organizing Your Pages

text: I'm having problems creating sub pages. So far I've followed the proper directions:   1. Go to a new page, click the "Page Parent" drop-down menu.    2. Select the appropriate parent Page from the drop-down menu to make the current Page a child Page.    3. Click Publish when ready. When I do publish the page, It results in page not found. For example: Suppose I had a page South America and I add 'child' pages: South America   * Argentina    * Brazil  When I go to www.mywebsite.com/SouthAmerica/Argentina It says page not found. However:   * www.mywebsite.com/SouthAmerica/ **(works)**   * www.mywebsite.com/Argentina/ **(works)**   * www.mywebsite.com/SouthAmerica/Argentina **(Does not Work)**


title: Multiple Instances sharing the same database in a development environment

text: I'm working with a team of developers on a new site and we've experienced an issue. All of have a local install (under SVN) of WP 3.1.3 running on our machines, but we're all connected to the same remote database. The issue comes in when one of us creates a new plugin and installs it. Until the plugin files are checked-in to the SVN repository, and the other devs check-out the new plugin files, WP will deactivate the plugin (since we're all on the same db, but different local installs) if it can't find the plugin file on another dev's machine who happens to be in the WP Dashboard. So for example:   1. Dev A creates a plugin, and installs it. The files are local on his machine. He checks then into SVN.   2. Dev B is in the dashboard, and hasn't gotten latest from the SVN repository so WP deactivates the plugin that Dev A just created since it can't find the files on Dev B's machine. Is there any way around this other than each dev having a local db installed? Any help would be much appreciated!


title: Display Media Uploader in Own Plugin on Wordpress 3.5

text: I have little problem with Media Uploader in new WordPress 3.5. I created own plugin which is upload the picture. I'm using this code JS:               <script type="text/javascript">         var file_frame;              jQuery('.button-secondary').live('click', function( event ){                  event.preventDefault();                  if ( file_frame ) {                 file_frame.open();                 return;             }                  file_frame = wp.media.frames.file_frame = wp.media(                 {                     title: 'Select File',                     button: {                         text: jQuery( this ).data( 'uploader_button_text' )                     },                     multiple: false                 }             );                  file_frame.on('select', function() {                 attachment = file_frame.state().get('selection').first().toJSON();                 jQuery('#IMGsrc').val(attachment.url);             });                  file_frame.open();         });     </script>      The code works fine, but unfortunately forms appears incomplete. When I select any picture doesn't show me 'Attachment Display Settings' on right side. I don't know why. I try add options to media:               displaySettings: true,     displayUserSettings: true      But it also doesn't work.


title: Extract video content from post to display on front page

text: Well I know how to extract image from post.But what about videos?I want to show first video from post .               <?php $args = array(       'tax_query' => array(         array(           'taxonomy' => 'post_format',           'field'    => 'slug',           'terms'    => 'post-format-video'         )       )     );     query_posts( $args );     if ( have_posts() ) : while ( have_posts() ) : the_post();       the_title();       the_post_video();           the_post_video_first();      // echo get_post_format();       echo '<br />';     endwhile; else:       echo 'no';     endif;     wp_reset_query();           ?>`enter code here`      Thus the_post_video() will return first video and the_post_video() return/grab every video inside the post. CHEERS


title: W3 Total Cache - Converting Apache rewrites to Nginx

text: I'm trying to convert the following Apache rewrites to Nginx :               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteCond %{REQUEST_METHOD} !=POST     RewriteCond %{QUERY_STRING} =""     RewriteCond %{REQUEST_URI} \/$     RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]     RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html" -f     RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index.html" [L]     </IfModule>      What I have done is :               # Set a variable to work around the lack of nested conditionals     set $cache_uri $request_uri;          # POST requests and urls with a query string should always go to PHP     if ($request_method = POST) {         set $cache_uri 'no cache';     }     if ($query_string != "") {         set $cache_uri 'no cache';     }          # Don't cache uris containing the following segments     if ($request_uri ~* "(\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register|mail)\.php|wp-.*\.php|index\.php|wp\-comments\-popup\.php|wp\-links\-opml\.php|wp\-locations\.php)") {         set $cache_uri "no cache";      }          # Don't use the cache for logged in users or recent commenters     if if ($http_cookie ~* "comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle") {         set $cache_uri 'no cache';      }           # If the cache file does not exist, pass it of to apache for processing     location / {         try_files /wp-content/cache/page_enhanced/example.com/$cache_uri/_index.html @backend;     }          # Pass off php requests to Apache     location ~* \.php$ {                    include /usr/local/etc/nginx/proxypass.conf;         proxy_pass         http://127.0.0.1:80;     }          # Pass off php requests to Apache     location @backend {         include /usr/local/etc/nginx/proxypass.conf;         proxy_pass         http://127.0.0.1:80;     }      What I am wondering is am I missing anything? or done something wrong?


title: How to Rewrite Attachment URL when use %category%

text: When I use permalink structure %category%/%postname%/ the result is: mydomain.com/category/postname/attachment/attachment-title   what I want to get is:   mydomain.com/category/postname/attachment-title So how do I remove attachment in url? I have try this method but I don't want attachment replaced by another words, I need to remove it.


title: Why isn't WordPress respecting my HTML?

text:
I have a page in WordPress which includes the following valid HTML5:

Book your first lesson today

      When it's rendering on the page, however, it looks like this:

Book your first lesson today

      I'm editing in TEXT mode, so why is it adding `<br>` and `<p>` tags? ![enter image description here](http://i.stack.imgur.com/owuGc.png)


title: White screen after login attempt

text: In my wordpress site, I built a login area. In my page-login.php I ask the user to enter his login information which after click on submit will be sent to the same page - on top of the page his entries are being checked. My problem: After clicking on submit a white screen appears. Here is what I have done so far:   * In my functions.php I included: `function register_session() {   session_start(); }   add_action('init', 'register_session', 1);`   * In my wp-config.php I put `session_start()` onto the beginning   * In wp-includes/load.php I included `_SESSION` into the `$noUnset`-Array Here comes the code for the login page I am talking about:               <?php          /* Template Name: page-login      */     ?>          <?php              if (isset($_POST['submit'])) {                  $username = $_POST['u'];             $password = $_POST['pw'];                  $db = @new mysqli("............."); // left out for demonstration only                  $username = $db->real_escape_string($username);             $password = $db->real_escape_string($password);                  $results = $db->query("SELECT password FROM users WHERE username='$username'");             while ($result = $results->fetch_assoc()) {                      if (($result['passwort']) == $password) {                          session_start();                          $_SESSION['username'] = $username;                          wp_redirect( 'http://www.example.de/?page_id=884' );                     exit;                       } else {                     $error_message = 'Please check your entry.';                 }             }              }     ?>          <?php     get_header();     ?>          <form action="<?php get_permalink(); ?>" method="post">     <input type="text" name="u" autofocus>     <input type="password" name="pw">         <input type="submit" name="submit">     </form>          <?php get_footer(); ?>      Clicking on submit results in a white page. What is missing for the login process to work?


title: Default gallery returns as shortcode text not gallery from synchronized custom field

text: I'm using ACF and Polylang plugins. In ACF I have set up a custom WYSIWYG field where I create default WP gallery. Then in Polylang I have set up that it synchronizes this field across languages. So when the gallery is edited in one language it also updates in others. But the thing is that for other languages it returns the gallery shortcode text like [gallery link="file" columns="4" ids="77,76,75,74"] instead of the formated gallery itself. If I go to this post in admin I can see gallery shown there and also when I click update, now the gallery also shows as needed. What might be the problem? That the fields synchronize fine, but gallery gets returned instead of text only when I have clicked on Update for those translated posts.


title: How to print the current post depth as update notification?

text:
I need to find a simple if-condition to print the current post-depth for parents as an update notification. The following code in the functions.php is not working, it is resulting in "0" for all posts, both for parents and childs. Can anybody help out on this?               global $wpdb;     global $post;     $id = $post->ID;     $depth = $wpdb->get_var("SELECT post_parent FROM $wpdb->posts WHERE ID = '".$id."'");     if($depth == '0')         {     function my_admin_notice() {         ?>

<?php _e( 'Depth is 0!', 'my-text-domain' ); ?>

         <?php     }     add_action( 'admin_notices', 'my_admin_notice' );     }


title: Sidebar Slideshow widget with text

text: Can anyone suggest me some good sidebar slideshow widget? I need to add some text file along with each sides and show the image along with the text. Eg:http://misys.com/products/bankfusion-universal-banking.aspx. Please see the widget given here in the bottom of the sidebar.


title: WooCommerce - Fixed quantity of a product

text: I am trying to accomplish a thing on WooCommerce that I can not find any information about. It is like the following scenario: I sell screws and have 1500 in stock. I would like the customer to choose between buying 10, 30, 50 and 100 screws in a drop-down list. The price for each screw is lower when you buy 100 compared to 10, 30 etc. This works just the way I want by using product attributes and product variations. **BUT** the stock is not effected the way I want since the system think that it is one package of 100 screws and therefore reduce the stock by 1. I am thinking of modifying the `class-wc-product-variation.php` file that contains the following code:               function reduce_stock( $by=1 ) {         global $woocommerce;         if ( $this->variation_has_stock ) {             if ( $this->managing_stock() ) {                 $this->stock        = $this->stock - $by;                 $this->total_stock  = $this->total_stock - $by;                 update_post_meta( $this->variation_id, '_stock', $this->stock );                 $woocommerce->clear_product_transients( $this->id ); // Clear transient                 // Check parents out of stock attribute                 if ( ! $this->is_in_stock() ) {                     // Check parent                     $parent_product = new WC_Product( $this->id );                     // Only continue if the parent has backorders off                     if ( ! $parent_product->backorders_allowed() && $parent_product->get_total_stock() <= 0 ) {                         update_post_meta( $this->id, '_stock_status', 'outofstock' );                     }                 }                 return $this->stock;             }         } else {             return parent::reduce_stock( $by );         }     }      I am trying to set `$by` to the name of the product variation (10, 30, 50, 100) but I am not that good at PHP. I have tried to collect some relevant code (at least what I think) and putted it together to the following function:               function new_reduce_by () {         //Get the name of the variation         $this->variation_data[$name] = $attrvalue[0];         //Extract only the numbers (some attributes may end with "grams" etc.)         preg_match_all('!\d+!', $attrvalue[0], $modified_attrvalue);         //Convert the array to a variable         $custom_reduce_value = implode(' ', $modified_attrvalue[0]);         //Return the name (value) of the variation         return $custom_reduce_value;     }      I have tried to call this function in different ways but without success, I guess the code above is not correct. Should the code above work? If so, how do I call the function in the best way? I know that you cant call a function by changing `$by=1`, you have to pass a value or variable. Or should I solve this some other way? Many thanks!


title: Setting up a multilingual wordpress site

text: I am trying to set up a multilingual site using wordpress. I went through Each language in its own WordPress installation and decided to use this option: > Plugins like Multisite Language Switcher and the newcomer Multilingual Press > link together separate WordPress network (multisite) installations for each > language by pinging back and forth.. Now I installed the Multilingual Press and set up a network. The URL of my site was `wordpress.private.net` and next on is `it.wordpress.private.net`. Both domains are served from same folder. But still when I visit the `it.__` site it shows in English language and that too without all the posts. I get this notice on network dashboard > You didn't setup any blog relationships! You have to setup them first to use > Multilingual Press. For this, go to Network » Sites » and choose a blog to > edit. Then go to the tab "Multilingual Press" and set up the relationships. But there is no option to set up the relationships in the tab "Multilingual Press". Please guide me where am i going wrong? Any other way to set up is also welcome. My goal is to run my WordPress site in two languages.


title: Exclude category on blog list page

text:
I've got a site with a News page (archive for category 'news') and a separate Blog page. When I make a post for the News page I select the category 'news'. So, on the news page you only see the posts marked news, but on the blog page you can see all posts. What I would like to do is preferably show all posts EXCEPT the 'news' posts on the blog page. How do I do this?                                <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                                     <?php if ((function_exists('has_post_thumbnail')) && (has_post_thumbnail())) { ?>                                         <?php the_post_thumbnail(); ?>                                     <?php } else {                                          }                                     ?>

  <?php echo get_the_time('M, d, Y') ?>

                                       <?php comments_popup_link('No Comments.', '1 Comment.', '% Comments.'); ?>

                                       <?php the_author_posts_link(); ?>

                                       <?php the_category(', '); ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">                                 <?php the_title(); ?>
                         <?php the_excerpt(); ?>                                 <a class="read_more" href="<?php the_permalink() ?>"><?php _e('Read More', 'infoway'); ?>

                               Above is the code from blog.php, the php file I am trying to edit as it is the template for my blog page, (if it helps)


title: Problem with different query loops (and "main loop") on category template page!

text:
so, heres the problem: i've created a category-template (category.php) with two query loops and the main loop (in which the content from the category should get looped in). if i now click on a category the template page shows but also the first two query loops get affected by it. everything is messed up. above is my template architecture. as you can see, i used the wp_reset_query function but this did not help. how do i make JUST THE MAIN LOOP react to the catgeory posts? **the first loop:**
      <?php $args = array( 'post_type' => 'slider');     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();?>         <div class="startslide" style="background-color: <?php echo get_post_meta($post->ID, 'Farbcode', true); ?>">
<?php the_post_thumbnail( 'slider' ); ?>

<?php the_title(); ?>

<?php the_content(); ?>

      <?php endwhile; ?>      <?php wp_reset_query(); ?>
       **the second loop:**
     <?php $args = array( 'post_type' => 'teaser');     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();?>             <div class="topteaseritem" style="background:url(<?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 36,36 ), false, '' ); echo $src[0]; ?>) no-repeat 10px top">
<?php the_title(); ?>
                 <?php the_content(); ?>
            <?php endwhile; ?>             <?php wp_reset_query(); ?>
      **..and the third loop (the main loop):**
     <?php if (have_posts()) : ?>         <?php while (have_posts()) : the_post(); ?>

<a href="<?php the_permalink() ?>"><?php the_post_thumbnail( 'related' ); ?>

<?php the_title(); ?>
                 <?php the_content(); ?>

     <?php endwhile; ?>         <?php endif; ?>
       i hope you get my problem as i'm not a native english speaker (it's hard to explain all that) ;-)


title: replace html entities in posts between pre tags

text: I run a wordpress blog with a syntax highlighter plugin (Crayon). The plugin highlights code between pre tags, example:               <pre class="lang:languageid" title="example">     some code     </pre>      Wordpress sometimes replaces characters suchs as `" & < >` with html entities which are shown in the code `"` `&` etc. I tried several plugins that should prevent this but they don't (always) work. Is there an easy method to bulk edit old posts and search for entities between `pre` tags en replace them with the character? Or would it be easier to use a replace function on display and replace entities with their characters? Any suggestions to prevent this in the future are welcome as well (perhaps extend/modify crayon?). I usually write my blogs with Windows Live Writer but the behaviour also occurs when editing posts with the builtin editor.


title: Theme Development : License help

text: I'm developing my WordPress Theme. Is Theme required to use Copy Right when its does not have registered in Copy Righted list? is themes images directory required Copy Right declaration? I checked many WordPress does not provide Copy Right info and also does not declare copy right declaration that used in theme.


title: how to logout user on browser tab or window closes

text: How to logout a user when he closes the tab/window ? If no, it is possible to clear the session after specific time? How to do that?


title: Custom caption output for custom image size

text:
I've done a lot of searching and have found out how to customize the `img_caption_shortcode` oputput. What I can't seem to figure out how to do: Add a specific class to the caption's output if a certain custom thumbnail size was chosen in the media uploader. So, to elaborate a bit: I created a new image size:               add_image_size( 'profile-image', 300, 300 );      I added that to the media uploader image size options:               /**      * Add Custom Image sizes to Media Uploader      */     add_filter( 'image_size_names_choose', 'my_custom_image_sizes' );          function my_custom_image_sizes( $sizes ) {         return array_merge( $sizes, array(             'profile-image' => __('Profile Image with Caption'),         ) );     }      I found this code to hook into the `img_caption_shortcode` function:               function my_custom_img_caption_shortcode($a, $attr, $content = null) {              extract(shortcode_atts(array(             'id'    => '',             'align' => 'alignnone',             'width' => '',             'caption' => ''         ), $attr));              if ( 1 > (int) $width || empty($caption) )             return $content;              if ( $id ) $id = 'id="' . esc_attr($id) . '" ';              return '
'     . do_shortcode( $content ) . '
' . $caption . '

';     }     //Add the filter to override the standard shortcode     add_filter( 'img_caption_shortcode', 'my_custom_img_caption_shortcode', 10, 3 );      Now I would like to be able to change the caption output if the `profile- image` thumbnail size is chosen. I thought I would just try to output the thumbnail size (`size-profile-image`) class that WP provides to the caption's div wrapper, but I can't figure out how to do that.


title: Posts page drop down is not selecting the selected page

text: I tried to link the blog post to new page. so i went to `settings->reading` and selected the page in `Post page` drop down and i hit save after it says `Settings saved` i can't see the selected page in the `Post page` drop down. i see only `--select--` option. Nothing is selected. The post are not displayed in the selected page as well. What might be problem? What can i do? Any idea of what happening would be helpful. **Edit** after posting When i see the value in options table through wp-admin/options.php for this `page_for_posts` option the page ID is selected. That is option has the slected page ID. but it is not showing post at the front page as well in the select box.


title: Fastest way to fetch posts across a multisite

text: What's the fastest way to fetch posts/content across a multisite? I had been using SimplePie RSS feeds, but I'm now investigating `switch_to_blog()`. As `switch_to_blog` appears to be quite simple to use, I'd much rather use this implementation, but wanted to make sure that it would remain speedy.


title: Contact Form 7 - E-mail message template

text: In contact form 7 email settings, I put in all the necessary details like below: ![enter image description here](http://i.stack.imgur.com/EUrwu.jpg) However, when the e-mail is sent, it still has the "Wordpress" title or person who sent it in gmail: ![enter image description here](http://i.stack.imgur.com/3Mop6.jpg) ![enter image description here](http://i.stack.imgur.com/JoTRk.jpg) What am I missing? Did I set something up wrongly? Any piece of advice or information would be highly appreciated. Thanks!


title: How can I upgrade wordpress with manual?

text: When I update or upgrade my site automatically ,it corrupted. How can I update or upgrade it safely and manually?


title: the_content() isn't showing content, but $post->post_content does

text:
I'm trying to echo the content of a single post by using the_content(); but I get an empty result. However when I directly address the global $post, and specifically the post_content property it does show. What can cause such peculiar behaviour? CODE: the problematic line is near the end               <?php       get_header(); ?>

             <?php              $title = get_the_title();             $q = new WP_Query(array(                 'post_type'=>'community',                 'numberposts'=>-1,                 'orderby'=>'title',                 'order'=>'asc'));             if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post(); ?>
<a href="<?php the_permalink(); ?>" <?php if ($title==get_the_title()) echo "class=com_sel"; ?> ><?php the_title(); ?>
             <?php endwhile; ?>                  <?php endif; ?>

קהילות צעירות <?php wp_reset_query(); the_post(); the_title(); ?>
                  <?php                   $title=get_the_title();                  $forum_id =  $wpdb->get_row("SELECT id FROM wp_forum_forums WHERE name='$title'"); // find forum id                  ?>

<a href="<?php the_permalink(); ?>" <?php if (!isset($_GET['tab'])) {echo "class=com_sel"; $page = "אודות הקבוצה";} ?>>אודות הקבוצה

<a href="<?php the_permalink(); ?>/?tab=events" <?php if (isset($_GET['tab']) && $_GET['tab']=='events') {echo "class=com_sel"; $page = "ארועים";} ?>>ארועים

<a href="<?php the_permalink(); ?>/?tab=gallery" <?php if (isset($_GET['tab']) && $_GET['tab']=='gallery') {echo "class=com_sel"; $page = "גלריה";} ?>>גלריה

<a href="http://localhost/midor/%D7%A4%D7%95%D7%A8%D7%95%D7%9D/?mingleforumaction=viewforum&f=<?php echo $forum_id->id;  ?>.0">פורום

<?php echo $page; ?>
             <?php if (isset($_GET['tab']) && $_GET['tab']=='events'): ?>                          <?php elseif (isset($_GET['tab']) && $_GET['tab']=='gallery'):  ?>                          <?php else: ?>

                <?php  the_content(); ?>   // not working

             <?php endif; ?>

     <?php          get_sidebar();     get_footer();


title: Function to return values from metabox

text: I have created two custom metaboxes using the Meta Box plugin for my cpt called books, and I am confused how to output the values. The values need to be used in sperate places in one of my templates. I tried using `get_post_custom()` and with `get_post_meta()` but couldn't get it to work. Here is my metabox template:               add_action('admin_init', 'rw_register_meta_boxes');     function rw_register_meta_boxes()     {         $prefix       = 'rw_';         $meta_boxes   = array();         // Here is the code to define a meta box         $meta_boxes[] = array(             'title' => 'Amazon Affiliate Link',             'pages' => array(                 'books'             ),             'fields' => array(                 array(                     'name' => 'url',                     'id' => $prefix . 'amz',                     'type' => 'text'                 )             )         );         $meta_boxes[] = array(             'title' => 'Subtitle',             'pages' => array(                 'books'             ),             'fields' => array(                 array(                     'name' => 'Subtitle',                     'id' => $prefix . 'subt',                     'type' => 'text'                 )             )         );         foreach ($meta_boxes as $meta_box) {             new RW_Meta_Box($meta_box);         }     }


title: Meta Query And/Or

text: My question is very similar to Meta Query with AND & OR? . This question was answered in 2011 by @Otto. With the exception that my logic is different. I want to query, for example, posts with custom meta that match submitted form. The two required bits are city and state. Therefore, my query must be of the 'AND' type. However, I _also_ want to query posts with custom data of 'metro-area' that matches the same city, if they have that data. Not all posts do. This yields the need for an additional query, but of type 'OR', considering that I don't care if they match against the 'city' field, just the 'metro-area'. Real world scenario being that if I have small cities within a greater metro area, I want to be able to find posts in the small city as well as in the metro area. In sql, the query would look like WHERE metro-area = 'city123' OR (city = 'city123' AND state = 'state123'). My main problem is that this doesn't seem to be possible with the way WP_QUERY works. My question is - am I overlooking some part of WP_QUERY that may do what I'm after, or is there something else WP provides? I realize I may come to being forced to build the sql myself, but I'd like to pursue my WP options first.


title: Force image crop size in media editor

text: I've searched high and low for this but think the answer I seek is being buried by the more common questions. I am developing a theme for a client that has two specific image sizes (100x127 for thumbnail, 300x380 for medium). I have the media settings cropping like this when an image is uploaded, but if the user goes in to edit a thumbnail it doesn't re-crop to the sizes specified in media settings. What I am ideally looking for is either a plugin or something I can add to functions.php that will restrict the crop "draw" feature to the aspect ratio and then when the crop button is hit, will automatically resize the thumbnail to 100x127. Does anything like this exist? I don't even want the end user to have the option of entering in custom pixel sizes or aspect ratios. I'd rather that menu went away entirely.


title: What is the simplest way to create a redirect

text: If I have a custom post type called Drink which has permalinks like `/drink/pepsi/` then `/drink/` will list all of the Drinks. How can I rewrite `/drink/` to `/drinks/`? I want permalinks for single Drinks `/drink/pepsi` to stay with the `/drink/` root but I think `/drinks/` makes better sense for the "archive" of Drink.


title: Form processing: How to process form before output and access data from shortcode

text: I have a form that's output with a shortcode. I need to be able to conditionally process a redirect on the form submission, so the form processing needs to happen before any output is sent (I've put it on the `init` hook). What's the best way for me to access the form validation's status (`$validate`) so I can output any errors that are found in the form (within the shortcode)? Is using a global variable the only way? I try to avoid that if possible. I will have multiple forms needing to use this same process as well.               add_action( 'init', 'wpse_process_my_form' );     function wpse_process_my_form() {         if ( ! empty( $_POST['submit'] ) && 'myform' == $_POST['submit'] ) {             if ( $validate = wpse_validate_my_form( $_POST['form_data'] ) ) {                 $success = wpse_save_my_form( $_POST['form_data'] );                 if ( $success ) {                     wp_redirect( '/success', 302 );                     exit();                 }             }              }     }          add_shortcode( 'myform', 'wpse_my_form_shortcode' );          function wpse_my_form_shortcode( $atts ) {         // Somehow get the errors ($validate) generated in the function attached to init              // output form (with errors if found)              return $form;     }          function wpse_save_my_form( $form_data ) {         // Run save process here, return true if successful      }


title: How to make plugin work in each template in wordpress

text: I am new to plugin development .I want to get all images of a particular page/post and want to show them as slideshow below the page ..Currently i am able to gather all images in media library and display it...But i want images if that particular page ..I have learnt that to get images of particular template u need to add lines of code in that specific post template ..But how that can be done using a plugin                   $query_images_args = array(             'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,         );              $query_images = new WP_Query( $query_images_args );         $images = array();         foreach ( $query_images->posts as $image) {             $images[]= wp_get_attachment_url( $image->ID );         }     foreach($images as $item){             /// any function not yet decided     }     echo($item);      I m getting image urls in $item ..


title: Add multiple orderby with pre get posts

text: I am already using a small code to set default sort orderby a custom field called "Year" I need to add another orderby to also sort by "Post Title" in the same sort. **Sort** = Year-Customfield (DESC) and Post-title (ASC) Following is the code I'm currently using to sort by Year DESC.               add_filter('pre_get_posts', 'sort_arc');     function sort_arc($q) {      if ($q->is_category) {        $q->set('orderby', 'meta_value_num');        $q->set('meta_key', 'the-year');        $q->set('order', 'DESC');      }      return $q;     }      Thanx \------------------EDIT--------------------------------- The Code that stopped working, as explained below               add_action('pre_get_posts', 'check_meta_sort');     function check_meta_sort($query) {     if( $query->is_admin == 1 ) {     return;         }     if( !$query->is_main_query() ) {     return;     }     if( !$query->is_archive == 1 ) {     return;     }     $custom_field = ( $_GET['sort'] ) ? stripslashes( $_GET['sort'] ) : '';     $custom_value = ( $_GET['sortorder'] ) ? stripslashes( $_GET['sortorder'] ) : '';     if( $custom_field ) {     $query->set( 'meta_key', $custom_field );     $query->set( 'orderby', $custom_field );     if( $custom_value ) {     $query->set( 'order', $custom_value );     }     }     }


title: plugin to post from admin to flickr

text: I'm looking for a plgin which allows the admins to post to flickr directly from the admin panel when posting. I saw this and thought it would work but seems to only 'get' images not 'post' them http://wordpress.org/extend/plugins/wp-flickr-press/ and the documentation is a bit patchy & japanese