call wp_insert_user in custom class doesnt work

im creating a custom class to manage users in wordpress and chamilo but this is not the point. Class looks like this:               class Platform     {         private $security_key = '..';         private $secret_key;         private $firstname;         private $lastname;         private $status;         private $email;         private $login;         private $password;         private $encrypt_method = "md5";         private $original_user_id_name = "uid";         private $original_user_id_value;              public function __construct()         {             $arguments = func_get_args();             if(!empty($arguments))                 foreach($arguments[0] as $key => $property)                 if(property_exists($this, $key))                 $this->{$key} = $property;         }         /*          * Do autoryzacji z chamilo potrzeba IP clienta + auth_code.         * Z tych danych jest tworzyony API_KEY potrzeby podczas komunikacje z platformą.         * Funkcje sprawdzają akutalne IP oraz auth_code platformy i generują API_KEY         */         public function check_client_ip()         {             $ip = trim($_SERVER['REMOTE_ADDR']);             if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {                 list($ip1,$ip2) = split(',',$_SERVER['HTTP_X_FORWARDED_FOR']);                 $ip = trim($ip1);             }             return $ip;         }         public function generate_secret_key()         {             $ip_address = $this->check_client_ip();             $secret_key = sha1($ip_address.$this->security_key);             return $secret_key;         }         /*          * Dodawanie użytkownika w Chamilo         */         public function add_user_to_chamilo()         {             $params = array(                     'firstname'                 => $this->firstname,                     'lastname'                  => $this->lastname,                     'status'                    => '5', // 5 STUDENT - 1 TEACHER - zawsze ustawiamy na studenta - konta administracyjne będziemy tworzyć ręcznie                     'email'                     => $this->email,                     'loginname'                 => $this->login,                     'password'                  => $this->password, // encrypted using sha1                     'encrypt_method'            => 'md5',                     'language'                  => 'Polish',                     'official_code'             => '',                     'phone'                     => '',                     'expiration_date'           => '0000-00-00',                     'original_user_id_name'     => 'uid', // the extra user field that will be automatically created in the user profile see: main/admin/user_fields.php                     'original_user_id_value'    => $this->wp_user_id, // third party user id                     'secret_key'                => $this->generate_secret_key(),             );             echo "
";             print_r($params);             echo "
";                  //$client = new SoapClient('http://....pl/registration.soap.php?wsdl');             //$response = $client->WSCreateUserPasswordCrypted($params);         }         /*          * Dodawanie użytkownika w Wordpress         */         public function add_user_to_wordpress()         {             $params = array(                     'ID'                        => '',                     'first_name'                => $this->firstname,                     'last_name'                 => $this->lastname,                     'user_email'                => $this->email,                     'user_login'                => $this->login,                     'user_pass'                 => $this->password,                     'role'                      => 'subscriber'             );             echo "
";             print_r($params);             echo "
";             wp_insert_user($params);         }     }      This is how i initialize the class in wordpress page (page-adduser.php)               $p = new Platform(array(             'firstname'                 => 'John',             'lastname'                  => 'Doe',             'email'                     => 'test@example.com',             'login'                     => 'test',             'password'                  => 'somepass'                  )     );      Then i run public function add_user_to_wordpress               $p-> add_user_to_wordpress();      So it prints data from $params array but it seems this is not running wp_insert user. Data printed:               Array     (         [ID] =>          [first_name] => John         [last_name] => Doe         [user_email] => test@example.com         [user_login] => test         [user_pass] => somepass         [role] => subscriber     )      Can You tell me how to runn wordpress functions inside my custom class. BTW class i loaded to function.php file in theme as a first line.


How can I edit commit messages in my wp-hosted plugin repo?

I stupidly committed code with a commit message that doesn't make sense. I looked up how to edit commit messages for SVN repos and read this stackoverflow post, however, unfortunately it seems like I need to "have admin rights (directly or indirectly) to the repository to do this." I tried to follow the directions in the stackoverflow post, but got this message after attempting to edit my last commit message:               svn: E175002: DAV request failed; it's possible that the repository's pre-revprop-change hook either failed or is non-existent     svn: E175002: Error setting property log:     Repository has not been enabled to accept revision propchanges;     ask the administrator to create a pre-revprop-change hook      So- it obviously seems like the folks managing the WP plugin repos don't give plugin devs admin access to their repositories, so what's the best way to go about editing commit messages? Is there anyway to do this? Am I left with no other choice but to add another commit message saying "ignore the last one" (eep) ?


Getting settings saved two times in settings page with tab

I tried to show tabbed settings in admin settings page by a tutorial but for me am getting settings saved notification for two times. I think it is due to different settings field but based on selection of tab am showing only one form using the php condition. So there might be only one form with one `settings_fields()` but how it is showing settings saved two times when i save. i don't know any idea. can any body help on this. **Code**

Sandbox Theme Options
               <?php settings_errors(); ?>               <?php $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'd_options';  ?>
           <a href="?page=followshape&tab=d_options" class="nav-tab <?php echo $active_tab == 'd_options' ? 'nav-tab-active' : ''; ?>">Display           <a href="?page=followshape&tab=s_options" class="nav-tab <?php echo $active_tab == 's_options' ? 'nav-tab-active' : ''; ?>">Shape          <a href="?page=followshape&tab=Stat" class="nav-tab <?php echo $active_tab == 'Stat' ? 'nav-tab-active' : ''; ?>">Stat
                                <?php  if( $active_tab == 'd_options' ) { ?>             <form method="post" action="options.php">                   <?php                 settings_fields( 'shapet' );                   ?>
                 <input type="radio" name="shape" id="radio1" value="1"<?php checked(1,get_option('shape')); ?>/>                 <img src="<?php echo plugins_url(); ?>/slider/images/1.jpg">                      <input type="radio" id="radio2" name="shape" value="2"<?php checked(2,get_option('shape')); ?> />                 <img src="<?php echo plugins_url(); ?>/slider/images/2.jpg">                      <input type="radio" id="radio3" name="shape" value="3"<?php checked(3,get_option('shape')); ?> />                 <img src="<?php echo plugins_url(); ?>/slider/images/3.jpg">                      <input type="radio" id="radio4" name="shape" value="4"<?php checked(4,get_option('shape')); ?> />                 <img src="<?php echo plugins_url(); ?>/slider/images/4.jpg">                      <input type="radio" id="radio5" name="shape" value="5"<?php checked(5,get_option('shape')); ?> />                 <img src="<?php echo plugins_url(); ?>/slider/images/5.jpg">                 <input type="text" name="sh_color" value="<?php echo get_option('sh_color'); ?>" class="ir" />
                 <input type="submit" name="submit" />                  </form>                   <?php              } if($active_tab == 's_options') { ?>                <form method="post" action="options.php">                    <?php                 settings_fields( 'social' );                 for($i=1;$i<=8;$i++){                ?>                 <lable>Social Network<?php echo $i; ?> </lable><input type="text" name="sfsocial_net<?php echo $i; ?>" value="<?php echo get_option('sfsocial_net'.$i); ?>"/>                 <lable>Show </lable><input type="checkbox" name="sfsocial_net_show<?php echo $i; ?>" value="1"<?php checked(1,get_option('sfsocial_net_show'.$i)); ?> />                 <lable>Lable</lable><input type="text" name="sfsocial_lable<?php echo $i; ?>" value="<?php echo get_option('sfsocial_lable'.$i); ?>"/>
                      <?php  }                    ?>                  <input type="submit" name="submit" />                </form>                   <?php } if ($active_tab == 'Stat') { ?>                 <form method="post" action="options.php">                     <?php                 echo "graph";                 settings_fields('stat');?>                 <lable>facebook</lable><input type="text" name="facebookun" value="<?php echo get_option('facebookun'); ?>"/>                  <input type="submit" name="submit" />                  </form>             <?php             }?>
      **Tried After posting Question from @MrJustin advice** After i came to know i should use `add_settings_section` and `add_settings_field` apart from `register_setting` Here is the code i tried from another tutorial.               function registering_settings(){       register_setting( 'my-settings-group', 'my-setting' );         add_settings_section( 'section-one', 'Section One', 'section_one_callback', 'my-plugin' );         add_settings_field( 'field-one', 'Field One', 'field_one_callback', 'my-plugin', 'section-one' );     }     add_action('admin_init','registering_settings');          function callback_testing(){         ?>

Sandbox Theme Options
               <?php settings_errors(); ?>               <?php $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'd_options';  ?>
           <a href="?page=slug_testing&tab=d_options" class="nav-tab <?php echo $active_tab == 'd_options' ? 'nav-tab-active' : ''; ?>">Display Options           <a href="?page=slug_testing&tab=s_options" class="nav-tab <?php echo $active_tab == 's_options' ? 'nav-tab-active' : ''; ?>">Social Options          <a href="?page=slug_testing&tab=S" class="nav-tab <?php echo $active_tab == 'S' ? 'nav-tab-active' : ''; ?>">Statistics          <a href="?page=slug_testing&tab=new" class="nav-tab <?php echo $active_tab == 'new' ? 'nav-tab-active' : ''; ?>">New
                  <?php  if ($active_tab == 'new') { ?>                 <form action="options.php" method="POST">                 <?php settings_fields( 'my-settings-group' ); ?>                 <?php do_settings_sections( 'my-plugin' ); ?>                 <?php submit_button(); ?>             </form>                  <?php } ?>              <?php  if ($active_tab == 'd_options') { ?>                  <?php } ?>              <?php  if ($active_tab == 's_options') { ?>                  <?php } ?>
              <?php     }            function section_one_callback() {         echo 'Some help text goes here.';     }       function field_one_callback() {         $setting = esc_attr( get_option( 'my-setting' ) );         echo "<input type='text' name='my-setting' value='$setting' />";     }      Even after trying this i am getting settings saved two times. But there is only one form `section` with one `settings_fields` and only one form in total. Why it is showing settings saved two times when i hit save changes. **Edit**                 register_setting( 'my-plugin', 'my-setting' );         add_settings_section( 'section-one', 'Section One', 'section_one_callback', 'my-plugin' );         add_settings_field( 'field-one', 'Field One', 'field_one_callback', 'my-plugin', 'section-one' );                       <form method="post" action="options.php">       <?php  if($active_tab == 'new') {         settings_fields( 'my-plugin' );         do_settings_sections( 'my-plugin' );     } else if($active_tab == 'd_options') {          // Do D_Options     } else if($active_tab == 's_options') {         // Do S_Options     }      submit_button();     ?>       </form>


generating po mo translating files from scratch in a wordpress theme

Maybe I'm missing something here but I really can't find any answer to my question around the web. I am creating a new wordpress theme from scratch (literally from scratch) and would like to create languages folder with PO and MO file in it. **I would like to generate this translation MO file from scratch** I was looking for a good tutorial that will get me started and let me understand the whole procedure but all the good tutorials I found all talking about how to translate strings that are already exist.. meaning that a MO file exists already, the strings are already in it and I need to translate them.. that's pretty easy but that's not what I want. I would like to generate something from scratch using my own custom strings.. + I want to always be able to add more strings and compile it again to update the PO file. can anyone send a good tutorial of how o do it from scratch? am I missing something here? Thanks a lot


getpost content with all formatting for admin pages

All My post usually uses various plugin based data manipulations (Like visual layout, grouping, plugin css, etc) And now I want to render a post content in my admin page. On using following code:               $post  = get_post(123);     $content  = apply_filters('the_content', $post->post_content);     echo $content;      It just displaying a formated text content and I can't see my plugin based alignments, layouts which I usually can see it on normal post. So How to get post content for admin panel all formatted along with all plugin based manipulation done?


Unable to remove meta box from custom post for all non admin users

i am unable to remove plugin meta box from custom post for all non admin users. Here is the function of the plugin :                   function PreparePostPageOptions() {             global $WishListMemberInstance;             $post_types = array('post', 'page', 'attachment') + get_post_types(array('_builtin' => false));             foreach ($post_types AS $post_type) {                 if ($post_type == 'attachment')                     add_meta_box('wlm_attachment_metabox', __('WishList Member', 'wishlist-member'), array(&$WishListMemberInstance, 'AttachmentOptions'), $post_type);                 else                     add_meta_box('wlm_postpage_metabox', __('WishList Member', 'wishlist-member'), array(&$WishListMemberInstance, 'PostPageOptions'), $post_type);             }         }      This is the code I am using for the removal:                   if (is_admin()) :     function remove_wlm_metaboxes(){         if ( ! current_user_can( 'administrator' ) ) {               remove_meta_box( 'wlm_postpage_metabox', 'post', 'normal' );          }     }     add_action( 'admin_menu', 'remove_wlm_metaboxes', 9999 );     endif;


A link (not in the post) to download a specific PDF file

I want to add a button (or rather, a link formatted to look like a button) in the utilities area somewhere above the main navigation menu of a WordPress- based business site (that is, not in the body of a post or page). The purpose of the link is to enable the website visitors to download the company's annual report to their computers, either from media library, or from some other directory on the server. I found some information among earlier WordPress Answers, but still couldn't figure out the best way to do what I need to be done. Just to explain what I mean: I'm not asking how to place a link into a page. What I want to learn is how to force a file download onto a user's computer. Apparently, there are plugins that allow you to do that, but they all end up with a link in the body of the post. What I want is a link in the website's header. Would be grateful for assistance!


3 domains, 1 wordpress install, redirecting and changing domains on live site

**UPDATED & SIMPLIFIED:** I have one Wordpress install at Host #1 with a domain (Domain-A) at Host #2. Domain-A was used for the WP install. I have Domain-B & Domain-C at Host #3. I need Domain-B & Domain-C to now point to the Wordpress site at Host #1, and the original WP domain (Domain-A) to point to Domain-C. How would I handle the redirects and make the proper changes in Wordpress and/or the htaccess to make everything resolve properly?


static landing page leading to author specific pages w/ "live" content

My site has a static landing page with buttons to go to Cait's content or Shannons's content. Each author's page will feature their own posts, as well as a section with their social media streams. It is vital that these two author's content is kept separate. Currently, I'm using conditional tags in the header to take care of this but I've ended up with nothing but blank author pages. Any ideas how I can rectify? header.php-               <!DOCTYPE html>                   <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />         <meta name="generator" content="Wordpress <?php bloginfo('version'); ?>" />         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />         <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>         <link rel="pingback" href="<?php bloginfo('pingback url'); ?>" />         <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />         <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" />         <link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?>/favicon.ico" />         <?php wp_head(); ?>

outfit of the day

vlog

features

diy

contact

                 <?php                     if (is_author(cait barker)) {                     echo do_shortcode("[ix_show_latest_yt ytid='caitbarker' width='280' height='170' autoplay='off' count_of_videos='1']");                     }                     if (is_author(shannon barker)) {                     echo do_shortcode("[ix_show_latest_yt ytid='shannonbarkerr' width='280' height='170' autoplay='off' count_of_videos='1']");                     }                 ?>
vlog

                 <?php                     if (is_author(cait barker)) {                     $new_query = new WP_Query( 'cat=your_category_id&showposts=2' );                     if( $new_query->have_posts() ): while( $new_query->have_posts ): $new_query->the_post();                          the_post_thumbnail();                          endwhile;                     endif;                     wp_reset_query();                     ]                     if (is_author(shannon barker)) {                     $new_query = new WP_Query( 'cat=your_category_id&showposts=10' );                     if( $new_query->have_posts() ): while( $new_query->have_posts ): $new_query->the_post();                          the_post_thumbnail();                          endwhile;                     endif;                     wp_reset_query();                     ]                 ?>
outfit of the day

                 <?php                     if (is_author(cait barker)) {                     echo do_shortcode("[instapress userid='caitbarkerr' piccount='6' size='73px']");                     ]                     if (is_author(shannon barker)) {                     echo do_shortcode("[instapress userid='shannonbarkerr' piccount='6' size='73px']");                     ]                 ?>
instagram

      index.php-               <?php echo get_header();;?>     <?php         if (is_author(cait barker)) {         echo get_sidebar('cait');;         }         if (is_author(shannon barker)) {         echo get_sidebar('shannon');;         }     ?>

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

<?php the_title() ;?>
                                      <?php the_excerpt('read more...'); ?>                     <?php endwhile; else: ?>
Sorry, no posts to list
                          <?php endif; ?>
>> Posted on <?php the_date('M-d-y'); ?> >> <?php the_tags('tags: ', ', ', '
'); ?>

               <?php get_footer(); ?>


Add Stack Exchange Recent Questions to a wordpress sidebar?

So my question is what is the easiest way to go about scraping a Stack Exchange forum "recent questions" and display them in the side bar of a wordpress site?


!in_array doesnt recognize category

I want to fill an array with categories and tried to prevent duplicates with in_array:               if ( $query->have_posts() ) {         $categories = array();         while ( $query->have_posts() ) {             $query->the_post();             foreach((get_the_category()) as $category) {                 if(!in_array($category, $categories)) {                     $categories[] = $category;                 }             }         };     } ?>      But the categories are still counted twice (or more, depending on the amount of posts).


Blog guid link is re-directing to a 404 page

I have this link from the wp_posts table               http://domain.com/blog/?p=895      But when I put that link into a browser it redirects to               http://doamin.com/blog/title-of-my-blog-post/      It is using the post_name column in the database We had a Magento integration using Fishpig, so the original blog was in /wp/ but the frontend always referenced /blog/ - we now changed the blog to /blog


Add date under slider/grid featured content

I'd like to add post date under slider/grid text (which is category+Title) in my twenty fourteen wordpress child theme. Is it possible?


Can images be automatically compressed?

having trouble educating clients to compress their images, and would quite like wordpress to compress images to predefined size (normally, 800px long edge, 72dpi) and discard the original


Custom sidebar category listing?

I am trying to make a custom Category Display on my side bar and for that I need some way to get both, the category list and the child list in 2 different arrays or something alike... First, I tried the function `get_categories`, but it does not allow me to gather top-level categories only:               $args=array('orderby' => 'name', 'order' => 'ASC');     $categories=get_categories($args);      Then, I moved to `wp_list_categories` which does what I want. However, the return does not give me an array of data that I can query. It gives me a simple HTML-formatted list ready to print out:               $categories=wp_list_categories('echo=0&style=none&orderby=name&order=ASC&depth=1&title_li=');        * Is there a way to gather the top level categories list in a way I can personalize it as I wish ? For Example:              foreach($category_list as $category) {         echo '
';         echo '  cat_name ) . '" href="' . get_category_link($category->cat_ID) . '">' . $category->cat_name . ' (' . $category->cat_ID .') ';         echo '  ▼';         echo '
';     }      Why do I want the top-level only ? Because, I wanted to make a show/hide function for the children of the top-level category. If you have another way to accomplish this or suggestion, let me know.


Allow Author role to publish one post type and not another

I have two custom post types. One of them, I would like the author role to be able to publish. The other one, I would like for them to "Submit for Review". Any suggestions?


Make posts 410 dynamically

I have a site where posts get created and expired often. I want to add 410 status code to all posts that expire so that Search Engines remove them. I want to know if wordpress provides a provision to do this? or is this possible at all? Any suggestions how to achieve this would be very helpful. Thanks


Video shortcode inside tabs shorcode NOT working

I have the "video" shortcode and the "tabs" shortcode.               [video]code youtube[/video]          [tabs]     [tab title="text"][/tab]     [tab title="text"][/tab]     [/tabs]      If I write the video shortcode into a tab, the "video" shortcode doesn't work... How can I resolve?


Get categories list with category name in custom WP_List_Table class

Im building a plugin and i made custom wp_list_table class to suit my needs and display items with native wordpress look. The problem is that i can't get to list categories with categories names. I use data from database table and list of my categories in database is in comma separated list of categories id's so the data looks like               136, 8, 10, 11, 110      And when i output that on website i get list just like that comma separated ![categories list on my plugin](http://i.stack.imgur.com/QmTBK.png) But i want to display each category name instead of simple id like this so at the end i want to make it display like on wordpress post default list like this ![enter image description here](http://i.stack.imgur.com/F0tHY.png) It doesn't need to be clickable i just want to display category names on my custom class. Any idea how to achieve this? EDIT: Here is the whole class that i currently use               class custom_feeds_list_table extends WP_List_Table {     // declare constructor and give some basic params     function __construct() {         global $status, $page;         $message = null;         $type = null;              parent::__construct(array(             'singular' => 'custom-feed',             'plural' => 'custom-feeds',         ));     }          //List all columns that we want to display in table     function get_columns() {         $columns = array(             'cb' => '<input type="checkbox" />', //Render a checkbox instead of text             'feedname' => __('Feed Name', 'vt-translate'),             'provider' => __('Selected provider', 'vt-translate'),             'searchterm' => __('Searchterms', 'vt-translate'),             'numvideos' => __('Videos to pull', 'vt-translate'),             'post_category' => __('Categories', 'vt-translate'),             'feedstatus' => __('Status', 'vt-translate'),         );         return $columns;     }          //Select which columns are sortable     function get_sortable_columns() {         $sortable_columns = array(             'feedname' => array('feedname', true),             'provider' => array('provider', false),             'searchterm' => array('searchterm',false),             'numvideos' => array('numvideos',false),             'feedstatus' => array('feedstatus', false),         );         return $sortable_columns;     }          // Default column render is required     function column_default($item, $column_name) {         return $item[$column_name];     }          //Bulk action for delete      function get_bulk_actions() {         $actions = array(             'update' => 'Update',             'enable' => 'Enable',             'disable' => 'Disable',             'delete' => 'Delete'         );         return $actions;     }          //Process bulk action in database     function process_bulk_action() {         global $wpdb;         $custom_table = $wpdb->prefix . 'custom_feeds';              if ('enable' === $this->current_action()) {             $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();             if (is_array($ids)) $ids = implode(',', $ids);                  $this->type = 'updated';             $this->message = __('No feed selected to enable.', 'custom-feeds');                  if (!empty($ids)) {                 $wpdb->query("UPDATE $custom_table SET feedstatus = 1 WHERE id IN($ids)");                 $this->type = 'updated';                 $this->message = __('Selected feeds are enabled, your website will be updated with enabled feeds at scheduled time.', 'custom-feeds');             }         }         if ('disable' === $this->current_action()) {             $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();             if (is_array($ids)) $ids = implode(',', $ids);                  $this->type = 'updated';             $this->message = __('No feed selected to disable.', 'custom-feeds');                  if (!empty($ids)) {                 $wpdb->query("UPDATE $custom_table SET feedstatus = 0 WHERE id IN($ids)");                 $this->type = 'updated';                 $this->message = __('Selected feeds are disabled, your website will no longer get updates of disabled feeds.', 'custom-feeds');             }         }         if ('delete' === $this->current_action()) {             $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();             if (is_array($ids)) $ids = implode(',', $ids);                  $this->type = 'updated';             $this->message = __('No feed selected to delete.', 'custom-feeds');                  if (!empty($ids)) {                 $wpdb->query("DELETE FROM $custom_table WHERE id IN($ids)");                 $this->type = 'updated';                 $this->message = __('Selected feeds are deleted, your website will no longer get updates from deleted feeds. ', 'custom-feeds');             }         }     }          //Prepare items to show in list     function prepare_items() {         global $wpdb;         $evg_table = $wpdb->prefix . 'custom_feeds';              $per_page = $this->get_items_per_page('feeds_per_page', 20);         $current_page = $this->get_pagenum();              $columns = $this->get_columns();         $hidden = array();         $sortable = $this->get_sortable_columns();              // here we configure table headers, defined in our methods         $this->_column_headers = $this->get_column_info();              // process bulk action if any         $this->process_bulk_action();              // will be used in pagination settings         $total_items = $wpdb->get_var("SELECT COUNT(id) FROM $custom_table");              // prepare query params, as usual current page, order by and order direction         $paged = isset($_REQUEST['paged']) ? max(0, intval($_REQUEST['paged']) - 1) : 0;         $orderby = (isset($_REQUEST['orderby']) && in_array($_REQUEST['orderby'], array_keys($this->get_sortable_columns()))) ? $_REQUEST['orderby'] : 'id';         $order = (isset($_REQUEST['order']) && in_array($_REQUEST['order'], array('asc', 'desc'))) ? $_REQUEST['order'] : 'desc';              //Define item aray         $this->items = $wpdb->get_results($wpdb->prepare("SELECT * FROM $custom_table ORDER BY $orderby $order LIMIT %d OFFSET %d", $per_page, $paged), ARRAY_A);              // configure pagination         $this->set_pagination_args(array(             'total_items' => $total_items,             'per_page' => $per_page,             'total_pages' => ceil($total_items / $per_page)         ));     }          //Input checkbox for id     function column_cb($item) {         return sprintf(             '<input type="checkbox" name="id[]" value="%s" />',             $item['id']         );     }          //Display feed name column with buttons     function column_feedname($item) {         $actions = array(             'edit' => sprintf('%s', $item['id'], __('Edit', 'custom-feeds')),             'delete' => sprintf('%s', $_REQUEST['page'], $item['id'], __('Delete', 'custom-feeds')),         );              return sprintf('%s %s',             '' . $item['feedname'] . '',             $this->row_actions($actions)         );     }          //Display feed status column     function column_feedstatus($item) {         return sprintf(             ($item['feedstatus'] == true) ? '
Active
' : '
Inactive
'         );     }          //Display category column      function column_post_category($item) {         return sprintf(             $item['post_category']         );     }      } As you can see the category column function is at the end and i only use basic code                       return sprintf(             $item['post_category']         );      which will return raw data from the database, and that is only ID's of categories with comma separated numbers               136, 8, 10, 11, 110      I know if i use this in theme somewhere like this               $cats = $item['post_category'];      it will return               $cats = 136, 8, 10, 11, 110      than               $categories = get_categories( array('include' => $cats) );      and in the end               foreach($categories as $single_cat){        echo $single_cat->cat_name;     }      it will echo the name of every category. But that's not the case here, this doesn't work in wp_list_table class for some reason so im looking for some other solution. I also looked at wordpress wp_list_table class in included php file but couldn't find anything related to category.


Using Custom Field in Google Map Embed Code Works in One Theme, Not Another

I built a site using twenty twelve that is not on a live server yet, but which allows you to simply enter a street address into a custom field, and outputs a Google Map centered right on that address with a marker on the house number. It works exactly as I want it to. I did it by adding a custom field output to the iframe code:               <iframe width="300" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.ca/maps?center=<?php the_field('street_address'); ?>&q=<?php the_field('street_address'); ?>&zoom=14&size=300x300&output=embed&iwloc=near">
      Now I am trying to use this same code in another theme that I have developed using Wordpress and Bootstrap 3. It refuses to center properly or zoom properly. It gets sort of close, but that's useless, and it doesn't show a marker. I am assuming the problem has something to do with the fact that this is Bootstrap, but it would be helpful to me if someone could confirm that so that I can at least know I am not overlooking something obvious, and just as importantly so I can be sure my first site is not going to break for some reason because I didn't code it correctly after all. I am simply cutting and pasting the above code from my old theme to this current one. I am sure I am calling the custom field correctly.


Should everything in functions.php be hooked or filtered?

Considering how often functions.php is called, shouldn't all of its contents be hooked or filtered into core WP functions like init?


why is this query returning entire blog-posts

I have tow WP_Query loops running on a page. The first query displays the sticky posts and the second query is set according to meta_value. The trouble I am having is when there is no-sticky posts, the query seems to display all the available posts, which is definitely no what I need. I need it to display nothing found, if there are no posts found according to query.                $com_soon = array(                      'post_type' => 'post',                     'post__in' => get_option( 'sticky_posts'),                     'numberposts' => -1,                     'cat' => 2                     );                          $cs_profiles = new WP_Query($com_soon);                     if ($cs_profiles->have_posts()) :                     while ($cs_profiles->have_posts()) : $cs_profiles->the_post();?>                     //the loop here                      endwhile; else:                     echo 'NOTHING FOUND';                     endif;        I guess this is some wp fallback mechanism. Is there any way I could avoid this because the if-have-posts doesnot seem to work here.


Custom category link in wp_list_categories()

I simply want the link to be `/catname` instead of `/category/catname` for all the links listed using the `wp_list_categories()` function. Any ideas for this?


Accessing WordPress installation in its own directory at domain root

I am using this tutorial Giving WordPress Its Own Directory to launch a WordPress (installed in a sub folder called `wordpress`) by using example.com instead of example.com/wordpress. It says to copy `index.php` to your root folder and change the relative path to `wp-blog-header.php` accordingly. However, my folder structure is a little complex: ![Folder Structure](http://i.stack.imgur.com/UD6tE.png) To access site root I go to example.com. But to access WordPress I have to go to example.com/wordpress (if anyone wondering why I am using Bitnami WordPress stack AMI and thus everything came pre-configured) According to tutorial I should copy `index.php` to site root from WordPress root and change relative location of `wp-blog-header.php` accordingly. When index.php was in same directory the function was `require('./wp-blog- header.php')` . Now this location is to be changed I have tried all three options I could think of:   1. `../apps/wordpress/htdocs/wp-blog-header.php`   2. `./wordpress/htdocs/wp-blog-header.php`   3. `wordpress/htdocs/wp-blog-header.php` But visiting the domain root gives a server error. Any suggestions?


MU/Subdomains + Domain Mapping + SSL?

I use a wordpress multisite (subdomain setup + MU Domain Mapping). mainsite.com sub1.mainsite.com = sub1.net sub2.mainsite.com = sub2.net sub3.mainsite.com = sub3.com I want to use the ssl in one of the sites (main site or sub mapping domain) for fb apps. will have no problem with the seo? What SSL should I choose and what settings should I do to get it right?


How do I stop the loop from repeating in my category template?

For some reason, when viewing a category, the posts are repeated - basically the whole loop repeats as many times as there are posts for that category. **E.G.:**   If `category_a` has 3 posts, the page will display: post1 - Featured   post2   post3   post1 - Featured   post2   post3   post1 - Featured   post2   post3   If `category_a` has 4 posts it will display: post1 - Featured   post2   post3   post4   post1 - Featured   post2   post3   post4   post1 - Featured   post2   post3   post4   post1 - Featured   post2   post3   post4   I'm using the same post-template (`content-feed.php`) for the main blog page and for category pages. It works fine on the main blog page. _I'm not sure if it matters or has anything to do with this issue, but may be noteworthy: that in the loop I'm first pulling a "featured" post - and then the rest of the posts ("not-featured") below. Again - this works just fine on the main blog page, this issue is only on category pages._ Here is the entire post-template (`content-feed.php`):
          <?php while (have_posts()) : the_post(); ?>                  <?php                                $args = array(                    'posts_per_page' => 1,                    'post_type' => 'post',                    'order' => 'DESC',                     'category__in' => ($cat),                    'meta_query' => array(                        array(                          'key' => 'is_featured',                           'value' => '1', // only display the latest post marked featured, if there is one                       )                    )                 );                      $first_query = new WP_Query( $args );                 if ( $first_query->have_posts() ):                      echo '
';                         while( $first_query->have_posts() ) : $first_query->the_post();                              $attachment_id = get_field('image');                    $size = 'customfeatblg'; // (thumbnail, medium, large, full or custom size)                    $image = wp_get_attachment_image_src( $attachment_id, $size );                                  if( get_field('image') ):                                $thisimage = '';                                  $divclass = 'summary';                            else:                                $divclass = 'fullsummary';                            endif;                                  if( is_category() ):                                 $category = strip_tags( single_term_title('',false) );                               echo '
' . $category .'
';                            else:                                 $category = get_the_category();                               echo '
' . $category[0]->cat_name .'
';                            endif;             ?>                  <?php                 echo '                          ' . get_template_part('templates/social-shareing') .'
                                  ' . $thisimage .'

' . get_the_title() .'

' . get_the_date() .'

' . get_the_excerpt() . '…
                                 More ›

                               ';                     endwhile;             ?>                  <?php                 echo '

';                 endif;                 wp_reset_postdata(); // to reset the loop                            ?>
         <?php                            $args = array(                'posts_per_page' => 10,                'post_type' => 'post',                'category__in' => ($cat),                'meta_query' => array(                    array(                      'key' => 'is_featured',                       'value' => '1',                      'compare' => '!=', // only display posts not marked as featured - to prevent repeat from above                   )                )             );                  $second_query = new WP_Query( $args );             if ( $second_query->have_posts() ):                while( $second_query->have_posts() ) : $second_query->the_post();                     $titlechars = 45; // Character Limit                $posttitle = get_the_title();                $modtitle = substr($posttitle, 0, $titlechars);                     $contentchars = 120; // Character Limit                $postcontent = get_the_excerpt();                $modcontent = substr($postcontent, 0, $contentchars);                  echo '
';         ?>              <?php             if( get_field('image') ):                      $attachment_id = get_field('image');                 $size = 'customfeatins'; // (thumbnail, medium, large, full or custom size)                 $image = wp_get_attachment_image_src( $attachment_id, $size );                  echo '';         ?>              <?php else : ?>                  <?php echo '' ?>              <?php endif; ?>              <?php             echo '
' . $modtitle .'

' . get_the_date() .'

' . $modcontent . '… More ›

';         ?>              <?php                                           endwhile;             endif;             wp_reset_postdata(); // to reset the loop         ?>
          <?php/*
12345›
  */?>     <?php         global $wp_query;              $big = 999999999; // need an unlikely integer              echo paginate_links( array(             'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),             'format' => '?paged=%#%',             'current' => max( 1, get_query_var('paged') ),             'total' => $wp_query->max_num_pages         ) );     ?>
     <?php endwhile; ?>      And here is my `category.php` template:               <?php get_template_part('templates/nav', 'category'); ?>      <?php get_template_part('templates/content', 'feed'); ?>     <?php if (hchw_sidebar()) : ?>         <?php get_template_part('templates/sidebar', 'right'); ?>     <?php endif; ?>      I tried adding/moving `<?php wp_reset_query(); ?>` after `<?php endwhile; ?>` in `content-feed.php` but that didn't change anything. Any ideas on how to fix this or prevent it from happening? Thanks in advance for any help!


get link to custom taxonomy for one custom post type when multiple CPT share the taxonomy

post_type-1 and post_type-2 share the same custom taxonomy. How do I generate a link to a page which shows all posts of post_type-1 in that custom taxonomy? I figure that in the end it has to be the following link structure:               ?post_types=post_type-1&my-custom-taxonomy=taxonomy-term      Right? Can anyone assist?


Any plugin out there that uses WP's internal image uploader?

I'm trying to use the media uploader thing from WP (the form from the pop-up with crunching and all that), and can't figure out how. Is there any plugin out there that uses it? It would be easier to understand...


HTML Table creator in metabox to put into post theme

I'm looking for a funcionality of creating HTML Table in metabox in post- editing page to put into post theme with a shortcode or something similar?      http://alexrabe.de/wordpress-plugins/wp-table/ is almost perferc, but I need this table creator while post editing...      it could act similar to custom fields:      title1 | value1   title2 | value2   title3 | value3   etc..


Does the number of widgets installed affect website performance?

Does a website slow down or under perform in any way with a large number of widgets installed?


wordpress 3.0 json issue

im using the media finder plugin which works fine in 2.9 wordpress, but since the 3.0 wordpress, the json sans eval library which the plugin uses works no more. not sure what was involved in the upgrade from 2.9 to 3.0 core wise with json. here is a screenshot what firebug in firefox spits out, the actual json is parsed, but its not displayed. (media finder lets you search vid the media manager in your post) so since json eval sans is non validating, not sure if wp 3.0 doesnt like that. here is the url to the plugin http://wordpress.org/extend/plugins/media-finder/ here is the screen shot of the error in the plugin http://imgur.com/RFGXm.jpg anyone can assist would be a life saver, or even what is involved in converting the code from json sans eval to json2.js which wp is packed with now the code that would need to be converted to json2 would be the line xhr = $.post(ajaxurl, params, function(data) { data = jsonParse(data);


Subscribe2 widget with choosing categories?

Is it possible to specify the category people can choose to subscribe to in the Subscribe2 (Wordpress Plugin) widget?


Better way to exclude category output for post/pages?

I always assumed there was a way to exclude certain categories from being output in the loop using `get_the_category`, `the_category`, or one of the `term` related functions. After looking around it seems like the only way is to grab the array and just remove them by ID or name. For instance this is what I am using:               <?php // exclude category ID 12 as an example.                foreach((get_the_category()) as $cat) {             if (!($cat->cat_ID =='12'))              echo 'category_nicename . '/">'. ' | ' . $cat->cat_name . '';           }      ?>      This looks kinda messy due to having a somewhat "hard-coded url" using `/category/` ( I know I can also change this but it still seems counter intuitive).   Is there no better way to exclude categories?


How to make my front page display only the most recent sticky post, plus usual widgets?

WP 3.3.1, Suffusion 4.0.2 I am trying to figure out how to make my front page display only the most recent post marked sticky. I can't find how to do this in the documentation. What I'm trying to do is use a combination of future post publication dates and expirations (via the Atropos plugin) to control what shows up on my front page. Any suggestions? Is there a plugin that has a shortcode that lets me insert the most recent stick post?


BuddyPress/bbpress: There was an error when creating the topic

When trying to create a new topic in a BuddyPress installation with integrated bbpress, I keep getting the "There was an error when creating the topic" error message. I've tried the following list of suggestions I found around the Internet:   * uncheck/check "enable forums"   * delete group, recreate it   * chmod 755 all of buddypress   * re-setup bbpress in wp-admin   * delete from wp_bp_groups_groupmeta where meta_key='forum_id'; Of course I tried enabling WP_DEBUG and staring at the errors for a while, but that isn't very useful when BuddyPress and bbpress generate hundreds of errors on every page. WordPress 3.1.2, BuddyPress 1.2.8, bbpress 1.0.3.


Custom Post Type meta oembed html output resulting in WSoD

For a homepage template I'm trying to query a custom post type with a couple custom meta boxes. They are a title, oembed text field, and text area. I've compiled the below code from various sources as I piece together what I need for this homepage. The result on the front end is currently a blank white screen. The custom post type and metaboxes add/edit/save fine on their own. It's just when I have this homepage template code in there that it's blank. Any ideas?               <?php     /*     Template Name: Homepage     */          /*     @package _tk     */          get_header(); ?>          <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
              <?php $args = array( 'post_type' => 'films', 'posts_per_page' => 12 );               $the_query = new WP_Query( $args ); ?>              <?php if ( $the_query->have_posts() ) : ?>         <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>                      <?php /* Get the current post ID. */                         global $post;                         $post_id = $post->ID;                       /* If we have a post ID, proceed. */                         if ( !empty( $post_id ) ) { ?>
<?php the_title(); ?>

<?php echo wp_oembed_get( esc_html( get_post_meta( $post_id, $prefix . 'film_embed', true ) ) ); ?>
                                  <?php if ( get_post_meta( $post_id, $prefix . 'film_textarea', true ) ) : ?>

<?php echo get_post_meta( $post_id, $prefix . 'film_textarea', true ); ?>

                             <?php endif; ?>                                  <?php wp_reset_postdata(); ?>                              <?php } else { ?>
<?php _e( 'Sorry, no posts matched your criteria.' ); ?>
                              <?php } ?>               <?php wp_link_pages( array(                 'before' => '
' . __( 'Pages:', '_tk' ),                 'after'  => '
',             ) ); ?>          <?php endwhile; ?>
     <?php edit_post_link( __( 'Edit', '_tk' ), '', '' ); ?>
          <?php wp_reset_query(); ?>     <?php get_footer(); ?>      The error message I get from WP_DEBUG is: _Parse error: syntax error, unexpected end of file in /myhost/test/wp- content/themes/ianrigby/homepage.php on line 54_


Customize Admin Users Screen based on Role

I've added a role of "Customer" and I am working on customizing the Users Screen for that role. What I'd like to do is customize columns based on that particular role. **Note:** For example, take a look at the screenshot. How would I remove the reference to the posts column for _only_ the customer role? ![Example of current "Customer" screen](http://i.stack.imgur.com/RhSGH.png)


Reslug a Custom Post Type

I built a plugin for wordpress with custom post types and somewhere along the line I realized that I had to rebuild the way slugs are generated. Originally, I had the cpt making default slugs like new-post-1, new-post-2, etc. I realized this was silly and rewrote the naming convention to create a slug from the post title like it should be. The only issue I have now is that I want to have all the old posts I entered into wordpress use the new naming convention. Is there a function or a way to tell wordpress to rebuild/regenerate the slugs for a particular custom post type. I found this plugin: http://wordpress.org/plugins/re-slug/ But.. it does not work for cpts Thanks for the help.


Sizing textarea field in custom metabox

Here's the code for a custom metabox. Very simply, how would I resize the textarea box? I'd like to add an expression such as cols="50" rows="5".               // Echo out the field         echo '
Enter the location:
';     echo '
<input type="textarea" name="_location" value="' . $location  . '" class="widefat" />
';         echo '
How Should People Dress?
';         echo '<input type="textarea" name="_dresscode" value="' . $dresscode  . '" class="widefat" />';      (Source: http://wptheming.com/2010/08/custom-metabox-for-post-type/) Thanks.


Hacking TinyMCE for better usability (shortcodes and html)

I'm looking for some theme or plugin examples that showcase ways in which to enhance the usability of editing shortcodes and/or custom html objects that have been inserted into the editor. I know that its possible to apply runtime styles to elements (nextpage and image rollovers are a couple examples) and I'm looking for some examples of scripts that seek to extend this to other elements (custom classed divs for example). I've never seen an example of shortcode editing that went beyond the basic bracket+properties+content. Ideally, I'd like to see an example where someone has abstracted shortcodes into their html equivalent, with rollover and right click events to modify element attrributes. Just looking for any examples of work in this field.


What is the simplest ajax upload plugin or script to be used with wordpress?

I'm trying to use image upload in my theme's options page and haven't found yet a simple ajax upload script with many tutorials or a good documentation, I just want a simple straightforward script so I just edit the file path and couple other stuff, and of course that works with many uploaders on the page. I tried plupload but it's complicated for me because I don't know anything about javascript, just a little jQuery understanding. So are there any simple ajax uploaders with a good tutorial about it?


Can I explicitly specify ENGINE=InnoDB in Wordpress?

I converted all my tables to InnoDB, but the MySQL server (which I can't access, as I'm on shared hosting) has MyISAM as the default, so every new table that Wordpress creates (e.g. when I add a new site on my multisite) uses the MyISAM engine and I have to alter it manually. Can I somehow set Wordpress up to enforce the InnoDB engine when creating new tables? I know that by default Wordpress doesn't specify anything and lets the table use the default engine, but I'm wondering if there is some plugin where I could add the               ENGINE=InnoDB      clause to all the `CREATE TABLE` queries.


Wordpress Plugin Shortcode Help

I am trying my best to get rid of this pain when creating a Chart Plugin. I have registered custom post type to add every single chart with specific meta boxes. Everything works fine except the Datasets below.               datasets : [         {             fillColor : "'.$datasetfillcolor1.'",             strokeColor : "'.$datasetstrokecolor1.'",             data : ['.$datasetdata1.']         },         {             fillColor : "'.$datasetfillcolor2.'",             strokeColor : "'.$datasetstrokecolor2.'",             data : ['.$datasetdata2.']         },     ]      I want to let my users create new datasets when they want, also the data sets should have a default parameter values when that aren't filled. My shortcode looks like this:               `/* Register Shortcodes  */          add_action( 'init', 'register_chart_shortcodes');     function register_chart_shortcodes(){        add_shortcode('chart', 'chart_function');     }          /* Chart Shortcode */          function chart_function($atts, $content = null) {             extract(shortcode_atts(array(           'id' => '',        ), $atts));              $chart_type = get_post_meta($id, 'chart_type', true);         $height = get_post_meta($id, 'height', true);         $width = get_post_meta($id, 'width', true);         $labels = get_post_meta($id, 'labels', true);         $datasetfillcolor1 = get_post_meta($id, 'datasetfillcolor1', true);         $datasetfillcolor2 = get_post_meta($id, 'datasetfillcolor2', true);         $datasetstrokecolor1 = get_post_meta($id, 'datasetstrokecolor1', true);         $datasetstrokecolor2 = get_post_meta($id, 'datasetstrokecolor2', true);         $datasetdata1 = get_post_meta($id, 'datasetdata1', true);         $datasetdata2 = get_post_meta($id, 'datasetdata2', true);             $return_string = '<canvas id="wpcp_'.$id.'" height="'.$height.'" width="'.$width.'"></canvas>              <script>                  var barChartData'.$id.' = {                 labels : ['.$labels.'],                 datasets : [                     {                         fillColor : "'.$datasetfillcolor1.'",                         strokeColor : "'.$datasetstrokecolor1.'",                         data : ['.$datasetdata1.']                     },                     {                         fillColor : "'.$datasetfillcolor2.'",                         strokeColor : "'.$datasetstrokecolor2.'",                         data : ['.$datasetdata2.']                     },                 ]                  }              var myLine = new Chart(document.getElementById("wpcp_'.$id.'").getContext("2d")). '.$chart_type.'(barChartData'.$id.');          </script>';             return $return_string;     }      ` So my question is how can I let my users add datasets dynamically right from meta boxes of the post? So they can add as many datasets as they want. Also, how can I set default fillcolor, strokecolor, & data value in shortcode when users haven't defined them? Thanks


Custom Taxonomy Children in Dropdown

Someone publish this code. It works perfect. The issue is that no link when I select a sub-category. Also would be good when I'm in the taxonomy-page cat.php watching a child category. The drop down is not visible.                //first get the current term      $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );     //then set the args for wp_dropdown_categories      $args = array(         'child_of' => $current_term->term_id,         'taxonomy' => $current_term->taxonomy,         );       wp_dropdown_categories( $args );      I've reached a new code that works well. But missing the option to "Show All" with a valid link.:               <?php $term = get_queried_object();     $children = get_terms( $term->taxonomy, array(     'parent'    => $term->term_id,     'hide_empty' => false     ) ); ?>          <!-- If category is parent, list it -->          <?php if($children) { ?>          <?php          //first get the current term     $current_term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );          //then set the args for wp_dropdown_categories          $orderby = 'name';            $args = array(     'child_of' => $current_term->term_id,     'taxonomy' => $current_term->taxonomy,     'hide_empty' => 1,     'hierarchical' => true,     'depth'  => 2,     'title_li' => '',     'orderby'=> $orderby,     'show_option_all' => 'Show All',     );          ?>          <form action="<?php bloginfo('url'); ?>" method="get">          <div>          <?php $cats = get_categories($args); ?>          <select id="categories">          <option value="all">Show all</option>          <?php foreach ($cats as $cat) : ?>          <option value="<?php echo get_term_link($cat, $cat->taxonomy) ?>"><?php echo $cat->name  ?></option>          <?php endforeach; ?>          </select>          </div>          </form>          <script>          jQuery(document).ready(function()          {     jQuery('#categories').change(function()          {     window.location = jQuery(this).val();          });          });          </script>          <?php } ?>


How to start learning CSS and theme development?

What would be your suggestions for learning CSS and WordPress theme development ? I have been using WordPress for over 4 years now, but I have never really gotten comfortable with CSS or theme design (I could tweak it here and there, but that's not really doing much). I would love to be able to do these, but don't know where to start. Most guides I came across are not WP specific, and I fear I'd go through redundant material. Thanks


How to add authors contact info to author metabox in post editor?

By default the Author Metabox on the post editor displays only a drop down to set the author of that respective post/page. I'd like the author's contact info (email address) displayed on the Author metabox as well (only in the post/page editor, not on the front-end). Currently I have to go to my Users and search for the author of the post to view their contact info, which isn't very efficient. Is there a tutorial or snippet to achieve this? I have not been able to find anything thus far. Any advice is greatly appreciated!


Retrieving $_POST variables on WordPress

How do you retrieve a `$_POST` in inside the options page? I'm currently trying to save some `$_POST` variables I got from the options page, and save it inside my custom table for the WordPress plugin. However, it won't save. Here's the code               public static function save_poll(){         $plugin_id = ID;         global $_POST;         if($_POST)             if($_POST[$plugin_id."_action_taken"])                 self::add_poll($_POST[$plugin_id."_category"], $_POST[$plugin_id."_politician"], $question);     }                public static function add_poll($cat_id, $politician_id, $question, $answers = ""){        global $wpdb;         $wpdb->insert(          a14_POLL_QUESTIONS,          array(              'category_id' => $ca_id,              'tag_id'        => $politician_id,             'question'  => $question         ));              return $wpdb->insert_id;       }      I also tried hooking it up to the `'admin_init'` though it still won't budge.. I was trying to look at the internet for hours yet, to no avail. Is there any special way that we could access some `$_POST` variables? I am truly sure that these variables wont be registered since I used a unuique ID for it.


Load loop images on click / defer image loading until click or other event

I have a loop of some images (custom post type) that are in a tiny slideshow. There are about 30 of them. When the user clicks the tiny slideshow, it pulls up a fancy-box gallery that is populated by a loop of the large images. The problem is that I don't want to load 30 large images, if no one ever even clicks the slideshow, and especially on a phone, where that option doesn't even exist. What is the best way for me to load that .php loop of the big images, only after the user had clicked the slideshow with jQuery? I can load simple html strings, but having trouble with a whole chunk of PHP and routing image paths. I've played with `.load()` and `.html()`               $('button').on('click',  function() {         $('#insertion-point').load('this-WP_query-loop-chunk.php');     });


SQL QUERY needed to get POST category (taxonomy) ? - MUST be SQL statement

Working on a tool outside of Wordpress to query the wordpress database by POST_ID and return the Category Name associated. This is for a real estate website, and the Categories are called "mi_neighborhoods" and are referred to by wp_term_taxonomy.taxonomy. In one of my other queries to get all the Category names I use:                   SELECT *         FROM wp_term_relationships         LEFT JOIN wp_term_taxonomy         ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)         LEFT JOIN wp_terms on wp_term_taxonomy.term_taxonomy_id = wp_terms.term_id         WHERE wp_term_taxonomy.taxonomy = 'mi_neighborhoods'           GROUP BY wp_term_taxonomy.term_id      So I have the POST_ID, I need to return the value of the "mi_neighborhoods" for that post. Can anyone help?


remove_action in a theme

I'm using a theme that gets updated pretty frequently. For this, it has added a custom.php file to include modifications. Now, in this theme, under the functions.php, the developer has included his own meta section which is added using the following function:               add_action('wp_head', 'theme_metas');      I want to let my SEO plugin manage this, so I tried adding this into the custom.php:               remove_action('wp_head', 'theme_metas', 15);      I even tried altering the priority higher and lower than 10 (which is default) but the metas are still showing. Can someone shed some light please?


Trying to use Advanced Custom Fields with custom image sizes

I have a product section on my wp-site. I am trying to display the attached thumbnail image in specific sizes that are automatically cropped to the right size. I have used **Advanced Custom Fields** to create a field called product_thumbnail I have used **Additional Image Sizes** to create a new image size called products I have used the following code on another word press site and it worked fine, but on my current site it returns empty.               <?php $image = wp_get_attachment_image_src(get_field('product_thumbnail'), 'products'); ?>     <a href="<?php the_permalink(); ?>"><img src="<?php echo $image[0]; ?>" />      I have ran a batch to make sure my images are created if not already. This is boggling my mind. Any help appreciated.


How do I use just one category' posts on my home page?

I have mainly protected categories, but I have one open category, how can I set it up so I load only the open catgeory posts to show on my home page


Remove Admin sidebar link

I have a taxonomy link in my admin sidebar i'd like removed from view. Only in the sidebar though, i will still be using the function in the post view, so if that creates problems a simple simple CSS trick will do. Just need it gone from the sidebar as it's unnecessary clutter. The current link looks like: http://domain.com/wp-admin/edit-tags.php?taxonomy=featured&post_type=movies


Loop through all posts, show attachment if there

I've created two simple `foreach` loops: one for all posts, one for all attachments. I want it show every post title, and if there is an attachment, show that attachment. I have, thus far:               $get_posts_array = array( 'posts_per_page' => 3, 'post_type' => 'post' );     $get_posts = get_posts( $get_posts_array );          foreach ($get_posts as $post)     {         the_title();              $get_images_array = array( 'posts_per_page' => 1, 'post_type' => 'attachment' );         $get_images = get_posts($get_images_array);              if ($get_images)         {             foreach ( $get_images as $post )             {             ?>                 <li> <?php the_attachment_link( $post->ID ) ;?> </li>             <?php             }          }     }     ?>      However, it is not working as expected. It retrieves every post title, but uses the same first attachment for all posts. Any help would be great (I'm inexperienced with PHP, so this could be completely buggy).


Change Rating range in Link Manager

I have looked in here and across the internet but I can not seem to find an answer. Is there a way to change the values of the ratings. By Default it seems to be 0 to 10, but I can not find a way to modify this feature to something like 0 to 20 or something. Thanks.


wpColorPicker - problem with implementation to post meta

I need your help as I am stuck and Google does not return anything, so I must be doing something obiusly wrong here, I just don't know what. Basically, I need color input in one of my custom post types meta and I am trying to use a new WordPress 3.5 colorpicker for that. I could simply find another script and use it, but if it's already bundled with WP, that's what I should use. So anyway, this is what I have done: I have this input field in custom metabox:               <input name="mv_cr_section_color" type="text" id="mv_cr_section_color" value="<?php echo $sections_color; ?>" data-default-color="#ffffff">      I have this piece for enqueueing the script needed:               wp_enqueue_script( 'wp-color-picker' );      and finally I have this custom js:               jQuery('#mv_cr_section_color').wpColorPicker();      wrapped in .ready() Result is this: Input field gets hidden (it gets display: none inline urle applied to it), if I uncheck that (using Google Chrome), when I click the field nothing happens (:focus should trigger colorpicker). If I then unhide colorpicker (it is spawned, I see it in source) I can use it and it functions normally, default color also works well but I just can't find the reason why field gets hidden and why it does not open colorpicker on focus. Anyone have any idea, I am really ... about this :) Thanks EDIT: Just the note, no error in console.


Common login for websites belonging in different networks

Is there a tool to connect the databases of 2 sites sitting on separate networks with one login allowing them to share a common user base? I have searched around, but I unable to find a clear answer or a way to be done.


How to check if a category has a parent and child categories?

Im trying to check if 'categoryone' has a parent. Right know I can check and see that there is a category called categoryone, but I want to check categoryone for parent and child categories. I have tried to code something like the code bellow. Finaly my goal is to use wp_set_post_categorie(); after the category check.                foreach ( $network_posts as $network_post ) {            // Add the new post       $insert_id = wp_insert_post( $network_post->post );            // Add metadata (useful for lookups later)       update_post_meta( $insert_id, '_network_content', 1 );       update_post_meta( $insert_id, '_network_site_orig_id', array(     'site_id' => $bid,     'post_id' => $network_post->id,      ) );                     $tid = term_exists('categoryone', 'category', 0);           $term_ids = [];           if ( $tid !== 0 && $tid !== null )      {       $term_ids[] = $tid['term_id'];           }      else      {       $insert_term_id = wp_insert_term( 'categoryone', 'category' );       if ( ! is_wp_error )       $term_ids[] = $insert_term_id;       }       wp_set_post_categories( $insert_id, $term_ids );        }


How to do some action weekly?

For each new post, I add `News` category. And I want to `delete this category` from each post after 7 days. I already know to "delete" the new category but how to run it every week ?


Show page without reference to post (like front-page)

I created a plugin that adds a new post-type `awards`. Each award has multiple votes attached, which are stored in a custom table, created by the plugin. Now I need to show two different overview-pages for the award:   1. "mysite.com/awards" - show a list of all awards (simple)   2. "mysite.com/votes" - show a list of all votes (problem) The first part is simple: I create a theme file with the name "archive- award.php" and display the list. **I need help with the second case** : A `vote` is not a custom post-type, so I cannot simply create an `archive-votes.php` file. This page has absolutely no relation to any item in the posts-table. My idea is that I create a theme file (e.g. `list-votes.php`) and then link it with a custom slug. So the slug `votes` would open the theme file `list- votes.php` - but I could not find out how to do this. Only solution which is not very good in my eyes is to create a page called `votes` and then add a short-code on that page which will display the list.


Variable scope in plugin outside loop

OK so I'm trying to use the plugin "adrotate" outside of the loop for my frontend. I can access all the WP functions I need for everything else using               require_once(APP_PATH.BLOG_FOLDER.'wp-load.php');      The plugin has a function called `adrotate_group()` which is just in a script file, no class or anything.               function adrotate_group($group_ids, $fallback = 0, $weight = 0) {         global $wpdb, $adrotate_config, $adrotate_debug;         var_dump($adrotate_config);      This outputs `NULL` when I call it like so on my frontend               require_once(APP_PATH.BLOG_FOLDER.'wp-load.php');     echo adrotate_group(1);      `$adrotate_config` is setup in another setup script for this plugin and I've done some var_dumps there and it outputs to my frontend correctly. Below is where the variable is set ![enter image description here](http://i.stack.imgur.com/77oSs.png) For some reason using `global $adrotate_config` in that function isn't working, however using `get_option('adrotate_config');` does, but I cannot go edit all of the plugin functions to use this as it will break on updates. I think it has to do with the way I'm hooking wordpress.


What is the best way to manage small blocks of content on my home page?

Excuse the newbie question. I have a home page that has 2 sections on it. None of these sections are the 'blog' which is in another section of the site. I suppose I'm looking for another way of content managing these sections. The first is a 'what we do' section. It has three paragraphs that are limited to say 200 words. e.g:   1. Title then 200 words   2. Title then 200 words   3. Title then 200 words There are no other pages associated with each point. I want each to be available in the backend for editing. The second section 'Example Work' consists of 6 images with a small caption underneath each one. How would I go about content managing each one of these? From reading around, I found 'Custom Post Types' but that seems like quite a bit of work for something that would be potentially quite simple. This must have been done a thousand times before. Also this is potentially a 'module' - but again I'm not sure. I'm not necessarily looking for code (feel free to include though) but a high level description of the best way to do this.


Tidy nav menu classes except for edit-menu-item-classes and active class

I want to tidy the menu class and remove the `<li>` ID tags, but return the class which is added by CSS Classes (optional) and current class.


Dynamically insert an article at the top of a taxonomy archive - or?

I'm making a directory for half a dozen sorts of venues that are located in innumerable cities in all 50 US states. My plan has been to use a custom post type for each venue type and then assign a hierarchical "location" taxonomy to all of them. When I create my "location" taxonomy archives, I'd like to start plugging in information about each state and eventually each major city. I envision an article about the location, a list of related tags and categories about what could be found in that location, and some excerpts from blog posts. Once you click through to a venue type, you'd get a list of that sort of venue in the "location." How can I dynamically add an article about that location to the top of a location taxonomy's archives? Or, should I have gone with a "location" custom post type instead? However... that would still give me a location-related taxonomy archive that does not begin with an article about the location.


Migrating Users along with their password

I would like to migrate users from one wordpress site to another along with their paasswords, there are 15000 users in total . what would be the best way to do this . is a migration of the database tables wp_users and wp_user_meta recommended ? Thanks


Parent a CPT to a page

I have my custom post type set up with hierarchicy set to true and the url works like: _Lions News › S1 › Test Post 1_ which is nice except that it should go one futher and be like _Lions Minis › Lions News › S1 › Test Post 1_ Lions Minis being the parent page to everything. Is there a way to to set that up? The following is my setup in functions.php               /** Custom Post Types for Lions News */      $labels = array(     'name'                          => 'Lions News Categories',     'singular_name'                 => 'Lions Category',     'search_items'                  => 'Search Lions Categories',     'popular_items'                 => 'Popular Lions Categories',     'all_items'                     => 'All Lions Categories',     'parent_item'                   => 'Parent Lions Category',     'edit_item'                     => 'Edit Lions Category',     'update_item'                   => 'Update Lions Category',     'add_new_item'                  => 'Add New Lions Category',     'new_item_name'                 => 'New Lions Category',     'separate_items_with_commas'    => 'Separate Lions Categories with commas',     'add_or_remove_items'           => 'Add or remove Lions Categories',     'choose_from_most_used'         => 'Choose from most used Lions Categories'     );          $args = array(     'label'                         => 'Lions Categories',     'labels'                        => $labels,     'public'                        => true,     'hierarchical'                  => true,     'show_ui'                       => true,     'show_in_nav_menus'             => true,     'args'                          => array( 'orderby' => 'term_order' ),     'rewrite'                       => array( 'slug' => 'lions_news/lions_articles', 'with_front' => false ),     'query_var'                     => true     );          register_taxonomy( 'lions_articles', 'lions_news', $args );          register_post_type( 'lions_news',      array(         'labels'                => array(             'name'              => __( 'Lions News' ),             'singular_name'     => __( 'Lions News' )             ),         'public'                => true,         'show_ui'               => true,         'show_in_menu'          => true,         'supports'              => array( 'title','editor','thumbnail','comments','revisions' ),         'rewrite'               => array( 'slug' => 'lions_news', 'with_front' => false ),         'has_archive'           => true     )     );     /** End custom Post Types */      Thanks!


Using str_replace on wp-admin

I'm currently having some difficulties getting this below snippet to work. The current outcome is it replaces nothing. _I realize this particular question could also be solved using`gettext`, but I was looking a general example solving all of my `str_replace` questions at once._               add_filter( 'admin_print_scripts-index.php', 'wpse_replace_version_message' );     /**      * wpse_replace_version_message      */     function wpse_replace_version_message( $html ) {       $html = str_replace( 'You are using WordPress 3.4-alpha-19904', '', $html );       return $html;     }


How to call widget by widget's id?

Is it possible to call widgets using it's id? for example I have a sidebar. In this sidebar I put meta widget and tag cloud widget. I have got their id's ($widgets_list): 'meta-2' and 'tag_cloud-2'. How can I call them without dinamic_sidebar function.               foreach($widgets_list as $item){         if($item =='meta-2'){             //echo widget with 'meta-2' id here         }     }


posts_per_page & pagination conflict

I have a custom query to display my custom post type. `posts_per_page` set to '5'. In admin post per page set to '10' (settings => Reading => Blog pages show at most 10 posts) My template lists 5 posts per page. If I have 15 posts it must be shown in 3 pages, **but on third page I get 404 error.** So my pagination uses the admin settings (10 posts per page). How can I fix it?               global $paged;     query_posts(array(         'post_type' => 'custom_post_type',         'posts_per_page' => 5,         'orderby' => 'title',         'order' => 'ASC',         'paged' => $paged         ));          while (have_posts()) : the_post();         the_title();     endwhile;          next_posts_link('Next');     previous_posts_link('Prev');


Is there a way to rate users instead of posts?

I would like to enable ratings for individual authors on my site instead of posts, so that users can rate each other. I just want a star rating system with some text to form some sort of review. I have played around with Lester Chan's WP-PostRatings (http://wordpress.org/extend/plugins/wp-postratings/) but sadly my coding skills are not that good so I couldn't figure out how to modify it. I would really appreciate any help I can get on this. Thanks!


Password change when the user login first time

I have a "change password" page. Is there a way to redirect that page when the user `login first time` using wordpress generated password? Thanks


Rewrite Page with a slug before page name

I am using $wp_rewrite->non_wp_rules I have the following code that works:               'name/(.*)' => 'index.php?post_type=post';      Im able to use a url like http://mysite.com/custom_name/post_name using $wp_rewrite->non_wp_rules, how can I make pages work the same way. This is just an example:               'anothername/(.*)' => 'index.php?post_type=page'; //for all pages          'anothername/(.*)' => 'page/pagename' //for one specific page      Is there a way I can have a page look like this:                http://mysite/custom_name/page_name.      The two examples above just redirects me to:               http://mysite/page_name  //without the slug


Is there a way to give users the option to log in to their favorite group on login? So if a user belongs to say half a dozen groups I can show those groups on the login with some sort of drop down menu and have a checkbox they can tick off to select the Buddypress group they want to log directly into.


custom template rewrite

I have a page called `my-todo-list` and is using a custom page template. The page is accessible via this type of URL : `http://domain.com/my-todo- list/` Now I need to paginate it, and I want to look like this: `http://domain.com/my-todo-list/page/1` I've read a lot of questions here, but nothing clear. Any Ideas to make it possible? my template needs something like`$page= $_GET['page']` ?


Search Woocommerce product titles only

Limiting post search to titles only is a breeze, but WooCommerce's post types don't abide by this rule. I have tried modifying the code below to be specific to products but am not having any luck.               function search_by_title_only( $search, &$wp_query )     {         global $wpdb;         if ( empty( $search ) )             return $search; // skip processing - no search term in query         $q = $wp_query->query_vars;         $n = ! empty( $q['exact'] ) ? '' : '%';         $search = '';         $searchand = '';         foreach ( (array) $q['search_terms'] as $term ) {             $term = esc_sql( like_escape( $term ) );             $search .= "{$searchand}($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')";             $searchand = ' AND ';         }         if ( ! empty( $search ) ) {             $search = " AND ({$search}) ";             if ( ! is_user_logged_in() )                 $search .= " AND ($wpdb->posts.post_password = '') ";         }         return $search;     }     add_filter( 'posts_search', 'search_by_title_only', 500, 2 );      I'm not sure if I'm not using the right hooks or if I'm barking up the wrong tree altogether. Anyone know how to do this?


Check if a post is in specific category to show an icon

I have multiple categories let's call them Group1 (imp1, imp2, imp3) and group2 (cat1, cat2, cat3, cat4). My posts are in one from the first group of categories and in multiple categories from the second group. I want to show a small icon in the corner of the post thumbnail if the post is from `imp1`, or show another icon if the post is from `imp2` and so on.


Positioning Screen (Contextual) Help Tabs

Using the new `WP_Screen` class makes it pretty easy to add help text to a screen.               <?php     add_action( "load-{$somepage}", 'wpse_load_reading' );     function wpse_load_reading()     {         get_current_screen()->add_help_tab( array(             'id'        => 'my-help-tab',             'title'     => __( 'My Title' ),             'content'   => __( 'Help Content' )         ) );     }      This is great for custom pages. But when adding a help tab to an existing screen, let's say `options-reading.php`, some weirdness happens. The `load-options-reading.php` hook fires before the built in WP page adds its own help tabs. In other words, adding a help tab to an existing screen bumps all the built in help tabs to the bottom of the of list. Here's some code, if you'd like to try this out:               <?php     add_action( "load-options-reading.php", 'wpse_load_reading2' );     function wpse_load_reading2()     {         get_current_screen()->add_help_tab( array(             'id'        => 'my-help-tab',             'title'     => __( 'My Title' ),             'content'   => __( 'Why is this tab above the built in tab?' )         ) );     }      **Is there any way to reorder the help tabs on a screen?** **EDIT:** Found a way around this. The default help tabs are added before the `admin- header.php` file is included. So you can hook into `load-{$built_in_page}`, and from there hook a function `admin_head` which takes care of setting up your help tabs.               <?php     add_action( 'load-options-reading.php', 'wpse45210_load' );     function wpse45210_load()     {         add_action( 'admin_head', 'wpse45210_add_help' );     }          function wpse45210_add_help()     {         get_current_screen()->add_help_tab( array(             'id'        => 'my-help-tab',             'title'     => __( 'My Title' ),             'content'   => __( 'This tab is below the built in tab.' )         ) );     }      Seems kind of like a hack. Is there a better way?


wp_enqueue script my_javascript_file in the footer

I am trying to place `my_javascript_file` in the footer. According to the documentation `$in_footer` is the fifth value and it is a boolean so I have it set to `true`. Currently it doesn't show up anywhere, as far as I can tell from inspecting the code. Got it to work, it was hidden in a div I forgot to close (oops) UPDATE _added fourth parameter as empty string`' '`_ FUNCTIONS.PHP FILE               <?php     function load_scripts() {        wp_enqueue_script('jquery');        wp_enqueue_script('my_javascript_file', get_template_directory_uri() . '/javascripts/app.js', array('jquery'),' ',true);     }              add_action('init', 'load_scripts');     /*add_action('wp_footer', 'load_scripts');/*DELETED THIS PART     ?>      FOOTER.PHP added wp_footer               </div>         <!-- Main Row Ends -->     <?php wp_footer(); ?> /*added*/     </body>          </html>


Change column of row action (Quick Edit) links in WP_List_Table

Is it possible to move the "Edit | Quick Edit | Trash", etc... links (A/K/A "Quick Edit links") from a table generated by a custom post type registration into a different column other than the "Title" column? Perhaps a custom column? Is there a action/filter for this? Or can I just remove the "Title" column, and add a column called "Actions", and just stick the links there with a function call of some sort? ![enter image description here](http://i.stack.imgur.com/N9pqv.png)


wp_enqueue_script not loading my custom js file

I am using the following code below in my functions.php, However app.js is not found when I inspect it in the resources tab. It is looking for it in http://localhost:8888/goodMorningMoon/javascripts/app.js?ver=3.3.1 when it should be looking in http://localhost:8888/goodMorningMoon/wp- content/themes/Good-Morning-Moon/javascripts/app.js?ver=3.3.1 How do I modify this code so it looks in the correct directory, do I need to add get_template_directory_uri(); somewhere, I have tried but to no avail. Thanks in Advance p.s this is located in my functions.php file, since I read from here http://smashingshare.com/2010/09/22/how-to-properly-add-javascript-files-to- your-wordpress-site/ that that is the proper way to approach including js files.               <?php     function load_scripts() {        wp_enqueue_script('jquery');        wp_enqueue_script('my_javascript_file', '/javascripts/app.js', array('jquery'));     }              add_action('init', 'load_scripts');     ?>


Ajax Search results via Fancybox

**What I'm trying to do:** when the user clicks on the search icon, I open a lightbox overlay via fancybox. In the lighbox there's the search form where the user should type his search terms, hit the Enter key and via ajax the results should appear below, in the same lightbox. **The setup:**   1. I display the search icon in header and I bind the `fancybox` script to load via ajax the `searchform.php` file (btw, thanks to G. M. for the ajax solution):              <?php $url = add_query_arg( array('action'=>'show_search_form'), admin_url('admin-ajax.php') ); ?>     <a id="search-label" class="fancybox.ajax" href="<?php echo $url; ?>">          add_action( 'wp_ajax_show_search_form', 'zune_show_search_form' );     add_action( 'wp_ajax_nopriv_show_search_form', 'zune_show_search_form' )     function zune_show_search_form() {        get_search_form();        exit();     }        2. I install the `T5 AJAX Search` plugin from Tosho's gist. **The problems:** If I leave everything as it is, the search doesn't work - it will not fetch the results via AJAX, but will open a new window (`myurl.com/?s=%s`). In this case, I moved the content of the script.js file inside my `searchform.php` file. Now the results show up via AJAX but there are two other problems:   1. Each time the user hits the Enter key, the results will show up again, below those already shown.    2. If the user deletes the original query and makes a new search, the new results will be appended below the previous ones.  The question and I believe the solution in both cases (1. and 2.) is the same: how do I stop the results from staking up at the pressing of the Enter key and how do I delete the previous results and show the new ones? Bonus question: why the search ajax didn't work when the content of the `script.js` file were not in `searchform.php`? For ease of use here is the code from the `searchform.php` file:
         <form action="<?php echo home_url( '/' ); ?>" id="s" method="get">             <fieldset>                 I'M SEARCHING:                 <input type="text" class="notv" id="search" placeholder="for something" name="s" value="<?php the_search_query(); ?>" />             </fieldset>         </form>


Listing tags from a custom post type

The **topic** custom post type:                   register_post_type( $this->forum_post_type, $bbp_cpt['forum'] );              /** TOPICS ************************************************************/              // Topic labels         $topic['labels'] = array(             'name'               => __( 'Topics',                   'bbpress' ),             'singular_name'      => __( 'Topic',                    'bbpress' ),             'add_new'            => __( 'New Topic',                'bbpress' ),             'add_new_item'       => __( 'Create New Topic',         'bbpress' ),             'edit'               => __( 'Edit',                     'bbpress' ),             'edit_item'          => __( 'Edit Topic',               'bbpress' ),             'new_item'           => __( 'New Topic',                'bbpress' ),             'view'               => __( 'View Topic',               'bbpress' ),             'view_item'          => __( 'View Topic',               'bbpress' ),             'search_items'       => __( 'Search Topics',            'bbpress' ),             'not_found'          => __( 'No topics found',          'bbpress' ),             'not_found_in_trash' => __( 'No topics found in Trash', 'bbpress' ),             'parent_item_colon'  => __( 'Forum:',                   'bbpress' )         );      The **tag** custom taxonomy:               function register_taxonomies() {              // Topic tag labels         $topic_tag['labels'] = array(             'name'          => __( 'Topic Tags',   'bbpress' ),             'singular_name' => __( 'Topic Tag',    'bbpress' ),             'search_items'  => __( 'Search Tags',  'bbpress' ),             'popular_items' => __( 'Popular Tags', 'bbpress' ),             'all_items'     => __( 'All Tags',     'bbpress' ),             'edit_item'     => __( 'Edit Tag',     'bbpress' ),             'update_item'   => __( 'Update Tag',   'bbpress' ),             'add_new_item'  => __( 'Add New Tag',  'bbpress' ),             'new_item_name' => __( 'New Tag Name', 'bbpress' )         );              // Topic tag rewrite         $topic_tag['rewrite'] = array(             'slug'       => $this->topic_tag_slug,             'with_front' => false         );              // Topic tag filter         $bbp_tt = apply_filters( 'bbp_register_topic_taxonomy', array(             'labels'                => $topic_tag['labels'],             'rewrite'               => $topic_tag['rewrite'],             'capabilities'          => bbp_get_topic_tag_caps(),             'update_count_callback' => '_update_post_term_count',             'query_var'             => true,             'show_tagcloud'         => true,             'hierarchical'          => false,             'public'                => true,             'show_ui'               => true         ) );              // Register the topic tag taxonomy         register_taxonomy(             $this->topic_tag_id,    // The topic tag id             $this->topic_post_type, // The topic post type             $bbp_tt         );     }      I would like to list all (or most popular) tags of the custom post type topic. Any suggestions?


White text on white background in TinyMCE when wp_editor is called in WP 3.9

One of the features of my plugin is to add a TinyMCE editor instance inside a meta box on the Edit Post screen. This has worked great up until 3.9, and I'm not clear as to what's going wrong. Here are the relevant files containing the code for the meta box editor (links to files inside Github commit): admin/author-customization-admin.php admin/assets/js/edit-post.js What am I missing? This is what I'm given when I load the Edit Post screen: http://i.imgur.com/6GQUUa9.png The contents are there though, which you can see when you highlight inside the textarea: http://i.imgur.com/jTSlgWm.png On WordPress 3.8.1 the code works just fine: http://i.imgur.com/i7nTqPb.png I'm not sure whether it's an issue with the PHP code or the JavaScript. Any help is appreciated.


Post Meta rows from other types being added to DB regardless of post type

I have 3-4 custom post types in my wordpress site. Each one has some unique post meta fields I create and update using meta boxes. In looking in the database during development I'm noticing that every post meta field being used for all custom types is being added for every time I add a post regardless of post type. So if i add a "Team" post type, it adds a row for every meta field for Team custom post type and all the meta fields for the Person custom post type as well (the person ones have blank values but it's still taking up rows in the database). Why is this happening? I'd rather prevent the excess rows since I'm going to have a large amount of data.


Add parameter (time) to oembed

I need to add a time parameter to the YouTube oEmbed callback. This time parameter should be set via URL. I found various answers which describe how to hook into the oEmbed callback, but none of them covers the addition of a time parameter.


Can wp_insert_post_data filter be used to save custom field data?

I have custom field data that I would like to modify on its way to the database. wp_insert_post_data filter seems to be the closest thing I can find to achieving this. I dumped the $data and $postarr values but I don't see how I can access my custom field data as those fields aren't in the dump. Can wp_insert_post_data be used to save custom field data, and if not, what is the preferred filter / practice? EDIT: additional detail: I have a front end form that asks for a user's company website address. If the user simply types in 'example.com' then the target for that website in his post defaults to mywebsite.com/example.com instead of opening up example.com. If http:// is not part of the text they enter, then I want to add that to it right before it saves. There is javascript to help with validation, but those who have it turned off get by it.


Installing wordpress on Parallels plesk 9.5.3

I would like to know if it is possible to install WP on Parallels Plesk 9.5.3, and if so, I do I do that? Thanks, Erez A.


custom posts on different page

> i have a custom post on my website, i just want that the all post from > custom post types should be published on a separate **page** which will be > "Blog", is this possible? the code worked, i edited the code this is my code:               <?php     /*     Template Name: Blog template     */     get_header();           $blog_query = new WP_Query;     $blog_query->query( 'post_type=uni' ); // <-- Your args on this line     ?>

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

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

                             <?php the_category(' ') ?>

                                  <?php _e('Featured Venue |', 'woothemes'); ?>                                  <?php comments_popup_link(__('0 Reviews', 'woothemes'), __('1 Review', 'woothemes'), __('% Reviews', 'woothemes')); ?>

                              <?php the_excerpt(); ?>

              <?php endwhile; ?>          <?php endif; ?>          <?php wp_reset_query(); ?>

          <?php      get_footer();      but when i click on the title of the blog page, it takes me to a page where content of the posts come without div tag, and on the menu its on the home page check this image ![alt text](http://i.stack.imgur.com/E9sGD.jpg) in this image everything looks fine, this is what i wanted in this when i click on the post i.e. title it comes this way check this image ![alt text](http://i.stack.imgur.com/t4oCb.jpg) the menu is pointing on home and there is no `div` tag in the post


How to search and replace text in all posts of a wordpress.com blog (NOT wordpress.org one)?

I have some texts that need to be replaced in every posts in my blog. Is it possible to do that? ps (I need to tag this question as `search-and-replace` but not enough reputation to do that. Please add the tag if you can. Thank you!)


If post content exists (any post content), do not display featured image

If post content exists, do not display featured image, if it does not exists, then display featured image or url. So, basically I want featured image to be displayed only if nothing else in post content to be displayed. Thanks!!!!


Importing Multiple DB to one MU database

I have three databases associated with three different WP sites. I set up one MU site, with one database. How should I import each of the three databases?


How do I create a form to search a custom post type

Basically how would I create a form to search only within a custom post type?


How to use relative links on my pages?

In my web pages I want to use relative links instead of absolute links. However, pages do not allow php code inside them, so i cannot do to from a url in a relative manner. How does one get relative urls inside wordpress pages so that changing domain names wouldnt affect the links?


Anyway to convert a plugin to become a shortcode?

is there any (easy) way to convert an existing plugin to become shortcode instead? http://wordpress.org/extend/plugins/rax-top-social-media-share-with- counter/ I want to place it's output specifically in the layout and not below posts like plugin does automatically. Thanks!