title: blog page showing as home/landing page despite template change and reading settings

text:
Live site. I'm having trouble pinpointing exactly why the Blog page is showing up as the Home/landing page. I've changed the page template to General/page.php and have WP reading settings set to Front Page as Static/Home, and Posts page as Blog. Any ideas? All of the other pages I've set to use the General template have done so without issue. index.php               <?php get_header(); ?>

Hi, I'm Dylan Elchami-
a health and fitness enthusiast with a passion for inspiring.

My interests are vast and ever changing, but my virtues remain true. I love to motivate, create, make people healthier, stronger, sexier, and flat out better all while building great, unmitigated relationships along the way. Please roam my site and enjoy all the information I post for you, and if you have a question please don't hesitate to contact me- it's your way of giving back for all the free information because helping you is what makes me feel AWESOME.

Stay in touch-

<img src="<?php echo get_template_directory_uri(); ?>/img/facebook.png" alt="Like on Facebook" />

<img src="<?php echo get_template_directory_uri(); ?>/img/twitter.png" alt="Follow on Twitter" />

<img src="<?php echo get_template_directory_uri(); ?>/img/linkedin.png" alt="Connect on LinkedIn" />

                  <?php $my_query = new WP_Query( array( 'posts_per_page' => 3, 'nopaging' => true ) );             echo $post_count;             while ( $my_query->have_posts() ) : ( $my_query->the_post() ); ?>

                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                     <?php the_post_thumbnail( array(120,102) ); ?>

             <?php endwhile; ?>
          <?php get_sidebar(); ?>          <?php get_footer(); ?>      page.php               <?php     /*     Template Name: General     */     ?>          <?php get_header(); ?>

             <?php if(have_posts()) : while(have_posts()) : the_post(); ?>             <?php endwhile; ?>             <?php else : ?>
I'm not sure what you're looking for.
             <?php endif; ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

written by <?php the_author(); ?> on <?php the_date(); ?>

                 <?php the_content('read more...'); ?>

          <?php get_sidebar(); ?>          <?php get_footer(); ?>


title: How do I create a gallery page?

text: I've been pulling my hair out trying to figure out how to make a photo gallery page. I hope I can explain it in a way everyone can understand. I have alot of galleries on my site and I would like to display them on one page and have one image as a link to open that gallery post. Like the gallery on this theme http://themes.devilcantburn.com/stereoline/gallery/. I'm kinda new to wordpress and not sure what the best way of displaying the galleries are, someone suggested creating a page template, which I tried but i was too complicted for me to work out how to add the images to the links. I would prefer to use coding rather then a plugin but at this point i'm willing to try anything as long as i get the result i need. I like the way my galleries currently display on my site, but not the way they are displayed when your searching through them. (http://bgpworld.com/?cat=157). If anyone has a solution I would be really grateful. Thanks


title: Sort users by custom user meta value

text: I'm trying to sort users by a custom meta value "user_business" which is their business name that way when users are listed they're sorted alphabetically by their business name as they should be. I'm currently using:               <?php                             // WP_User_Query arguments                             $args = array (                                 'exclude'        => array( 1 ),                                 'count_total'    => true,                                 'fields'         => 'all_with_meta',                             );                                       // The User Query                             $user_query = new WP_User_Query( $args );                                  // The User Loop                             if ( ! empty( $user_query->results ) ) {                                 foreach ( $user_query->results as $user ) { ?>      Is there a way that I can order users by meta key "user_business"?


title: Not enough memory

text: Sometimes after activating a plugin the admin side is blank with a memory error message, sometimes the front page too. The standard fix is to increase the memory in config.php. What is the best way to prevent in advance all or most memory problems to occur ?


title: Wordpress Action Hooks and Post ID?

text: I'm creating a very basic Wordpress plugin whose purpose is to display a numerical value beside each post. My Logic for the plugin function ( **plugin.php** ) is this:               <?php     function foo($post_id){     $somevalue=1 //Some random value     add_post_meta($post_id, 'posts_numericalvalue', '0', true) or update_post_meta($_post_id, 'posts_numericalvalue', $somevalue);     }          add_action('post_save', 'foo');     ?>      And in my template's **index.php** , I have (inside the loop):               <?php     ....     printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0'));     $numerical_val = get_post_meta($post->ID, posts_numericalvalue);      echo 'this post has a value of ' .$numerical_val;     ....     ?>      1) The code above is obviously not working. I think its because my function in plugin.php requires me to pass the current post's ID, but the action hook doesn't pass the post's current ID I guess (correct me if I'm wrong). How do I pass the post ID to my function inside plugin.php using an action hook? 2) Any other elegant way of doing this? I just need to assign my posts with a numerical value which should be updated with 1 if the post already has one, zero if the post hasn't got one already. Any help is much appreciated. Thanks.


title: Remove admin menu for custom taxonomy attached to custom post type

text: I'm trying to create a taxonomy that is sort of hidden.. meaning i intend to adjust the metabox so that you can only select a unique term from 3 options. "featured","normal" or "excluded". but i can't figure out how to remove the administration menu. the following removes the Tags menu item from underneath Posts:               add_action('admin_menu','yoursite_admin_menu');     function yoursite_admin_menu() {         // remove_submenu_page was introduced in 3.1         remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );     }      but this doesn't remove the Featured taxonomy from underneath Portfolio               add_action('admin_menu','yoursite_admin_menu');     function yoursite_admin_menu() {         // remove_submenu_page was introduced in 3.1         remove_submenu_page( 'edit.php?post_type=portfolio', 'edit-tags.php?taxonomy=featured&post_type=portfolio' );     }      i've tried it a couple of different ways w/ regards to the slugs, but can't get any of them to work. what am i missing?


title: How to limit search to first letter of title?

text: I was wondering if there was a way to make the search only look for the first letter in the posts title, basically let's say my search query is www.mysite.com/?s=q I'd like to get all posts that start with the letter "Q". Is this possible? Thanks in advance.


title: How to create full header but keep content narrow

text:
I want to set a full header in wordpress theme, while i want to keep the content narrow (center). How can i do that? I'm trying like:
              ...

      It will display background image fine, the title and other text inside the header will be totally in the left side. (As its the wrapper which keeps the content center,and now header is outside of the wrapper). If i put the header inside the wrapper tag, the text inside header is at right place but the header image will also be displayed within the wrapper area only (it will not be shown on full body). I want to have one image in header background, and a different image in body background. I will be thankful if you can help me with this problem.


title: Problem creating a table with dbDelta

text: I'm working on a plugin that _was_ creating a table successfully. However, I decided to test it in a fresh install of Wordpress (on my local server) and now the table is not being created in my activation code. Instead I am getting the error message: > The plugin generated 149 characters of unexpected output during activation. > If you notice “headers already sent” messages, problems with syndication > feeds or other issues, try deactivating or removing this plugin. Here is my code:               function nc_create_location_table() {         // makes the location table         global $wpdb;         global $simple_location_version;              $table_name = $wpdb->prefix . "nc_location";              $installed_ver = get_option( "simple_location_version" );              if( $installed_ver != $simple_location_version ) {             $sql = "CREATE TABLE " . $table_name . " (                     location_id MEDIUMINT(9) NOT NULL AUTO_INCREMENT,                     PRIMARY KEY  (location_id),                         name VARCHAR (100),                         street_no VARCHAR (5),                         street_name VARCHAR (75),                         city VARCHAR (75),                         province_state VARCHAR (75),                         postal_code VARCHAR(10),                         country VARCHAR (75)                 );";                  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');             dbDelta($sql);                  update_option("simple_location_version", $simple_location_version);              }              $tmp = get_option('nc_location_options');              if(($tmp['chkbox_reset']=='on')||(!is_array($tmp))) {         echo 'setting defaults';             $arr = array(                 "nc_location_zoom"=>10,                  "nc_location_width" => "200",                  "nc_location_height" => "200",                  "nc_location_drop_down_maptype" => "road",             );             update_option('nc_location_options', $arr);         }     }          register_activation_hook(__FILE__,'nc_create_location_table');      When I check my tables, I see that my table hasn't been created, and also I am getting an error message. If anyone can shine a light on why code that _was_ working is now not working (and also, is it possible to see _where_ the unexpected output is...as there's no display as to what the error is other than this message)?


title: Passing inputs from one column to the Other within a post

text: I have a post with 2 column layout. The first column has an mp3 player. I am thinking of adding a Lyrics window in the second column. Based on the song selected by the user, the Lyrics window will display the Song Lyrics. (without refreshing the whole page). Is this possible in a self-hosted wordpress site? Thanks for helping.


title: Help with walker for nav

text:
For some reason, this walker won't work when I pass in `'echo ' => 0`, it always prints the nav, and never returns the nav as a var. I can't seem to figure out where it's by passing that in wordpress. Any chance anyone can spot the problem?               function bones_main_nav() {         $menu_args = array(             'menu' => 'main_nav', /* menu name */             'menu_class' => 'nav',             'echo ' => 0,             'theme_location' => 'main_nav', /* where in the theme it's assigned */             'container' => 'false', /* container class */             //'fallback_cb' => 'bones_main_nav_fallback', /* menu fallback */             'depth' => '2', /* suppress lower levels for now */             'walker' => new description_walker()         );              echo wp_nav_menu($menu_args);         /*         if(function_exists('new_beginnings')) {             $topNav = wp_get_cache('topNav');             if ($topNav === false) {                 $topNav = wp_nav_menu($menu_args);                 print_r($topNav);                 wp_set_cache('topNav', $topNav, 4000);             }             echo $topNav;         } else {             echo wp_nav_menu($menu_args);         }         */     }                                   // this is the fallback for header menu     function bones_main_nav_fallback() {         // not calling this in case of multiple level pages - hope to add dropdown menu as an enhancement         //wp_page_menu( 'show_home=Home&menu_class=menu' );     }          // this is the fallback for footer menu     function bones_footer_links_fallback() {         /* you can put a default here if you like */     }          // Menu output mods     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 = '';                      // If the item has children, add the dropdown class for bootstrap                 if ( $args->has_children ) {                     $class_names = "dropdown ";                 }                      $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 . '"' . $value . $class_names .'>';                      $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        ) .'"' : '';                 // if the item has children add these two attributes to the anchor tag                 if ( $args->has_children ) {                     $attributes .= 'class="dropdown-toggle" data-toggle="dropdown"';                 }                      $item_output = $args->before;                 $item_output .= '';                 $item_output .= $args->link_before .apply_filters( 'the_title', $item->title, $item->ID );                 $item_output .= $args->link_after;                 // if the item has children add the caret just before closing the anchor tag                 if ( $args->has_children ) {                     $item_output .= '';                 }                 else{                     $item_output .= '';                 }                 $item_output .= $args->after;                      $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );                 }                  function start_lvl(&$output, $depth) {                 $indent = str_repeat("\t", $depth);                 $output .= "\n$indent
\n";             }                  function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output )                 {                     $id_field = $this->db_fields['id'];                     if ( is_object( $args[0] ) ) {                         $args[0]->has_children = ! empty( $children_elements[$element->$id_field] );                     }                     return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );                 }               }


title: SQL Query members by profile fields Buddypress

text: i am trying to add a profile based search option into my existing plugin. my plugin already search members by distance within a certain radius and i want to add the option to filter results by profile fields. what i am trying to do is getting the user id that has the matching values entered in the search form. i am trying something like:               SELECT user_id FROM {$bp->profile->table_name_data}      WHERE (field_id1 = "field1" AND value1 = "value1")     AND (field_id2 = "field2" AND value2 = "value2")     AND (field_id3 = "field3" AND value3 = "valu3")     ........      but this doesn't work. it will work with the WHERE clause only but not when i am adding the ANDs. i assume this is have something to do with joins maybe? any help would be much appreciated.


title: Can someone explain Wordpress caching, and what's the best in my scenario?

text: I'm creating a website that has two basic user groups: Subscribers and Editors. Bot can create posts via a custom form using `wp_insert_post()`, but Editors are allowed to mark a post as private, effectively sharing a single post only among other Editors. As Wordpress already filters private posts out of the loop for anyone lower than Editors, i'm wondering how this will affect my caching because (as far as I understand) I'll have two caches: one showing posts to Subscribers, and one showing posts to Editors which also includes private posts. Within the loop I'm using:   * `current_user_can()`: to include or exclude some post content based on Subscriber/Editor/Administrator   * `get_post_status()`: to include or exclude some post content based on if the post is "private" or "published"   * `get_post_meta()`: to retrieve various custom fields Right now I'm using 26 queries in 0.198 seconds on index.php and 28 queries in 0.193 seconds on single.php. How would one effectively cache this? I don't have any caching plugin yet but I do have access to xCache. Many thanks!


title: Automatic Theme Upgrade hooks?

text: If you do a radical update of a theme, can you prevent people from unintentionally upgrading until they have read and approved a warning telling them the changes might break their child themes? Or, is it best to fork your theme and call it Theme2 or something similar?


title: How to allow specific extensions and file size to wp_mail attachment?

text:
I am trying to create a form with an attachment option that will be sent to an email when the form is submitted on a wordpress site. My codes work fine and it sends email in a HTMKL table format to my email address. Also I am able to send attachment using the codes. The issue arises when I consider the attachment file extensions and file size. I do not know that how to restrict big size of files and set attachments for some allowed extensions only. My code is:               <?php     //Setup an empty array.     $errors = array();          if($_POST["submit"]) {         $to = "myemail@gmail.com";         $subject = "New reservations request";         $hotel = $_POST["hotel_url"];         $sender = $_POST["sendername"];         $senderEmail = $_POST["senderEmail"];              //Check the name and make sure that it isn't a blank/empty string.         if(empty($sender)){             //Blank string, add error to $errors array.                     $errors['sendername'] = "Please enter your name!";         }              /*  attachment */            move_uploaded_file($_FILES["attachment"]["tmp_name"],WP_CONTENT_DIR .'/uploads/'.basename($_FILES['attachment']['name']));         $attachments = array(WP_CONTENT_DIR ."/uploads/".$_FILES["attachment"]["name"]);                  if(empty($errors)){                  $mailBody = "

                             No	                             Item	                             Description

                             01	                             Hotel	                             $hotel

                             02	                             Name	                             $sender

                             03	                             E-Mail	                             $senderEmail

";                        $headers = array('From: '.$_POST['sendername'].' <'.$_POST['senderEmail'].'>');                      $mail_sent = wp_mail( $to, $subject, $mailBody, $headers, $attachments );                }         }              if ($mail_sent) {     ?>
Request sent
          <?php      } else {     ?>          <form id="" name="" action="<?php echo get_permalink(); ?>" method="post" enctype="multipart/form-data">     <input type="hidden" name="hotel_url" value="<?php echo get_permalink();?>" />

Your Details

Name

                 <input type="text" name="sendername"/>                 <?php if(isset($errors['sendername'])) { echo ''.$errors['sendername'].''; } ?>

E-Mail

                     <input type="email" name="senderEmail" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required value="<?PHP if(!empty($errors)) { echo $senderEmail;} ?>"/>

                Select A File To Upload:         <input type="file" name="attachment">              <input type="submit" value="Submit" name="submit">     </form>          <?php     }     ?>      The above code send the attachment to my mail and it saves the file into my uploads dirctory. I know I have to do something around this area **/* attachment */** to allow specific extensions and size of the file. but how to do that? eg: if I have to allow .png, .jpg, .pdf only and the maximum file is 1mb how can I do that? where and what code I have to amend into the above codes?


title: Help with query function get_calendar()

text: I have a own "get_calendar" function (plugin) cloned from the default wp function. I just wanna see posts that have a certain custom field set (true). How do I add this goal into:               $gotsome = $wpdb->get_var("SELECT 1 as test FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1");      the name of the custom field checkbox is               ua_allow_future_check      So if this field returns true, I want those posts to show in the calendar!


title: Future post ID not showing

text:
I'm attempting to send an email notification when a scheduled post is published. I've tried quite a few different ways. I receive the email but the id (and other random details) are not published with it. Is there something that I'm fundamentally missing in this code? I tried both outside and inside and a few other ways. The dap post is a fictional custom post type that I was initially testing on and then thought that it may be custom post types. So I used a regular post and nothing. I also disabled all plugins except for the one containing the code below. Still nothing worked. I can see the details if I publish immediately but not from when it's scheduled.               add_action( 'init', 'create_dap_post_types' );          function create_dap_post_types() {         register_post_type( 'dap',              array(                 'labels' => array(                     'name' => __( 'Daps' ),                     'singular_name' => __( 'Dap' )                 ),                 'public' => true,             )         );     }                    function status_changes( $new_status, $old_status, $post ) {      global $post;      global $wpdb;      global $wp_query;           if ($new_status == 'publish') {         //$post = get_post($id);             $id = get_the_ID();         $post = get_post($id);         $post_title = $post->post_title;           // $author = get_userdata($post->post_author);          // the rest of your function here          $link = get_permalink($post->ID);         $date = mysql2date('M j Y', $post->post_date);         $category = get_the_category($post->ID);         //$category = $category[0]->cat_name;              $to = "//left blank to void out email";         $subject = $post_title;         $message = "

 schedulenotificte

 Let's begin: author " . //$author .                     " the link? " . $link;         wp_mail( $to, $subjet, $message);      }               }       //add_action( 'transition_post_status', 'status_changes', 100, 3 );               add_action('publish_'. $_POST['post_type'], 'scheduledNotification');     add_action('future_to_publish_dap', 'scheduledNotification');     add_action('new_to_publish_dap', 'scheduledNotification');     add_action('draft_to_publish_dap', 'scheduledNotification');     add_action('pending_to_publish_dap', 'scheduledNotification');     add_action('future_to_publish_dap', 'scheduledNotification');     add_action('auto-draft_to_publish_dap', 'scheduledNotification');     add_action('pending_to_future', 'scheduledNotification');     add_action('approved_to_future', 'scheduledNotification');          function scheduledNotification() {       global $post;       global $wp_query;       $post = $wp_query->post;       //$post = get_post($id);       $my_postid = $post->ID;//This is page id or post id       $content_post = get_post($my_postid);       $content = $content_post->post_content;       $content = apply_filters('the_content', $content);       $content = str_replace(']]>', ']]>', $content);            $id = get_the_ID();       $post = get_post($id);            $link = get_permalink($post->ID);       $date = mysql2date('M j Y', $post->post_date);       $category = get_the_category($post->ID);                 $to = "//left blank";       $subject = $post->post_title;       $message = "

 schedulenot

Let's begin shall we?:

author " . //$author .                 " the link? " . $link .                  "
 this is the content
" . $content .                 "
 this is the idea
" . $post->ID;       wp_mail( $to, $subject, $message);     }          function hereIsATest ($post) {       global $post;       global $wp_query;       $post = $wp_query->post;            $my_postid = $post->ID;//This is page id or post id       $content_post = get_post($my_postid);       $content = $content_post->post_content;       $content = apply_filters('the_content', $content);       $content = str_replace(']]>', ']]>', $content);                      $subject = $post->title;       $message = "
 hereisatest
 this is the id " . $post->ID .              "This is content " . $post->content .             "
 the title
" . $post->post_title .             "what else there" . $subject .              "
 id
" . get_the_ID() .              "
 id_
" . $post->ID .             "
 id
" . $post->content_post;        wp_mail("//blank", $subject , $message);     }          add_action('publish_'. $_POST['post_type'], 'hereIsATest');               add_action( 'transition_post_status', 'inLoop', 100, 3 );     add_action ('wp_transition_post_status', 'inLoop');          function inLoop($new_status, $old_status, $post) {       global $post;       $thePostID = $post->ID;            if ($new_status == 'publish') {         $to = "blank";         $subject = $thePostID;         $message = "
 This is insidethe loop
" . $thePostID .                 "
 the title ////" . get_the_title() .                 "
 get the title
" . get_the_title() .                  "
 old status is:
 " . $old_status .                  "
 new status is:
 " . $new_status .                  "
 dump post:
" . $rpost;              wp_mail($to, $subject, $message);         }     }          add_action( 'transition_post_status', 'outLoop', 100, 3 );     add_action('wp_transition_post_status', 'outLoop');          function outLoop($new_status, $old_status, $post) {       // Works in single posts outside of the loop       global $wp_query;            if ($new_status == 'publish') {         $thePostID = $wp_query->post->ID;         //$rpost = print_r($post, true);         $to = "email";         $subject = $thePostID;         $message = "
 This is outside the loop
" . $thePostID .                  "
 get the title
" . get_the_title() .                  "
 old status is:
 " . $old_status .                  "
 new status is:
 " . $new_status .                  "
 dump post:
";              wp_mail($to, $subject, $message);        }          }


title: Calling a class method instantiated by ajax call in wordpress

text: I have an ajax call in Wordpress that instantiate a class. I want to be able to call the class methods in other functions. Here is the code to demonstrate. Ajax call:                 kalimahJS(".a").click(function() {                  var data = {                 'action': 'list_items'             };                  kalimahJS.ajax({                 url: ajaxurl,                 type: "POST",                 data: data,                 success: function(data, textStatus, jqXHR) {                     console.log(data);                 }             })         })      PHP class:               <?php     class Plugin     {         var $itemsClass;              public function __construct()         {                  add_action('wp_ajax_list_items', array(                 $this,                 'list_items'             ));         }              function list_items()         {             // Get class instance             $this->itemsClass = new itemsClass();                  echo "success";             die();         }              function another_function()         {             // Can't access this function             $this->itemsClass->list_items();                  return false;         }     }      I am not able to access `list_items()` method of `$this->itemsClass` since it is instantiated from an Ajax call. Is there another way to do this?


title: How to export and import woocommerce product reviews along with product

text: I want to export and also import all the product reviews along with product meta in woocommerce. I have tried woocommerce product import csv suite, WP CSV, export comments. They don't export comments along with product details. either comments separately or product data separately not together. Any help is appreciated.


title: Adding content to custom taxonomy category pages

text: I can't figure out or find an answer on how to enable the description in the custom taxonomy category pages. Under description field it says: "The description is not prominent by default; however, some themes may show it.". I've managed to enable it to normal category pages by adding this code to archive.php               <?php echo category_description(); ?>      But it's still disabled on taxonomy pages. Any help will be appreciated. **Problem solved** I find out that my theme has taxonomy.php where this code               <?php echo term_description(); ?>      needs to be added to make the description visible on custom taxonomy page. Thanks to @PieterGoosen for helping me out.


title: Show billing_address, sku and more in email

text:
I'm setting up my first store with woocommerce, and I'm nearly done without great problems. My php skills are very limited and I'm stuck on a little s.th. I need some data in a very special format in the admin-new-order-mail. So I copied the template file into my custom theme and tried to get the necessary fields. I was able to get some of them, but the address data I get only in a simple array provided by a function.               $adresse = $order->get_billing_address( );      I get this: blablastr. 55, Hometown, 22321, DE How can I get the field billing_adress_1 directly? I also need to loop through the products to get the sku, price, and more. Also shipping and payment infos. I don't understand the API pages on wootheme.com. Maybe someone can point me into the right direction. This is my code so far. I put it at the bottom of admin-new-order.php               $ordNr = $order->get_order_number();     $ordNr = substr($bestNr,4,10);     $date = date_i18n( woocommerce_date_format(), strtotime( $order->order_date ) );     $time = date_i18n( woocommerce_time_format(), strtotime( $order->order_date ) );     $adresse = array();     $adresse = $order->get_billing_address( );     $officerCode = '##OFFICER-START##
       Date:' . $date . '
       Time:' . $time . '
' .       $ordNr . '|' . $ordNr . '| | |' . $order->billing_email . '|' . $order->billing_phone . '
       |

       ##comment##

     ##OFFICER-END##';     print($officerCode);      As I mentioned, I'm not a programmer and appreciate any help.


title: Simple Calendar

text: I'm using the ACF (Advanced Custom Fields) and selected the date picker. I'm wondering if anyone has created a simple calendar plugin that can grab the field and produce a calendar. How should I do that?


title: Is there a way to display others posts in my post?

text: Is there a way I can pull in the content from another post into my own post without writing code? What I mean is that I have created a post called, "Apple post". I also created a post called, "Orange port". I create a third post called, "Fruit". In this post I want to display the content from the first two. I also have second blog on another server that has, "Pear post". I want to pull the content in from that as well. Will Wordpress do this?


title: Fetching Video From YouTube Automatically

text: I am using WordPress, and a theme called DeTube. Is kind of a YouTube clone, and I use this website to upload mainly videos from YouTube. Is there anyway to fetch videos and populate all the required fields, name, url, tags, using a plug in. Is there any other method to do this. Like for example fetching a particular video just by adding it's url? **Edit** I found this great plugin called External Videos, it does exactly what i want, but is not interrogated with the theme I am working on, it just fetches the videos and post them as regular posts. I guess if there is no ready solution, i will have to do the coding by my- self.


title: Using characters to separate menus in navigation bar

text: I’m attempting to modify my blog's navigation menu (http://reasonandfolly.com/) to replicate what is here: http://chimpchomp.us/ Two pieces represent a challenge: 1. The separators 2. The line on right/left of menus. I’m fairly new to WP and can’t be certain if this requires a change to CSS or PHP. Any guidance would be appreciated!


title: Remember form field values with page navigation

text:
I have a form on a page template that controls which posts show up on the page and how those posts are ordered. You can see what I mean here: http://www.theseattlevine.com/the-vine The questions I have is, how do I get the form to "remember" the selected values when the user uses the pagination at the bottom to go to the next page or a specific page? EDIT: Looks like sessions in the answer, but I can't get it to work. Any help is appreciated. Here is my current code after formatting and adding the suggestion below. It's still not working.                   <?php      /**      * Template Name: The Vine      *      * @package WordPress      * @subpackage Twenty_Eleven      * @since Twenty Eleven 1.0      */ ?>          <?php         //Form Processing-----------------------------------------------------------------         //Display chosen number of posts per page         $gridperpage = array("8", "16", "32", "64", "96");         $listperpage = array("10", "20", "40", "65", "100");         $perpagecurrent = $_POST['perpage'];         //If the number is already set, use it              if (isset($_POST['perpage'])) {             $perpage = $_POST['perpage'];         }              //If the number of posts matches the multiples of the grid numbers AND we're on the list page, switch the count to 20              if ((!in_array($perpagecurrent, $listperpage)) && (($_POST['view']) == 'list') ){             $perpage = '20';         }              //If we're on the grid page and the number is a multiple from the list page, switch to 32. Also do this if there is no value set yet since the default view is the grid         elseif (((!in_array($perpagecurrent, $gridperpage)) && (($_POST['view']) == 'grid')) || (!$_POST['perpage']) ){             $perpage = '32';         }              //Display chosen post types              if ((!$_POST['userposts']) && (!$_POST['posts'])) :         $posttype= array('tsv_userpost', 'post');         elseif ((($_POST['userposts']) == 'true') && (($_POST['posts']) == 'true')) :         $posttype= array('tsv_userpost', 'post');         elseif ((($_POST['userposts']) == 'true') && (($_POST['posts']) == '')) :         $posttype= 'tsv_userpost';         elseif ((($_POST['userposts']) == '') && (($_POST['posts']) == 'true')) :         $posttype= 'post';         endif;         //Display only selected User Post Categories              if (isset($_POST['showvideos']) && ($_POST['showvideos'] == 'true')) {             $cats[]='user-video';         }                   if (isset($_POST['showimages']) && ($_POST['showimages'] == 'true')) {             $cats[]='user-image';         }                   if (isset($_POST['showaudio']) && ($_POST['showaudio'] == 'true')) {             $cats[]='user-audio';         }                   if (isset($_POST['showwriting']) && ($_POST['showwriting'] == 'true')) {             $cats[]='user-writing';         }                   if (isset($_POST['showevents']) && ($_POST['showevents'] == 'true')) {             $cats[]='user-event';         }              ;         $upostcat = implode(',',$cats); //Put all the selected categories into the $upostcat array         ?>      <?php          //Sort posts by selected method              if (isset($_POST['sortby']) && ($_POST['sortby'] == 'date')) {             $sortmetakey='';             $sortby='date';         }              elseif (isset($_POST['sortby']) && ($_POST['sortby'] == 'rating')) {             $sortmetakey='ratings_average';             $sortby='meta_value_num date';         }              elseif (isset($_POST['sortby']) && ($_POST['sortby'] == 'favscount')) {             $sortmetakey='wpfp_favorites';             $sortby='meta_value_num date';         }              elseif (isset($_POST['sortby']) && ($_POST['sortby'] == 'viewcount')) {             $sortmetakey='_count-views_all';             $sortby='meta_value_num date';         }              ;         ?>          <?php //Session              session_start();         // your formfields         $post_fields = array( 'sortby', 'view', 'perpage' , 'posts' , 'userposts' , 'showaudio' , 'showvideos' , 'showimages' , 'showevents' , 'showwriting' );         $form_data = array();         // copy needed form data from $_POST array         foreach ( $post_fields as $key )         if ( isset( $_POST[$key] ) )    $form_data[$key] = $_POST[$key];         // save your form data in a session if no form data was saved before              if (  ! empty( $form_data )    &&  ! isset( $_SESSION['form_data'] ))  $_SESSION['form_data'] = serialize( $form_data );         // read saved form data from session              if (  isset( $_SESSION['form_data'] )    &&  ! empty( $_SESSION['form_data'] )    &&  empty( $form_data ))  $form_data = unserialize( $_SESSION['form_data'] );         ?>                     <?php          //Start of content         get_header();         ?>
     <?php  //Search the vine ?>
         <form method="get" id="searchform" action="<?php  echo esc_url( home_url( '/' ) ); ?>">             <?php  _e( 'Search', 'twentyeleven' ); ?>             <input type="text" class="field" name="s" id="vinesearch" placeholder="<?php  esc_attr_e( 'Search', 'twentyeleven' ); ?>" />             <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php  esc_attr_e( 'Search', 'twentyeleven' ); ?>" />         </form>
     <?php  //Browse the vine ?>     <?php      //Start filter menu      ?>         <form method="post" id="vine-sort-form" >         <?php                 if ($_SERVER['REQUEST_METHOD']!='POST') {             $notsubmitted='checked';             $notsubmitted_dd='selected';         }              ;         //Auto-select all post types when user first selects to show userposts                if ('true' == ($_POST['userposts']) && ('' == ($_POST['showvideos'])) && ('' == ($_POST['showaudio'])) && ('' == ($_POST['showimages'])) && ('' == ($_POST['showwriting'])) && ('' == ($_POST['showevents'])) ) {             $userpostselected='checked';         }              ;         //Dont allow both post types to go unselected              if ('true' != ($_POST['userposts']) && ('true' != ($_POST['posts']))) {             $noselectnone='checked';         }              ;         ?>         <?php php//Choose View  ?>         <?php      if (($_POST['view'] == 'grid') || (!isset($_POST['view']))) { ?>         <input id="viewgrid" type="radio" name="view" value="grid" onclick="this.form.submit()" <?php                   if ('grid' == ($_POST['view'])) :             echo 'checked';             elseif ($notsubmitted) :             echo $notsubmitted;             endif ?> style="display:none;">                  <?php  } else { ?>           <input id="viewgrid" type="radio" name="view" value="grid" onclick="this.form.submit()" <?php                   if ('grid' == ($_POST['view'])) :             echo 'checked';             elseif ($notsubmitted) :             echo $notsubmitted;             endif ?> style="display:none;">                  <?php  } ?>         <?php      if ($_POST['view'] == 'list') { ?>         <input id="viewlist" type="radio" name="view" value="list" onclick="this.form.submit()" <?php                   if ('list' == ($_POST['view'])) :             echo 'checked';             endif ?> style="display:none;">                  <?php  } else { ?>         <input id="viewlist" type="radio" name="view" value="list" onclick="this.form.submit()" <?php                   if ('list' == ($_POST['view'])) :             echo 'checked';             endif ?> style="display:none;">                  <?php  } ?>

Per page:
         <?php  if ((($_POST['view']) == 'grid') || (!isset($_POST['perpage']))) { ?>         <select name="perpage" id="perpage">             <option value="8" <?php                   if ('8' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">2 rows (8)</option>             <option value="16" <?php                   if ('16' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">4 rows (16)</option>             <option value="32" <?php                   if ('32' == ($_POST['perpage'])) :             echo 'selected="selected"';             elseif ((in_array($perpagecurrent, $listperpage))) :             echo 'selected="selected"';             elseif (!$_POST['perpage']) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">8 rows (32)</option>             <option value="64" <?php                   if ('64' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">16 rows (64)</option>             <option value="96" <?php                   if ('96' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">24 rows (96)</option>         </select>         <?php  } else { ?>         <select name="perpage" id="perpage">             <option value="10" <?php                   if ('10' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">10 posts</option>             <option value="20" <?php                   if ('20' == ($_POST['perpage'])) :             echo 'selected="selected"';             elseif ((in_array($perpagecurrent, $gridperpage))) :             echo 'selected="selected"';             elseif (!$_POST['perpage']) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">20 posts</option>             <option value="40" <?php                   if ('40' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">40 posts</option>             <option value="65" <?php                   if ('65' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">65 posts</option>             <option value="100" <?php                   if ('100' == ($_POST['perpage'])) :             echo 'selected="selected"';             endif;             ?> onclick="this.form.submit()">100 posts</option>         </select>         <?php  } ?>
Sort by:
         <input type="radio" name="sortby" value="date" onclick="this.form.submit()" <?php               if ('date' == ($_POST['sortby'])) :         echo 'checked';         elseif ($notsubmitted) :         echo $notsubmitted;         endif;         ?>>Date
         <input type="radio" name="sortby" value="rating" onclick="this.form.submit()" <?php               if ('rating' == ($_POST['sortby'])) :         echo 'checked';         endif ?>>Rating
         <input type="radio" name="sortby" value="favscount" onclick="this.form.submit()" <?php               if ('favscount' == ($_POST['sortby'])) :         echo 'checked';         endif ?>># of Favs
         <input type="radio" name="sortby" value="viewcount" onclick="this.form.submit()" <?php               if ('viewcount' == ($_POST['sortby'])) :         echo 'checked';         endif ?>># of Views

Post Type:
         <input type="checkbox" name="posts" value="true" onclick="this.form.submit()" <?php               if ('true' == ($_POST['posts'])) :         echo 'checked';         elseif ($notsubmitted) :         echo $notsubmitted;         elseif($noselectnone) :         echo $noselectnone;         endif;         ?>>Featured Posts
         <input type="checkbox" name="userposts" value="true" onclick="this.form.submit()" <?php               if ('true' == ($_POST['userposts'])) :         echo 'checked';         elseif ($notsubmitted) :         echo $notsubmitted;         elseif($noselectnone) :         echo $noselectnone;         endif;         ?>>User Posts

             <?php               if ('true' == ($_POST['userposts'])) {                  if ('' == ($_POST['posts'])) {                 ?>             <input type="checkbox" name="showvideos" value="true" onclick="this.form.submit()" <?php                       if ('true' == ($_POST['showvideos'])) :                 echo 'checked';                 elseif ($notsubmitted) :                 echo $notsubmitted;                 elseif ($userpostselected) :                 echo $userpostselected;                 endif;                 ?>>Video
             <input type="checkbox" name="showimages" value="true" onclick="this.form.submit()" <?php                       if ('true' == ($_POST['showimages'])) :                 echo 'checked';                 elseif ($notsubmitted) :                 echo $notsubmitted;                 elseif ($userpostselected) :                 echo $userpostselected;                 endif;                 ?>>Images
             <input type="checkbox" name="showwriting" value="true" onclick="this.form.submit()" <?php                       if ('true' == ($_POST['showwriting'])) :                 echo 'checked';                 elseif ($notsubmitted) :                 echo $notsubmitted;                 elseif ($userpostselected) :                 echo $userpostselected;                 endif;                 ?>>Writing
             <input type="checkbox" name="showaudio" value="true" onclick="this.form.submit()" <?php                       if ('true' == ($_POST['showaudio'])) :                 echo 'checked';                 elseif ($notsubmitted) :                 echo $notsubmitted;                 elseif ($userpostselected) :                 echo $userpostselected;                 endif;                 ?>>Audio
             <input type="checkbox" name="showevents" value="true" onclick="this.form.submit()" <?php                       if ('true' == ($_POST['showevents'])) :                 echo 'checked';                 elseif ($notsubmitted) :                 echo $notsubmitted;                 elseif ($userpostselected) :                 echo $userpostselected;                 endif;                 ?>>Events
             <?php              }              }              ?>
               </form>
<?php  //.thevinemenu ?>
<?php //.vine-display ?>             <?php         // The Query           $counter = 1;         $paged = (get_query_var('paged')) ? get_query_var('paged') :         1;         $the_query = new WP_Query( array('post_type'=> $posttype,'posts_per_page'=>$perpage,'paged'=> $paged,'category_name'=>$upostcat,'meta_key' =>$sortmetakey, 'orderby' =>$sortby, 'order'=> 'DESC'));         //Top Navigation         wp_pagenavi( array( 'query' => $the_query ) );         //Start loop         while ( $the_query->have_posts() ) :         $the_query->the_post();              if ('grid' == ($_POST['view']) || ($_SERVER['REQUEST_METHOD']!='POST')) :         get_template_part('the-vine', 'grid');         elseif ('list' == ($_POST['view'])) :         get_template_part('the-vine', 'list');         endif;         ?>       <?php  endwhile; ?>
<?php  wp_pagenavi( array( 'query' => $the_query ) ); ?>
     <?php  wp_reset_query(); ?>
     <?php  get_footer(); ?>


title: Make change in media library affect images in published articles

text: Is there any way/plugin to make wordpress change the description/alt text/caption of an image used in already written articles if I change any of those texts of that specific image in the media library?


title: Categories in media library

text: I want to add a rather big sound collection to the media library. The problem is that i can't add category to the bunch of files while uploading them... I even can't add it to one uploading file.... And I can't find the way to solve this problem. It's a big work to add the category to thousands of sound files. Is it possible to add a tag field or a catagory field to the media library and include appropriate field to the uploading media library page? The plugins in answer do not allow to set a category in the time of uploading... probably it's time to add more features for users to work with media library in wordpress?


title: Sysc the content and pages between two WordPress install?

text: I've some questions about Sysc the content and pages between two WordPress install we just build a site: Example.com.au and we need to sync all product pages (and some other pages) to dealer sites , but need custom header & footer + other pages for example, There are dealerships who sell the caravans (Testing.com.au sample dealer ) we will take a copy of Example.com.au and customize it as per clients logo and dealer specific content but we want to have certain pages be 'pulled / sync'd' from Example.com.au , so when they update Example.com.au, the changes go out to the other dealers sites like Testing.com.au Any help and possible solutions ? Cheers


title: Category page when using static front page

text: I'm using a "static" front page with the posts on a page called News. Is it possible to make the categories use that as the base? Like this: /news/[category_name]/ And is it also possible to do the same with posts? /news/2012/09/17/post-title


title: Registration page background color covering 1 screen not covering full page

text: Good Day, I have been researching this for a few days and cannot find a solution. The website is http://gwendolinesroadtrip.com/ The background color of the registration page is not filling the entire page. I have tried almost all suggestions without touching the original WordPress files or Twenty Twelve theme files. The plugins I am using are jonradio Private Site and Register Plus Redux. I have removed them both but the problem is still there. Thank you in advance for any help Debbie


title: Is there a way to change select-list for new custom taxonomy?

text: When you add a category in the admin-panel, the adminstrator can select it's parent. Something like:               - Category1     -- Subcategory1 to Category1     -- Subcategory2 to Category1     -- Subcategory3 to Category1     ....     - Category2     -- Subcategory1 to Category2     -- Subcategory2 to Category2     -- Subcategory3 to Category2     ....       I have created a custom taxonomy. Is there a way to change these options to be only parent - selection like this for this specific taxonomy?               - Category1     - Category2     ....       ? (Is there a hook for this for a taxonomy at all?)


title: Display taxonomy with a maximum number of letters

text:
I'm looking for a function which displays a post's taxonomy with a maximum number of letters. I've achieved with title (How to limit the max number of characteres in the title that are displayed), but I'm not able to do it with taxonomies. E.g. I have this:               echo '
'.get_the_term_list( get_the_ID(), 'Artistas', '
', '
' ).'
';      This shows the "Artistas" taxonomy. I want to show only the first 10 letters. Any idea of how to hook in to change it?


title: How to run a subdirectory multisite install under a subdomain

text: I am on a VPS running Nginx as a backend server. I want to set up a sub-directory multisite WordPress installation, however I want all sub-sites to be under one sub-domain also. For example: My main site:               domain.com      Subsites:               clients.domain.com/site1     clients.domain.com/site2     clients.domain.com/site3      I realise I can install another copy of WordPress under `clients.domain.com` and use that as the Multisite home, however since `domain.com` is already running WordPress this strikes me as inefficient in terms of management and disk space especially as I only wish to serve a login page at the root of that subdomain anyway. I also realise I can redirect all requests to `clients.domain.com` to `domain.com` however I don't want the subsites or their related files to be accessible via `domain.com/site1`. The subsites should recognise their parent site as being `domain.com`. What is the best method for going about this?


title: Can you group pages associated to a specific parent menu item in the admin area?

text: I'm creating a site that has many neighborhood pages (27) and each of those neighborhood pages has a link to a Points of Interest page, History page, and Gallery page. Would that mean that at the end of the day in this particular example i would have to create 108 pages that would be the sum of all the neighborhood pages and each of their Points of Interest, History and Gallery pages combined. I realize that each type of page (Neighborhood, Points of Interest, Gallery and History) has it's own template for each given page type with custom fields for the individual content and specific content that each holds i'm just trying to figure out if that's about how many pages i would be creating? Then is there any way to group these pages for example Neighborhood 1 and its Points of Interest, History and Gallery page so that the admin user could just go to a specific Neighborhood and find all the relevant pages to it together? Or would they all just display in a long list which from what i can tell doesn't even allow you to drag and move in order? Any help would be great, thank you.


title: How can I let users create and share their own image galleries?

text: After searching on Google and this site, I found some old, outdated posts regarding this topic, so I figured I'd start a new one. How can I let users create their own public gallery and upload their own pictures to it? I want to set up a central "Gallery" page where users can view all the latest uploads, and choose a specific user's gallery to browse through. Basically, as the admin, I don't want to have to sit there and make separate galleries for each user to upload to (I think that's what NextGen does): I want every user to automatically get one and start uploading to it and share it. Can anyone offer any pointers to a way to do this?


title: How to add icon over specific thumb

text: I wanted to do the following, and I know its possible, but I don't know how. I'm looking at `in_category`, but it doesn't make to much sense. Basically what I want to do, for an example on my homepage, category page and similar posts are shown with title and a thumb. And for this thumbs I want to add function like this If post/thumb is inside category video -> add video icon above it. I guess with css I would need to position it, for an example at the bottom right corner. Any ideas how to this


title: Ways to create a paid wordpress plugin?

text: I can't find a lot of information on google about creating a paid wordpress plugin. I'm already versed into plugin development, but what are my options to have a freemium model ? I would like to restrict some parts of my plugin to paid users but obviously, as every wordpress plugin source code is free, is that really possible ? How do plugins like Gravityforms protect their plugin from being redistributed to the wild ?


title: how to request a script more than once in wordpress

text: Can I ask how I can request a script more than once in wordpress. For example:               for($i = 0; $i < 2 ; $i++){     wp_enqueue_script('alerthello.js', 'example.com/example.js');     }      I expect the code to display two hello, but it display one only instead.


title: delete value 0 in post meta

text: I have a simple question. I have this code and its correct,               <?php global $wp_query;     $postid = $wp_query->post->ID;     $meta = get_post_meta($postid, 'codigopostal', true);     if($meta != $empty) { echo "(".$meta.")"; } ?>      but when the user don't put nothing, value is 0. I want delete that value on frontpage.               <?php global $wp_query;     $postid = $wp_query->post->ID;     $meta = get_post_meta($postid, 'codigopostal', true);     if($meta != $empty) {         echo "(".$meta.")";     }      else if($meta != 0) {         echo "";     }     ?>      I added else if... but is wrong.


title: Displaying Metabox value (custom post type taxonomy)

text:
I have been stuck on this for days, reading articles and articles and nothing works. I am trying to display the value of my metabox on a template page. I successfully added the metabox, and I see the select box in my page admin, it also seems to be saving fine. I just can't seem to get the selected category in the metabox to echo on the template page. Everywhere I have read said to use the following which isn't working for me.               <?php      echo get_post_meta( $post->ID, 'sm_taxonomy', true );     ?>      The rest of my code is below               add_filter( 'rwmb_meta_boxes', 'sm_register_meta_boxes' );          function sm_register_meta_boxes( $meta_boxes )     {               /**      * Prefix of meta keys (optional)      * Use underscore (_) at the beginning to make keys hidden      * Alt.: You also can make prefix empty to disable it      */     // Better has an underscore as last sign     $prefix = 'sm_';          $meta_boxes = array();          $meta_boxes[] = array(     'id' => 'my-meta-box-2',     'title' => 'Portfolio Category',     'pages' => array('page', ''), // custom post type     'show_on' => array( 'key' => 'page-template', 'value' => 'grid-gallery.php' ),     'context' => 'normal',     'priority' => 'high',     'fields' => array(         array(                 'name'    => __( 'Choose a category', 'rwmb' ),                 'id'      => "{$prefix}taxonomy",                 'type'    => 'taxonomy',                 'options' => array(                     // Taxonomy name                     'taxonomy' => 'portfolio_category',                     // How to show taxonomy: 'checkbox_list' (default) or 'checkbox_tree', 'select_tree', select_advanced or 'select'. Optional                     'type' => 'select',                     // Additional arguments for get_terms() function. Optional                     'args' => array()                 ),             ),     )     );     return $meta_boxes;          foreach ($meta_boxes as $meta_box) {     $my_box = new My_meta_box($meta_box);     }          add_action('save_post', 'save');          }      and..               class My_meta_box {          protected $_meta_box;          // create meta box based on given data     function __construct($meta_box) {         $this->_meta_box = $meta_box;         add_action('admin_menu', array(&$this, 'add'));              add_action('save_post', array(&$this, 'save'));     }          /// Add meta box for multiple post types     function add() {         foreach ($this->_meta_box['pages'] as $page) {             add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);         }     }          // Callback function to show fields in meta box     function show() {         global $post;              // Use nonce for verification         echo '<input type="hidden" name="mytheme_meta_box_nonce" value="',     wp_create_nonce(basename(__FILE__)), '" />';              echo '
';              foreach ($this->_meta_box['fields'] as $field) {             // get current post meta data             $meta = get_post_meta($post->ID, $field['id'], true);                  echo '
',                     '', $field['name'], '	',                     '';             switch ($field['type']) {                 case 'text':                     echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta ? $meta : $field['std'], '" size="30" style="width:97%" />',                         '
', $field['desc'];                     break;                 case 'textarea':                     echo '<textarea name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4" style="width:97%">', $meta ? $meta : $field['std'], '</textarea>',                         '
', $field['desc'];                     break;                 case 'select':                     echo '<select name="', $field['id'], '" id="', $field['id'], '">';                     foreach ($field['options'] as $option) {                         echo '<option', $meta == $option ? ' selected="selected"' : '', '>', $option, '</option>';                     }                     echo '</select>';                     break;                 case 'radio':                     foreach ($field['options'] as $option) {                         echo '<input type="radio" name="', $field['id'], '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' />', $option['name'];                     }                     break;                 case 'checkbox':                     echo '<input type="checkbox" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';                     break;             }             echo     '',                 '
';         }              echo '
';     }          // Save data from meta box     function save($post_id) {         // verify nonce         if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) {             return $post_id;         }              // check autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         }              // check permissions         if ('page' == $_POST['post_type']) {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;         }              foreach ($this->_meta_box['fields'] as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                  if ($new && $new != $old) {                 update_post_meta($post_id, $field['id'], $new);             } elseif ('' == $new && $old) {                 delete_post_meta($post_id, $field['id'], $old);             }         }     }     }


title: Jetpack API for Wordpress Network

text: Wordpress provided a lovely Json API with Jetpack. I cannot seem to to find a way, or documentation on getting data from a multisite wordpress install? It seems to fail on sites like www.example.com/site1. Any ideas?


title: Retrieve a specific category of posts when using a custom post type

text:
I'm trying to retrieve a specific category within a custom post type of portfolio. I don't know what I have to put in the query to only get certain posts? Here is what I have so far:               <?php // Create and run custom loop         $custom_posts = new WP_Query();         $custom_posts->query('post_type=portfolio&posts_per_page=-1');         while ($custom_posts->have_posts()) : $custom_posts->the_post();       ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
       <?php endwhile; ?>
          <?php          wp_reset_postdata();     ?>      I've included ![two screenshots](http://i.stack.imgur.com/8DLJ2.jpg) from the database, I'm trying to retrieve the posts from 'portfolio_categories' with term_id 4. I did search prior to posting and found this post, but I still don't understand. Thank you.


title: Maximum file upload limit in php.ini have no effect on wordpress

text: I have changed the upload limits in php.ini > sudo sublime-text /etc/php5/apache2/php.ini upload limit, post limit and something else, I restarted apache2 the phpinfo shows me both upload and post limit as 100M for master and local value inside the index file where I have setup wordpress multisite. So my question is why the hell is WordPress still show me > Maximum size: 1.46484375MB I know there are 3 ways to do this with php.ini, .htaccess and inside a php file. But isn't it supposed to take effect when I change it in the very root level? In other words I don't want to set this for every site I setup in my server. I want to set this ip globally once and for all. What is maybe overwriting this? I read on some wordpress setting in "options", I cant find anything to change under "settings". No "options" menu is there under my wp-admin. **Got it, the thing was that I had to setup this for all subsites on the root multisite admin. The option is only available there.**


title: Executing a shortcode at the top of PAGE template?

text: I need to execute a shortcode at the TOP of contents area in specific _PAGE_ template. Notice that I'm talking about "pages" as there are lots of plugins for 'posts' Preferably inserting the shortcode somewhere between the page title & the actual contents of that page.. << if that's at all possible? :) So, does anyone know how to edit the Full Width Page Template (page-full.php) to include a shortcode (that is executed by another plugin) if the page is the full width? Thanks, Mary


title: Programmatically set page_on_front

text: I am trying to programmatically set the 'page_on_front' option with the id value retrieved from the get_page_by_title command...               $homepage = get_page_by_title( 'Front Page' );     update_option('page_on_front', $homepage);     update_option('show_on_front', 'page');      This isn't working, can anyone help?


title: I need some direction on how to have a sidebar based on meta rather than page

text: I'm working on a plugin that allows the user to create "page/post types", customize the type style, then tag a page/post with that type. All of this works. My problem is this plugin also needs to allow them to attach widgets to said type. I have no way of knowing how many "types" there are at any time. The plugin works like this:   * User creates types (cat, dog, mouse)   * User specifies things like background colors, link colors, etc. for a type   * User specifies widgets for that type When the page/post is viewed the page detects if it has a type. If it does it pulls in all the relavent data to that type. Everything works PERFECT. I know I have to register a sidebar but I can't registe for each type since I have no idea how many there are and the user can create and delete at their whim. My plan:   * Register a sidebar called "custom sidebar"   * Create a page that mimics the "Widgets" page   * Allow the user to add widgets there on the "custom sidebar"   * The plugin stores data for the sidebar based on the "type"'s id I can't really use another plugin since the sidebar function has to meld right into my plugin. I'm not even sure this will work or even where to start. Any push in the right direction would be great!


title: Removing the comment function within wordpress

text: I'm using wordpress for my company website but I want to remove the comments function completely so not just by unchecking a "alow comments" within every page. I did some googeling and the said I was supposed to remove this line of code:               <?php comments_template(); // Get wp-comments.php template ?>      And this code should be located in page.php but I'm unable to find this code. Maybe this was a way to do it in a old version of wordpress? Does anyknow know how I can remove it? :)


title: CSS Classes (optional) on menu is not showing

text:
As you know, there are input boxes for CSS Classes (optional) on each menus. But it's not showing (coming out) in source. Is there any function for disable for CSS Classes (optional)? I need to find it and remove it. my another sites work fine like this. I put "navi_box1" on Menu1 as CSS Class. and it shows right spot.. `

Menu1 ..........etc.......
 ` this is the codes for navi..                   wp_nav_menu( array( 'container' => false, 'menu_class' => 'left', 'theme_location' => 'primary', 'fallback_cb' => 'sweetdate_main_nav', 'walker'        => new sweetdate_walker_nav_menu) );      the name of theme_location is right.


title: Please ensure me that I'm not crazy using the pre_get_posts

text: function rpm_pre_get_post($query){            if($query->is_main_query()){                 $query->set('meta_key', 'parent-project');                 $query->set('meta_value', 'Metro-E');             }     }     add_action( 'pre_get_posts', 'rpm_pre_get_post', 9999 );      That should effectively pull back all posts that have the key 'parent-project' set to 'Metro-E' correct? below is what I get spit out when trying to debug               WP_Query Object     (         [query_vars] => Array             (                 [post_type] => rfd_job                 [posts_per_page] => 20                 [error] =>                  [m] => 0                 [p] => 0                 [post_parent] =>                  [subpost] =>                  [subpost_id] =>                  [attachment] =>                  [attachment_id] => 0                 [name] =>                  [static] =>                  [pagename] =>                  [page_id] => 0                 [second] =>                  [minute] =>                  [hour] =>                  [day] => 0                 [monthnum] => 0                 [year] => 0                 [w] => 0                 [category_name] =>                  [tag] =>                  [cat] =>                  [tag_id] =>                  [author_name] =>                  [feed] =>                  [tb] =>                  [paged] => 0                 [comments_popup] =>                  [meta_key] => parent-project                 [meta_value] => Metro-E                 [preview] =>                  [s] =>                  [sentence] =>                  [fields] =>                  [menu_order] =>                  [category__in] => Array                     (                     )                      [category__not_in] => Array                     (                     )                      [category__and] => Array                     (                     )                      [post__in] => Array                     (                     )                      [post__not_in] => Array                     (                     )                      [tag__in] => Array                     (                     )                      [tag__not_in] => Array                     (                     )                      [tag__and] => Array                     (                     )                      [tag_slug__in] => Array                     (                     )                      [tag_slug__and] => Array                     (                     )                      [post_parent__in] => Array                     (                     )                      [post_parent__not_in] => Array                     (                     )                  )              [tax_query] => WP_Tax_Query Object             (                 [queries] => Array                     (                     )                      [relation] => AND             )              [meta_query] =>          [post_count] => 0         [current_post] => -1         [in_the_loop] =>          [comment_count] => 0         [current_comment] => -1         [found_posts] => 0         [max_num_pages] => 0         [max_num_comment_pages] => 0         [is_single] =>          [is_preview] =>          [is_page] =>          [is_archive] =>          [is_date] =>          [is_year] =>          [is_month] =>          [is_day] =>          [is_time] =>          [is_author] =>          [is_category] =>          [is_tag] =>          [is_tax] =>          [is_search] =>          [is_feed] =>          [is_comment_feed] =>          [is_trackback] =>          [is_home] =>          [is_404] =>          [is_comments_popup] =>          [is_paged] =>          [is_admin] => 1         [is_attachment] =>          [is_singular] =>          [is_robots] =>          [is_posts_page] =>          [is_post_type_archive] =>          [query_vars_hash] => cf1479fdf40685bcc6b8eb6b842a2f6b         [query_vars_changed] =>          [thumbnails_cached] =>          [query] => Array             (                 [post_type] => rfd_job                 [posts_per_page] => 20             )


title: Missing Title on custom post types

text: I missed the title on custom post types on new or edit page; I have added some custom fields, but Title disappeared.               register_post_type( 'videos', array(           'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,         'exclude_from_search' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'post',         'has_archive' => true,         'hierarchical' => false,         'menu_position' => 10,         'supports' => array( 'editor' ),         'register_meta_box_cb' => 'videos_meta_boxes',     ) );      This is the first time I tried to add customs post types on my own. I think something here is missing.


title: How to get events using multiple custom meta fields?

text: I need to grab a list of current events. The events have a start and end date so I need to be able to select a range as opposed to just getting any list of events that have an end date that is after today's date. Does anyone have any suggestions as to how to do this? (from what I've read there doesn't seem to be a way to use multiple "meta_key" and "meta_compare" values, but there must be a way some how) Here's an example of what I'm using in my arguments, but I need to also do this for the start date as well:               'meta_key' => 'end_date_value', 'meta_compare' => '>', 'meta_value' => $todaysDate,


title: Change the background of the TinyMCE editor with available WP arguments

text: I'm using an instance of the TinyMCE editor in a plugin form, and I need for the editor to be highlighted (light red background) if the field is not correctly filled in. I can add a custom class 'error' if my code assesses that the editor has not been filled in as desired, but adding that class only affects the background of the 'Text' mode, not the 'Visual' mode. Is there a way through the WP options available to me of doing this? Thanks. Here is how I declare the editor -               /** Set up the editor arguments */     $wp_editor_args = array(         'media_buttons' => false,         'textarea_rows' => 10     );          /** Check to see if this editor is in error */     $is_error = $this->is_error_field('description');     if($is_error) :         $wp_editor_args['editor_class'] = 'error';         print("\t\t\t\t".'<label class="error custom-editor">Please enter an event description (minimum of 50 characters)</label>'."\n");     endif;          /** Add the editor */     wp_editor($this->options_event['description'], 'description', $wp_editor_args);      Here is the CSS I'm using, just in case anyone is curious -               .dd-options .single-option input.error,     .dd-options .single-option textarea.error{         background-color: #FFEBE8;         border-color: red;     }      And here is what I have tried (JS as suggested by @Kaiser)-               /**      * PHP      */     add_filter('tiny_mce_before_init', 'initiate_tinyMCE_wordcount');     function initiate_tinyMCE_wordcount($initArray){              $initArray['setup'] = <<<JS     [function(ed){         setupcontent_callback : "myCustomSetupContent()";     }][0]     JS;              return $initArray;          }          /**      * JS      */     function myCustomSetupContent() {         tinyMCE.getInstanceById('description')             .getWin()             .document.body.style.backgroundColor = '#FFEBE8';     }


title: Page header menu links change

text: I am trying to find out where the header menu links on my WP is located so that i can change the URL of the page. the link is: http://blahblah.com/?page_id=11 and i need to change it to: http://blahblah.com/?page_id=36 However, i do not see anywhere in the menus that i have to change that link. I even looked into the mySQL database **wp_posts** and tried changing all references to 11 to 36 but it still comes up 11!??! Where could i be overlooking it? The appearance Menus page: ![header menu](http://i.stack.imgur.com/uAp4J.jpg) And the header page itself: ![header page](http://i.stack.imgur.com/qM2w5.jpg) And the header code: ![navcode](http://i.stack.imgur.com/z8zim.jpg)


title: How can I force a file download in the WordPress backend?

text: I would like to add a "Click to download" button to one of my WordPress plugins, and I'm not sure which hook to use. So far, hooking 'admin_init' to this code seems to work:                header("Content-type: application/x-msdownload");      header("Content-Disposition: attachment; filename=data.csv");      header("Pragma: no-cache");      header("Expires: 0");      echo 'data';      exit();      This seems to work, but I just want to see if there is a best practice out there. Thanks, Dave


title: How to Make a Separate RSS Feed for Each Custom Post Type

text: How can I make a separate RSS feed for each custom post type? I had searched the net for it and found suggestions to do something like this: > http://www.yoursite.com/feed/?post_type=book I tried the above, but it just didn't work! It only takes me back to the custom post type archive page again... Does anybody knows where I went wrong or what I am missing??? FYI, I used the **Custom Post Permalinks** plugin to allow post type specific permalinks for post type archive pages. Not sure if this may affect the RSS feed problem. Cheers!


title: how to hide specific post from google search

text: I have a wordpress blog set up on my site, example "blog.domain1.com". I have several categories and write posts under each category. I have one specific category that I don't want google search to show on the results page and also the articles written under this category. I used robots.txt and added this Disallow: /category/profiles Disallow: /category/profiles/feed But when I search the content of the posts by doing site search, it appears in google results. How do I hide these posts from google? I used a plug in to hide these posts on blog.domain1.com home page, search page. Why I am doing this - I have another domain example "domain2.com" where I cannot install wordpress so I decided to use a parsing script that will fetch content from my other domain for the posts written under that one specific category "profiles". How I am doing this - I created a custom feed script that will have posts only from specific category "profiles". the url will be like this blog.domain1.com/custom-feed. I use this url on my domain2.com script to show the articles. Can you please help me to take of hiding these specific posts from google search results so that google doesn't think I have duplicate content. I had to do this way because of restrictions that I cannot install wordpress there. Also, no resource for me to do manual work by just creating a static page with content on my domain2.com. To automate it, I used a parser script and then whenever an article is written on blog.domain1.com, it will appear on this domain2.com. Please clarify. regards


title: "Connect" my personal website to wordpress.com

text: I used to have a blog on wordpress.com, now I've created my own site (using wordpress of course), on a privately hosted domain. I used to have a lot more traffic hitting my blog on wordpress.com than on my new site. I can see some other sites (not subdomains on wordpress.com) listed in "freshly pressed" rss feed. How can I do that on my site?


title: Accept (once only) policy page on login

text: I'm developing a simple application on WP that requires the user to accept a policy page on **first** login. If they accept, they're redirected somewhere (homepage), if not, they're redirected somewhere else (different page). However, this "policy page" should only appear after login UNTIL the user accepts it, and after that it should never appear again. Any ideas how to achieve this? Are there some plugins that would help? I tried playing around with "Redirection" plugin but it doesn't have an option to only show a page once. I assume it will have something to do with cookies. Thanks!


title: What are good plugins for beginners?

text: I want this question to turn into a more of a wiki because people often have this question. What do you think are some useful and must-have plugins for a wordpress-based site? Currently, I'm in the early stages of setting up a blog and I'm looking around for great plugins and some good tips. Please do include one or more. Also, if it's already there, upvote it.


title: Customizing Walker_Nav_Menu

text:
I'm looking for a solution to adjust the output of `wp_nav_menu` only on a specific navigation menu. I have my menu:               wp_nav_menu(         array(             "container"         => "nav",             "container_class"   => "container",             "container_id"      => "nav",             "fallback_cb"       => false,             "menu_class"        => "six columns omega main-nav sf-menu",             "theme_location"    => "main-nav"         )     );      ### The Problem I need to find a way insert `<span>[number]</span>` inside of the anchor element. `[number]` represents the number of the item starting at `1`. Here's a visual:![enter image description here](http://i.stack.imgur.com/AYPTk.png) The structure of the the menu would be:
         01.Home

         02.Services

         03.Portfolio
      Currently, I am using a jQuery hack. This works but there's no guarantee that the user can merely disable JavaScript. I've looked at:   * wp_nave-menu(): Add span tags inside a tag that is parent -- StackOverflow   * Understanding the Walker Class - Hub.TutsPlus.com I have an idea that extending the walker class is necessary but my ultimate confusion lies with building the links manually **and** inserting dynamic information _before_ link text is printed. The Stack Overflow question does it but does not explain how to get there. ### Addendum To get the precise result that I wanted see pastebin. `$item->title` needed to be modified in order to follow the HTML structure as listed above.


title: display sticky post outside loop and exclude from loop

text: I have a "featured" area in header.php that displays the content of the latest sticky post:               $last_sticky_post = get_post(end(get_option('sticky_posts')));     if(!empty($last_sticky_post)):     setup_postdata($last_sticky_post);     the_content();     endif;      problem is that the same post now renders below it in the Loop - how can I suppress sticky posts from appearing at all in the loop?


title: Thumbnail + Excerpt = loss in word count

text: My excerpts are shown using this function                <?php   function get_the_content_limit_custom_allowedtags() {     // Add custom tags to this string         return '


title: How to add multiple versions of the same featured image for SEO reasons?

text: I am currently writing a plugin that optimizes category pages in WooCommerce. The idea behind it is that a product can appear in multiple category pages and for every category page it appears in, will have a different ALT tag. The one component I can't figure out yet is how to give each featured image file a different file name based on each category. So example   1. Widget A is a part of Category A and Xategory x   2. Wigdet A Filenames: `wigeta-categorya.jpg`, `widgeta-categoryx.jpg` Based on my SEO's research, this is the approach we need to take. Any idea on how this can be accomplished? I know that I need to be dynamically generating new thumbnails to accomplish this but how can I **effectively** add this to the media gallery?


title: Javascript not displaying inside post

text: Hi I'm trying to add a video that uses javascript inside my post within the editor. I always enter it within the HTML editor with the post and have tried several different plugins but with no luck. I've included the relevant code below but it doesn't appear to run when I preview the page. I have set up a "test" page so that you can maybe determine what the problem might be with the script here: http://manofmany.com/test-2/


title: Can't get the user_meta correctly

text:
I have this code below:               function get_user_fields($user, $output = true, $main_title = 'Anmäld till kurs/kurser', $course_update = false) {            if ($output === true) {             if (strlen($title)>0) {                 echo '
' . $main_title . '
';             }         }              //Get locations (course-categories taxonomy) that starts with kurser_ in it's permalink (slug)         $locations = get_categories_with_slug('kurser_');              //Get list of all categorycourses         $categorycourses = get_terms('categorycourses');              $save_meta = array(); //When no output, use function for storing metadata-array to save         foreach($locations as $location) {             if ($output === true) {                 echo '
'.$location->name.'
';                         }                   foreach($categorycourses as $categorycourse) {                 //When a coursecategory has location as it's parent, then show courses for category                 if ($categorycourse->parent == $location->cat_ID) {                     wp_reset_query();                     $args = array('post_type' => 'course',                         'tax_query' => array(                             array(                                 'taxonomy' => 'categorycourses',                                 'field' => 'slug',                                 'terms' => $categorycourse->slug,                             ),                         ),                      );                           $loop = new WP_Query($args);                      if($loop->have_posts()) {                         $course_field_name = 'course_' . get_the_ID();                              //Check when updating course                                                    if ($course_update === true) {                             echo 'course update is true';                             //Course is selected by user in db, is it set as reserve?                                  if (get_user_meta($user->ID, $course_field_name) == 1) {                                 echo 'course field name is set';                                 //User is selected as reserve for this course in db                                 if (get_user_meta($user->ID, $course_field_name.'_reserve') == 1) {                                      echo 'course field reserve is 1';                                     //Can user be selected as non-reserve?                                     //(course is not full any longer)                                     $nr_available = intval(get_field('nr_available'));                                                                 echo 'nr available = ' . $nr_available;                                          if ($nr_available > 0) {                                            //User is no longer reserve for this course, save info to db                                             update_usermeta($user->ID, $course_field_name, 0);  //FOR TESTING                                            update_usermeta($user->ID, $course_field_name.'_reserve', 0);                                       }                                 }                             }                         }                              if ($output === true) {                                                     echo '
'.$categorycourse->name.'
';                                                echo '

';                             echo '
Kursnamn	Startvecka	Veckodag	Starttid	Pris	Antal platser	';                             echo '
';                             echo '
';                             echo '
';                         }                              while($loop->have_posts()) : $loop->the_post();                             $nr_available = intval(get_field('nr_available'));                             $status_available_full = 0;                             if ($nr_available == 0) {                                 $nr_message = 'fullt';                                 $status_available_full = 1;                             }                                else if ($nr_available<=4) {                                 $nr_message = 'fåtal platser';                             }                               else {                                 $nr_message = 'platser finns';                             }                                  if ($output === true) {                                                                                $checked = get_user_meta($user->ID, 'course_' . get_the_ID(), true);                                  if ($checked == 1) {                                     $checked = ' checked="checked"';                                                               }                                 else {                                     $checked = ' ';                                 }                                 echo '
';                                 echo '';                                 echo '<input type="checkbox"' . $checked . 'name="course_' . get_the_ID() . '"> ' . get_the_title();                                 //If course is full then be able to book pupil as reserve                                 if ($status_available_full === 1) {                                     echo '(reserv)';                                  }                                 echo '	';                                                        echo '' . get_field('start_week') . '	';                                                                                echo '' . get_field('week_day') . '	';                                 echo '' . get_field('start_time') . '	';                                   echo '' . get_field('course_cost') . '	';                                      echo '' . $nr_message . '	';                                 echo '
';                             }                             else {                                 //Add info to array when using not output                                 $save_meta[] = array(                                     'course' => $course_field_name,                                     'is_reserve' => $status_available_full                                 );                                     }                                                 endwhile;                         if ($output === true) {                             echo '
';                             echo '
';                         }                      }                              }                  } //End foreach categorycourses              } //End foreach locations              //Return array when no output is done         if ($output !== true) {              return $save_meta;         }     }          /* SAVE EXTRA FIELDS */          /* helper-function to save extra fields */     function save_user_fields($user_id) {         if ( !current_user_can( 'edit_user', $user_id ) )         return false;              //Save values of checkbox-fields into db         $save_meta = get_user_fields($current_user, false);  //False tells that no output should be done                //Go through all courses and save them         foreach($save_meta as $current_meta) {             $course = $current_meta['course'];             $is_reserve = $current_meta['is_reserve'];             $update = 0;             if (isset($_POST[$course])) {                 $chkbox = $_POST[$course];                 if ($chkbox == 'on') {                     $update = 1;                 }             }             //Save values from form into db             update_usermeta($user_id, $course, $update);                    //Save course into db with format course_{id of course)             update_usermeta($user_id, $course . '_reserve', $is_reserve);  //Save if user is reserve (1) or not (0) for this course         }     }          //Hooks for user (Update/add)     add_action('personal_options_update', 'save_user_fields');     add_action('edit_user_profile_update', 'save_user_fields');     add_action('user_register', 'save_user_fields'); //When adding new users      I use function save_user_fields for saving meta-data for user into database. I'm not sure I can use `$current_user` variable inside this function? (when calling get_user_fields) Basically, the code is generating a list of custom taxonomy categories in userprofile with checkbox and when updating user-profile the value of the checkboxes (category selected or not) are saved into db. This seems to work. I'm saving this metadata in `save_user_fields()`               //Save course into db with format course_{id of course) (1=checked, 0 = unchecked)     update_usermeta($user_id, $course, $update);                     //Save if user is reserve (1) or not (0) for this course     update_usermeta($user_id, $course . '_reserve', $is_reserve);        **I wonder why the code does not get past the statement (in get_user_fields- function, beginning of "the loop"** ) `if (get_user_meta($user->ID, $course_field_name) == 1) {` ? It does not echo out 'course field name is set' I'm also using the plugin Advanced Custom Fields, so therefore I'm using `get_field()`


title: Can user_register output the password?

text: I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this? If not, might you have any ideas on a hook that would do this for a new user? Thanks for any insight! **Edit: Below is the code that I'm using, along with the var_dump**   The code that I'm using for the password is from this accepted answer.               add_action('user_register', 'registration_save');          function registration_save($user_id){         global $wpdb;         echo "user saved";         ob_start();         var_dump($_POST);         $result = ob_get_clean();         echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);         $result = $wpdb->query($wpdb->prepare("REPLACE INTO test                                               (user,newpass)                                               values(%s,%s)",                                               array(                                                   $_POST['username'],                                                   $_POST['pass1']                                                 )         ));


title: wordpress is adding tags and messing with layout

text: i've searched and not found an answer specific to what i'm doing i'm hand coding a page of thumbnails with simple html and css. i'm writing it in a text editor so it's easier on my eyes and then pasting it into the WP post html editor (no tinymce used) ... i do have it formatted to be html legible and there are comments < ! -- -- > ... of course wordpress is screwing with it and adding in spaces p tags, etc. what's the best procedure for putting in a bunch of simple code like that so wordpress doesn't mess with it? is there a way to format it?


title: Load GD Star Rating for One Category

text: In Home i show all posts related to all category, but only on Film Reviews i want to GD Star Rating div. This is the code i have written its not working on homepage on the specific category                            <?php                     $cat = get_the_category();                         foreach($cat as $c) {                              if($c->name == 'Film Reviews'){                                   $showRating = true;                              }                         }                         if($showRating){                              wp_gdsr_render_review();                         }                 ?>


title: Child theme error "Template is missing"

text: I created a child theme of twentytwelve using the following in style.css:               /*     Theme Name: WAMSA     Template: twentytwelve     version: 0.1     */          @import url("../twentytwelve/style.css");      In Appearance > Theme, the template is listed with error: > The following themes are installed but incomplete. Themes must have a > stylesheet and a template. > > Description: Template is missing. The codex says only a style.css file is required, which is what I have. I uninstalled and reinstalled TwentyTwelve theme, without a change. Why is my child theme not being recognised? **Update.** Here is what I am doing to generate this problem.   1. Twenty Twelve theme is installed.   2. I create a folder on my local computer, and create a style sheet style.css inside this folder.   3. I place the code above into style.css, then I FTP the folder I created up into /wp-content/themes.   4. When I go to Appearance > Themes, I receive the errors above. **Update2** If I upload this child theme to a different Wordpress installation, it does not become broken.


title: creating a second image attachment template?

text: Hi i am trying to create a second image attachment template. I have one, but I have created another. In the second one I want the attachments that are under a certain category of a post to have a different view from the rest. Here is what i have in the nomrmal photo attachment page to try to call the category               <?php          $post = $wp_query->post;          if ( in_category('4679') ) {          include(TEMPLATEPATH . '/bet-photo.php');           ?>      but the problem is, It's still showing the old attachment page and not the new one. What am i doing wrong.