title: Register through url

text: Im looking for a solution where you can register through an url. Here's the thing, I want send out an email with a Url link. Best case: If the receiver click's on this link, the automaticly will be registered to my wordpress site (and become a subscriber) and be redirected to a page whitin my site. Second: ...or they will be redricted to an registration page where their email id is already has been put in, so they just have to click "accept" on this page to be registered. Is this doable at all?


title: How to add audio media in a post?

text: I am **simply trying to add an audio file** in a wordpress blog! I have tried different audio player plugins: the non-existing anymore (?) haiku minimalist player, the jQuery player, the mb.miniAudioPlayer and MediaElement.js. I have had only one player installed in each attempt. And, for each of these, I can see the(ir) _settings_ panel and add the respective code in some post to get the player displayed. So far so good. I can't, however, add any media files in the player(s)! All media files that I have uploaded, are nowhere to be selected. For example, while editing a post, I select _Add Media_ and inside the _Insert Media_ window, I expect at the very least to see the audio files (ogg, mp3 -- previously uploaded) under the _Media Collection_ Tab. This very "Insert Media" window is simply empty! What can I do to trace the "error"? Is it, perhaps, related to any directory/file access permissions where WordPress is installed?


title: Wp favorites posts by specific category?

text:
Well, let me get to the point, im trying to Display a specific category using the Wp favorites posts plugin this is what im adding `$category_id = get_cat_ID('news');` but it doesn't seem to work it shows all category's on favorite posts instead of a certain specific category. this is what im messing around with and i placed my category               <?php     foreach ( $favorite_post_ids as $o ) :         $category_id = get_cat_ID( 'news' );         $p = get_post( $o );         if ( $p->post_status == 'publish' ) {?>      & this is the whole entire favorite posts box that makes it functional.

<?php _e( 'fav posts', 'bd_lang' ); ?>

                  <?php $favorite_post_ids = wpfp_get_users_favorites();             if ( $favorite_post_ids ) { ?>                      <?php foreach ( $favorite_post_ids as $o ) : $p = get_post( $o );                     if ( $p->post_status == 'publish' ) { ?>
                                                   <?php if ( has_post_thumbnail( $o ) ) { ?>
                                     <a href="<?php get_permalink( $o ); ?>" title="<?php echo $p->post_title; ?>">                     <?php $image = vt_resize( get_post_thumbnail_id( $o ), '', 50, 0, true ); ?>                                         <img src="<?php echo $image[url]; ?>" width="<?php echo $image[width]; ?>" height="<?php echo $image[height]; ?>" alt="<?php if ( get_post_meta( get_post_thumbnail_id( $o ), '_wp_attachment_image_alt', true ) ) {                         echo get_post_meta( get_post_thumbnail_id( $o ), '_wp_attachment_image_alt', true );                     } else {                         echo $p->post_title;                     } ?>" />
                                   <?php } ?>                                                               <a href="<?php echo get_permalink( $o ); ?>" title="<?php echo $p->post_title; ?>"><?php echo $p->post_title; ?>
                  <?php } endforeach; ?>                  <?php } else { ?>
                     <?php _e( 'Your are not currently following any items.', 'bd_lang' ); ?>
          <?php } ?>


title: How do I query for posts by custom meta and those that have been stickied?

text: I realize how clumsy and inefficient this query is but SQL is not my strong point. I use the following query to pull the latest 8 events from a custom post type called Event Posts. However, I also need to include in those 8 posts any posts which have been stickied. Because of some very complicated client needs which exceed the capabilities of wp_query I've been forced to craft the query by hand and use wpdb to execute it. Could someone help me add to this query to also grab stickied posts?               SELECT SQL_CALC_FOUND_ROWS *, mt2.meta_value AS start_time, mt3.meta_value AS end_time, mt4.meta_value AS start_date, mt5.meta_value AS event_id, mt6.meta_value AS event_meta, mt7.meta_value AS event_thumb     FROM wp_posts     INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)     INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)     INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)     INNER JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id AND mt2.meta_key = 'event_start_time')     INNER JOIN wp_postmeta AS mt3 ON (wp_posts.ID = mt3.post_id AND mt3.meta_key = 'event_end_time')     INNER JOIN wp_postmeta AS mt4 ON (wp_posts.ID = mt4.post_id AND mt4.meta_key =      'event_start_date')     INNER JOIN wp_postmeta AS mt5 ON (wp_posts.ID = mt5.post_id AND mt5.meta_key = 'event_id')     INNER JOIN wp_postmeta AS mt6 ON (wp_posts.ID = mt6.post_id AND mt6.meta_key = 'event_meta')     INNER JOIN wp_postmeta AS mt7 ON (wp_posts.ID = mt7.post_id AND mt7.meta_key = 'event_thumbnail_url')     WHERE 1=1     AND ( wp_term_relationships.term_taxonomy_id IN (7) )     AND wp_posts.post_type = 'espresso_event'     AND (wp_posts.post_status = 'publish')     AND (wp_postmeta.meta_key = 'event_start_date'     AND (mt1.meta_key = 'event_start_date'     AND CAST(mt1.meta_value AS DATE) >= '" . date('Y-m-d') . "') )     GROUP BY wp_posts.ID ORDER BY CAST(wp_postmeta.meta_value AS DATE) ASC, CAST(mt2.meta_value AS TIME) ASC     LIMIT 0, 8


title: Add a captcha form to the woocommerce register form

text: I am trying to find a way of adding a captcha form on the register form that woocommerce build. I am able to create a template override but if i was to add the recaptcha directly i dont know what to do if it is correct etc. I have tried adding the plugin easy captcha but that didn't show anything. wp version is 3.7 woocommerce version is 2.0.20 Any ideas would be brilliant thanks in advance Alex


title: How to Display BuddyPress Profile Field Data In Multisite Blogs

text: I'm trying to display a BuddyPress xprofile field on a WordPress multsite blog. I thought this might do the trick but displayed_user doesn't seem to work outside of BP? Is there an easy way to do this? I know there's an old plugin that does it in a widget but I don't really need all of that and would rather put this directly in the theme. Here's what I've tried within the theme on the multisite blog. This works with loggedin_user->id but of course what I'm shooting for is the profile data for the blog admin. Is that possible to fetch?               <?php      global $bp;     $myfield = xprofile_get_field_data( 'Counties Served', $bp->displayed_user->id, $multi_format = 'comma' );     $data = xprofile_format_profile_field('checkbox', $myfield);     echo $data;     ?>


title: How to import linked images and make them featured -> automagically

text: I am using FeedWordPress to syndicate articles from RSS feeds. The plugin does a _beautiful job_ of bringing in the content, preserving original formatting, and assigning metadata to the right places. Images are displayed by linking to source images. What I want to do:   * automatically import all images from syndicated posts, and add them to the media library.      * import to media library should handle image processing to create thumbnails, etc.   * automatically assign image #1 as the featured image, to be used in widgets. The plugin doesn't seem to support these features. Can you suggest another plugin, or configurations that can help to support these features?


title: Display Sub-categories or Child Pages of Parent Cat/Page?

text: I am seeking two codes which I haven't been able to find which would allow a child menu to be created in a sidebar. A code to display the sub-categories of the parent category. A code to display the sub-pages of the current page. I remember having a theme that had these codes implemented which also allowed styling to be applied to current categories. Maybe it has since been depreceated and maybe not - but I would sure appreciate if anybody had more information on these codes.


I am building my first Wordpress site, I just downloaded and installed v3.9.1. I bought a theme (rustik3) and I am trying to install it, but I am running into these errors produced by WP_DEBUG:               Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 501          Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 502          Notice: Use of undefined constant Redux_TEXT_DOMAIN - assumed 'Redux_TEXT_DOMAIN' in /var/www/wp-content/themes/rustik3/admin/options.php on line 503          Notice: Undefined variable: item_info in /var/www/wp-content/themes/rustik3/admin/theme-functions.php on line 23      I have done some googling, and I'm starting to think that the last Wordpress update made it so that the Redux Framework is deprecated and cannot be used. This is just a hunch though. As of right now, the theme installs, but it shows up as completely blank - either when I go to `http://localhost` or when I am trying to customize it in the Wordpress UI. I haven't looked into the last part of the error messages log (line 23 error)...but it is just an undefined variable so I might be able to tackle that one myself. Any ideas? **UPDATE** This is what the chunk of code looks like in `options.php`:               array(                 'id' => 'google_webfonts',                 'type' => 'google_webfonts',                 'title' => __('Enable Google Webfonts', Redux_TEXT_DOMAIN),                  'sub_desc' => __('Pick from over 600 Google Webfonts to use on the site. Then select below which elements you want to apply it to.', Redux_TEXT_DOMAIN),                     'desc' => __('', Redux_TEXT_DOMAIN)           ),      **UPDATE** I did a text search through all of the wordpress files for `Redux_TEXT_DOMAIN` and the only spot it appears is in the above chunk of code... **UPDATE** This code is what loads the text domain in the theme I have...I am not familiar with what a text domain is - but this might be relevant:               public function load_textdomain() {             if ( isset( $this->textdomain_loaded ) )                 return $this->textdomain_loaded;                  $textdomain = $this->get('TextDomain');             if ( ! $textdomain ) {                 $this->textdomain_loaded = false;                 return false;             }                  if ( is_textdomain_loaded( $textdomain ) ) {                 $this->textdomain_loaded = true;                 return true;             }                  $path = $this->get_stylesheet_directory();             if ( $domainpath = $this->get('DomainPath') )                 $path .= $domainpath;             else                 $path .= '/languages';                  $this->textdomain_loaded = load_theme_textdomain( $textdomain, $path );             return $this->textdomain_loaded;         }      Is there something wrong with the above code? Note: I have posted a duplicate question here. I did this before I was aware that there was a Wordpress specific section of Stack Exchange. If you care about stackoverflow.com - you can answer the question there...I have put a 50 point bounty on it :). You should also read the comments on that page...I think I may have found some relevant information. **UPDATE** Thanks to a comment by cybmeta - I got rid of the `Redux_TEXT_DOMAIN` errors...the last one left is this: `Notice: Undefined variable: item_info in /var/www/wp- content/themes/rustik3/admin/theme-functions.php on line 23` Here is the code:               $item_info .= '

             <form action="http://doublerainbowx.us6.list-manage2.com/subscribe/post?u=eac2b83a92633c39dae8a663b&id=334c60b856" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>                 Get e-mails about important updates and helpful tips on how to run your store by joining the Rustik newsletter.                 <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<input type="text" name="b_eac2b83a92633c39dae8a663b_334c60b856" value="">
                 <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">                 Hide Notice             </form>

';                  echo $item_info;      The error is thrown on the `echo $item_info` line - so it is as if it isn't being set for some reason...even though it looks like it is above.


title: creating a custom walker class

text:
I am currently developing a theme for wordpress, and would like to add some data values to the list items that are returned. Here is the basic structure of my nav:

Top Slide

Parallax Scrolling

Grid

Credits

      I have created a walker class which is here (although not 100% how i want it):               class description_walker extends Walker_Nav_Menu     {            function start_el(&$output, $item, $depth, $args)               {               global $wp_query;            $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';                $class_names = $value = '';            $classes = empty( $item->classes ) ? array() : (array) $item->classes;                 $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );            $class_names = ' class="'. esc_attr( $class_names ) . '"';                 $output .= $indent . '
ID . '" id="menu-item-'. $item->ID . '"' . $value .'>';                 $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';            $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';            $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';            $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';                // $prepend = '';           // $append = '';            $description  = ! empty( $item->description ) ? ''.esc_attr( $item->description ).'' : '';                 if($depth != 0)            {                      $description = $append = $prepend = "";            }                  $item_output = $args->before;             $item_output .= '';             $item_output .= $args->link_before .$prepend.apply_filters( 'the_title', $item->title, $item->ID ).$append;             $item_output .= $description.$args->link_after;             $item_output .= '';             $item_output .= $args->after;                  $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );             }      } I am then calling wp_nav_menu like this:               <?php wp_nav_menu( array(      'container' => 'div',      'container_id'    => 'nav',      'container_class' => 'grid_9 omega',      'echo' => true,      'before' => '',      'after' => '',      'link_before' => '',      'link_after' => '',      'depth' => 0,      'walker' => new Walker_Nav_Menu())      );?>      The menu is not outputting correctly, but that is purely because i dont fully understand how the walker class. Can anyone she some light?


title: Reset password white page

text: For one of our clients we have the following situation: When using the forgot password option and clicking the 'reset password' link we re getting only white pages. It's not possible to reset the password anymore. Does anyone know what the problem could be? Thanks in advance.


title: Enclose title within a div?

text:
I'm using this code to display a page within my front page. I would like to learn how to add a div / spacer to isolate the page title... If I try to add a div class within the php code then it throws errors. **Question: How can I add a div to the title within this bit of code?**
     <?php      $page_id = 2945;      $page_data = get_page( $page_id );      echo '
'. $page_data->post_title .'
'; //enclose the title within a div/spacer???     echo apply_filters('the_content', $page_data->post_content);     ?>      Thanks


title: Skip posts without a thumbnail in loop

text:
I want skip every post that has no thumbnail. The code does not work properly yet. Actually the script doesn't show posts without a thumbnail - that's good, but in the loop the post with no thumbnail is still counted as a post. So when I have for example 10 posts in my database. I want show 5 of them. But only the posts with a thumbnail.
              <?php              $args = array(  'numberposts'  => 5,                           'orderby'      => 'date',                           'order'        => 'DESC',                         'post_type'    => 'post',                         'post_status'  => 'publish'                      );              $my_posts = get_posts( $args );         global $post;         foreach( $my_posts as $post ) : setup_postdata($post);               if ( !has_post_thumbnail() ) {              continue;                      } else {              ?>

<?php the_post_thumbnail('post-image-big'); ?>
                     <a href="<?php the_permalink(); ?>" class="title"><?php the_title(); ?>
<?php the_category(', '); ?>

              <?php } ?>              <?php endforeach; ?>


title: WP Cron doesn't save <iframe> or <object> in post body

text: I am using wp_cron to auto grab posts from a remote website and save them in my wp db. **NOTICE! I am executing my code from my plugin, not from my template functions.php or somewhere else. I have my own validation of grabbed content to prevent malicious code etc. so turning off security validation in wordpress is not an issue in my case, but be careful if you don't have your own validation of grabbed content. Always validate grabbed values if possible!** I have in my plugin one button to grab posts manually by clicking on this button and it works perfect. Everything is stored as I want in my database. No problem here. but then I have a wp cron function that runs for testing pursposes every two minutes (if somebody clicks on my page, of course ;) and here is a problem. Notice that the code is identical, just instead of `get_user_id()` I set it manualy to `1`. that's probably the only change between these two codes. And the problem is that everything is stored as expected including time, title, slug, (it even grabs and downnload and set the featured image for the post correctly), tags, categories and additional taxonomy too. So that fine. ONly thing that is missing is the body text (content) of the post. When downloaded from admin manually. It's somethign like:               <iframe width="650" scrolling="no" height="450" frameborder="0" src="http://example.com/embedframe/3843634"></iframe>      or               <object height="450" width="650" ><param name="movie" ... bla bla bla ... shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" height="450" width="650" /></object>       So, it is because it is filtered and striped out, I mean `object` and `iframe` when not logged in as an admin? If so, how can I turn it off in my plugin? Or is it something else? I really think it's only something with WP security issue, because the code works when performed from admin as admin manually. And the code of the function is the same and all variables are passed in as expected. Just content is not saved. **EDIT:** It's definitely **something with the WP security**. When I set in my auto cron function content variable manually to "Testing auto save." is is saved normally. But When I set it to `<iframe>something</iframe>` or `<object>blablabal</object>` it is NOT. **How to turn this "checking" off, so I can save my code with cron?** Any idea?


title: uploading Attachments with permalinks based on parent file structure

text: We are rebuilding a public-interest site centered on civil rights research & document archives. The links in years of published info posts must be preserved in WordPress, and future uploaded attachments must be consistent with this 'legacy URL' format - _i.e.,_ appending the "/filename.pdf" to the parent page URL.   This creates a clean intuitive link, showing the locus of each document in the topical hierarchy of the site. This is not exotic, it's the NORM in traditional HTML sites, and how attachment links were made in our prior Plone installation. WordPress should be able to do this... we need the simple solution on creating accurate Permalinks in accord with legacy URL's. It should be an easy manual operation for a single document upload, and allow bulk uploads that assign such links automatically. If this can be done with a good WP Plugin or quick- fix in the Permalink settings, please advise. ### That's What we Need; Here's the Problem: By default in WP, attachments uploaded via [Add Media] go into the root-level "uploads" folder, not to the Page - so the URL's show the path ".../wp- content/uploads/..." in lieu of the parent file hierarchy.   The site rebuild is precise to the original structure & URL's, and the correct document links are carried over in the new pages, but uploaded attachments go somewhere else, get different URL's, and don't connect to the hypertext links. This page in-construction serves as an example:   http://www.free-assembly.org/gather/campaigns/llur/ This is a brief narrative on a policy project in 1993, connecting to the document presented to Congress & Agencies in DC, with this "correct" link in the text:   (( _www.free-assembly.org/gather/campaigns/llur/legal-landuservw-dec93.pdf_ )) ...   ...this link is clear and contextual, but now goes nowhere. At the bottom the uploaded attachment is shown, with this WP link:   (( _www.free-assembly.org/wp-content/uploads/legal-landuservw-dec93.pdf_ )) ...   ...this link brings up the document on-site, but obsoletes all prior info about it. We experimented with the Permalink settings in WP, but they provide no simple way to either lodge the upload under the current Page OR connect the accurate URL of choice to the default link path. We are exploring the "Custom structure" option, htaccess file & other code modifications, and fitting Plugins - but have seen nothing yet addressing this specific problem. We are new to WordPress, able to implement the right solution, but need knowledgeable guidance to find it reliably and waste no time... your help is most appreciated.


title: Categorie parents and childs displayed

text: I'm trying to create a menu directly hard-coded, basically I need to display the parent category and below its child categories, however I have to do this several times meaning something like this: Category 1 * category child of 1.1 * category child of 1.2 * category child of 1.3 Category 2 * category child of 2.1 * category child of 2.2 and so on.... I've tried whit different kinds functions like call the category and is subcategory to call its ancestor, however I haven't been able to get the result I'm looking for. Any suggestion??? Thanks in Advanced.


title: Pause plugin option page until all data manipulation is complete

text: I have an option on my plugin page where I load content into all the posts in the blog. Now this takes some time, esp when there are a log of posts. Now the way is it set up now, when you press submit, the form success page is already presented, but you can see that the browser is still working. How can I have the plugin wait until the whole loop is finished, and then present the error or success page.


title: How to add an upload image button (just like the one in the Custom Header) in the Theme Options I just created?

text:
I used the following code in order to add a Theme Options panel in my Wordpress admin:               <?php          $themename = "Nettuts";     $shortname = "nt";          $categories = get_categories('hide_empty=0&orderby=name');     $wp_cats = array();     foreach ($categories as $category_list ) {         $wp_cats[$category_list->cat_ID] = $category_list->cat_name;     }     array_unshift($wp_cats, "Choose a category");          $options = array (         array( "name" => $themename." Options",         "type" => "title"),              array( "name" => "General",         "type" => "section"),         array( "type" => "open"),              array( "name" => "Colour Scheme",         "desc" => "Select the colour scheme for the theme",         "id" => $shortname."_color_scheme",         "type" => "select",         "options" => array("blue", "red", "green"),         "std" => "blue"),              array( "name" => "Logo URL",         "desc" => "Enter the link to your logo image",         "id" => $shortname."_logo",         "type" => "text",         "std" => ""),              array( "name" => "Custom Option",         "desc" => "Enter the link to your logo image",         "id" => $shortname."_custom",         "type" => "text",         "std" => ""),              array( "name" => "Custom CSS",         "desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:green}",         "id" => $shortname."_custom_css",         "type" => "textarea",         "std" => ""),              array( "type" => "close"),         array( "name" => "Homepage",         "type" => "section"),         array( "type" => "open"),              array( "name" => "Homepage header image",         "desc" => "Enter the link to an image used for the homepage header.",         "id" => $shortname."_header_img",         "type" => "text",         "std" => ""),              array( "name" => "Homepage featured category",         "desc" => "Choose a category from which featured posts are drawn",         "id" => $shortname."_feat_cat",         "type" => "select",         "options" => $wp_cats,         "std" => "Choose a category"),              array( "type" => "close"),         array( "name" => "Footer",         "type" => "section"),         array( "type" => "open"),              array( "name" => "Footer copyright text",         "desc" => "Enter text used in the right side of the footer. It can be HTML",         "id" => $shortname."_footer_text",         "type" => "text",         "std" => ""),              array( "name" => "Google Analytics Code",         "desc" => "You can paste your Google Analytics or other tracking code in this box. This will be automatically added to the footer.",         "id" => $shortname."_ga_code",         "type" => "textarea",         "std" => ""),              array( "name" => "Custom Favicon",         "desc" => "A favicon is a 16x16 pixel icon that represents your site; paste the URL to a .ico image that you want to use as the image",         "id" => $shortname."_favicon",         "type" => "text",         "std" => get_bloginfo('url') ."/favicon.ico"),              array( "name" => "Feedburner URL",         "desc" => "Feedburner is a Google service that takes care of your RSS feed. Paste your Feedburner URL here to let readers see it in your website",         "id" => $shortname."_feedburner",         "type" => "text",         "std" => get_bloginfo('rss2_url')),              array( "type" => "close")          );          function mytheme_add_admin() {         global $themename, $shortname, $options;              if ( $_GET['page'] == basename(__FILE__) ) {                  if ( 'save' == $_REQUEST['action'] ) {                      foreach ($options as $value) {                     update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }                              foreach ($options as $value) {                             if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } }                                      header("Location: admin.php?page=options.php&saved=true");     die;                  }             else if( 'reset' == $_REQUEST['action'] ) {                      foreach ($options as $value) {                     delete_option( $value['id'] ); }                              header("Location: admin.php?page=options.php&reset=true");     die;                  }              }              add_menu_page($themename, $themename, 'administrator', basename(__FILE__), 'mytheme_admin');     }          function mytheme_add_init() {         $file_dir=get_bloginfo('template_directory');         wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");     }          function mytheme_admin() {              global $themename, $shortname, $options;         $i=0;              if ( $_REQUEST['saved'] ) echo '

'.$themename.' settings saved.

';         if ( $_REQUEST['reset'] ) echo '

'.$themename.' settings reset.

';          ?>

<?php echo $themename; ?> Settings

     <form method="post">          <?php foreach ($options as $value) {         switch ( $value['type'] ) {              case "open":     ?>          <?php break;          case "close":     ?>

          <?php break;          case "title":     ?>
To easily use the <?php echo $themename;?> theme, you can use the menu below.
          <?php break;          case 'text':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>         <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id'])  ); } else { echo $value['std']; } ?>" />      <?php echo $value['desc']; ?>

     <?php         break;          case 'textarea':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>         <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id']) ); } else { echo $value['std']; } ?></textarea>      <?php echo $value['desc']; ?>

          <?php         break;          case 'select':     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>          <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">     <?php foreach ($value['options'] as $option) { ?>             <option <?php if (get_settings( $value['id'] ) == $option) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>     </select>              <?php echo $value['desc']; ?>

     <?php         break;          case "checkbox":     ?>
         <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?>          <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>     <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />              <?php echo $value['desc']; ?>

     <?php break;          case "section":              $i++;          ?>

<?php echo $value['name']; ?>
<input name="save<?php echo $i; ?>" type="submit" value="Save changes" />

          <?php break;              }     }     ?>          <input type="hidden" name="action" value="save" />     </form>     <form method="post">
     <input name="reset" type="submit" value="Reset" />     <input type="hidden" name="action" value="reset" />
     </form>
Icons: WooFunction

          <?php     }          ?>          <?php     add_action('admin_init', 'mytheme_add_init');     add_action('admin_menu', 'mytheme_add_admin');     ?>      I would like to add an upload button like this one: ![enter image description here](http://i.stack.imgur.com/llD03.png) I searched all the Internet and this StackExchange site but didn't find the answer (there is only one but it is for custom write panels in 'Pages'). Any suggestions?


title: stack-overflow-like content ranking for wordpress?

text: **drastically EDITed:** What approach would you recommend for **post** ranking in wordpress CMS? should it work with custom fields? something else? i couldn't find a plugin to do it, so i'm going to to write one by myself. i know how to use a database, and i'm a php programmer. but i'd prefer to rely as much as possible on WP existing components or features.


title: Email friend for each Custom Post Type posts on a page

text: I have a Custom Post Type called 'Property'. I display a list of CPT properties on a page: 10 per page with pagination. I would like to add an "Email friend" link to every property on the list, so a user can email that property url to multiple email addresses easily. Is there a plugin that can do this? Otherwise, what's the best approach for to do it? Many thanks, Dasha


title: Redirect single article permalink to paginated category page

text: Is it possible to redirect from a permalink (a single article) to that same post in a relevant category page, which might be paginated? So when people visit `http://domain/post_number` they get redirected to `http://domain/category/page/2/#post_number`?


title: Custom taxonomy archive - No posts found

text: I've created a custom taxonomy 'quote-categories' (a separate category listing for a custom post type) and created a taxonomy-quote-categories.php template that is called successfully when viewing a taxonomy term. However the page returns no matching post despite there being many posts in that category. I've called that content type successfully all around my site. _**FIXED_** The problem was the custom post type did not have the 'public' parameter set to 'true'. Otherwise it is invisible in normal loops and search results.


title: Add session or cookie to remember last menu location

text: I have a site that is pretending to be three sites. This is done by a series of conditional statements and page templates to make it look like the user is on a different site depending on their menu choice. The client wants it to remember the last 'site' the user was on so they are taken back there if they come back. For example, the three 'sites' are home, autos, advertising, so if the user was on the 'autos' part of the site, when they come back, they're taken back to autos. The three sites are in a menu that was created by the custom menus option under Appearance > Menus. I _think_ this question is the same thing I'm asking for, but the entire discussion and the tutorials posted are completely over my head. Doe anyone have the actual code I need to input and where? Or can point me to a tutorial to help me understand how to do it myself? Thanks much!


title: How can I easily reduce the size of WordPress installation from development to production?

text: Sometimes it happens that cheap but fast/reliable hosting plan has the drawback to have only 50MB/100 MB of local space, for files and database. Now, before going to production, I delete manually some files. For example development version of CSS and javascript, plugin language files that I do not use, etc. Is there a software or a batch script that can help me to reduce the size of my WordPress installation before deploying it to production server?


title: How Do I Prevent Junk Account Creation?

text: I want to allow readers of my WordPress-driven sites who comment frequently the ability to sign up and have their own account on the site. However the ratio of actual readers versus spam scripts using the sign-up form is something like 1:100. Is there a reasonable solution for preventing these bogus accounts from being created while still allowing reader sign-ups? Last I looked, I couldn't find anything for account creation like what spam-prevention measures are available for comments.


title: Automatically set post title to same value as a meta box

text: I've removed "Title" from a custom post type that I created. Which makes it that all new posts gets the name "Auto Draft". To get around this I want to be able to fetch a value/post name from a meta box and save that as the new title. Is this possible? This is what I'm using, and the value of this meta should be the new title                function save_title_meta($post_id, $post) {          // verify this came from the our screen and with proper authorization,     // because save_post can be triggered at other times     if ( !wp_verify_nonce( $_POST['meta_noncename'], plugin_basename(__FILE__) )) {     return $post->ID;     }          // Is the user allowed to edit the post or page?     if ( !current_user_can( 'edit_post', $post->ID ))         return $post->ID;          // OK, we're authenticated: we need to find and save the data     // We'll put it into an array to make it easier to loop though.          $project_meta['_title'] = $_POST['_title'];          // Add values of $project_meta as custom fields          foreach ($project_meta as $key => $value) { // Cycle through the $project_meta array!         if( $post->post_type == 'revision' ) return; // Don't store custom data twice         $value = implode(',', (array)$value); // If $value is an array, make it a CSV (unlikely)         if(get_post_meta($post->ID, $key, FALSE)) { // If the custom field already has a value             update_post_meta($post->ID, $key, $value);         } else { // If the custom field doesn't have a value             add_post_meta($post->ID, $key, $value);              }         if(!$value) delete_post_meta($post->ID, $key); // Delete if blank     }           }          add_action('save_post', 'save_title_meta', 1, 2); // save the custom fields     ?>                         echo '<input type="hidden" name="meta_noncename" id="meta_noncename" value="' .     wp_create_nonce( plugin_basename(__FILE__) ) . '" />';          // Get the location data if its already been entered     $title = get_post_meta($post->ID, '_title', true);          // Echo out the field     echo '<input type="text" name="_title" value="' . $title  . '" class="widefat" />';     ?>


title: How to allow <video> html5 tag in Wordpress

text: Currently I am running a Wordpress MU blog using the Unfiltered MU plugin. However, when I try to insert an HTML5 tag, it gets stripped away. I believe it may be the WYSIWYG editor cleaning the code. Where can I change settings to allow ? Thanks


title: Permalinks in Custom Post types

text: Is it possible for a custom post type to have a permalink as `domain.com/custom-slug/` instead of `domain.com/custom/custom-slug/`? I can't seem to achieve it. `rewrite` argument while registering it either defaults to the latter one or a custom one by using `'rewrite' => array( 'slug' => 'blah-blah' )`


title: Tabbed feeds with ajax vs. without on homepage

text: I have a tabbed section on my homepage where I call different feeds for new posts by category of my site much like the new youtube layout. I have 10 different feeds so my question is how important is to have those feeds crawled because I'd like to just rotate them with ajax rather than have all of it called and hidden on page load. I looked into the hash tag solution for crawling ajax but that doesn't seem to apply in this situation where the only thing needing crawled is the homepage. The other question is if I let it all load hidden without ajax is that going to dramatically slow down load times or is not so bad because the content isn't actually being shown on load?


title: Get Unique Categories - Group By?

text: I have 2 separate groups of Categories that a post can be classified in: Client & Medium. I'm trying to display all the Clients (if they have posts), and any Mediums that those posts may belong to. The problem I'm running into is this: Lets say a 3 posts are associated with Client A. When I'm in the loop, and gathering all the Categories for each post, I get 'Client A' 3 times, instead of just once (as I want it). The same is true with the Medium category as well. I want to display only: a) the unique / distinct Clients (that have posts) b) the mediums that those posts are categorized by, per client. What's the best way of going about this? If I'm in the Loop, is there a way to only pull unique Categories? Or do I have to gradually put them all in an array, and check that they don't exist before adding a new one? How about using some sort of Group By clause? Here's some of the code I'm using:               <?php $args = array('cat' => 4 );      $clients_query = new WP_Query( $args );     ?>          <?php while ( $clients_query->have_posts() ) : $clients_query->the_post(); ?>                  <?php $categories = get_the_category(); ?>                  <?php foreach($categories as $category) : ?>                      <?php if (cat_is_ancestor_of(4, $category)) : ?>                     /* 4 is the Client Cat -- so stick this in an array */                      <?php elseif (cat_is_ancestor_of(5, $category))                                    /* 5 is the Medium Cat -- so stick this in a seperate array maybe?                           <?php endif; ?>                  <?php endforeach; ?>              <?php endwhile; ?>


title: How is it possible to list custom post types by "category" like with simple posts?

text: I created a custom taxonomy, "partners". I would like to categorize these items, so I created a custom post type with a taxonomy.               register_taxonomy("partners-category", array("partners"), array("hierarchical" => true, "label" => "Partners", "singular_label" => "Partner", "rewrite" => true, "slug" => 'partners-category'));      I would like to list these posts by categories for example: categoryname- category.php. I know it's working only with posts, so what's the best way? Thank you very much and sorry, I'm newbie.


title: Custom Post Type Archive in Sub Folder

text: I have a sub-directory in my Wordpress theme (there are a lot of pages and I want a more logical structure). I have a custom post type called "entry" but if I place the archive-entry.php template in my sub-directory it is no longer picked up by the theme. Is there a way I can put my custom post type archive templates in a sub- directory?


title: Woocommerce - Free Shipping after coupon

text: Here is the situation:   1. Website offers free shipping on orders above $50.   2. Price total cost after coupon is less than $50   3. Free shipping is still applied. It looks like free shipping is calculated on the original price, and not on the final price. Is there a way to change that around? i have checked all woocommerce settings, and played around switching coupon settings and site wide settings to no success.


title: How to get author's name by author's id

text:
I want to show recent posts like this.
       <?php foreach( wp_get_recent_posts() as $recent ){ ?>
           <a href="<?php echo get_permalink($recent['ID']); ?>">         <?php echo $recent["post_title"]; ?> by         <?php echo $recent["post_author"]; ?>
       <?php } ?>
      But `$recent["post_author"]` returns only id of author. And this is outside `The Loop`, so I can't use `the_author()` function. How can I get author's name from ID? Or maybe there is a better way to do it?


title: List all posts of certain category which share some tags

text:
My problem is quite simple: I've got a couple of posts in different categories that have several tags, some of them in common. When I load a post, in my sidebar (using PHP Code) I want to show a list of all the posts of another category that share the same tags as the one displayed. I've tried related posts and it doesn't do the trick, because I found no way of adding the 'only this category' condition. UPDATE. I have tried this               <?php     global $post;     $tagargs = $catargs= '';     $catnames ='';     $tagnames = '';     $tags = get_the_tags($id);              if ($tags) {             foreach ($tags as $tag) {                 $tagnames .= $tag->name . ',';             }             $tagargs = array(                 'ignore_sticky_posts' => 1,                 'tag' => $tagnames,                 'post__not_in' => array($id),                 'showposts' => $number,                 'orderby' => 'name',                 'order' => 'asc',                 'cat' => '152'             );         }          $posts = get_posts($tagargs);       foreach($posts as $post) :         ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
      <?php endforeach; ?>      And I get all the posts in category 152 (the one I want) but that have only in common the first tag. I have figured out how to do the opposite, I mean, first, get the tags of all the posts inside this category (152) and then compare them with those in the current post (because sometimes, the current post have more than two or three), and get those posts that have all the tags in both sides. What do you think?


title: Basic function call on init failing

text: I've been banging my head against this for a while. I have this very straight- forward code in my plugin:               add_action('init', 'register_shortcodes');          $shortcodeRegistrationRan = False;          function register_shortcodes() {         global $shortcodeRegistrationRan;         $shortcodeRegistrationRan = True;         echo "Ran = True";              add_shortcode( 'accountability', array($hfMain, 'processAccountabilityShortcode') );     }      The problem is `$shortcodeRegistrationRan` never gets set to `True`, nor does "Ran = True" appear anywhere on the page. What am I missing? I'm using SimpleTest for Wordpress to check the status of my run flag. I have plenty of other passing tests, so the test suite is running fine. My test checks this way:               public function testShortcodeRegistrationRan() {         global $shortcodeRegistrationRan;         $this->assertEqual($shortcodeRegistrationRan, True);     }      At the beginning of the test suite:               require_once(dirname(__FILE__) . '/../[PLUGIN NAME].php');      **EDIT:** Per @s_ha_dum's advice, I added a new test using the `shortcode_exists` function:               public function testShortcodeRegistration() {         $this->assertEqual(shortcode_exists('accountability'), True);     }      Unfortunately, it, too, does not pass. **EDIT:** Here is the full context:               <?php     /*     Plugin Name: Nathan's Awesome Widget     Plugin URI: http://NathanArthur.com/     Description: This plugin does awesome things     Author: Nathan Arthur     Version: 1.0     Author URI: http://NathanArthur.com/     */          /*global $wp_version;          if ( !version_compare($wp_version,"3.0",">=") ) {         die("You need at least version 3.0 of Wordpress to use the copyright plugin");     }*/          function my_plugin_activate() {         error_log("my plugin activated");     }          register_activation_hook(__FILE__,"my_plugin_activate");                    if (!class_exists("HfAccountability")) {         class HfAccountability {             private $currentUser;             function HfAccountability() { //constructor                 $this->currentUser = wp_get_current_user();             }             function getCurrentUserLogin() {                 return $this->currentUser->user_login;             }             function processAccountabilityShortcode( $atts ) {                 #$to = '[MY EMAIL ADDRESS]';                 #$subject = 'Testing Mandrill integration';                 #$message = "Yup, that's all we're doing";                 #wp_mail( $to, $subject, $message, $headers, $attachments );                 return 'We tried.';             }         }     }          if (class_exists("HfAccountability")) {         $hfMain = new HfAccountability();     }          //Actions and Filters     /* if (isset($hfMain)) {         //Actions         add_action('init', 'register_shortcodes'); //PROBLEMATIC LINE              //Filters              $actionsRan = True;     } */          add_action('init', 'register_shortcodes');          $shortcodeRegistrationRan = False;          function register_shortcodes() {         global $shortcodeRegistrationRan;         $shortcodeRegistrationRan = True;         echo "Ran = True";              add_shortcode( 'accountability', array($hfMain, 'processAccountabilityShortcode') );     }


title: WordPress deployment strategy: Dealing with dependencies

text: The main question is: **How do you deploy your WordPress sites, taking into account dependency management and database migrations?** ## Details I've been reading around this issue both on Stack Exchange and from trawling Google and I'm yet to find a solid explanation of how to do this. I'm really interested in how other developers tackle deploying their WordPress sites and in particular how they deal with plugin dependencies. Let's say I'm developing a WordPress site. Assume I will need a local, staging and a live environment and they should all be virtually identical to each other. I need some solution to manage deploying to these remote servers and updating them periodically with the latest changes. Typically in this situation I use Vagrant locally, with a box that will match the live environment as closely as possible. Typically I'll use some WordPress specific flavour of Vagrant just to get up and running quickly (e.g. Varying Vagrant Vagrants). Now the first challenge: **How to handle versioning?** My current workflow involves versioning any custom code, i.e. the theme and any custom plugins. Third party code (i.e. plugins and WordPress itself) are defined as git submodules and so can be pulled in automatically by git and as they are submodules, I avoid having a ton of third-party code in my project repo. At a basic level this works just fine. I can ssh into the remote servers and do a simple `git pull my-stable-branch` and I'm all done. Except what happens when a particular plugin or other dependency isn't available as a git repo? Many plugins are only available via subversion. Additionally, any commercial plugins used in the project won't be available _at all_. How should these dependencies be handled? Yes, they could be added to the project repo and versioned, but this feels wrong as it's third-party code that won't be changed. **Handling databases changes:** How do you handle updating the database when moving from local to staging, to live? There are two main problems I encounter here:   * URLs stored in the database   * Ensuring the DB is up to date with the live environment. The first is currently the bane of my life when it comes to working with WordPress. There numerous entries in the database that use the full URL of the site. Naturally, this will change between environments and so the database needs to be edited whenever it's migrated to a different environment. Currently, I've just using a basic shell script + PHP script to get an SQL dump of the DB, find and replace all instances of the 'old' URL with the 'new' one and then import the result back into MySQL. This is messy, tedious and can't be the optimal solution, can it?! Secondly, let's say I do some work locally to update a site. Whatever this work is, let's assume it involves some changes to the database. Now I'm ready to push this to staging for client perusal, and eventually to live. In the time between me getting a copy of the live DB, completing my work and pushing the updates to staging, the live site DB may have changed significantly. So, not only are the DBs out of sync and will need merging, there could also potentially be conflicts that need to be managed. **Deployment tools: Chef, Ansible, Puppet, Composer... something else?** Whilst researching this topic, I've come across these names, though admittedly I haven't read into too much details about any of them. At a brief glance though they all seem to offer something useful in terms of automated deployment and dependency management, but as far as I can see none of them seem to solve any of the problems I'm having (recap: Commercial plugin dependencies and DB migration). This is all getting a little wordy now, so thank you if you're still reading. :)


title: pass html code to worpdress

text: I'm starting with wordpress and I have some doubts. I created a proprietary design from requirements that had. This design is made with html and bootstrap. Now I want to start using wordpress step then as the pages that I have the layout I made to wordpress? When I paste the html code when I create a new page, my code has things like this ...                <img src = "<? php echo get_template_directory_uri ();?> / images/clean/32x32/facebook.png" alt = "Facebook">       or php code which is not interpreted. How should I? I tried to give the image add text box but would have to upload the images, but if you and I have in the theme!!


title: How can assign posting to Subscriber to specific category?

text: I'd like to permit posting(writing) to "Subscriber"group to a specific category. How can I do it?


title: Comparing permalink to url

text:
I'm trying to compare the permalink with a url and then output stuff depending if they match. At the moment I have the code below. On the page it's visibly showing that the permalink and the url (i.e $company) match yet it's outputting "don't show news articles". Where am I going wrong?
permalink of current page: <?php $link = get_permalink(); echo $link; ?>
     <?php $portfolioloop = new WP_Query( array( 'post_type' => 'news' ) ); ?>         <?php while ( $portfolioloop->have_posts() ) : $portfolioloop->the_post(); ?>                                        <?php while(the_repeater_field('featured_companies')): ?>
url of linked page: <?php $company = the_sub_field('featured_company'); ?>
                 <?php  if ($link == $company) { ?>                     show news articles                 <?php } else { ?>                     don't show news articles                 <?php } ?>             <?php endwhile; ?>         <?php endwhile; // end of the loop. ?>


title: Get content or excerpt of top rated votes @GD-Star Rating?

text:
I am using the GD-star Rating plugin and I have a function which outputs the top rated posts. The problem: it won't show the content or the excerpt of those posts. How can I do this? This is the function I am using:               <?php     global $wpdb; // include the $wpdb     $query= "SELECT p.ID, p.post_title as title, visitor_votes + user_votes as total_votes, visitor_votes, user_votes  FROM  `".$wpdb->prefix."gdsr_data_article` da INNER JOIN $wpdb->posts p ON da.post_id = p.ID order by total_votes desc limit 20";     $results=$wpdb->get_results($query); // run the query on the database     if ($results) { // if we have any results         ?>

Position	Post	Points

         <?php             $position=0; // we set the position as 0, as we start every loop with increasing it by one             foreach ($results as $toppost) {                 $position++; // see, I told you, we increase by one, so the first post will get position #1                 echo "
#".$plads."	ID)."'>".$toppost->title."	".round($toppost->total_votes)."
";             }         ?>
         <?php            }     ?>      I already tried: `get_the_excerpt($toppost->title)` and `get_the_excerpt($toppost->ID)`, but none of them showed it.


title: Howto accurately position images with maximum flexibility?

text: I got a request to develop the following design with Wordpress: http://imm.io/DLrl (design is pixelated by me for the purpose of privacy). As you can see there is a pretty random structure of image placement and the webmaster should have maximum flexibility in deciding how to place images, how many and in which size. So the design as seen now will change each time the webmaster decides so. When a new collection of pictures is added to the website, the webmaster should be able to choose a couple of them which will be highlighted on the main page. In this design one image stands for an album or collection of pictures. So when clicking on one of these images a lightbox will popup whereby the visitor can browse all the containing images. I have no clue how to implement such a design within wordpress. Any tips/ideas on possibilities? Any plugins worthwhile looking at? (ps: to me the design is a bit confusing and not very clear in terms of usability and structure, but that's another matter)


title: using get_option to add a different js

text: I'm trying to us `get_option` in my plugin to choose to load 1 of 3 js files. I started with this (and it works) ...               add_action('wp_footer','isotope_vpl_set_style');          function isotope_vpl_set_style() {             include("inc/myfile.js");             }      then I changed it to ...               add_action('wp_footer','isotope_vpl_set_style');            function isotope_vpl_set_style() {        $style = (get_option('damien_style');         if  $style = ("isotope"){             include("inc/myfile.js");             }     }      And it's not working ... I checked the SQL table and the option name and value are set. My PHP error log tells me I have an unexpected ; on this line `$style = (get_option('damien_style');` Where have I gone wrong please :)


title: Get featured image on Blog Index

text: I've been trying to use the "featured image" from the home (the blog index) with no luck. It's working for every single page, but it's not working for the home. The code looks something like this:               // Don't use on single posts         if (!is_single()) {             if (is_home()) {                 if (function_exists('wp_get_attachment_thumb_url')) {                     $img = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');                     $featured_image = $img[0];                 }             } else {                 if (function_exists('wp_get_attachment_thumb_url') && has_post_thumbnail()) {                     $img = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID),'full');                     $featured_image = $img[0];                 }             }             if ($featured_image) { ?>                 // A lot of code...             <?php }         }      I already tried to obtain the thumbnail using the **_thumbnail_id** meta. Same result. This code is placed on the functions file, I believe that the issue is that it's trying to get the loop/posts featured image. Thanks a lot in advance.


title: the_excerpt() not showing manual excerpt for Pages

text:
I have enabled the excerpt feature for pages in my wordpress theme -               add_action( 'init', 'my_add_excerpts_to_pages' );         function my_add_excerpts_to_pages() {              add_post_type_support( 'page', 'excerpt' );         }      This has enabled the excerpt box when adding or updating pages through the admin area, which is what I expected. I am then trying to display each excerpt on the homepage of my site like so -               $child_pages = $wpdb->get_results("SELECT *    FROM $wpdb->posts WHERE post_parent  = 64    AND post_type = 'page' ORDER BY post_title", 'OBJECT');    ?>                 <?php if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild ); ?>                 <div class="memberHover" id="member-<?php echo $pageChild->ID; ?>">

<?php echo $pageChild->post_title; ?>

<?php the_excerpt(); ?>

<?php echo get_the_post_thumbnail($pageChild->ID, '312,156'); ?>
             <?php endforeach; endif; ?>      The issue is that even if I have a manual excerpt populated through the admin area, it still creates the auto excerpt when displaying on the homepage. It seems that it is not picking up the fact that there is a custom excerpt in the database for each item. Any and all help is greatly appreciated! Thanks, Tristan


title: How to handle shortcodes through plugin

text: I learned that I can only put in the code for handling my shortcode through the theme's `functions.php` But I was thinking of making it a plugin rather than a theme. How can I achieve that?


title: Bug: Post needs to be updated twice when adding action for save_post hook

text: My function does exactly what I want it to do: I'm trying to add/update meta fields in another post type when an "events" post is saved. Except the post needs to be updated _twice_ for the information to update on the front end. What am I doing wrong?                 function bam_create_next_show_meta($post_id) {             if(get_post_type() == 'tribe_events') {                 $meta = get_post_meta($post_id, $_artistMeta->$post_id, TRUE);                 $artists = unserialize($meta['_artistMeta'][0]);                      if($meta) {                     $event_link = get_permalink();                     $eventVenue = tribe_get_venue();                     if($eventVenue) {                         $eventVenueSplit = explode (' ', $eventVenue, 3);                         if($eventVenueSplit[0] == 'Centro' && $eventVenueSplit[1] == 'Cultural') {                             $eventVenue = ' en C.C. '.$eventVenueSplit[2];                         } elseif($eventVenueSplit[0] == 'Biblioteca') {                             $eventVenue = ' en Bibl. '.$eventVenueSplit[1].' '.$eventVenueSplit[2];                         } else {                             $eventVenue = ' en '.$eventVenue;                         }                     } else {                         $eventVenue = '';                     }                          $eventStartDate = tribe_get_start_date($postID,false,'j');                     $eventStartMonth = tribe_get_start_date($postID,false,'M');                          $event_sort = tribe_get_start_date($postID,false,'Y-m-d');                          $es_eventStartMonth = strftime('%b', strtotime($eventStartMonth));                          $event_title = 'Proxima fecha: '.$eventStartDate.' de '.$es_eventStartMonth.$eventVenue.'';                          foreach ($artists['artistName'] as $artist) {                         if($myid == $artist)                             continue;                         $output[] = $artist;                         $myid = $artist;                     }                          global $post;                          $artistas = get_posts(array('post_type'=> 'artistas','post__in' => $output, 'posts_per_page' => -1));                          foreach($artistas as $artista) {                         setup_postdata($post);                              $artistID = $artista->ID;                              $artist_event_id = get_post_meta($artistID, 'artistEventId', true);                         $artist_event_link = get_post_meta($artistID, 'artistEventLink', true);                         $artist_event_title = get_post_meta($artistID, 'artistEventTitle', true);                         $artist_event_sort = get_post_meta($artistID, 'artistEventSort', true);                              if(strtotime($artist_event_sort) >= $date_sort || $post_id == $artist_event_id) {                             update_post_meta($artistID, 'artistEventId', $post_id, $artist_event_id);                             update_post_meta($artistID, 'artistEventLink', $event_link, $artist_event_link);                             update_post_meta($artistID, 'artistEventTitle', $event_title, $artist_event_title);                             update_post_meta($artistID, 'artistEventSort', $event_sort, $artist_event_sort);                                             }                     }                 }             }         }              add_action( 'save_post', 'bam_create_next_show_meta');


title: Simple rich text editor in Text widget?

text: I've seen a few plugins that add rich text editing to the default "Text" Widget. However, all of the ones I've tested are either too complicated (or try to do too much) or don't work properly with the latest WP versions. I'm just looking for a simple rich text toolbar with a minimal feature set (basic formatting and lists), image upload and hyperlink tool. Ideally, I'd like to find one that does not require a separate window to handle rich text. Just a simple tab to switch between html and wysiwyg. Any suggestions or recommendations?


title: WP_Query with 2 genres

text: I'm working with a custom post type and trying to get a query working that includes 2 genres (a custom taxonomy). I have this, which works for a single genre (I don't want to display the widget currently being viewed in the list, the 'post__not_in' takes care of that).               $myposts = new WP_Query(          array(              'post_type' => 'widgets',              'post__not_in' => array($wp_query->post->ID),               'genre' => 'styleA'          )      );      But I'm having trouble when I try to make a list that includes 2 genres. I've tried various versions of this:               $myposts = new WP_Query(          array(              'post_type' => 'widgets',              'post__not_in' => array($wp_query->post->ID),               'genre' => array('styleB', 'styleC')          )      );      Everything I've read in the Codex seems to use a syntax like this, anyone know where I'm going wrong? Much appreciated.


title: Adding a function-based search to the Users admin page

text: On the Users admin page, I want to add a function-based search criterion. By default, there are filters to search by user role and there is a search box that searches the user data. I would like to add another text box and use that box's input to restrict which users are shown according to a function. The function will see whether that inputted text is present in a the usermeta table, and will return a boolean based on that. So, the generic version is that: Text box gets input: "search_data" When the admin user clicks on search (or a separate button), the users list should redisplay with only users who satisfy search_function( "search_data" ). What is the best way to implement this functionality in a plugin?


title: Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed

text: I have many custom post types, including some introduced by plugin such as bbPress or WooCommerce. My standard stylesheet is growing large, so I thought to split it into multiple stylesheets according to post types being viewed in the browser. In this way, when the users is viewing bbpress fourms, he will also load a forum.css; when viewing wordpress pages, he would load a page.css. And so on. I tried with the following code added in my functions.php:               function sg_frontend_enqueue_styles(){              $templateuri = get_template_directory_uri();              // some of my custom post types         if( get_post_type() == ( 'activity' OR 'dining' OR 'heritage' OR 'hiking' OR 'nightlife' ) ) :               wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );              // bbPress forums         elseif ( get_post_type() == ( 'forum' OR 'topic' OR 'reply' ) ) :             wp_enqueue_style( 'forum', $templateuri.'/css/forum.css', '', false, 'all' );              // Pages         elseif ( get_post_type() == 'page' ) :             wp_enqueue_style( 'page', $templateuri.'/css/page.css', '', false, 'all' );              // WooCommerce         elseif ( get_post_type() == 'product' ) :             wp_enqueue_style( 'product', $templateuri.'/css/product.css', '', false, 'all' );              endif;          add_action('wp_print_styles', 'sg_frontend_enqueue_styles');      However this is **not** working. Problem: all CSS styles are loaded altogether, regardless of whether the user is displaying a post belonging to that specific post type. Furthermore, ' **page.css** ' is not being included at all. I've then tried with a different approach, replacing conditionals with a switch:                   $templatename = get_post_type();         switch ( $templatename ) :             case 'activity' :                 wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );             case 'dining' :                 wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );             case 'forum' :                 wp_enqueue_style( 'forum', $templateuri.'/css/forum.css', '', false, 'all' );             case 'heritage' :                 wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );             case 'hiking' :                 wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );             case 'nightlife' :                 wp_enqueue_style( 'locations', $templateuri.'/css/locations.css', '', false, 'all' );             case 'page' :                 wp_enqueue_style( 'page', $templateuri.'/css/page.css', '', false, 'all' );             case 'product' :                 wp_enqueue_style( 'product', $templateuri.'/css/product.css', '', false, 'all' );             case 'reply' :                 wp_enqueue_style( 'forum', $templateuri.'/css/forum.css', '', false, 'all' );             case 'topic' :                 wp_enqueue_style( 'forum', $templateuri.'/css/forum.css', '', false, 'all' );             break;             default : '';         endswitch;      this one sometimes work sometimes not... On bbpress forums works fine, but on pages for example, it enqueues ALL the stylesheets...


title: W3 Total Cache, CDN and theme files

text: I updated the style.css file of my WordPress installation recently. The change were effective: when logged in as an administrator (my blog is set so that the administrator is never served a cached version of the site, but a “live” one), I can see them. But my blog is being served through a CDN (using W3 Total Cache). Through the CDN, the changes are not effective: the CDN does not serve the modified files from my theme. Even though I’ve uploaded them after modification (Dashboard>Performance>CDN>Upload theme files. My CDN runs on AmazonCloud Front. And Minify is disabled on W3 Total Cache. The theme file being served through my CDN is a compressed version: style.css.gzip Should I “purge” objects from my CDN or wait a little more (it’s been more than a week). And yes, I empty the cache of the browser I’m using to see in the changes are taking effect. Or is there something else I’m missing? Thanks, P.


title: Help Combine These Two PHP Codes

text: I have my WordPress post format codes:               <?php     if ( has_post_format( 'image' )) {       echo 'This is a image post';     } ?>      And my code to grab the first image from a post...               <a href="<?php the_permalink() ?>">     <?php $image = catch_that_image();     if( $image ) { ?>     <img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo $image; ?>&h=240&w=280" class="index" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />     <?php } ?>           So how do I put the image which is grabbed into the first code? Thanks for all the help guys and gals, I really do appreciate it.


title: Database Tables in Wordpress Theme

text: I am creating some sliders type functionality for my wordpress theme and I thought that creating two seperate db tables like 'sliders' and 'slider_images' is a good idea. My problem is that i don't know what is the best way to handle the creation of those tables. If it was a plugin, I would just do it on activation, but it is just some functionality as part of my theme and i haven't really found a hook that is executed once when the theme is activated. If possible, i would like to not have to check the database for the existence of tables in every page refresh and create if not. Is there a way to do that ?


title: Files placed in directory with wordpress 404

text: I changed my WordPress permalinks settings from the default to displaying the name of the post. When I did this, all the files that I had been storing in the directory with WordPress (www.example.com/notpartofwp.html) suddenly displayed wordpress style 404 errors.   1. Is this normal WordPress behavior?   2. If so, what can I do about it?


title: create taxonomy

text: I am new to word press, I want to display results on a page which belong to some group from database(I have group column). I think this can be done by taxonomy so I have taxonomy table but I don't know what to write in taxonomy.php file, any idea what is the minimum information that I have to write in taxonomy.php to make it work.


title: How to pass post title (which could include &) to Gravity Form

text: I have created a form (Gravity Form) which I want to be able to complete dynamically from several of my other websites. In such a case, one of the fields that I am trying to send to the form is the post title, which can - and does - includes ampersands from time to time (e.g. The Ins & Outs of Gravity Forms). The trouble I'm having is figuring out how to encode the post title so that ampersands within the post title are not treated as separators for the next query var. For example, the URL `mydomain.com/page-with-my-form-on-it/?title=The Ins & Outs of Gravity Forms&type=new` should complete the 'title' field with 'The Ins & Outs of Gravity Forms' and the 'type' field with 'new', but instead it puts 'The Ins ' in the 'title' field and leaves the 'type' field (and any other subsequent fields) empty. To create that URL, my current code is simply as follows, though I have tried using urlencode(), htmlentities(), and str_replace() with the_title() to try and overcome this issue:               <a href="http://www.mydomain.com/page-with-my-form-on-it/?title=<?php the_title(); ?>&type=new">Link      Any suggestions?


title: Tag page that displays specific posts

text: How would I go about coding a generic tag.php page that displays all the posts with a specific tag? For example, if I navigate to example.com/tag/your-tag, it should display all posts with the tag "your tag".


Is anyone familiar with this error? It is causing TinyMCE to break in my Wordpress theme. In console it gives me these two errors both seem to originate from wp- admin/post-new.php > Uncaught ReferenceError:switchEditors is not defined > > Uncaught TypeError: undefined is not a function /wp-admin/load- > scripts.php?c=0&load%5B%5D=hoverIntent,…editor,quickt&load%5B%5D=ags,wplink,wp- > fullscreen,media-upload&ver=3.9.1:2 ![enter image description here](http://i.stack.imgur.com/p3rLM.png) Both the Visual and Smart tabs break, becoming unclickable, and the TinyMCE toolbar disappears.


title: Close modal window after form submit

text: I have this in a php file from Contact Form 7, which **I load into a modal window** (FancyBox) and **I would like to close it after the user will press the Submit button**. I was thinking of adding onSubmit="action" to the form but I don't know how or which one is the function I am supposed to use to close the modal window?               $form .= '<form action="' . esc_url_raw( $url ) . '" method="post"' . ' class="' . esc_attr( $class ) . '"' . $enctype . '>' . "\n";      Is this the right approach? Also, if I can make it to click on a PayPal button right after that, it will be brilliant.


title: Custom field php

text:
Hi I put this php code on my single post php               <?php     $custom_fields = get_post_meta($post_id);      $my_custom_field = $custom_fields['_source_link']; //key name     foreach ( $my_custom_field as $key => $value )         echo $key . " => Click Here
";     ?>      however I've got error > Warning: Invalid argument supplied for foreach() How to fix this error?


title: How Do I Use A Custom Mobile Theme?

text: I have a self hosted blog and I want it to be mobile compliant. I know there is a free plugin the serves this purpose. However, I want to use a simple mobile theme I like (say from Theme Forest). How do i go about it? Is it as straight forward as uploading a normal theme?


title: how do I get the title in the post

text:
I have a custom grid loop to show a specific post type on a page. This shows the excertp for each post but it does not link include the post title, and I would like each post to have a title that links to the full post. Can anyone help? thanks,               <?php     /**       * @author Jonathan Perez      */          /*     Template Name: Grid Loop for Press Releases     */          // Do the Custom Loop     remove_action('genesis_loop', 'genesis_do_loop');     add_action( 'genesis_loop', 'sf_custom_loop' );          function sf_custom_loop() {                       echo '
' . get_the_title() . '
';             the_content();                  //WP Query Start                  $per_page = 9;                  $product_args = array(                 'post_type' => 'pressreleases',                 'posts_per_page' => $per_page,                                 'paged' => get_query_var( 'paged' )             );             $products = genesis_custom_loop( $product_args );     }          //Add Post Class Filter     add_filter('post_class', 'sf_post_class');     function sf_post_class($classes) {         global $loop_counter;         if ($loop_counter % 3 == 0) {             $classes[] .= 'first ';         }         return $classes;     }                    /** Move Post Info */     remove_action('genesis_before_post_content','genesis_post_info');     remove_action('genesis_after_post_content','genesis_post_meta');          genesis();


title: how to invoke wordpress API from other existing PHP system

text: We have our own php system, now we want to have a blog function. Because wordpress are widely used, so we decided to use it. And now I want to invoke wordpress's function , for example `wp_insert_user` , how can I can do that ? Suppose my system is `A` and installed on `/var/www/A`, and wordpress is `WP` and installed on `/var/www/WP`. I can put them together like this `/var/www/A/WP`, but I don't think that's a good idea. If we use `/var/www/A` and `/var/www/WP`, how can I invoke wordpress's function from a php file that in project `A`? Using curl? Edit:======================================================= Now I put WP below A (/var/www/A/wordpress) Here, in my project A , I have a logon.php, what I want to do is invoke 'wp_insert_user' function to create a new wordpress user when user logon our system (just a test purpose). I put the following code at the beginning of my logon.php               define('WP_USE_THEMES', false);     require('/var/www/A/wordpress/wp-blog-header.php');      Before I add the two line, when I visit my site, the url is :               http://localhost/myproject/www/logon.php      After I add it, the url become this:               http://localhost/myproject/www/logon.php/wp-admin/install.php      what worse, all the style of my logon.php are completely gone. My requirement is simple:               when user logon our system, invoke wordpress function 'wp_insert_user'      to create a user for wordpress. Just to create a new user, no more action.


title: Embeding YouTube video via a template function throws iframe cross-domain policy error

text: I'm using Wordpress 3.5 which natively supports embeds into posts and pages from many sites, YouTube included. When I embed a Youtube video directly onto a post or a page (by simply copying and pasting the video url), it works fine and no cross-domain policy errors are thrown in Chrome or Firefox. However, when I add the URL from a function inside a custom page template (outside the main loop), that I built for a custom post type, it throws an error. **Here is what my function looks like:**               function my_tour_video()     {         global $post,                $wp_embed;               $my_tour_video = get_post_meta($post->ID, "_my_tour_video", true);           echo $wp_embed->run_shortcode('[embed]' . $my_tour_video . '[/embed]');     }      In my custom field I have tried the "embed" youtube url and also just the "watch" url copied and pasted from the browser. You can try this sample url: http://www.youtube.com/embed/Y7AvqD2loX4 **Error in Chrome looks something like:** > Unsafe JavaScript attempt to access frame with URL http://www.mydomain.com > from frame with URL http://www.youtube.com/embed/Y7AvqD2loX4. Domains, > protocols and ports must match. Any suggestions on how to do this the right way would be very helpful at this point.


title: Avoiding page loop

text: I'm doing a custom page that has multiple wp query calls, the thing is that I don't need the main query that is I don't need anything from the page contents, so in order to save load time I was wondering how to tell wordpress not to fetch anything from the db ?


title: How to use WP_Query() on single.php?

text: I'm using `WP_Query()` to pull out a few posts under a specific category "Featured" to display at the bottom of any post. So I added `<?php if (function_exists('getEditorPicks')) getEditorPicks();?>` in single.php. In functions.php, I have               wp_reset_postdata();         $args = array('cat' => 4176, 'posts_per_page' => 5);         $query = new WP_Query($args);         //return $query->query_vars;         if ($query->post_count>2) {             while ($query->have_posts()) {                 $query->the_post;                 echo the_title();             }         }         wp_reset_postdata();      However, it takes forever for the page to load now and it simply exhausts memory in the end. What am I missing here?


title: Different sql queries count indicator on the main page

text: I use w3_total_cache plugin. But i can`t understand what is going on sometimes. I have enabled database caching and debug info at the bottom. Sometimes on the main page 90-96 db queries, sometimes 495-501. How can be so different results for the same page with the same parameters? Or how can be so much queries sometimes ? What is this meaning? Please explain me:)


title: Override plugin functions in functions.php

text: I´d like to override `$title = get_bloginfo();` with --> `$title = get_bloginfo('siteurl');` Some code from the plugin "Really simple Facebook Twitter share buttons":               function really_simple_share ($content, $filter, $link='', $title='', $author='') {         static $last_execution = '';              ...              $custom_field_disable = get_post_custom_values('really_simple_share_disable');         if ($custom_field_disable[0]=='yes' and $filter!='shortcode') {             return $content;         }              //GET ARRAY OF STORED VALUES         global $really_simple_share_option;         $option = $really_simple_share_option;              ...              $first_shown = false; // NO PADDING FOR THE FIRST BUTTON              // IF LINK AND TITLE ARE NOT SET, USE DEFAULT FUNCTIONS         if ($link=='' and $title=='') {             $link = ($option['use_shortlink']) ? wp_get_shortlink() : get_permalink();                  $title = get_bloginfo(); // OVERRIDE                  $author = get_the_author_meta('nickname');         }      Can I do this in my functions.php because I´ll updating this plugin without changing this lines after every update. Thanks


title: Why am I able to add a "formats" dropdown, but the style isn't applied?

text: I've created style called "smalltext" so the user can specify a paragraph with smaller text to match the theme where needed:               add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );          function my_mce_buttons_2( $buttons ) {         array_unshift( $buttons, 'styleselect' );         return $buttons;     }          // Callback function to filter the MCE settings     function my_mce_before_init_insert_formats( $init_array ) {           // Define the style_formats array         $style_formats = array(               // Each array child is a format with it's own settings             array(                   'title' => 'Smalltext',                   'block' => 'p',                   'classes' => 'smalltext',                 'wrapper' => true                  )         );           // Insert the array, JSON ENCODED, into 'style_formats'         $init_array['style_formats'] = json_encode( $style_formats );                return $init_array;            }      // Attach callback to 'tiny_mce_before_init'      add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );          add_action( 'admin_init', 'add_my_editor_style' );          function add_my_editor_style() {         add_editor_style();     }        I've attached the `editor-style.css` file in my theme. I know it's connected since I can see the css for it applied in the `formats` dropdown. When I highlight some text and choose the format the text is not wrapped in a `paragraph tag` and the "smalltext" class isn't applied. The `formats` dropdown just reset back to the default option. Is there something I'm missing to ensure this piece works?


title: How to show featured image in custom post type dashboard post page

text: I have added this code to my theme to add a new colmum for showing the featured image in the dashboard post page colmum. It's working in wordpress default post page, but not in custom post type (my custom post name is photo_gallery).               add_filter('manage_posts_columns', 'posts_columns', 5);     add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 3);     function posts_columns($defaults){         $defaults['riv_post_thumbs'] = __('Thumbnail');         return $defaults;     }     function posts_custom_columns($column_name, $id){        if($column_name === 'riv_post_thumbs'){             echo the_post_thumbnail( array('292, 292') );         }     }      How can I show this custom column as first in my custom post type overview?


title: Wordpress forces HTTPS to HTTP in template

text: I have a form in a specific page templates with a hidden field and a value of "HTTPS://www.mydomain.com/innerpage". When I view the source code of the page with the form the value changes to HTTP. When I strip the inner page, the HTTPS stays. I need to have this value as HTTPS, so a redirect is not optional. Any help would be appreciated. Thanks!


title: Is it possible to apply a meta_query to one specific post type in a query with multilple post types?

text: I have two post types, _news_ and _events_ :   * A _news_ has no custom fields.    * An _event_ has two custom fields : _start-date_ and _end-date_. I want to display _news_ and _events_ on the same page, ideally with one single query. One important fact is that _events_ have to be ordered by _end-date_ and that only future or current _events_ have to be displayed. Here's the query args I am trying :               $args = array(         'post_type' => array( 'news', 'events' ),         'meta_key' => 'end-date',         'orderby' => 'meta_value',         'order' => 'ASC',         'meta_query' => array(             array(                  'key' => 'end-date',                 'value' => date ( 'Ymd' ),                 'type' => 'NUMERIC',                 'compare' => '>='             )         )     );      That works fine for _events_ alone, but doesn't when I add _news_ to the post types. The problem seems to be that I specified 'meta_key' and 'meta_query' parameters which are only present on _events_ , as a result all the _news_ are left out in the results. So my question is, is there a way to target a _meta_query_ to one specific _post_type_ in one same query ?


title: How can I add a Custom Button to Add or Edit post / page next to Add Media?

text: I'm trying to add a custom button nearby the Add media on the wordpress Add and Edit Post/Page. How can I do that? Thank you very much for your help! ![Here's where I want it to be](http://i.stack.imgur.com/BqZpQ.jpg)


title: Logout redirect to home page

text:
I'm using custom menu for login/logout here below is my code:
           <?php     if (is_user_logged_in()) {       $user = wp_get_current_user();       echo 'Welcome '.$user->user_firstname.'       | Logout';     } else { ?>       <?php wp_loginout(); ?>       or <a href="<?php bloginfo('url') ?>/wp-login.php?action=register"> Register     <?php }?>
      but problem is : redirect to login page not current page... I want it should go to home page after logout. Please help me...


title: Pulling Advanced Custom Fields from other pages

text:
Basically I am using Advanced Custom Fields and have an ajax tabbing system that works with the ACF. The current set up is below:

General

Courses

In the area

Sports & facilities

      At the moment, I am loading external php documents through AJAX, only problem is, the php is not loading as when echo'ing that field, it cannot be found as it is held elsewhere. How can I use the custom fields to display what's in that page template, that is held elsewhere? I current am using:               <?php echo the_field('current_students'); ?>      To display the field, but where it's an external PHP document, it doesn't work.


title: After moving a site to another domain, all images are lost

text: I moved from www.domain1.com to www.domain2.com Trouble is the image paths left looking at www.domain1.com/wp- content/uploads... So when www.domain1.com went down all my images are now lost. I updated wp_posts table where all attachments now point to www.domain2.com/wp-content/uploads... The images exist in www.domain2.com but still I cannot see any image. Caching is off. Help!!!


title: Edit the output of wp_widget_rss_output()

text: I want to show rss feed in my dashboard widget, i use this code:               wp_widget_rss_output(array(         'url'           => 'http://www.example.com/',         'title'         => __( 'Some Title' ),         'items'         => 1,         'show_summary'  => 1,         'show_author'   => 0,         'show_date'     => 0     ));      but after the 'show_summary' wordpress addes '[...]'. How do i remove it?


title: handling login/logout redirects

text: I have a couple issues with the way Wordpress handles redirects on login and logout. Standard behaviour is:               login: /wp-login.php (with no redirect_to url) -> /wp-admin.php      logout: /wp-admin.php -> /wp-login.php      What want is:               login: /wp-login.php (with no redirect_to url) -> homepage     logout: /wp-admin.php -> homepage      Would prefer a coded solution please. It helps me to learn and understand how Wordpress works. Thank you


title: How to show Disqus comments and pingbacks?

text: I use disqus to handle comments on my blog. I also like to have pingbacks from various posts back and forth to each other (and from outside sources. However, I noticed today that while the comment count at the bottom of a post will show the total number of "comments" (including pingbacks), _only_ the Disqus comments are actually displayed. How can I get pingbacks to appear _as well as_ Disqus comments?


title: how to dynamically access file upload fileds

text:
in my custom plugin i wrote a php file for displaying a table in front end. and the datas used to display in that are taken from db and i added a input file upload field also but the file uploading is not performing. the part of code is:                 <form name="form_subscriber" method="post" action="<?php echo the_permalink(); ?>" enctype="multipart/form-data" >       foreach ( $testdatea as $data ) {       <?php echo(stripslashes($data->eemail_name_sub)); ?>	        <?php echo(stripslashes($data->eemail_email_sub)); ?>	        <?php echo(stripslashes($data->eemail_mobile_sub)); ?>	        <a href="javascript:void(0);" onclick="show_addreports('<?php echo $i;?>');">Add Report                 <div id="<?php echo 'Addreport'.$i;?>" style="display:none;">              <input type="file" name="report_uploadadd" id="<?php echo 'report_uploadadd'.$data->eemail_mobile_sub;?>" size="20"/>                           <input type="submit" name="Submit" class="button-primary" value="add" onclick="return addreportlab('<?php echo(stripslashes($data->eemail_mobile_sub)); ?>')"/>
              <a title="Delete" onClick="javascript:_subscriberdealdeletebylabs('<?php echo($data->eemail_patient_id); ?>')" href="javascript:void(0);">Delete
         <?php $i = $i+1;  } ?>        <input type="hidden" value="" name="reportsaddlab" id="reportsaddlab" >        <input type="hidden" value="" name="additional" id="additional" ></form>      The code for file uploading used is:                    if (!function_exists('wp_handle_upload'))         require_once( ABSPATH . 'wp-admin/includes/file.php' );         $floc='report_uploadadd'.$_POST['additional'];     $uploadedfile = $_FILES[$floc];          $upload_overrides = array('test_form' => false);     $movefile = wp_handle_upload($uploadedfile, $upload_overrides);     @$url = $movefile['url'];     @$type = $movefile['type'];     @$file = $movefile['file'];     @$filename = basename($url);     $rrfilename = $_FILES[$floc]['name'];          if ($movefile) {         echo "
File is valid, and was successfully uploaded.
\n";         var_dump($movefile);     } else {         echo "
Invalid file upload !
\n";     }     exit();      The javascript function used in this process is:               function addreportlab(ptmb){      if(document.form_subscriber.report_uploadadd.value=="")     {         alert("Please add a file.")         return false;     }      document.form_subscriber.reportsaddlab.value = "true";     document.form_subscriber.additional.value = ptmb;      document.form_subscriber.submit();      } The var_dump output is :               array(1) { ["error"]=> string(212) "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini." }


title: Rewriting WordPress core functionallity: Changing the private posts

text: I'm trying to rewrite a bit of core WordPress functionality. I'm using WordPress 3.9.2 and I consider myself an intermediate in WordPress programming. This is an image that will explain what I am trying to do: ![Explanatory image](https://cloud.githubusercontent.com/assets/1983593/3995444/04c8c072-2928-11e4-9a7f-b0bc7a598339.png) Currently, when one sets a post to "Private", it will hide the post from view, only to be accessed directly through it's link and by specially privileged users. This is not what my customer want, they want a "Member" (Norwegian: Medlemmer) functionality instead, where that option will make the posts exclusively visible for that specific access role. So for an anonymous user you would see some posts, but when logged in as a member, you would see all of those posts. I am also trying to remove the "Password protected" option, as this does not apply to my customer's website, but this is not a priority. So my question is: **Any ideas on what I will have to do to change this from a plugin?** My current thoughts are in the lines of filter hooks. Any help appreciated.


title: Exclude custom taxonomy term posts from custom post loop

text: I have a custom post type set up called `projects` with a custom taxonomy called `categories` that has a number of terms. For one of them called `archive` I would like to remove its associated posts from the custom post loop. I'm attempting with the code below, but doesn't seem to be excluding.               <?php $loop = new WP_Query( array( 'post_type' => 'projects', 'orderby'=>'rand', 'posts_per_page' => -1 ) );           query_posts( array(     'post_type' =>'projets',     'tax_query' => array(      array( 'taxonomy' => 'categories', 'field' => 'slug', 'terms' => array( 'archive', ), 'operator' => 'NOT IN',),)     ) );     ?>          <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> POST CONTENT <?php endwhile; ?>


title: How to remove Biography from user profile admin page

text: I would like to remove or hide the Biography input field from the profile page. How do you do this? I already removed some contact methods from this page, but I'm not sure how to get rid of the biography.


title: Display 1 Post per taxonomy with polylang

text:
I am trying to make a loop where I display all my taxonomies with the first post of every taxonomy. It's the taxonomy `"customers"` and I want to display every first portfolio-CPT of the customer. I have **polylang** with english and german language installed, all working, instead of this loop. The Loop is working, but the project always get me the english posts. No matter what language it's set. Here is a pastebin, just to be clear the customer tax is `"kunden"` and the custom post type is `"portfolio"`. The `"kunden"`-tax is not translated, both language use the same one. The `"portfolio"`-cpt is translated.               <?php get_header() ?>

                     <?php                          $lang = pll_current_language();                          $terms = get_terms( 'kunden' );                          foreach( $terms as $term ) :                                  $args = array(                                     'post_type' => 'portfolio',                                     'kunden' => $term->slug,                                     'posts_per_page' => 1,                                     'lang' => $lang,                             );                             $single = new WP_Query( $args ); ?>                             <?php if ($single->have_posts()) { ?>                                  <?php while ($single->have_posts()) : $single->the_post(); ?>                                  <?php get_template_part('project-thumb'); ?>                                  <?php endwhile; ?>                                  <?php } ?>                     <?php endforeach; ?>

               <?php get_footer() ?>      If I change `post_per_page => 2` the german post is the second one after the english one. So both Languages are displayed one after another.


title: Metabox Populated with a Custom Post Type - How to Output CPT based on Select?

text: I have a dropdown metabox populated with a custom post type, now in my template, I can get the value of the metabox output but what I really need is all the information stored from that selected CPT to be displayed in certain areas of the post. **My metabox**               $meta_boxes[] = array(     'id' => 'actordetails',     'title' => 'Select an Actor',     'pages' => array( 'films' ),     'context' => 'normal',     'priority' => 'high',          // List of meta fields     'fields' => array(              array(     'name' => '',     'id' => $prefix . 'getactors',     'type' => 'select',     'clone' => false,     'options' => get_actors_options(),         ),               )      );      **My function**               function get_actors_options( $query_args ) {          $args = wp_parse_args( $query_args, array(         'post_type' => 'actors',     ) );          $posts = get_posts( $args );          $post_options = array();     if ( $posts ) {         foreach ( $posts as $post ) {             $post_options [ $post->post_title ] = $post->post_title;         }     }          return $post_options;     }      This is what I get with:                   <?php echo get_post_meta($post->ID, 'nt_getactors', true); ?>      ![enter image description here](http://i.stack.imgur.com/QPM7d.png) **This is what I need:** ![enter image description here](http://i.stack.imgur.com/3oRmt.png) So what code would I use to get the rest of the custom post type that I selected.