title: Override file in parent theme

text: Presumably a common question, but I'm having some difficulty as it's my first time editing WordPress themes. I'm trying to create child theme based on Zincious. This is all fine for CSS, but when it comes to editing HTML, it doesn't work. I have the same file name and path as the original. Any idea what could be going wrong? All I'm trying to do for now is comment out / delete a div. Thanks very much.


title: Switch to blog and get content from that blog

text: Anyone thinks this should not work? I can't make it work for some reason.               add_action( 'wp_head', function() {         switch_to_blog( $blog_id );         wp_query( 'p=' . $post_id );     });      The point is that instead of displaying whatever page I am about to display, I choose content from a different blog instead.


title: use add_action('wp_head') in a widget

text:
Hi I cant seem to find an answer out there to solve my issue. what i am trying to do is fix this validation error 'Element link is missing required attribute property.' that is occurring because the style sheet isn't in the head. what i wanted to do was use the wp_head action to place it into the header but as soon as i add the code to the widget i have the javascript breaks completely so i dont know how to add a style to the head? this is the code i am using at the moment:               wp_register_script('piechart', get_template_directory_uri() . '/js/jquery.easypiechart.min.js', '', '2.0.4');                 wp_enqueue_script('piechart');                 wp_register_style('piechart-css', get_template_directory_uri() . '/css/jquery.easy-pie-chart.css');                 wp_enqueue_style('piechart-css');      what i am trying to do is get something like this: (this code is all in the widget function)               add_action('wp_head', 'pieChartScripts');                 function pieChartScripts() {                     wp_register_style('piechart-css', get_template_directory_uri() . '/css/jquery.easy-pie-chart.css');                     wp_enqueue_style('piechart-css');                 }      or i can write the whole link tag out etc but doing that would add it multiple times. EDIT: here is my widget function code:               public function widget( $args, $instance ) {             $title = apply_filters( 'widget_title', $instance['title'] );             $barOrPie = apply_filters( 'barOrPie', $instance['barOrPie'] );             $graphTitle = apply_filters( 'graph1_title', $instance['graph1_title'] );             $graphQuote = apply_filters( 'graph1_quote', $instance['graph1_quote'] );             $graph1Figure = apply_filters( 'graph1_figure', $instance['graph1_figure'] );             $graph1Colour = apply_filters( 'graph1_colour', $instance['graph1_colour'] );             $graph2Figure = apply_filters( 'graph2_figure', $instance['graph2_figure'] );             $graph2Colour = apply_filters( 'graph2_colour', $instance['graph2_colour'] );         ?>              <?php             $progressSlector = $args['widget_id'];                  echo $args['before_widget'];             if ( ! empty( $title ) ) {                 echo $args['before_title'] . $title . $args['after_title'];             }                  if($barOrPie == 'progressBar') { ?>                                   <?php                 echo '
';                 echo '

';                 if( !empty ($graph2Figure) )  {                     echo '

';                 ?>                                      <?php                 }                 echo '
';              } else {                 add_action('wp_head', 'pieChartScripts');                 function pieChartScripts() {                     wp_register_style('piechart-css', get_template_directory_uri() . '/css/jquery.easy-pie-chart.css');                     wp_enqueue_style('piechart-css');                 }                           wp_register_script('piechart', get_template_directory_uri() . '/js/jquery.easypiechart.min.js', '', '2.0.4');                 wp_enqueue_script('piechart');                           switch($graph1Colour) {                     case 'purple':                         $pieColor = '#78267B';                         break;                     case 'yellow':                         $pieColor = '#ffc000';                         break;                     case 'green':                         $pieColor = '#89bf3c';                         break;                     default:                         $pieColor = '#78267B';                 }                      echo '
' . $graph1Figure . '%
';                      if( !empty ($graph2Figure) )  {                     switch($graph2Colour) {                         case 'purple':                             $pieColor2 = '#78267B';                             break;                         case 'yellow':                             $pieColor2 = '#ffc000';                             break;                         case 'green':                             $pieColor2 = '#89bf3c';                             break;                         default:                             $pieColor2 = '#78267B';                     }                          echo '
' . $graph2Figure . '%
';                 }                 ?>                              <?php             }                  echo '
' . $graphTitle . '
';             echo '
"' . $graphQuote . '"
';                  echo $args['after_widget'];         }      Thanks for anyones help


title: Wordpress Rewrite: Ignore Specific Pattern

text: I want to make Wordpress Rewrite to ignore a specific pattern, here is what I mean: I have this lovely page               http://mysite.com/my-lovely-page      I want to ignore anything that contains the word "section" and comes after "my-lovely-page" to be ignored, for example this would be ignored:               http://mysite.com/my-lovely-page/section/about      By Ignored, I mean that Wordpress would return the same content as for "my- lovely-page". Is there a safe way to do it without directly modifying .htaccess ?


title: mysite.co.uk/wordpress redirects to mysite.co.uk?

text: I have seen many similar posts about similar problems, but they all seem to say delete the redirect plugin but the only plugin I have is google analytics. The site was working ok, but suddenly redirects to the main site if you enter or click a link to http://www.mysite.co.uk/wordpress it redirects to http://www.mysite.co.uk i can find no way to change this even with the .htaccess file any ideas?


title: Schedule a post without editing permissions

text: I want an user to schedule posts but I don't want the user to edit those. Is there a way to schedule draft or pending posts without the others editing permissions?


title: How wp_cache is supposed to work, and does it help with performance?

text: I was coding my recent comments widget, and using $wpdb->get_results and I wanted t use cache so it doesn't perform the query every time the page loads, so I used:               $comments = wp_cache_get('mycomments');     if ($comments == false) {         $query = //some sql stuff         $comments = $wpdb->get_results($query);         wp_cache_set('mycomments', $comments);     }     //then use $comments      and I used WP Cache Inspect plugin to check if it's working, I tried setting the $expire value in wp_cache_set in 2 ways '9999' and 9999 and deleted the cache between the 2 test but it doesn't seem to work for me, I commented on an article and it showed immediately in the recent comments so it seems that it's not caching the query for 9999 seconds, so is this how it's supposed to work or am I doing something wrong ? and thanks in advance. EDIT: I was checking the codex there's also Transients API but limited to 45 characters, so what's the difference between this and wp_cache ? this one seemd to store data in the database.


title: Captions for More Fields groups, not just individual fields

text: I'm using More Fields to create some meta boxes on my custom post type. Is it possible to have a caption for each "group" of fields in the More Fields options? I would like to provide some basic information on the post edit screen. I see you can enter a caption for each individual field but it would be handy to be able to give the group a caption also.


title: Custom admin_notices Messages Ignored During Redirects

text:
I have a error handling mechanism setup in one of my plugins to add notices and errors to the admin area, just like the core does. It works fine in most cases, but there are some situations (like saving a custom post type) where it doesn't. I'm guessing that a redirect is happening behind the scenes, and the messages are being printed before the redirect happens, so that they appear to never show up. So, I'm guessing this is what's happening   1. User edits a custom post type and hits Publish   2. My post_updated callback is called, which validates and saves the custom fields   3. The callback adds an error message   4. Wordpress does a redirect to a some page to do some processing   5. My admin_notices callback is called, which prints and clears the messages   6. Wordpress redirects back to the post   7. My admin_notices callback is called again, but there are no messages to print because they were printed in step #5 Under normal circumstances steps 4 and 5 don't happen, so everything works fine, but I think when Wordpress saves posts it introduces the extra redirect. Is something I can do to make sure this always works? I was thinking I might be able to check something inside printMessages() and return immediately if it's at step 4, but I'm not sure what. These two questions may shed some light on the problem, but don't fully give a solution: Add validation and error handling when saving custom fields?, How to display admin error notice if settings saved succesfully?. Here's the code:               /**      * Constructor      * @author Ian Dunn <redacted@mpangodev.com>      */     public function __construct()     {         // Initialize variables         $defaultOptions         = array( 'updates' => array(), 'errors' => array() );         $this->options          = array_merge( get_option( self::PREFIX . 'options', array() ), $defaultOptions );         $this->updatedOptions   = false;         $this->userMessageCount = array( 'updates' => 0, 'errors' => 0 );         // more              add_action( 'admin_notices',    array($this, 'printMessages') );         add_action( 'post_updated',     array($this, 'saveCustomFields') );              // does other stuff     }          /**      * Saves values of the the custom post type's extra fields      * @author Ian Dunn <redacted@mpangodev.com>      */     public function saveCustomFields()     {         // does stuff              if( true ) // if there was an error             $this->enqueueMessage( 'foo', 'error' );     }          /**      * Displays updates and errors      * @author Ian Dunn <redacted@mpangodev.com>      */     public function printMessages()     {         foreach( array('updates', 'errors') as $type )         {             if( $this->options[$type] && ( self::DEBUG_MODE || $this->userMessageCount[$type] ) )             {                 echo '
';                 foreach($this->options[$type] as $message)                     if( $message['mode'] == 'user' || self::DEBUG_MODE )                         echo '
'. $message['message'] .'
';                 echo '
';                      $this->options[$type] = array();                 $this->updatedOptions = true;                 $this->userMessageCount[$type] = 0;             }         }     }          /**      * Queues up a message to be displayed to the user      * @author Ian Dunn <redacted@mpangodev.com>      * @param string $message The text to show the user      * @param string $type 'update' for a success or notification message, or 'error' for an error message      * @param string $mode 'user' if it's intended for the user, or 'debug' if it's intended for the developer      */     protected function enqueueMessage($message, $type = 'update', $mode = 'user')     {         array_push($this->options[$type .'s'], array(             'message' => $message,             'type' => $type,             'mode' => $mode         ) );              if($mode == 'user')             $this->userMessageCount[$type . 's']++;              $this->updatedOptions = true;     }          /**      * Destructor      * Writes options to the database      * @author Ian Dunn <redacted@mpangodev.com>      */     public function __destruct()     {         if($this->updatedOptions)             update_option(self::PREFIX . 'options', $this->options);     }         * * * ~~**Update:** The updated code with the accepted answer has been committed to core.php in the plugin's trunk in case anyone wants to see a full working copy. The next stable release that will have it is 1.2.~~ **Update 2:** I've abstracted this functionality into a self-contained library that you can include in your plugin. Core is discussing including similar functionality in #11515.


title: How can I just get content inside a shortcode or just outside

text: Suppose I have content like               [xxx]     Here is some content in xxx      [/xxx]          Here is content outside xxx ...      Can I somehow just get   1. content inside `[xxx]` ONLY   2. content outside `[xxx]` ONLY


title: Custom Theme With Custom Loops

text: There are so many different questions on how to make pages show page numbers at the bottom but I can't seem to use the concepts explained in those to solve my own problem. I know some PHP and I've used Wordpress for a few years, but this (that seems like it should be simple) is way over my head. I'm currently working with a pre-made template called Zine. I have nearly everything else how I want it but this page number thing is killing me. I'll admit that I've found a few things here and there that are inefficient or wrong in the code and certain features don't actually work. Furthermore, the support over at the creator's site is sub-par and they usually just direct you to a vague Codex article. The front page of the blog I'm working on shows the latest posts but it refuses to show page numbers. This gets confusing because it calls to a different part of the template which in turn calls to another, different part of the template (I think). The page in question is Chainsaw Creative So, here we go. The static page shown as the index is here: http://pastebin.com/zxZg1ZWd It works just fine, but, as I said, there are no page numbers but the loop can be found somewhere else. I don't use the custom post-types in that page so the code `<?php get_template_part('last', 'all'); ?>` seems to call back to this loop:               <?php      global $theme;     $args = array(      'post_type' =>  bd_post_types() ,     'orderby' => 'post_date',     'posts_per_page' => 5     );          $loop = new WP_Query($args);         if($loop->have_posts()): while ($loop->have_posts()) : $loop->the_post(); ?>             <?php get_template_part('loop', 'all'); ?>         <?php endwhile; ?>         <?php endif; ?>      Which in turn seems to call back to this loop:                   <?php if(get_post_type( $post->ID )=='post'): ?>                  <?php get_template_part('loop', 'post'); ?>              <?php elseif(get_post_type( $post->ID )=='music-reviews'): ?>                  <?php get_template_part('loop', 'music-reviews'); ?>              <?php elseif(get_post_type( $post->ID )=='movie-reviews'): ?>              <?php get_template_part('loop', 'movie-reviews') ?>          <?php elseif(get_post_type( $post->ID )=='game-reviews'): ?>              <?php get_template_part('loop', 'game-reviews') ?>          <?php elseif(get_post_type( $post->ID )=='book-reviews'): ?>              <?php get_template_part('loop', 'book-reviews') ?>          <?php endif; ?>      I've tried all that I can to edit the loop that I posted in here, but I can't make it show page numbers. The most success I've had is changing `'posts_per_page'` to -1 and making it show all posts. I've tried adding the $paged variable among other things, but none of those seem to work. An example of what I'm trying to do can be found on an author page of the same blog. Hopefully that's a good enough explanation as to why the rest of the "Custom Template Pagination" posts haven't been helping me. I've also created custom page templates to show posts from specific categories only but I feel like solving this problem will solve that one as well.


title: Typical wp_kses $allowed

text: I have a custom post textbox that I want to sanitize using `wp_kses` before I update my post meta. I was looking for examples of common `$allowed` settings, but I have only seen this example:               $allowed = array(               'a' => array( // on allow a tags                   'href' => array() // and those anchors can only have href attribute               )           );        What is a typical `wp_kses` `$allowed` setting? Can someone provide an example of what they normally filter for?


title: Page only shows when user is logged in (even with visibility set to public)

text: I'm trying to troubleshoot an issue on a client's site. There is one specific page which appears as "not found" unless you log in and then visit the front end, in which case it appears normally. The visibility on the page is set to public, and in every other way it's a normal boring wordpress page. Stranger still, it only started happening recently (after months of trouble-free use). Problem page: http://www.leecamp.net/schedule/ Any ideas why this would happen?


title: Add 1 category more to If_in_category statement

text: **Hey everyone, a simple question.** # Question I need to add one more category: Events in the if statement along with News which is stated in the code. How can I add it? **_Thank You very much :)_** # Code               <?php if (in_category('News')) : ?>


title: Why is WordPress changing my HTML code

text:
I've been playing around with CSS and HTML code and I finally got to the point where the section I was working on works. I saved my CSS, and updated my post, and everything looked great, but when I returned to the post and switched from the HTML tab to the Visual tab WordPress altered/deleted my HTML code. I re-entered my HTML code in the post, saved it while still in HTML view and the post appears exactly the way I want it to look. My Post \- The Bobby Ore quote is what I was working on. I saved/updated while still in HTML view, so the code appears to work. Here's the HTML code that I entered into the HTML view of my post:
<quote class="open">&#8220</quote><quote class="font">Forget about style; worry about results.</quote><quote class="cite">~ Bobby Orr</quote><quote class="close">&#8221</quote>
      After switching to the Visual tab and back to the HTML tab, the HTML code now looks like this:
&#8220Forget about style; worry about results.~ Bobby Orr&#8221
      Help???


title: Hardcoding links to wp_nav_menu

text:
I am currently trying to add a some links to the end of my wp_nav_menu but am having a hard time with the callback function that creates the list of languages I want to insert. The first function is from a WPML plugin and works correctly anywhere else.               function lang_selector_links(){          $languages=icl_get_languages('skip_missing=0&orderby=code');              if(!empty ($languages)){                  foreach ($languages as $language){                 echo '
<a href="' . $language['url'] . '" title="' . $language['translated_name'] . '"'. $language['language_code']. '
';             }              } else {             echo 'no languages';         }     }           function my_lang_links( $items, $args ) {             $lang_list= lang_selector_links();                  $items .= '
' . $lang_list . '
';              return $items;     }     add_filter('wp_nav_menu_items','my_lang_links', 10, 2);      If I call `lang_selector_links()`in any other context it works as expected and outputs a list of supported languages but I can't seem to call it within the filter. **Edit: It turns out that it is outputting them only I was expecting the links to be part of the unordered list that contains the other menu items. Instead it adds them before.**


title: Why do I need to register my custom post type a second time when flushing rewrite rules?

text: If I register my custom post type when the `init` action fires (which is before plugin activation) why do I need to register my custom post type a second time when flushing rewrite rules (on plugin activation)? See the following example.               add_action( 'init', 'my_cpt_init' );     function my_cpt_init() {         register_post_type( ... );     }          function my_rewrite_flush() {         my_cpt_init();         flush_rewrite_rules();     }     register_activation_hook( __FILE__, 'my_rewrite_flush' );


title: add an image field to wordpress category

text:
i am trying to add an image field to the wp_term table in the database, I'll call it icon. I want that filed to contain a URL to an image that will be the thumb for the category. I have already added the field to the DB and I have also inserted it into the code in the admin panel :               <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
         <?php _ex(' Icon', 'Taxonomy Icon'); ?>	         <input name="icon" id="icon" type="text" value="<?php if ( isset( $tag->icon ) ) echo esc_attr($tag->icon); ?>" size="40" />
<?php _e('The “icon” is the URL to the category icon. if it is an uploaded image it will be http://'.$_SERVER['SERVER_NAME'].'/wp-content/uploads/{your_file.name}.'); ?>

     <?php endif; // is_taxonomy_hierarchical() ?>      the code shows the content from the database if it is preset but doesnt update it. what/where do i need to add so that it will also update the DB icon field? thank you.


title: Allowing users to edit only their page and nobody else's

text: We currently have about 50 pages, each of which I want a user (eg, bob, rob, smith) to be able to edit only 1 page. For example, bob & smith each have their own page. I do not want bob to be able to edit smith's page. I want bob to ONLY be able to edit bob's page. I don't care if he can see other pages. Looking through the user roles, I don't see a way to currently to do this- I only see how to allow restrict access on a global scale. Are their any plugins to help restrict edit access per user, or roles restricted to editing specific pages and I can just add 1 user per role? Or was there a way to do this with default settings I missed.


title: Change default options on attachment page

text: I'm currently adjusting someone's plugin, and they're pulling data from the attachment page. Rather than edit the whole plugin entirely, I'm after a quick fix. Is it possible to change the wording on the attachment page? I'm ideally trying to change the word 'caption' to the word 'buy' — but I'm unsure how to override the wording shown? Any help would be great. Cheers.


title: My galleries are messed up

text: I am running wp 3.9.1. I am using jetpack and using the carousel option. Lately, when I click on an image, the carousel does not work, the black background appears, but to see the image, I need to scroll down where it appears (the background disappears while scrolling so when the photo appears, it overlaps with the rest of the post) and sometimes the picture is of very low quality. The caption and "comments" space appears much lower. it does not make any sense. I asked my theme support for help and they could not fix it. They suggested I deactivate my plugins and reactivate them (especially digg digg). That did not seem to work. I cleared my cache and all, but the issue is still there! What can I do? Thank you!


title: Custom post type - permalink

text: Is it possible to change the permalink of a custom posttype? I have a custom post type called "events", I have made a page called archive- event.php and this is reached by /event.php is it possible to change this into something else? Like /foo.php?


title: subdirectory install breaking existing links

text: I've had this issue several times now. While building a site, including some content, I keep wordpress in a subdirectory (say, `/wordpress/`). When putting it live, I move/copy 3 files out of the dir into the root, in accordance with the WordPress specifications here http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre- existing_subdirectory_install It works, but all the links already entered in content refer to /wordpress/bla/bla and will, after the move, return 'file not found'. Also, links previously sent in emails and links already indexed by Google will return file not found. My question is: is this behaviour as designed, or am I doing something wrong ? Please note: my question is not how to fix it. It's easy enough to add some lines to the root .htaccess to say 'for every request inside `/wordpress/`, if it doesnt exist, remove the word `/wordpress/` and try again', so I'm surprised wordpress doesn't do that by itself - this makes me think I'm doing something wrong ... *-pike


title: Get Comment Author ID on the fly while posting

text: I am adding custom data to custom table while author posting a comment. Please find my code in my own answer here http://wordpress.stackexchange.com/a/85109/9821 Now I want to add one more column of 'author_ID' and not able to get the comment author id on the fly. Can anyone help me to get comment author id on the fly and insert into custom table column `author_ID` Thanks a lot


title: wordpress apply filters and is singular()

text: I'd like to know whether anybody has heard of , or created a workaround to the following problem: let's say there is a plugin which has code like this,               add_filter('the_content'.'some_func');     some_func($content)     {         if(is_singular())         {         //do something and return the content         }         else         {         //just return the content,dont modify it in any way.         }     }      now in my plugin there is code like this                   $doggy = apply_filters('the_content',$content)      but because the author of the earlier plugin has specified the is_singular, my $doggy WILL NOT get the content with the changes that the earlier plugin would have applied otherwise. As a result i wont be able to use the actual final content to do whatever i want in my plugin. Any help is appreciated, since i just read an article where the author says, "the is singular has been designed so that the filters apply only within the main WP query." So i have an additional question - as to whether there is any way to intercept this. I would like to use this apply filters action inside my code like this,               wp_insert_post_data($data,$postarr)     {     $data["post_content"] = apply_filters('the_content',$data["post_content"])     $data["post_content"] = my_func($data["post_content"]);     return $data;     }      and manipulate the story content, after applying all the filters that would be eventually applied to the content, and then returning the data. I hope i have explained things clearly. I need a workaround, since i dont think an official solution exists. AND-- doing what i need to do ---using--- save post or publish post is NOT AN OPTION FOR MY PURPOSE. Also i cannot do this on the_content filter. I NEED A SOLUTION THAT WORKS BEFORE THE POST DATA IS INSERTED INTO THE DATABASE. SO please do not suggest that. Best Regards, app_maniac.


title: How do I render a navigation menu like my theme does?

text: I am using the theme suffusion, and I'm trying to add a custom navigation menu to only one of my pages.   I've managed to get it almost working using this in my page template:               if(is_page('123')     {         wp_nav_menu( array( 'menu' => 'my-menu' ) );     }      Where `'123'` is the page id of the page that I want, and `'my-menu'` is the menu I want. The page is using the correct template. The correct items are generated with appropriate links, but they are rendered as an unordered list like so: >   * Item 1 >   * Item 2 >   * Item 3 >   * Item 4 > If I have the menu bar rendered by my theme (by placing it in one of the slots in the dashboard), it renders this menu horizontally as attractive-looking buttons. When I do it this way, it correctly only shows up on the page that I want, but is rendered as a vertical bulletted list. What do I need to change so that the menu is rendered as if done by the theme?


title: contact form 7 database short codes

text: I am using contact form 7. I have successfully added to my page, Now I want to export the database onto a separate page with short code. I have the following code, but it results in the following error. **\Code**               <?php     echo do_shortcode('[cfdb-html form="Contact form 1" show="Submitted,your-name"]${your-name}${your-email}${your-message}[/cfdb-html]');     ?>      **\Error**               Fatal error: Call to undefined function is_plugin_active() in /Users/anderskitson/Sites/fiftyfity/wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.php on line 654


title: Proper use of option_page_capability_{$page_name}

text: I am having trouble giving access to an options page to Editors. I am pretty sure I need to use the filter `option_page_capability_{$page_name}` but it is not working for me. Is there a specific place to hook this? I am still getting the `Cheatin', uh?` error with this:                   function bf_ins_capability(){             return 'edit_posts';         }              add_filter( 'option_page_capability_brightfire-insurance-settings', 'bf_ins_capability' );


title: JSON API similar plugin can't set custom fields

text: I'm trying to use a similar plugin to JSON API, called ScrollBlog. I'm using two custom fields, an external link and an author's name. JSON API parses them ok, but when I try to use ScrollBlog (coding is fairly identical), it doesn't. This is the code in the post.php model for custom fields:                 function set_custom_fields_value() {         global $json_api;         if ($json_api->include_value('custom_fields') &&             $json_api->query->custom_fields) {           $keys = explode(',', $json_api->query->custom_fields);           $wp_custom_fields = get_post_custom($this->id);           $this->custom_fields = new stdClass();           foreach ($keys as $key) {             if (isset($wp_custom_fields[$key])) {               $this->custom_fields->$key = $wp_custom_fields[$key];             }           }         } else {           unset($this->custom_fields);         }       }      Any clues to why it doesn't work? Also, I'm new to JSON so bare with me! Thank you! Update: If I use the code from JSON API's file, the website doesn't work anymore (turns blank).               function set_custom_fields_value() {              global $json_api;         if ($json_api->include_value('custom_fields')) {           $wp_custom_fields = get_post_custom($this->id);           $this->custom_fields = new stdClass();           if ($json_api->query->custom_fields) {             $keys = explode(',', $json_api->query->custom_fields);           }           foreach ($wp_custom_fields as $key => $value) {             if ($json_api->query->custom_fields) {               if (in_array($key, $keys)) {                 $this->custom_fields->$key = $wp_custom_fields[$key];               }             } else if (substr($key, 0, 1) != '_') {               $this->custom_fields->$key = $wp_custom_fields[$key];             }           }         } else {           unset($this->custom_fields);         }       }


title: Ipad app: Need uploaded images to go into "Gallery" as well as "Media Library"

text: When I upload an image on my desktop, the image is added to   * Media Library   * Gallery Media Library shows all images that have been uploaded to date, while Gallery only shows images which are associated with this Post. Using the Wordpress ipad app, however, the image **only appears in the Media Library**. Is there any way to get new images uploaded to appear in the **Gallery** as well as the **Media Library**? * * * I need this functionality because I have a function which creates a nice javascript gallery from the items in the **Gallery** , and the users of the site are not HTML-aware. * * * I would be happy to get answers that include a different blogging or image app that will do this for me.


title: Multiple jQuery conflict unsure of why

text:
I am trying to use the same image fader in two different spots on my testing site. ~~The one in the top banner works, and the one in the furthest right sidebar kind of works~~ They both now do not work. However I believe that the answer below is more or less on the right track and it is a Wordpress "quirk" that is at a fault and I just need a workaround. If I have a look at it in Chrome's developer tools, the css is transitioning properly. In the browser the first image fails to load, the second image does and then nothing. I have literally copied and pasted the code from the top of the page to the widget location in the side bar. I have tried copying and pasting both the jQuery and the CSS adding a 2 onto the end of all declarations to try and create a distinct function, but to no avail. Am I able to have two of the same jQuery function? **CSS**                     **PHP** _code is the same for both_

      **jQuery** _only called once_


title: Post and bbpress - link discuss on forum

text: i would like to have in every post a link to bbpress, for example: "Discuss it on Forum" But, how to link it up? Using tags, categories? I don't know how i can do it. Any idea?


title: How do I get standard posts to open up in their own template when using get_template_part()?

text: It seems to me that twentyelven opens standard single posts using the file `content-single.php` yet when I try the same code and files they open for me in `content.php` here's the code I have in index.php `<?php get_template_part( 'content', get_post_format() ); ?>` ... then I have two files `content.php` and `content-single.php` Standard posts are opening up in content.php not content-single.php How can I fix this?


title: Forcing SSL login, have to log in again from WP/BP-Admin Bar

text: I am forcing SSL login on a multisite install running BuddyPress, and after doing so I have to log in a second time when trying to access anywhere in the dashboard via the admin bar.


title: how to perform wordpress bulk actions using table inherited from wordpress list table

text:
In my plugin which shows a table of business listings from database, I wanted to add the option for bulk actions. Besides the checkboxes I displayed the control for bulk actions, but when I click Apply, nothing happens. How do I perform a bulk edit, delete anyway, since I've no idea if I'm even on the right track. this is my Listing table class constructor               function __construct() {          parent::__construct( array(         'singular'=> 'wp_list_text_link', //Singular label         'plural' => 'wp_list_test_links', //plural label, also this well be one of the table css class         'ajax'  => false //We won't support Ajax for this table         ) );      }      and display row function function display_rows() {               //Get the records registered in the prepare_items method     $records = $this->items;           list( $columns, $hidden ) = $this->get_column_info();                //print_r($records);     //Loop for each record     if(!empty($records)){foreach($records as $rec){              //Open the line         echo '
sr_no.'">';         foreach ( $columns as $column_name => $column_display_name ) {                  //Style attributes for each col             $class = "class='$column_name column-$column_name'";             $style = "";             if ( in_array( $column_name, $hidden ) ) $style = ' style="display:none;"';             $attributes = $class . $style;                  //edit link                            //Display the cell             switch ( $column_name ) {                     case "name":                                      echo ''.stripslashes($rec->name);                                        $actions = $this->get_bulk_actions();                                     echo $this->row_actions( $actions );                      echo '	';             break;                           case "cb": echo '<input type="checkbox" name="wp_list_text_link[]" value="%s">	'; break;                 case "name": echo ''.stripslashes($rec->name).'	'; break;                 case "address": echo ''.$rec->address.'	'; break;                 case "phone": echo ''.$rec->phone.'	'; break;                                 case "datestarted": echo ''.$rec->start_date.'	'; break;                 case "url": echo ''.$rec->url.'	'; break;             }         }              //Close the line         echo'
';     }}     }      so how bulk actions will be implemented in this code. get_bulk_actions()?


title: Checking for existence of a page by title?

text: I'm currently working on a plugin, and I essentially want to check if a certain page has been created. Essentially, I want to do something like this:                   if (file_exists($file)) {         $exists = true;     } else {         $exists = false;     }      But I just want to do it so that it checks, instead, for a post_name value. (If I was further able to ensure that the post was a _page_ and not just a post with that title, that would be great too.) How do I do this? I had been getting the script to grab the headers from the url of the post and if it returned a 404, to return $exists = false, but I've pinpointed a memory leak problem with that and I don't think it's very efficient.


title: Show the author's count of total amount of posts assign to a custom taxonomy term

text: I have assigned a custom taxonomy named `Highlight` to posts and I have added a term to it named `Featured`. Whenever I want to feature a post, I simply assign it to featured. To each author, I want to display their count of total amount of featured posts. So the function `the_author_posts()` will display count of total posts. I want to display count of total posts that were featured to the author. How can I do this?


title: Youtube parameters within WordPress embed code?

text: Ok, so I want to embed youtube videos but also remove the annoying annotations. The following code works great from to embed the video               [embed width="599" height="360"]youtube.com/watch?v=mNf0v2WkV0U [/embed]      But whatever I seem to do, I cannot add the following parameter: > >     iv_load_policy=3 >   Im not sure if its even possible to to add this within the wordpress embed code? I then found something intresting:               $('object').each(function(){          var $param = $(this).children(':first-child');          var newUrl = $param.attr('value') + '&iv_load_policy=3';          $param.attr('value', newUrl);      });      The above code is meant to set all youtube videos globally (`iv_load_policy=3`) but i think Im doing it wrong. Thanks in advance.


title: My tab title, link address and content don't match!

text: I have some issued regarding the address bar and the titles on my browser's tab. For example, just now, I visited one of my posts. The, I accessed the dashboard. The link changed correctly, but the title in my tab remained the title of the post. On other occasions, for example, if I edit a page, after I am done and I click "view page", the address bar won't show the link of the page, so that I can copy mysite.org/wp-admin/post.php?post=1500&action=edit (which is not a shareable" link if i may). I deactivated my plug-ins, I cleared my cache and so on. Nothing seems to be working! Thank you!


title: Getting 404 error on my wp rewrite error

text: **The code I'm using to rewrite urls with query vars:**               function add_query_vars($aVars) {         $aVars[] = "city";         $aVars[] = "address";         $aVars[] = "pg";         return $aVars;     }     // hook add_query_vars function into query_vars     add_filter('query_vars', 'add_query_vars');          function add_rewrite_rules($aRules) {         $aNewRules = array( 'listing/([a-zA-Z\-0-9]+)/([a-zA-Z\-0-9]+)$' => 'index.phppagename=listing&city=$matches[1]&address=$matches[2]',         '([a-zA-Z\-_]+)/pg/([0-9]+)$' => 'index.php?pagename=matches[1]&pg=$matches[2]');               $aRules = $aNewRules + $aRules;              return $aRules;     }     // hook add_rewrite_rules function into rewrite_rules_array     add_filter('rewrite_rules_array', 'add_rewrite_rules');      > >     listing/Tokyo/89465-this-is-address >   seems to work fine, but I get a `404` error as soon as I put `wordpress-page/pg/3` in the url I'm using the standard "pretty permalinks" option in wp settings. Can the wp query var: "`pagename`" be variable? Or is there something else wrong with my code? Thanks in advance!


title: Show recent posts from one category on a non-WP site

text: I'm trying to move back to WP for our blog, after struggling with a clunky CMS for a few years, but we'll be sticking with that CMS for the rest of the site. Is there a plugin (or code) that I can use to pull the recent posts in a particular category from my WP blog to the sidebar of my non-WP site? Assume full permissions on both the WP blog and the external site.


title: define orderby URL with meta_key=post_views_count

text: I want to make an url with meta_key=post_views_count. E.g: http://www.mysampleweb.com/?meta_key=post_views_count&orderby=meta_value&order=DESC So the posts should be ordered by Views. Views are counting in the backend - but the url doesn't work. Just orders after newest/oldest posts. How can I setup this query? Like it is above, it's not working. Do I have to put something into functions.php - a rewerite Rule? Thank you! AD


title: Creating links to a page displaying posts from a particular category

text:
Ok so at the moment I have a page which displays a list of categories within my Taxonomy (event-themes), here's the code:

By Theme

             <?php             //list custom portfolio categories             $taxonomy = 'event-themes';  // define portfolio categories from taxonomies in functions.php             $tax_terms = get_terms($taxonomy);                  foreach ($tax_terms as $tax_term) {             echo '

' . $tax_term->name.'
<a href="index.php?<?php get_the_category( $id ) ?>" rel="' . $tax_term->slug . '">Go';             }             ?>

      First of all, I am aware that the echo'd link does not work, and that is what I need help with. I'm trying to not only display all of the categories, but I also want each of them to **link to a page displaying the posts within that particular category**. I think I'm almost there with this code, as what I am trying to do is **insert the category ID within the href so that for each listed category it directs to the correct page**. Many thanks


title: Flushing rewrite rules

text: I'm using this function to add a custom end point to the WordPress urls               add_rewrite_endpoint('print', EP_ALL);      When the plug-in gets deactivated, I run this function               flush_rewrite_rules();      This flush the rewrite rules, and disable the 'print' end point. Fine. But I'm thinking of other plug-ins. What if other plug-ins have registered some rewrite rules. Will they be flushed too? If so, how can I preserve them as this will run their rewrite rules. And the same being for my plug-in. Do you have to re-register the rules everytime WordPress is called?


title: How do I create a section in the dashboard w/ an input field

text: I want to create an input field in the dashboard where I can put in links or text which will update a section I define on the actual website. I know I can just edit the template but I want to make things easier for the client. To be a bit more specific, I have a 'latest updates' section in the header and the client has requested that he'd like to update this manually. So I'd like to create an input box of some sort in the dashboard so he can easily enter text (or links), click save, and have it reflected on the website (in the header). Can someone give me a starting point?


title: Can I host wordpress separately on one hosting account?

text: I have a client who would like an auction site. I have decided to use Wordpress for this and found proper hosting and what not and thought I was set. Then the client asked if I could save time and money on their part by hosting this event site on their main site as well as their domain. IE: www.123.com/auction. The main site was not created by me and is not powered by WordPress. It is also hosted by some sort of "school community" website platform. Is it even possible, If I can access the file manager in the first place, to host a wordpress database and CMS separately on one hosting account for what is pretty much an entire different web page. Is this even practical?


title: E-commerce for wordpress

text: Is there an e-commerce solution for wordpress which will allow a shop with an onsite blog? If so, what are the options and is there generally one thats considered the 'best'?


title: Regex to Remove File Extension

text: I am using the Redirection plugin and I would like to use it to redirect my old static html pages to the new Wordpress pages. So basically anything that looks like http://www.example.com/page.html becomes http://www.example.com/page/ The only catch is that I want to exclude a folder so anything that is http://www.example.com/specialfolder/page.html shall remain untouched.


title: Using WP functions such as the_title() in an included php file

text: I'm including a php file in single.php, in the loop. Is it possible to use WP variables such as the_title(), the_date(), etc in the included php file?


title: How do post IDs work in WordPress?

text: So I have 2 blog posts so far and the first one has ID `8` and second one has ID `12`. How exactly does WordPress count those IDs? What if I want to change ID `8` and ID `12` to ID `1` and ID `2`? I have some knowledge about MySQL and I know that post IDs are related to the wp_posts table of the DataBase. How to edit the IDs? I have WordPress 3.9.2 and access to phpMyAdmin.


title: First Custom Post Custom Fields Empty After New Custom Post

text: I am working on a theme which contains a custom post type with custom fields. Everything is working perfectly except the when a new custom post is added, the custom fields for the first custom post and first one only are wiped.               function save_details(){           global $post;           update_post_meta($post->ID, "testimonyname", $_POST["testimonyname"]);     }       add_action('save_post', 'save_details');       This is what i am using to save the custom field data


title: Display last postings of 5 categories on homepage

text:
i have a question. I want to display on my homepage (template) the last postings of 5 categories as excerpts. Means excerpts from last article of cat.1, last article of cat.2 and so on, so i got then 5 articles (excerpts), each one from a differend category i.e. cat. 1-5.; How can i make this "simply"? EDIT: I did it so:               <?php     $args = array( 'posts_per_page' => 1, 'order'=> 'DESC', 'orderby' => 'post_date', 'category' => '5', );     $postslist = get_posts( $args );     foreach ($postslist as $post) :  setup_postdata($post); ?>

<a href="<?php echo get_page_link(149); ?>">my 1. category

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

              <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array( 120,120 ), array( 'class' => 'recent-thumbs' )); ?>
     <?php endforeach; ?>          <?php     $args = array( 'posts_per_page' => 1, 'order'=> 'DESC', 'orderby' => 'post_date', 'category' => '7', );     $postslist = get_posts( $args );     foreach ($postslist as $post) :  setup_postdata($post); ?>

<a href="<?php echo get_page_link(151); ?>">my 2. category

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

              <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array( 120,120 ), array( 'class' => 'recent-thumbs' )); ?>
     <?php endforeach; ?>      Dis example shows 2 excerpts of 2 cats, and i have to repeat it until i get my 5 articles. I thougt, maybe is there a better way. Thanks, and sorry for my "great" englisch, -Orwell


title: How can I remove fields in the attachment editor?

text: Is it possible to remove a default attachment field from the attachment editor, for example the "Caption" field ? To give you some context, I'm trying to build a custom attachment editor page. I found how to add custom fields, now I'd like to remove some of the default ones I don't need.


title: Loading a remote WP website to Netbeans

text: I have a Worpdress blog on a hosting company (it's remote and existing). I would like to load it to Netbeans. How do I do that? Thanks,


title: WP Subtitle Plugin Problem

text:
I'm having some problems getting the WP Subtitle plugin to work. After inserting the `<?thesubtitle()?>` or `<?getthe_subtitle($id)?>` into the index.php template I get a 'call to undefined function' error - inside or outside the loop doesn't seem to matter! Thanks in advance //Update In most pages the following now works thanks to toscho's updated syntax               <?php get_header(); ?>

<?php the_title(); ?>

<?php the_subtitle(); ?>

     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>      But no such joy in index.php where the following fails               <?php get_header(); ?>

<?php the_title(); ?>

<?php the_subtitle(); ?>

          <?php if (have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>


title: Post type hierarchy

text: I am looking to create two custom post types, one of which is a child of the other. Let's call them Authors and Books for simplicity. Authors should be a top level URL and the landing page for them should show a list of all their authored books. So you'd have something like: http://mysite.com/Shakespeare/ http://mysite.com/Shakespeare/Macbeth http://mysite.com/Shakespeare/Othello How do I create something like this in Wordpress? I am fine if it requires custom coding, just not sure how to express the relationship of post types to Wordpress.


title: Password protect a specific category page/post

text: I have searched high and low for this but nothing is sticking out at me. I am looking to password protect posts and/or pages based on a certain category. The reason for this is that I am creating a "members" side of things and want to keep things simple. If the post/page is in that category then users will enter a pre-defined password. I'd like to stay away from user/roles as i think it would be easier to change password every month and "members" being notified of such change rather than maintaining who's what. Hope someone can help me. If anything above doesn't make sense please comment :) Thanks in advance.


title: Efficient Tag Management?

text: I am the admin for a blog with around 20 authors contributing articles. Have just migrated from Wordpress.com. The problem that started to happen at WP.com, was different authors would use tags differently. i.e Some would pick just basic tags, others would list out every key word possible. It would appear that for WP roles, all the ones that allow people to submit posts, they can also tag their posts with as many tags as they want. So, my question is - **What is best practice for Tag Management for a blog that has multiple authors?**   \- I guess the answer to this could be subjective. But I really need experienced advice on this, and Wordpress-Answers is where I am going to find this.   \- Happy to convert to Community Wiki?


title: Is disabling test_form in wp_handle_upload a security concern?

text: I'm writing a plugin that modifies the default behavior when uploading a file for a post or to the media library. I'm setting $overrides in wp_handle_upload() with a custom $unique_filename_callback. Once I added that, it tripped the following check inside wp_handle_upload(), because $_POST['action'] wasn't set. (I'm not sure why it wasn't, but it wasn't).               if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )         return call_user_func($upload_error_handler, $file, __( 'Invalid form submission.' ));      So, I set $overrides['test_form'] = false, and now it's working. I'm wondering if that could be a potential security issue, though. Would that allow someone to post a form from a remote source or something? It seems like it's normal to disable it when you're creating your own upload fields, but I'm using the built-in post upload form, so I want to make sure.


title: Disallow Same Post Title

text: I am looking for some code where member can't use the same title as another post already having or used. e.g if there is a post with title "Amazing Australia Tour" than it should not allow to use the same title to same or other user.


title: Extending select_post type in Custom Meta Boxes for WordPress (HumanMade fork) to store both ID and Post Title

text: I'm trying to figure out how exactly to extend one of the existing fields in CMB (HumanMade fork). I'm not terribly familiar with this process, so I'm looking for a suggestion of where to begin. The type is `post_select`, which allows you to select from an existing post type to populate your options. It then stores the ID of that post in the named `meta_key` field. If it's repeatable, we just get multiple `meta_id`s associated with this post, each with the ID of the option selected. If the `multiple` argument is set to true, it instead serializes the selections for each field of this type. What I would like to do is extend this field type to store both the ID and the Post Title, most probably in a serialized array. This way Projects that people from the directory are assigned to will be returned in a search for their name on the front end (using Relevanssi to index my custom fields). Since it's just an ID that's stored right now, they aren't returned. Here's how I'm creating the metabox within a Projects CPT, with a Directory CPT as the select option:               function cmb_projects_metaboxes( array $meta_boxes ) {              $prefix = '_jra_project-';              $info_fields = array(             array(                 'id' => $prefix . 'principal-investigator',                 'name' => 'Principal Investigator(s)',                 'type' => 'post_select',                 'use_ajax' => true,                 'allow_none' => true,                 'query' => array(                     'post_type' => 'directory',                 ),                 'repeatable' => true,                 'cols' => 6,             ),         );              $meta_boxes[] = array(                 'title' => 'Basic Info',                 'pages' => 'projects',                 'fields' => $info_fields,         );              return $meta_boxes;     }     add_filter( 'cmb_meta_boxes', 'cmb_projects_metaboxes' );      I'm somewhat unfamiliar with OOP PHP, so I'm not precisely sure how to get where I want to be by writing an extension of the class. The current type is declared in classes.fields.php, starting at line 1062 My preference is to simply extend that field and change the data it returns/saves. Any thoughts or suggestions on how to do that?


title: Custom options - register, defaults and delete empty fields (Settings API)

text:
I cant figure out how to register all of my setting fields into 1 database option. Code for my menu page:               add_menu_page('Custom options', 'Custom Options', 'manage_options', 'rm_options', 'display_options_page');      then my main function to add and register section, fields etc.               function rm_register_custom_settings_fields() {         add_settings_section('rm_contact_info', 'Contact Info', 'rm_contact_info_callback', 'rm_options');              add_settings_field('rm_number', 'Number:', 'rm_input_fields_callback', 'rm_options', 'rm_contact_info', array('rm_number', 'Description'));         add_settings_field('rm_adress', 'Adress:', 'rm_input_fields_callback', 'rm_options', 'rm_contact_info', array('rm_adress', 'Description'));         add_settings_field('rm_about_us', 'About us:', 'rm_textarea_fields_callback', 'rm_options', 'rm_contact_info', array('rm_about_us', 'Description'));              register_setting('rm_options_group', 'rm_number', 'esc_attr');         register_setting('rm_options_group', 'rm_adress', 'esc_attr');         register_setting('rm_options_group', 'rm_about_us', 'esc_attr');     }      then im displaying the options like this:               function rm_display_options_page() { ?>

<?php echo 'Custom options for:' . wp_get_theme(); ?>

Description
                  <?php settings_errors(); ?>                  <form method="post" action="options.php">                 <?php                     settings_fields('rm_options_group');                     do_settings_sections('rm_options');                          submit_button();                 ?>             </form>
     <?php      What I want to do, instead of having 3 different options in the database and registering them separately, as it is now, I want to have them saved as an array, I tried doing something like:               register_setting('rm_options', 'rm_options', 'esc_attr');      but nothing worked, how can I do this? Basically instead of:               echo get_option('rm_number');      It will be:               $options = get_option('rm_options');     echo $options['rm_number'];      And also, how can I set defaults for the get_option? If the value is empty, I want to echo some default message. It should work with `get_option('rm_options', 'default');` but I noticed that even when the fields are empty, they are saved in the database, so this default will never work. How to make this work? And last thing, to get the default thing to work and to clean database, how can I delete options when there is nothing entered in the field? How to control this, when wordpress is updating and doing all the work by itself? I will be really grateful when someone can help me with this, please. Thanks in advance :)


title: How to edit/delete single row items in a table on my own menu page

text: I have successfully created a wp-LINKS-list-table that displays the output of WP's core "Links" table in the WP Dashboard, and I have it displaying on a menu page I created. Step 1 accomplished! But now I would like to be able to have the single row edit/delete (database) functionality just like the Links page. Right now I can edit/delete the links, but it's just adding/removing items from the actual links database table. I'm assuming that I not only have to create a different database table for my own queries, but I need to process my pages outside of the WordPress core as well. Right? Or is there a core WP functionality that I can use to edit/delete my own table items?


title: jQuery forms & updating info

text: I'm attempting add some ajax to an existing script, all goes well for the first submit, but subsequent ones are not working as expected.                 add_action('wp_head', 'my_special_action_javascript');     add_action('wp_ajax_my_special_action', 'my_special_action_callback');     add_action('wp_ajax_nopriv_my_special_action', 'my_special_action_callback');     add_action('wp_ajax_my_cart', 'my_cart_callback');     add_action('wp_ajax_nopriv_my_cart', 'my_cart_callback'); and prior to those I also have a `wp_enqueue_script('jquery');`               function my_special_action_javascript() {     ?>     <script type="text/javascript">     //<![CDATA[     jQuery(document).ready(function() {      jQuery(".addtocart").submit(function() {       var data = {action: 'my_special_action',post:jQuery(this).serialize() };       jQuery.post("<?php echo admin_url('admin-ajax.php'); ?>", data,       function(response){        jQuery(".eshopajax").replaceWith(response);       });       function upCart(){        var tdata = {action: 'my_cart'};        jQuery.post("<?php echo admin_url('admin-ajax.php'); ?>", tdata,        function(response){         jQuery(".ajaxcart").replaceWith(response);        });       }       setTimeout (upCart,500);       return false;      });     });     //]]>          </script>     <?php     } Notes:   .addtocart is the class of the form (and there are going to be occasions when there are multiple forms on a page.)   .eshopax is a section within the form where I am displaying the response (though really I should add this via the script as well).   .ajaxcart is the cart in the widgets which I am trying to auto update.   setTimeout - added to slow things down for updating the cart, to allow the first process to finish. Now as explained the above works as intended, **once**. But when I submit the form again, even with different values the display is no longer changed, yet the cart is updated (upCart) and no response text is visibly added. Additionally it doesn't appear to recognise changed form details. So how do I reset things for it to recognise possible new form details? Additionally I don't think the _jQuery.post_ in the upCart function is correct either (but it does work...). any help appreciated. (originally asked over on the WordPress support forums).


title: How to configure DNS If I use the plugin yet-another-multi-site-manager?

text: I just configured yet-another-multi-site-manager and I can able to use internal sub-domains like **1.domain.com and 2.domain.com** as alternate domains .I can able to create sub-sites on those domains successfully like **try.1.domain.com** . But Unfortunately when I set external domain(Primary domain Registered some where else) the sub-site's URL showing error page.. Example: **3.domain.com** is addon domain pointing to my multi-site installation folder .A sub-site created under it is **try.3.domain.com** .This sub-site's URL showing error page. Actually I am pointing that external domain pointing to Numeric IP(My hosting is shared hosting) address of my multisite domain.Later adding that domain as an addon pointing to my Multisite installation folder . Does any one have Idea on this?I think that I have wrongly configured the DNS of Addon domain . **Update:** Now I am able to create sub-sites using the additional domains .But the problem is when logging into the sub-sites created on these domains .The login pages are again redirecting to login form and the loop continues .I am even unable to edit the sites using the option "Backend" on admin panel . **Update 2:** The code inside the yamm-signup.php page and yet-another-multi- site-manager.php are not updated as per the updated new version 3.1 .The plugin is prepared for wpmu not updated for a long while .


title: How can I show the contents of only a few users

text: I'm trying to show the contents only for certain registered users. All users have the role of "agent". To hide the contents of an unregistered user, I use this code:               <?php if  ( current_user_can( 'agent' )  ){ ?>         ///here the content     <?php } ?>      Now I want to show the contents only for users with id 8,9, with this code:               <?php if  ( current_user_can( 'agent=8,9' )  ){ ?>         ///here the content     <?php } ?>`,`<?php if  ( current_user_can( 'author_name=Jacks,David' )  ){ ?>         ///here the contents     <?php } ?>      But nothing happens!!! Please help.


title: wordpress custom_meta ordering of timestamps

text: So I have a wp meta query that is handling the searching of events which have a start timestamp, and an end timestamp, I want to return all results within the two dates a user picks in the search. This part is working fine as of now. However, I want to sort the results by the start timestamp, so the most recent events show up first.               $args = array(         's' => $_GET['k'],         'post_type' => 'event',         'posts_per_page' => '-1',         'post_status' => array( 'private','publish' ),              'meta_key' =>'_start_ts',         'orderby' => 'meta_value_num',         'order' => 'asc',              'meta_query' => array(             'relation' => 'OR',             array(                 'key' => '_end_ts',                 'value' => array(strtotime($_GET['d1']),strtotime($_GET['d2'])),                 'compare' => 'BETWEEN',                 'type' => 'NUMERIC'             ),             array(                 'key' => '_start_ts',                 'value' => array(strtotime($_GET['d1']),strtotime($_GET['d2'])),                 'compare' => 'BETWEEN',                 'type' => 'NUMERIC'             )         )     );      If I seach for all events in the month of april, we get the following timestamp ordering: 1397865600, 1398211200, 1398384000, 1397520000, 1398297600 how do I get wordpress to sort by _start_ts?


title: wp_nav_menu google analytics event tracking

text: I've got a WP3 custom menu, with a custom link in the menu, How can I add google analytics event tracking to that custom link. Thanks Alex


title: Load Balanced WP with single server admin access

text: I am trying to complete my load-balanced installation of WP and I have come into an issue. I would like to sync the uploads folder between the two installs but I do not know how to limit wp-admin access to a single server. Can someone please help me? Thanks!


title: Call to undefined add_action() in theme's functions.php

text: Once done validating a form with ajax, I use php within my functions.php to actually send the form.               <?php     $name = $_POST['fname'];     $lname = $_POST['lname'];     $subject_line = $_POST['subject'];     $email = $_POST['email'];     $phone = $_POST['phone'];     $message = $_POST['message'];     $captcha = $_POST['captcha'];               if (!empty($name) && !empty($lname) && !empty($email) && !empty($phone) && !empty($subject_line) && !empty($message) ) {              $to = 'email@domain.com';         $from = $subject_line;         $subject = $subject_line;         $body1 = "First Name: " . $name .             "\nLast name: " . $lname .             "\nEmail: " . $email .             "\nPhone Number: " . $phone .             "\nMessage: " . $message;         if (mail($to, $subject, $body1, 'From: ' . $email)) {             print "Thank you, we will get back to you shortly.";         }     }      When I add in the php to the functions.php, I get the fatal error Call to undefined add_action() in the theme's functions.php. Any suggestions on what I'm missing?


title: spacing disappears on posts when importing

text: This is a random question, so I'll be lucky if there's an answer out there. I imported this wp site from another location, and for some reason, none of the posts show spacing between paragraphs anymore. If you look at any post, you'll see there is no space between each paragraph. In the actual post, on the backend, the spaces are all there. Each paragraph has a nice space between it. On the actual site, the spacing disappears. What gives? This is the case with all of her posts, so I'd be just delighted if there is some solution to the issue. it's at: www.travelwithcastle.com and it's a twentytwelve child theme Kelly


title: Remove Slug From Custom Post Type URL?

text: On www.webhostingbreak.com I have custom post types for web hosting companies. Their url is /hosting-directory/ and unfortunately, since then (aug2010), we've still got all those pages at PR0 and rankings overall have been terrible. The only guess I have is that because visiting /hosting-directory/ causes a 404 error, Google might not see pagerank flowing from the root domain to a subpage of hosting-directory. We want to remove /hosting-directory/ altogether. We tried doing that but we couldn't get normal posts in a category to work. Is there any workaround for this? Custom post types destroyed our rankings and pagerank since august 2010. Be well and talk soon.


title: Problem code and show comments

text: **I use this code in shortcode for show posts :**               <?php     while ($wp_query->have_posts()) : $wp_query->the_post();           $imagen = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), "medium");     $ruta_imagen = $imagen[0];     if ($ruta_imagen!="")     {     $ruta_img="ID)."'>";     }     echo $ruta_img;          endwhile;     ?>      This code works perfect inside the code for create the shortcode , but the problem it´s if i use the shortcode and put active the comments for ones post or page , the form and comments no show I don´t understand what have bada this code for no let show the comments , if i don´t use this shortcode the comments show other time and the form Please if you can tell me which it´s the problem perfect for me Thank´s , regards !


title: Remove duplicated values from a loop

text: I have a loop that outputs `<option>` fields for a `<select>` group. It contains many cities' names for many travel packs that I am publishing. The trick is that I need avoid repeated values. For instance: I have 4 travel packs departing from Chicago, 5 from Orlando, 3 from Los Angeles e 2 from New York. So, it outputs:   **Select your city**   Chicago   Chicago   Chicago   Chicago   Orlando   Orlando   Orlando   Orlando   Orlando   Los Angeles   Los Angeles   Los Angeles   New York   New York   I would need to print only one of them!               <select name="nDep" id="iDep" onchange="this.form.submit();">     <option selected disabled>Outras saídas disponíveis</option>       <?php         $args = array(           'post_type'     => 'packs',           'order'         => 'ASC'         );         $the_query = new WP_Query( $args );         if(have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();       ?>          <option value="<?php the_field('departures'); ?>"><?php the_field('departures'); ?></option>            <?php endwhile; endif; ?>     </select>


title: $wp_query when new WP_Query

text: I'm trying something but I have an issue with WP_Query. I've an Hook on the_post in order to add some variation on the query.               add_filter('the_posts', 'query_variation');          function query_variation($posts, $query = false) {         if (is_search())         {         // Do stuff         }     }      It's working well when I'm searching on the site. But, I know creating an ajax search like that :               function ajax_search_123( ){          $search_keyword = esc_attr($_REQUEST['query']);          $args = array(                 's'                     => $search_keyword),                 'post_type'             => 'product',                 'posts_per_page'        => 3,             );             $products_query = new WP_Query( $args );             // Do stuff with $product_query     }      But when I instanciate WP_Query with $args, is_search() doesn't return true so I'm entering on the if... What Can I do ? Thank you for your help


title: How to get first post in a category of a custom taxonomy

text:
I'm attempting to make a list of categories bound to a custom taxonomy, but using the featured image of the first post in each category. Getting the categories was simple enough, but when I try to query for the post thumbnail I keep being presented with the details form the most recent post in the first category fetched. I am running this outside The Loop, if that makes any difference;
         <?php                 $categories = get_terms(                     array(                         'produkter'                     ),                     array(                         'hide_empty' => false,                     )                 );                      foreach( $categories AS $cat )                 {                     $taxonomy = new WP_Query( array( 'posts_per_page' => 1, 'tax_query' => array( 'taxonomy' => 'produkter', 'terms' => $cat->slug ) ) );                     while ( $taxonomy->have_posts() )                     {                         $taxonomy->the_post();                     ?>

                                 <a href="<?php bloginfo( 'wpurl' ); ?>/produkt/">                                     <?php the_post_thumbnail( "product-small" ); ?>
                                  <a class="product-title" href="<?php bloginfo( 'wpurl' ); ?>/produkt/"><?php echo $cat->name ?>
                          <?php                     }                 }         ?>


title: My Server Has Problem With Class-Editor.Php / $buttons

text: My server has problems displaying the Visual and Text buttons, the code for the buttons is simply missing and none of the obvious solutions works. // blank default Install, no plugins, default theme // problem on entire server // not a wp-config.php issue /concenate scripts etc For some strange reason my server will not process `$buttons` and therefore the buttons are not visible. Any ideas what could be the issue? Is this a PHP configuration issue? I dont get any JS errors at all, so pretty much have no idea how to fix it, because there's simply code missing in the source.               if ( self::$this_quicktags && self::$this_tinymce ) {         $switch_class = 'html-active';              // 'html' and 'switch-html' are used for the "Text" editor tab.         if ( 'html' == wp_default_editor() ) {             add_filter('the_editor_content', 'wp_htmledit_pre');         } else {             add_filter('the_editor_content', 'wp_richedit_pre');             $switch_class = 'tmce-active';         }              $buttons .= '' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "\n";         $buttons .= '' . __('Visual') . "\n";     }


title: Add php function into .js file (for tinyMCE button)

text: I am creating a tinyMCE button for the wp WYSIWYG editor. Basically what happens is when a use clicks on the button a modal form pops up and they have to enter a few fields. However One of the fields needs to be a list box that lists every post category and the user will select one. The basic syntax for that is as follows:               {     type: 'listbox',      name: 'sds-category',      label: 'Category',      'values': [         {text: 'Name Of Cat', value: 'Cat ID'},         {text: 'Name Of Cat', value: 'Cat ID'},         {text: 'Name Of Cat', value: 'Cat ID'}]}      So in order to get all the categories displaying like that I have used a PHPfunction which will spit out that `{text: '', value: ''}` syntax for every category and it goes as follows:               function write_cat_list($cat){         $cats = get_categories('hide_empty=false&orderby=name&order=ASC&parent=' . $cat);              if($cats) :             foreach ($cats as $cat) :                 $tinyMCE_list[] = "{text: '".$cat->name."', value: '".$cat->term_id."'}";                 write_cat_list($cat->term_id);             endforeach;             echo implode(',', $tinyMCE_list);         endif;     }      So now all that is left is placing the PHP function `write_cat_list(0)` into my .js file, and that is where I am completely stuck! I am not sure how to go about doing this, because I am very very inexperienced with AJAX, is there an easy way or a jquery function that will make it easy to include my php function to this js file?


title: term_link filter gives less atributes

text: I have made a filter for term_link but when I work with it, I get message about not getting the second and third attr. Its a pitty, i need them               add_filter('term_link','authorsongsurl',10);          function authorsongsurl($url,$term='',$taxonomy=''){          }      Whats up?


title: Only output function from functions.php if conditional tag is true

text: I am using Masonry (included in WP 3.9) in my childe theme. I followed this tutorial. In their code for functions.php they use conditional statement:               if ( ! is_admin() ) :     function slug_scripts_masonry() {         wp_enqueue_script('masonry');         wp_enqueue_style('masonry’, get_template_directory_uri().'/css/’);     }     add_action( 'wp_enqueue_scripts', 'slug_scripts_masonry' );     endif; //! is_admin()      The ! is_admin seems to work, because when I look up the source, I can't find anything. However, my goal is to only let this function run when we are an a taxonomy page. However, changing it to:               if ( is_tax() ) :         function slug_scripts_masonry() {             wp_enqueue_script('masonry');             wp_enqueue_style('masonry’, get_template_directory_uri().'/css/’);         }         add_action( 'wp_enqueue_scripts', 'slug_scripts_masonry' );         endif;       does not work! It's including nowhere anymore! What am I doing wrong?


title: Is it possible to track down Actions and Filters?

text: As far as I know using Actions and Filters hooks is the best approach for developing on WordPress. I have just to ask if there is any way to track down which Actions and Filters are applied on WordPress rendering. My question is based on the fact that hooks may be applied by on WordPress through various plugins or the active theme itself. Is there any way to track down which Actions and Filters hooks are fired and from which file are they called?


title: New register email notification sending some fields blank on site admin emai id

text:
Working on real estate project.Here i am facing a problem with new email registration when user register with site admin getting some fields blank.i am using Group but plugin and also in back end under Group Buying Plugin > Account tab getting warning to city ,state colum like:               Warning: Illegal string offset 'city' in /home/reddvise/public_html/app/wp-content/plugins/group-buying/controllers/groupBuyingAccounts.class.php on line 299.       I am using word press version 3.4.1 with Group buying plugin Version 3.5.1 **Getting Email like below example:-** New user registration on your site Reddvise Real Estate: User Id: 243 Username: sanjay E-mail: sanjaynakate@gmail.com Mobile No. : Address : City : State : Pin Code : Country :               public static function column_display( $column_name, $id ) {             global $post;             $account = Group_Buying_Account::get_instance_by_id($id);                  if ( !$account )                  return; // return for that temp post                  $user = Group_Buying_Account::get_user_id_for_account($account->get_ID());             $user_data = get_userdata($user);             $address = $account->get_address();             switch ( $column_name ) {                 case 'id':                     echo $id;                     break;                      case 'username':                     echo get_avatar( $user_data->user_email, '35' );                     $get_name = $account->get_name();                     $name = ( strlen($get_name) <= 1  ) ? $post->post_title : $get_name;                     echo ''.$name.'
';                     break;                      case 'user':                     echo ''.$user_data->user_login.'';                     break;                      case 'state':                     echo $address['zone'];                          break;                      case 'city': //on this line getting a warning                      echo $address['city'];                     break;                      default:                     # code...                     break;             }         }


title: Enabling XSendFile causes 404 for images on Wordpress Multisite / Network

text: I've compiled and installed the `XSendFile` module and added the following lines to my `.htaccess`:               XSendFile On      It shows up as being activated in `<?php info() ?>` under loaded modules. The problem is, when I activate it in my site's top level wp-config.php using:               define('WPMU_SENDFILE', true);      All images on all the blogs in our network stop loading. When you try and click on them you get a 404 error for `wp-includes/ms-files.php` I figure this is something to do with my `.htaccess` not magicing the URLs correctly, but it looks correct to me:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) $1 [L]     RewriteRule ^(.*\.php)$ $1 [L]     RewriteRule . index.php [L]          XSendFile On      How can I get XSendFile to correctly send files on our Wordpress Network?


title: How to add a second content section when using certain page template

text: Is it possible to enable a second content area in the edit screen if a certain template is chosen? I have seen plugins like the second section plugin but that enables it for all pages I would like to only have the second section if a certain page template is chosen for a page.


title: Taxonomy Pagination

text: I have a `custom post_type => 'products'` wich has a `taxonomy => 'product_type'` and I have a page that uses a template to display all posts by `post_type => 'products'`. Works just fine when I create a PAGE for each post_type/taxonomy template but... I have for example a term named `"furniture" (taxonomy => 'product_type')`, and I don't want to create a page+template for each term that I'll be adding, it's crazy but seems to be the only way the pagination works on a static page. So, I can get the first page with the posts of the current term but in the second page forwards to search page and gives me an output with the number os posts (with that term) that I have, that number is correct but it doesn't display my posts!!! So I'm going crazy to figure out a way to make it work, god!! I have custom permalinks (only the postname)... I've seen almost all topics os taxonomy pagination, nothings works for me... I'm really desperate, please help...


title: Which file of wordpress manage plugins functionalities?

text: Which file of wordpress manage the plugins functionalities. For example if a have to insert another rule in a plugin functionality where i go to modify?


title: Wordpress Author Page

text: Whenever I click on the Author link, I get redirected to the home page. I've set up the author.php page according to the instruction on codex, but still no luck. Does anyone have any other suggestions?


title: Best practice for implementing a blog page / section in wp_menu_nav()

text: I currently have a theme I am developing and had a thought on best practice. I am using `wp_menu_nav()` for my menus and they are linking to 4 or 5 pages respectively. I would like to add a page / to this menu but do not want to add a specific template to list the blog posts, in addition I do not want the user going to edit a page called blog with no content in it. What is the best way to implement a page with all blog posts to the current `wp_menu_nav()`. This seems simple to me in theory but I want to make sure I am using best practice for this. Open to hearing how you would go about this. Thanks in advance, JN


title: Stop Wordpress from "guessing" redirects for nonexistent URLs

text: Wordpress sometimes "guesses" a redirection for a nonexistent page slug if the slug is at the beginning of another URL. After some searching, my hypothesis is that this part of the canonical redirection functionality, which can be disabled using this code:               remove_filter('template_redirect', 'redirect_canonical');       However, I like the idea of canonical redirection, and would prefer not to turn it off entirely. Is there a way to only disable the slug "guessing"? I would prefer a 404 over an incorrect 301.


title: Duplicate and alter sidebar for Twenty Eleven

text: I'm trying to create own template including submenu instead of the regular sidebar in Twenty Eleven. Although I manage to create and select my new template the page ends up with bad CSS. Here is what i have done   * Copy sidebar-page.php and named it submenu-page.php   * Copy sidebar.php and named it sidebar-submenu.php In **submenu-page.php** Added new template name " **Sidebar left menu template** " and changed               <?php get_sidebar(); ?>      to               <?php get_sidebar('submenu'); ?>      In In **sidebar-submenu.php** Replaced all code with Hello World-link. Even tough Hello World appears correctly the link is uncklickable due the div #primary is all over the page. For unknown reason the HTML-body gets both singular and two-columns as value in the class attribute. If I edit sidebar-page with get_sidebar('submenu') everything looks and works great. _**How do I tell wordpress that my template (submenu-page.php) is two columns and not both single and two columns?_** Thanks for your time!


title: New Roles and Capabilities in WordPress

text: I am creating a new role in WordPress, and I would like it to be simlar to an 'author' role, except that this new role only allows 'working with' a specific category (in other words, it allows editing, posting, deleting posts of a specific category only). Can that be done?


title: Show number of views in the last 48 hours

text: I have now the most popular views on the posts I have. But I want to show the most viewed in the last 48 hours. How can I achieve that? Someone helped me and I placed this in single.php file. $post_id = get_the_ID(); $post_view_count = get_post_meta($post_id, 'view_count', true);                   if( $post_view_count=='' ) {                                 update_post_meta($post_id, 'view_count', 1);                         }         else{                 $post_view_count = intval($post_view_count);                 ++$post_view_count;                 update_post_meta($post_id, 'view_count', $post_view_count);         }       And I have this in tabs4.php to show the 4 tabs on my website:               $args_popular = array (                 'posts_per_page'         => '5',                 'order'                  => 'DESC',                 'orderby'                => 'meta_value_num',                 'meta_key'               => 'view_count',                 'day'                    => '2',                 'cache_results'          => true,      But current day => 2 is not working. Thanks a lot.


title: Processing empty search TwentyTen

text: On my website when you submit an empty search box it takes you to a page that says nothing found however the navigation menu isn't displayed but it does when you enter a search term (whether it finds anything or not). How do I change it so that if a person submits an empty search it either doesn't do anything or takes them to a nothing found page with the navigation menu displayed. If I am correct it is loop.php that needs editing but I have tried different things based around my searches on the internet with no result please could someone help me with this problem? Thanks


title: A /proc folder in wp-content?

text: I inherited a WordPress site that a series of consultants built and who are all long-gone. As I grep'd to find where they defined a strange shortcode they keep using, grep dumped a sequence of errors as it tried to read files from `ABSPATH/wp-content/proc`. Comparing the contents and dates of `ABSPATH/wp-content/proc` to the real `/proc` on my server, I suspect somebody copied over the contents of their `/proc` during development (but why?). Before I delete it:   1. I want to be sure this isn't needed by WordPress for some weird situation I haven't ever encountered. Grepping through the files in the custom theme, I don't see any references to the directory. A few web searches also turned up nothing, so I think I'm safe here...but...   2. I am functionally literate with Linux but far from expert, so I hoped somebody could tell me how to check this rogue /proc directory to be sure deletion won't damage my operating system because of a link or reference or...something I don't know about yet.


title: Script dependencies for post.js

text: I have already got the built in meta boxes displaying on the front, but some of them require the accompanying `wp-admin/js/post.js` to function correctly. I'd rather not rewrite anything here and just include what is already written. The problem is there are variables in the file which must be declared somewhere else, `postboxes` for example. Does anybody know where in the core files this file and/or it's dependencies are defined? If anybody is wondering, this is part of a front end administration plugin.


title: Why does Jetpack insert it's script outside the <html> tag?

text: I went to validate my HTML with the W3C validator and I got this error: Line 463, Column 77: Stray start tag script.   …t src="http://stats.wordpress.com/e-201338.js" type="text/javascript"> This script is insterted by the Jetpack plug-in for the statistics, but it is inserted outside of the html tags, which ruins my validation!! Any ideas how to fix that? Thanks.


title: Change the Author name to a custom field?

text: In my wordpress backend, is there a way to change the author metabox to display a custom field instead of the user's display_name or username? For example, all our users have a custom field 'Organization' which shows their company name. I want this to be displayed in the Author dropdown box on the post.php page instead of the normal id or username. This is to make it easier for our client's web admins to find users(aka companies) faster when creating new posts. Possible? We used CIMY Extra User Fields for the additional fields. Any help would be great.


title: feed appearing different in the three main browsers

text: My blog feed appears diffenently in the three main browsers:   * in IExplorer it is perfect;    * in Chrome it appears as a xml file in source view   * in Firefox it appears like the result list from a search in the blog (first lines of the posts without any html formatting) Why?


title: Permissions question

text: Is there a plug in that allows User A to only see and edit their own post and User B to see all posts from all users like User A. We have tried a few plug ins without success. Thoughts?


title: Add custom post type taxonomy tag to article class

text: Ok, so I have tried about 5 different WP functions now and no luck. Basically here is what I want to do. I have a custom post type called "work", I have a taxonomy within this custom post type called "type" with 2 types available.. "Case Study" & "Portfolio". Depending on which option is checked off I would like that to print in the class of my container for that item and also be converted to lower case with spaces replaced by underscores.               <aside class="work_item <?php has_term('Portfolio', 'type'); ?>" data-type="<?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?>">      That is what I have now but no luck.. I have tried: has_term get_the_terms get_term and no luck... been looking at this so long now feel like I am missing something dumb Desired output:               <aside class="work_item case_study" data-type="<?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?>">      &               <aside class="work_item portfolio" data-type="<?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo str_replace('-','_',$tag->slug . ' '); } } ?>">      Thanks!


title: A good hook to check authorization and redirect?

text: It seems strange to put a redirect in a template page, because so much of the page has already been built by the time you reach a custom page template. I'm wondering what is a good action hook to use where I can test whether the user's logged in, and whether they're on a particular page/category/etc and `wp_redirect` them if necessary?


title: Is it possible to restrict a specific user to edit a specific custom post.

text: I have a site setup with a custom post for team member profiles, blog posts etc ... I am currently setting up user roles so that users can edit certain areas of the site. I currently use Adminimize to restrict user permissions by role, and it works fine. What I would like to do is to be able to restrict the appropriate user to only being able to edit the team member profile that relates to them (one single post within the custom posts of 'team members) or that they have permission to do so. I don't believe that this is possible through Adminimize as its done on a per role basis. Is anybody aware of a possible solution to this that they could recommend, if it is at all possible? Thanks in advance for any help Cheers Noel


title: Add Tags to custom post type

text: I'm using the cherry framework on a WP site. It comes with a custom post type that can be used to add 'Team Members' and create staff pages etc. I need to expand this so that I can add tags to each 'team member' inorder that I can essentially tag them as working in a department a / b / c / etc. The custom post type is registered in the theme-init.php file using this code;               /* Our Team */     function my_post_type_team() {     register_post_type( 'team',         array(             'label'               => theme_locals("our_team"),             'singular_label'      => theme_locals("our_team"),             '_builtin'            => false,             // 'exclude_from_search' => true, // Exclude from Search Results             'capability_type'     => 'page',             'public'              => true,             'show_ui'             => true,             'show_in_nav_menus'   => false,             'menu_position'       => 5,             'menu_icon'           => ( version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) ) ? 'dashicons-businessman' : '',             'rewrite'             => array(                                         'slug'       => 'team-view',                                         'with_front' => FALSE,                                     ),             'supports' => array(                             'title',                             'editor',                         'thumbnail',                         )         )     );     }     add_action('init', 'my_post_type_team');      I want to add tags to this, so that when I add a new team member, I can also assign them to a department by means of adding a given relevant tag. At present the tag editor box doesn't appear on the add new / edit page. So, I adapted the above code to include a register taxonomy like this;               /* Our Team */     function my_post_type_team() {     register_post_type( 'team',         array(             'label'               => theme_locals("our_team"),             'singular_label'      => theme_locals("our_team"),             '_builtin'            => false,             // 'exclude_from_search' => true, // Exclude from Search Results             'capability_type'     => 'page',             'public'              => true,             'show_ui'             => true,             'show_in_nav_menus'   => false,             'menu_position'       => 5,             'menu_icon'           => ( version_compare( $GLOBALS['wp_version'], '3.8', '>=' ) ) ? 'dashicons-businessman' : '',             'rewrite'             => array(                                         'slug'       => 'team-view',                                         'with_front' => FALSE,                                     ),             'supports' => array(                             'title',                             'editor',                         'thumbnail',                         )         )     );     register_taxonomy(         'team_tag',         'team',         array(             'hierarchical'  => false,             'label'         => theme_locals("tags"),             'singular_name' => theme_locals("tag"),             'rewrite'       => true,             'query_var'     => true         )     );     }     add_action('init', 'my_post_type_team');      However, I'm still not getting the tag box showing up on the edit page in admin. Any help with this will be greatly appreciated.


title: Wordpress email templates

text: I have a custom plugin which needs to send custom emails to users in specific cases. At the moment i have the email content embedded in within the plugin codebase which makes updating the text a little difficult since the plugin needs to be updated. I want to decouple the email content from the plugin but can't decide on the approach i should use. I could extend the existing plugin and allow the user to create a specific page for each email template. The user can update the content on the page as they like. The admin backend for the plugin would then map each email type to a the specific wordpress page. When i need to send a specific email, the plugin would get the specific page content and use that as the message parameter for wp_mail(). An alternative approach might be to use an existing off the shelf email editing plugin for this. What solutions have other developers used for this scenario?


title: Implications of changing wordpress.com associated with Jetpack

text: Our corporate blog has the Jetpack plugin and it is associated with my personal wordpress.com account. I'd like to change it to our corporate wordpress.com account. If I do that then will I lose the site statistics from before the switch?


title: Making WordPress available while logged into another website

text: A bit of a tricky one this and I'm not sure the best way to proceed or even if there is way to proceed. We have a self-hosted, secure, members-only website running off Oracle and IIS. Members sign up, get a username, password and PIN (via PIN mailer). They can then access this site and go about their business. Our model is to build simple stand alone brochure sites in WordPress hosted on a shared hosting plan that acts as a portal to this secure site. This model has worked fine for years as there has never been a need for overlap between the two. We have a customer asking that the WordPress site be locked down and accessible only via a username and password. We are trying to work out a way to allow access to the WP site if someone has logged into our secure site. Or to see if there is a way we can use the credentials from one on the other without need to recreate the user in WP. Heads are being banged off tables at this stage so I am throwing this one out to see if people better placed than us have a solution. I can provide any additional information that might be required. Thanks in advance. G