title: how to make custom bulk actions for a WP_List_Table (core class)

text:
I am using the `WP_List_Table` class and I added the links for the actions like this:               function get_bulk_actions() {             $actions = array();                  $actions['approv'] =''.__( 'Approve' ).'';                     $actions['reject'] = ''.__( 'Reject' ).'';                     $actions['delete'] = ''.__( 'Delete' ).'';                     $actions['view'] = ''.__( 'View' ).'';                       return $actions;         }      Then I display them in the `display_row()` function like this:               $actions = $this->get_bulk_actions();     echo $this->row_actions( $actions );      Now I am wondering how to add custom actions to those links I created. Is there anyway where I can send the variables to a page? To do the DB handling of these links and repopulate the `WP_List_Table` that was created before i performed action. ### UPDATE 1 Here is the Full Code for the `WP_List_Table` Class:               <?php     // Our class extends the WP_List_Table class, so we need to make sure that it's there     if( ! class_exists( 'WP_List_Table' ) ) {         require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );     }     class Link_List_Table extends WP_List_Table {              /**          * Constructor, we override the parent to pass our own arguments          * We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.          */          function __construct() {              parent::__construct( array(             'singular'=> 'wp_list_text_link', //Singular label             'plural' => 'wp_list_test_links', //plural label, also this well be one of the table css class             'ajax'  => true //We won't support Ajax for this table             ) );          }     /**      * Define the columns that are going to be used in the table      * @return array $columns, the array of columns to use with the table      */     function get_columns() {         return $columns= array(             'col_person_name' => 'Name',                     'col_business_name' => 'Bussiness Name' ,                     'col_person_email' => 'Email' ,                      'col_pserson_phone' => 'Contact Number',                     'col_request_status' => 'Status',                     'col_is_deleted' => 'Deleted'         );     }          /**      * Prepare the table with different parameters, pagination, columns and table elements      */     function prepare_items() {         global $wpdb, $_wp_column_headers;         $screen = get_current_screen();              /* -- Preparing your query -- */             $query = "SELECT * FROM approval_requests";              /* -- Ordering parameters -- */             //Parameters that are going to be used to order the result             $orderby = !empty($_GET["orderby"]) ? mysql_real_escape_string($_GET["orderby"]) : 'ASC';             $order = !empty($_GET["order"]) ? mysql_real_escape_string($_GET["order"]) : '';             if(!empty($orderby) & !empty($order)){ $query.=' ORDER BY '.$orderby.' '.$order; }              /* -- Pagination parameters -- */             //Number of elements in your table?             $totalitems = $wpdb->query($query); //return the total number of affected rows             //How many to display per page?             $perpage = 20;             //Which page is this?             $paged = !empty($_GET["paged"]) ? mysql_real_escape_string($_GET["paged"]) : '';             //Page Number             if(empty($paged) || !is_numeric($paged) || $paged<=0 ){ $paged=1; }             //How many pages do we have in total?             $totalpages = ceil($totalitems/$perpage);             //adjust the query to take pagination into account             if(!empty($paged) && !empty($perpage)){                 $offset=($paged-1)*$perpage;                 $query.=' LIMIT '.(int)$offset.','.(int)$perpage;             }              /* -- Register the pagination -- */             $this->set_pagination_args( array(                 "total_items" => $totalitems,                 "total_pages" => $totalpages,                 "per_page" => $perpage,             ) );             //The pagination links are automatically built according to those parameters              /* -- Register the Columns -- */             $columns = $this->get_columns();                     $hidden = array();                     $sortable = array();                     $this->_column_headers = array($columns, $hidden, $sortable);         /* -- Fetch the items -- */             $this->items = $wpdb->get_results($query);     }               /**      * Display the rows of records in the table      * @return string, echo the markup of the rows      */               function display_rows() {              //Get the records registered in the prepare_items method         $records = $this->items;               list( $columns, $hidden ) = $this->get_column_info();                    //print_r($records);         //Loop for each record         if(!empty($records)){foreach($records as $rec){                  //Open the line             echo '
sr_no.'">';             foreach ( $columns as $column_name => $column_display_name ) {                      //Style attributes for each col                 $class = "class='$column_name column-$column_name'";                 $style = "";                 if ( in_array( $column_name, $hidden ) ) $style = ' style="display:none;"';                 $attributes = $class . $style;                      //edit link                                //Display the cell                 switch ( $column_name ) {                     case "col_person_name":                                          echo ''.stripslashes($rec->person_name);                                            $actions = $this->get_bulk_actions();                              echo $this->row_actions( $actions );                                          echo '	';                                      break;                     case "col_business_name": echo ''.stripslashes($rec->business_name).'	'; break;                     case "col_person_email": echo ''.$rec->person_email.'	'; break;                     case "col_pserson_phone": echo ''.$rec->pserson_phone.'	'; break;                                     case "col_request_status": echo ''.$rec->request_status.'	'; break;                     case "col_is_deleted": echo ''.$rec->is_deleted.'	'; break;                 }             }                  //Close the line             echo'
';         }}     }          function get_bulk_actions() {             $actions = array();                  $actions['approv'] =''.__( 'Approve' ).'';                     $actions['reject'] = ''.__( 'Reject' ).'';                     $actions['delete'] = ''.__( 'Delete' ).'';                     $actions['view'] = ''.__( 'View' ).'';                       return $actions;         }                    }          function show_table(){          $wp_list_table = new Link_List_Table();     $wp_list_table->prepare_items();          //Table of elements     $wp_list_table->display();               }          ?>


title: Mega WordPress Applications WPMU or otherwise

text: I'm a small-timer, so I was amazed at this question: Ideal WP multisite server setup for up to 1000 sites?. I know that WordPress is a highly flexible platform, but what types of entities/businesses would need or use this type of setup? In situations like this is there much redundant content? How do you begin designing something like this? Are there lessons in this for the small- timers?


title: How can I add a button to quicktags-toolbar?

text: I would like to add a button to this toolbar, right of "fullscreen": ![enter image description here](http://i.stack.imgur.com/z1Rlt.png) The button should add this: „“ If text is selected, it should get around the text, like this: „selected text“ How can I add such a button to the ed_toolbar (class: quicktags-toolbar)?


title: Advice: Template structure - php blocks in sidebar or someting else?

text: I'm trying to create certain modulair blocks which I can add to multiple pages in Wordpress. But I use sidebar-[name].php files for this, what is the best practice for this? Should you add them to a function or add them in a sidebar... It feels Kinda off using many sidebar's. It would be nice if I could add them to a sub-folder in the template. Checkout the image. How do you do this? ![enter image description here](http://i.stack.imgur.com/sfnEB.png)


title: Query posts filter not working

text:
I have created one custom post type which name is `villa`. In this post type I have added five post and assigned custom field values(mention bellow):                  Post Name        Assigned Fields     1. Chalet Austria   Beachfront     2. Antoinette       Cook Services     3. Soline           Garden     4. Apoline          Private Pool     5. Alexandra        Sea View      After that I have created one custom field using with advance custom field plugin, and custom field name is `features`. In features there is five option value:               1. Beachfront     2. Cook Service     3. Garden     4. Private Pool     5. Sea View      **Note: Value and text is same.**      Now I am trying find all posts that have post_type of 'villa' and value is 'Beachfront, Cook Services, Garden, Private Pool and Sea View'. **My Code is:**               <?php      $args = array(         'numberposts' => -1,         'post_type' => 'villa',         'meta_query' => array(             'relation' => 'OR',                 array(                     'key' => 'features',                     'value' => '%Beachfront%',                     'compare' => 'LIKE'                 ),                 array(                     'key' => 'features',                     'value' => '%Cook Services%',                     'compare' => 'LIKE'                 ),                 array(                     'key' => 'features',                     'value' => '%Garden%',                     'compare' => 'LIKE'                 ),                 array(                     'key' => 'features',                     'value' => '%Private Pool%',                     'compare' => 'LIKE'                 ),                 array(                     'key' => 'features',                     'value' => '%Sea View%',                     'compare' => 'LIKE'                 )             )         );     $the_query = new WP_Query( $args );     ?>          <?php if( $the_query->have_posts() ): ?>
             <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
             <?php endwhile; ?>
     <?php endif; ?>          <?php wp_reset_query(); ?>      When I run this code I am not getting anything, only page is reloading.. reloading.. and reloading.. :( **I am expecting this result:**   * Chalet Austria   * Antoinette   * Soline   * Apoline   * Alexandra


title: Metabox image upload value

text: I am using meta boxes from WP tuts this tutorial http://wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra- fields/ everything works fine but I don't know ho to call value from image uploader. In my index.php I used this code               <?php $image_upload = get_post_meta($post->ID, $field['custom_image'], true);?>     <?php print_r($image_upload );?>      and it printed this               Array (          [_edit_last] => Array ( [0] => 1 )          [_edit_lock] => Array ( [0] => 1331586724:1 )          [_thumbnail_id] => Array ( [0] => 152 )      )      And when I write this code:               <?php echo wp_get_attachment_image(152); ?>      It shows completly diferent image. Does someone know what I am doing wrong?


title: How do I exclude main pages and link only to sub pages?

text: I have read the following but I'm still confused http://codex.wordpress.org/Function_Reference/wp_list_pages At my website http://alluvialtrading.com/ I would like for example "Who We Are", "What We Do" to link to nothing and only have sub pages. Is this possible?


title: WordPress won't display errors at all

text: I have been having constant issue with WordPress not displaying errors at all and I have no clue what is wrong.   * PHP errors display on non-wordpress related pages.   * Debugging is turned on.   * Display errors in wordpress is turned on.   * PHP is allowed to display errors.   * This is a nginx webserver not apache.   * This happens with addons, plugins and themes. No errors at all just a white page.


title: Can't Auto-Update, but permissions are good?

text: Normally wordpress will auto-update fine without a fuss, but now throws the old ftp credentials form up in my grill. I haven't changed any permissions in between updates, even running `chmod` and `chown` recursively to be sure, but still wordpress wants the ftp. Out of the few wordpress installations i run, this is the only one playing hard-to-update. I'll resort to a manual update if i have to and hope it fixes itself, but it'd be great to know what's the beef.


title: How use Videos from another directory?

text: I have a huge number of videos on my server in the folder of root directory. As they have a large size I do not want to upload them to "Media Library" one by one. How can I say to Wordpress to use the videos from that directory, and also to see them listed in Media Library->Video.


title: Is there a limit to the number of options you can store in one settings field of wp_options?

text: I have a theme with an options page. And on that page there are 1083 options. I've noticed that the last 13 are not saving. They _were_ saving at one point, but after I added new options above them, they stopped working. I suspected that I may have run up against some kind of option limit or limit on the array so to test that, I removed 7 options above the last 13 and sure enough 7 of them saved after that. I've been trying to find information about this but have been unable to do so. Does anyone know if you can only have 1070 options in one settings field? It's not an issue with the database longtext memory limit. These are simple 1's and 0's and hex color values and other CSS type stuff. The export of the field is only 33k.


title: Menu support for touch devices

text: I've noticed that on touch devices like the iPad or Surface the menus in my WordPress site do not work. When using a mouse on a desktop, as soon as I move over a menu item, the submenu automatically expands. However, on touch devices this does not work. If I've followed the code correctly, http://core.svn.wordpress.org/trunk/wp- includes/js/admin-bar.js is setting up the menu items to use the mouseover and mouseout events which do not work in a touch based environment. Is there a way to fix this using the theme or does WordPress itself need to be modified to fix this?


title: How do I use inline SVG in WordPress

text: I am trying to put in an SVG inside my post, but it seems WordPress removes the content. e.g.                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190">      <polygon points="100,10 40,180 190,60 10,60 160,180"      style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;">      </svg>      Gets rendered to                <svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="190"></svg>      Is it possible to do this without a plugin like raw_plugin


title: Add "Write For Us" Option

text: My WordPress site is located at Howbees. I would like to add an option of "write for us". Is there a plugin for that? I've searched and found that it can be achieved using registration and then redirect to admin page. Let me know if there is another way to achieve this?


title: Method to retrieve category names and IDs only as an array?

text: I'm building a category picker select list. I just need to populate an array of categorys like so:               $myCats = array("null" => "None (default)", "1" => "Uncategorized", "2" => "Second Category", etc..)      Does WP have an existing method call I can use to pull this data alone? I may need to exclude some categories from the listing too.


title: What login/password do I need to install a wordpress theme?

text: I clicked to download a wordpress theme, and it asked me for user name and password. But I gave it my ftp password and it said invalid. Then I gave it my Wordpress credentials and it said invalid. So which credentials does it need? Thank you!


title: How to construct multiple meta boxes

text:
As of now I have a perfectly working script for a single meta-box. (I'll supply the details below.) However, I want to add more meta-boxes but am having trouble wrapping my head around how I would bend or add to this script to get those results. I had someone explain to me that I should create individual include's for each metabox and essentially recreate duplicates of what I already have, changing my functions and such for example: from `plib_add_box` to `plib_add_box_2` and so on so they don't clash. But that's so crude and I know there has to be a way to simply add it to my existing include and essentially keep my format/save data portions the same. my **functions.php:**               include("metaboxes/preset-library.php");          //I created an array called $meta_box and set the array key to the relevant post type, in this case post     $meta_box['post'] = array(         'id' => 'venue_location',           'title' => 'Venue/Location',         'context' => 'normal',         'priority' => 'high',         'fields' => array(             array(                 'name' => 'Venue',                 'desc' => 'Venue Name',                 'id' => 'venue_info',                 'type' => 'text',                 'default' => ''             ),             array(                 'name' => 'Location',                 'desc' => 'Location of the Venue',                 'id' => 'location_info',                 'type' => 'text',                 'default' => ''             )         )     );     add_action('admin_menu', 'plib_add_box');      my **include:**               //Add meta boxes to post types     function plib_add_box() {         global $meta_box;              foreach($meta_box as $post_type => $value) {             add_meta_box($value['id'], $value['title'], 'plib_format_box', $post_type, $value['context'], $value['priority']);         }     }     //Formatting     function plib_format_box() {       global $meta_box, $post;            // verification       echo '<input type="hidden" name="plib_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';            echo '
';            foreach ($meta_box[$post->post_type]['fields'] as $field) {           // get current post meta data           $meta = get_post_meta($post->ID, $field['id'], true);                echo '
'.                   ''. $field['name']. '	'.                   '';           switch ($field['type']) {               case 'text':                   echo '<input type="text" name="'. $field['id']. '" id="'. $field['id'] .'" value="'. ($meta ? $meta : $field['default']) . '" size="30" style="width:97%" />'. '
'. $field['desc'];                   break;               case 'textarea':                   echo '<textarea name="'. $field['id']. '" id="'. $field['id']. '" cols="60" rows="4" style="width:97%">'. ($meta ? $meta : $field['default']) . '</textarea>'. '
'. $field['desc'];                   break;               case 'select':                   echo '<select name="'. $field['id'] . '" id="'. $field['id'] . '">';                   foreach ($field['options'] as $option) {                       echo '<option '. ( $meta == $option ? ' selected="selected"' : '' ) . '>'. $option . '</option>';                   }                   echo '</select>';                   break;               case 'radio':                   foreach ($field['options'] as $option) {                       echo '<input type="radio" name="' . $field['id'] . '" value="' . $option['value'] . '"' . ( $meta == $option['value'] ? ' checked="checked"' : '' ) . ' />' . $option['name'];                   }                   break;               case 'checkbox':                   echo '<input type="checkbox" name="' . $field['id'] . '" id="' . $field['id'] . '"' . ( $meta ? ' checked="checked"' : '' ) . ' />';                   break;           }           echo     ''.'
';       }            echo '
';          }     // Save data from meta box     function plib_save_data($post_id) {         global $meta_box,  $post;              //Verify         if (!wp_verify_nonce($_POST['plib_meta_box_nonce'], basename(__FILE__))) {             return $post_id;         }              //Check > autosave         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         }              //Check > permissions         if ('page' == $_POST['post_type']) {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }         } elseif (!current_user_can('edit_post', $post_id)) {             return $post_id;         }              foreach ($meta_box[$post->post_type]['fields'] as $field) {             $old = get_post_meta($post_id, $field['id'], true);             $new = $_POST[$field['id']];                  if ($new && $new != $old) {                 update_post_meta($post_id, $field['id'], $new);             } elseif ('' == $new && $old) {                 delete_post_meta($post_id, $field['id'], $old);             }         }     }          add_action('save_post', 'plib_save_data');


title: How Can I add a menu to the theme from withen the function.php file

text:
I have the following code I'm trying to automatically add a menu to a theme via overriding a function. So I won't have to edit the theme file However the menu is being outputted at the top of the page and on every page instead of only in its given location.                /*******************************          MENUS SUPPORT         ********************************/         if ( function_exists( 'wp_nav_menu' ) ){             if (function_exists('add_theme_support')) {                 add_theme_support('nav-menus');                      function register_cbx_menus() {                     register_nav_menus(                         array(                             //'primary_navigation' => __( 'Main Menu'),                             'legal_footer_navigation' => __( 'Legal Footer Menu'),                             'echo'            => 0,                         )                     );                 }                 add_action( 'init', 'register_cbx_menus' );             }         }              //******************************************************         //Function to override default footer credits         //*******************************************************         if ( !function_exists('ci_theme_footer_credits') ) {              function ci_theme_footer_credits() {                   // Get blog/site name              $cbx_blogame = get_bloginfo( 'name');                    //$cbx_footernav = ;                   //Output new footer content              return '
                 © '.date('Y').' '. $cbx_blogname .' '.'All rights reserved. '.wp_nav_menu( array( 'theme_location' => 'legal_footer_navigation' ) ).'
 '              .'
Powered by example.com
';            }    //End function               } //End function      How can I modify the above code to properly add the menu to a theme via the fucntion.php file without having to edit the theme file to add               wp_nav_menu( array( 'theme_location' => 'legal_footer_navigation' ));


title: How can I output HTML in a template without it being passed through a caching filter?

text: I'm in a bit of a bind. I'm using W3TC, with the "Prevent caching of objects after settings change" option enabled, so that pagespeed service can be refreshed when needed. Unfortunately, this adds query strings to everything, including a call to a remote .js file (which is included in one of the template files), which I need to exclude– unfortunately it breaks if there's a query string (which is something that's out of my control to fix). Is there a way I can just have this bit of HTML be excluded from the W3TC filter somehow? I'm open to calling the page in question with a GET query, but so far can't find a way to make it work.


title: Is it possible to import a wordpress backup from a single site in to a multi-site configuration?

text: I have a local development server with WordPress installed (my desktop Linux Mint 12 box). I'd like to use multi-site WordPress to manage my different client projects through one install, but I have a couple of important questions before I commit to this set-up. 1) Is it possible to import a database backup (created from the Admin Panel's backup tool) from a single WP site into a multi-site child site? 2) Vice versa -- Is it possible to export a multi-site child site's database and import it in to a single site? (for migrating from my dev box to the live server!) 3) Are there any other 'obvious' problems that I should worry about when using this kind of set-up for localhost development? Community question: What method(s) do any other developers out there use for managing multiple WordPress projects? All advice / help / guidance greatly appreciated!


title: What tools are available for managing/writing to WordPress?

text: Aside from the actual WordPress dashboard, what tools are available for writing posts, moderating comments, and otherwise administering your site? Please identify whether you're referencing a desktop tool, a web-based tool, or a mobile tool.


title: Archive widget - limit number of months to 12

text: The default Archive widget display monthly archives in a dropdown. I would like to limit the number of months to 12 (in dropdown). What filter I should apply in my functions.php? I tried this, but it gives me parsed error:               add_filter('WP_Widget_Archives','set_number_months');     function set_number_months($args) {     $args = array('number'    => 12);     return $args;     }      I also tried with wp_get_archives but same parsed error


title: Best-of-Breed Features of a High-End WordPress Web Host?

text: I'm posting this as a community wiki because I'd like to get a collaboratively edited list of features for a high-end WordPress webhost. For example, if you are running a high-traffic WordPress-based site and/or a WordPress site that needs really hardened security what features would you love to see offered so that you don't have to implement everything that exceeds the most basic installation of WordPress core? Many of us know that WP Engine has just launched and it's the closest thing to a high-end webhost specifically for WordPress that I'm aware of. But rather than have there be only one, it would be great if there were many webhosts offering a much higher level. Admittedly I'm weak in this area which is one of my reasons for posting but I'll start with a strawman list of desired features. Let's ignore the non- WordPress related things like 24 hour phone support, etc. and ask that we also be specific i.e. don't just say " _performance optimized_ " or " _highly secure_ " like you see on this site, but actual specifics that indicate a specific implementation:   * Preinstalled Memcached support   * Standard .htaccess tuning for GZIP support   * Optional integration with Amazon Cloud Front for upload files   * Automatic file and database backup with an advanced admin console like a "Time Machine" on the Mac but for WordPress in the Browser.   * Files that are automatically versioned upon FTP upload into SVN or GIT   * Automatic database versioning into SVN or GIT   * Pre-selected list of verified and supported plugins   * What else? I'm sure there's a much longer list than I've come up with. Another speciality feature could also be _White-labeled turnkey WordPress multisite hosting_. What I mean by this is a service that allows someone with marketing and sales experience in a vertical niche (for example, " _Dry Cleaners_ ") to offer website hosting for their market without having to do any technical work whatsoever, including having the host handle all support as well as signup and billing but do it white-label. I think there's a huge market for this. _Note I'm not asking because I want to create such a service, I don't, but I would like to see a definitive reference for webhosts who would consider offering such a service._ **UPDATE:**   * Another feature that would be nice to have would be to have a service that could **synchronize WordPress core, themes and plugins across multiple servers** so that managing multiple server instances for a site that needs to scale would be easier and handled by the hosting company. (ref: Ticket #13067 - Configuration of Plugin and Theme Repository/ies) **UPDATE #2:**   * Yet _another_ feature would be to offer an option to use a **Sphinx Search** server and to interface it with WordPress using one of these plugins:     * WP Sphinx Search     * WordPress Sphinx Search Plugin     * WordPress Sphinx Plugin     * Search API (See Also) **UPDATE #3:**   * **Cron scheduling via robust and reliable Linux cron** as an alternative to WordPress' pseudo-cron (see also and this). Possibly incorporate admin functionality i.e. with one of the following plugins:      * Crony CronJob Manager     * Cron View Plugin     * WP-Crontrol **UPDATE #4:** Over on the LinkedIn WordPress group someone offered free hosting and I asked him what his service would offer **to which he replied the following** (need to become a member to see this link, membership is free but I think you have to be approved by the group moderator first):   * suPHP   * PHP Minify   * FFMPEG   * PHP Mcrypt and all Dependancies    * ION Cube Loaders   * GD Library   * LAME   * MPlayer/MEncoder   * Zend Optimizer   * AMR codec support   * AC3 codec support   * AAC codec support   * MP3 codec support   * OGG/Vorbis codec support   * x264 codec support   * DivX/XviD codec support   * win32 codec support   * FLVtool2   * W3 Total Cache plugin for use with Highwinds CDN In addition to those items he also mentioned:   * Latest up to date version of PHP    * Latest up to date version of MySql    * MySql configured with high allocations of RAM   * Systems configured to do their best not to run anything in Swap And in addition to all the above someone else in the group suggested it would be nice to have:   * Opcode PHP cache like APC or eAccelerator **UPDATE #5:**   * The question " **What steps can I take to optimize wordpress in regard to server load**" has some useful comments related to this topic.


title: Integrating WP as a CMS with a Bug Tracker

text: First of all, I can't use Trac, which is what the WP dev community uses to track bugs. However, my consulting company is using WordPress as a CMS for just about everything - product information, sales portal, news site, etc. I'd like to set it up to integrate our plug-in listing with a bug tracker ... Right now, I have Flyspray set up as a standalone bug tracker. It works alright, but it's a separate domain (http://bt.jumping-duck.com) so that it remains separate from WordPress. But I'd like to be able to pull in numbers of tickets onto the WP page listing our plug-ins. Ideally, users could also submit bug reports directly from the plug-in info page. Does anyone have any experience integrating WP with a bug tracking system like this? Should I stick with keeping the two systems separate?


title: How do I reset a self-hosted Wordpress URL?

text: i was using a wordpress install on an ubuntu server virtual machine. At first the adapter was host-only at an address of 192.168.55.55. The host had this on a vboxnet0 subnet.   i changed to bridged adapter to try port forwarding from the router, and now i cant access the page with the new address.   the new address is 192.168.1.5 and everything appears fine on routing tables of host.   i also cleared the dnsCache on the host.   but when i type in:   192.168.1.5/wordpress   in the browser, the activity bar shows it is trying to contact the old ip of 192.168.55.55, which was the vboxnet0 host-only adapter.


title: Create Read Only Admin

text: Is there an easy way to create an admin user that has read only permissions? That is, they can login and see everything an admin can, but they cannot change anything at all.


title: How do I attach a php file to an arbitrary slug and still have access to the wp-core functions?

text: Based on an example found here and several others, I am trying to load a non wordpress page from a specific URL while having access to the wordpress core. I have the following code (which seems to work as expected) to hook into the `template_redirect` action:               function templateRedirect() {         global $wp;         if ( $wp->query_vars['pagename'] == 'nlm-admin-thumbnail' ) {             global $wp_query;             // if we have a 404 status             if ($wp_query->is_404) {                 // set status of 404 to false                 $wp_query->is_404 = false;                 $wp_query->is_archive = true;             }             // change the header to 200 OK                  header("HTTP/1.1 200 OK");             //load our template             include( dirname( __FILE__ ) . '/thumbnail.php' );             exit;         }     }          add_action('template_redirect', 'templateRedirect');      My problem comes when executing the code in `thumbnail.php`. This file is supposed to download a thumbnail of a webpage and output the raw image. The nlm-admin-thumbnail slug is used as the src for an image tag. When I execute the thumbnail.php I keep getting `undefined function some_wp_function()`. I have included http.php and class-http.php from the wp- includes folder. Now that I have included those, the next error is `undefined function apply_filters()`. Does loading a php file in this way not give me access to the wp core, and should apply_filers() not accessable?


title: posts-2-posts embedding post title of connected posts

text: I'm trying to create a default title for all the posts that are created, the title is generated by a couple of things, such as the post fields. I was able to write code for getting the post fields into the title, but I can't seem to figure a way out to get the posts-to-posts connected post's title into the title of the post that's being created. I tried to add the following code into a function that I already created..               $connected = new WP_Query( array(         'connected_type' => 'posts_to_anime',         'connected_items' => get_queried_object(),         'nopaging' => true,         ) );              $animetitle;              while ( $connected->have_posts() ) : $connected->the_post();                              $animetitle = get_the_title();                  if (isset($animetitle)) {                 break;             }                 endwhile;      This was embedded into the following function, which works perfectly if the above code isn't present..               function my_acf_save_post( $post_id ) {     // vars     $episode_number = get_field('anime_episode_number' , $post_id );          if( $episode_number )     {         remove_action('acf_save_post'   , 'my_acf_save_post'   , 20);              $connected = new WP_Query( array(         'connected_type' => 'posts_to_anime',         'connected_items' => get_queried_object(),         'nopaging' => true,         ) );              $animetitle;              while ( $connected->have_posts() ) : $connected->the_post();                              $animetitle = get_the_title();                  if (isset($animetitle)) {                 break;             }                 endwhile;              $my_post = array();         $my_post['ID'  ] = $post_id;         $my_post['post_title'] = $animetitle." Online Episode ".$episode_number;         $my_post['post_name'] = $animetitle."-online-episode-".$episode_number;              wp_update_post( $my_post );     }     }              // run before ACF saves the $_POST['fields'] data              add_action('acf_save_post'   , 'my_acf_save_post'   , 20);      Now with the connected posts code added I get the following error               Warning: Could not find direction(s). in /home2/asdf/public_html/wp-content/plugins/posts-to-posts/core/query-post.php on line 16          Warning: Cannot modify header information - headers already sent by (output started at /home2/asdf/public_html/wp-content/plugins/posts-to-posts/core/query-post.php:16) in /home2/asdf/public_html/wp-includes/pluggable.php on line 876      I just want to figure out what is called by posts 2 posts or what not when the post is created. That way I could probably use that to grab the post title of the connected post and embed it into the post title of the post that's being created.


title: Working with arrays/foreach statements - echo results? Addition operator w/foreach... multiplying?

text: I'm really struggling with this - I'm relatively new to PHP but I'm trying make this code that I've pulled together output a list of chapters sorted by user pageviews based on a user_meta field called "total_user_postviews". Chapters are defined by another user_meta field called "chapter_name". When users have "chapter_name" x - they are a part of the chapter. Here is my code (updated to reflect what I've been working on for the past hour)                   <?php              // WORKS - get all editors and contributors         $contributor_query = new WP_User_Query(                 array   (                            'role'      => 'contributor',                     )                    );         $contributors = $contributor_query->get_results();         $editor_query = new WP_User_Query(                     array   (                                'role'      => 'editor',                         )                        );         $editors = $editor_query->get_results();         $users = array_merge ( $editors, $contributors );                           // WORKS - get all chapter names from users and store in array         $chapter_names = array();         foreach ( $users as $user ) {             $user->ID;             $chapter_name_variable = $user->chapter_name;             $chapter_names[] = $chapter_name_variable;              }                   // WORKS - get rid of all duplicate chapter names            $chapters_unique = array_unique ( $chapter_names );                            // SORT OF WORKS - NOT GETTING "TOTAL COUNT"/KEY VALUE - open the total chapter count array             $chapter_total_count = array();                        // look at each unique chapter, and get all users with that user_meta         foreach ( $chapters_unique as $chapter_unique ) {                          $user_fields = array( 'chapter_name', 'ID', 'user_email' );                     $chapter_members = new WP_User_Query(                                     array   (                                         'fields' => '$user_fields',                                         'meta_query' => array(                                                 'key'     => 'chapter_name',                                                 'value'   => $chapter_unique,                                               )                                         )                                     );                      // of those users who have the same user_meta, get their post_view meta and add up all users in the chapter post_view counts                                     $total_count = 0;                             foreach ( $chapter_members as $chapter_member ) {                                 $chapter_member->ID;                                 $chapter_member_views = $chapter_member->total_user_postviews;                                       //  echo $chapter_member->user_email; ?                                      $total_count = $total_count + $chapter_member_views;                             }                                     $chapter_total_count[] = array ( $chapter_unique => $total_count );         }                   print_r($chapter_total_count);                      ?>      I'm now trying to echo a list of all chapters, their users, and the total chapter count - sorted by total chapter count. **I think I'm having trouble with the addition: for some reason $total_count = 0 + $chapter_member_views (let's say it's 50) is multiplying by 8 and outputting 400. When tested with integer 1 ($chapter_member_views field) - it var_dumps 8?** Does anyone know why this might be happening?


title: How to disable empty <p> tags in comment_text()

text: Im not sure if you guys have encountered this problem, but WordPress appends empty `<p>` tags before and after the body of text from the `comment_text()` function. Strangely, when you `echo get_comment_text()` or `echo $comment->comment_content` (same thing) the empty `<p>` tags disappear before and after the body of text. This is entirely exclusive to a call to `comment_text()`. If you'd like to recreate it the problem, give your `<p>` tags top and bottom padding. Anyway to fix this?


title: Disable comments

text: I'm wondering if there's any way to prevent users from leaving comments but still display the comments form? So, whenever a new comment is posted, it should be automatically trashed or it shouldn't be added at all. The comment form I have is for presentational purposes only and it shouldn't accept any comments but it should be displayed. I've already found `preprocess_comment` and `comment_post` hooks but I'm out of ideas on how to utilize that to block commenting. I'm thinking about something like:               function prefix_delete_comments( $comment_id ) {       wp_delete_comment( $comment_id, true );     }     add_action( 'comment_post', 'prefix_delete_comments');      but will this work or will it cause some errors in later execution?


title: unknown issue in 'header.php' preventing theme from displaying fully

text:
My theme is currently activated and showing only the background image and the "home" link. I believe the issue lies within header.php, but I can't quite figure out what. Any ideas? (Also, is there a php validator I could run my code through, or would a WP theme's code be too WP specific?)               <!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('template_directory'); ?>/img/favicon.ico" />         <?php wp_head(); ?>

                 <a href="<?php bloginfo('url'); ?>">

<a href="<?php bloginfo('url'); ?>">Home
                     <?php wp_lists_pages('title_li=&include=9,5,60,62,64'); ?>


title: Multiple variables through wp_get_image_editor

text: I want to merge 2 images with imagick.   I already know how to merge them with imagick, but I need to pass 2 variables through `wp_get_image_editor` to get this to work. I named the 2 variables `$background` and `$logo`. `$background` contains the background image path. `$logo` contains the logo image path. Does anyone know how I should do this?


title: How to remove some media upload icons from post editor?

text: I would like to remove some of the media upload buttons just above TinyMCE in the Add post screen, how can I do that? Thanks.


title: WordPress keeps altering my embed code

text:
Every time I edit a WordPress post or page that has a google map embedded in it - useing the "visual" edit mode - wordpress deletes part of the data. for example: this
View 1825 Spartanburgh Map in a larger map      turns into               View 1825 in a larger map      Which does not render the map at all. This does not happen when I edit in "html" mode. How can I prevent Wordpress from altering this embed code?


title: Make sub menu items a main link in the admin menu using fuctions.php

text: I am trying to customize the admin area using the functions.php file to make things easier for my clients. One request I have got before and hope to be able to accomplish, is to move some of the sub menus into the main navigation. For instance I would like to make Widgets and Menus appear in the main navigation as opposed to being a submenu for Appearances. I would then end up removing the Appearances tab all together. I have been able to remove the tab but unable to make the new buttons for Widgets and Menus. Even if I can get help of not technically moving them but instead creating a new button and setting the link myself (ex. for Menus -> /nav-menus.php). Is any of that possible? Thanks


title: Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page

text:
I am working with custom post types and I had trouble with the nav menu not getting the `.current-menu-item` on my `custom post archive page` menu item. In fact, when I was on that page or any of the `custom posts`, instead of the cpt archive menu item getting the current class, the menu item pointing to the articles was getting the `.current-menu-item` (blog page in my case). After several hours, google, tests and hacks, I found this thread on wordpress and here's a copy past edited version of the workaround fix:               // As of WP 3.1.1 addition of classes for css styling to parents of custom post types doesn't exist.     // We want the correct classes added to the correct custom post type parent in the wp-nav-menu for css styling and highlighting, so we're modifying each individually...     // The id of each link is required for each one you want to modify     // Place this in your WordPress functions.php file          function remove_parent_classes($class)     {       // check for current page classes, return false if they exist.         return ($class == 'current_page_item' || $class == 'current_page_parent' || $class == 'current_page_ancestor'  || $class == 'current-menu-item') ? FALSE : TRUE;     }          function add_class_to_wp_nav_menu($classes)     {          switch (get_post_type())          {             case 'artist':                 // we're viewing a custom post type, so remove the 'current_page_xxx and current-menu-item' from all menu items.                 $classes = array_filter($classes, "remove_parent_classes");                      // add the current page class to a specific menu item (replace ###).                 if (in_array('menu-item-171', $classes))                 {                    $classes[] = 'current_page_parent';              }                 break;          }         return $classes;     }     add_filter('nav_menu_css_class', 'add_class_to_wp_nav_menu');      This solution works when we use the menu item id, but I find it very ugly and it's impossible to use this for plugin development... Any _other idea_ for selecting the menu item corresponding to the archive page of the custom posts when we are on the archive page or on one of the custom posts in a cleaner way? _In other words, an archive template isn't supposed to select it's own menu item out of the box?_ I'd never tought that highliting an element in the wordpress nav menu could have been a problem with custom post types, I'm a bit disapointed. Anyway, here are nnippets of codes I use to manage my custom posts (artist): **artist.php** :               /****************************************************************     * Custom Post Type     ****************************************************************/          add_action( 'init', 'custom_post_artist' );     function custom_post_artist()     {       $labels = array(         [...]         );            register_post_type( 'artist',         array(           'labels' => $labels,           'public' => true,           'menu_position' => 15,           'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'revisions', 'excerpt'),           'show_in_nav_menus' => true,           'show_in_menu' => true,           'taxonomies' => array( 'artist_genre', 'artist_music_type' ),           'has_archive' => 'artistes',           'rewrite' => array( 'slug' => __('artistes', 'ppdev'), 'with_front' => False )           )         );     }          /****************************************************************     * Templates     ****************************************************************/          add_filter( 'template_include', 'include_tpl_function', 1 );     function include_tpl_function( $template_path )     {       if ( get_post_type() == 'artist' )       {         if ( is_single() )         {           // checks if the file exists in the theme first,           // otherwise serve the file from the plugin           if ( $theme_file = locate_template( array('single-artist.php') ) )           {             $template_path = $theme_file;           }           else           {             $template_path = ARTIST_PATH . 'templates/single-artist.php';           }         }          else if( is_archive() )         {           if ( $theme_file = locate_template( array('archive-artist.php') ) )           {             $template_path = $theme_file;           }           else           {             $template_path = ARTIST_PATH . 'templates/archive-artist.php';           }         }       }       return $template_path;     }      Very basic archive template page: **archive-artist.php** :

         <?php if ( have_posts() ) : ?>
Latest artists
                                             <?php while ( have_posts() ) : the_post();                $thumbnail_attr = array(             'class' => "aligncenter",             'alt' => get_the_title()           );
             <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">               <?php the_title(); ?>
                if ( has_post_thumbnail() ) : ?>               <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">                 <?php the_post_thumbnail( 'full', $thumbnail_attr ); ?>                                      <?php endif; ?>           <?php endwhile; ?>                       <?php global $wp_query;        if ( isset( $wp_query->max_num_pages ) && $wp_query->max_num_pages > 1 ) { ?>        <nav id="<?php echo $nav_id; ?>">
<?php next_posts_link( '← Previous artists' ) ); ?>

<?php previous_posts_link( 'Next artists →' ); ?>
                <?php };       endif; ?>

      _Note: Also tested with twenty twelve theme and same issue_


title: Transfer WP from subdomain to main domain

text: I've set up a redesign of a site in the subdomain to work out any kinks and to make sure everythings working ok before setting it up on the root domain. I've looked up transfers but have only found info on transfering from host to host or from local to host. I've set up a wordpress site that was previously locally hosted, so I know how to transfer a site, I'm just hoping that there is an easier way to do this since this is transferring from subdomain to domain - like hopefully without having to reinstall wordpress... Any solutions or suggestions welcome. Thanks in advance.


title: FTP Widget Location

text: I am trying to recover some code I had several months ago (I have backups of everything). It was part of a text widget in my WordPress sidebar. If I have the full backup, where can I find that code? I can't seem to find that folder.


title: exposing attachment uploading to the front end -- delicate

text: i'm probably breaking a few common sense rules here. > **is there a way to utilize wordpress' bake in attachment file handling for > an upload form within a theme template? yes, the front end -- i know.** i’m creating a memorial site and i want people to be able to leave textual photographic "comments" for a dear person our community has lost. but these aren't wordpress users. they're aunts and kids and everything in between. these people are not going to be able to figure out WP default media UI and i don't want them having to log in and futz around. too confusing for them. if this weren't such a specific and delicate project, i wouldn't be trying to bend the rules so much. i understand that i'm opening up security holes by allowing anyone to upload a file, but i think it's somewhat necessary. all uploaded attachments will be "pending." i have both the text and photos set a custom post type, not as comments, so that i can utilize some built in post data. and it would be _great_ if i could utilize worpdress built in file checking, handling, naming, size... etc. even though the file handling is on the front end. i thought that perhaps i could use: **wp_handle_upload()** by including **'../wp-admin/includes/file.php'** but that didn't work. i get a fatal error when i try to include it. is it just TOTALLY against the rules to include admin includes within templates... probably. i could just do all the file handling myself, but thought perhaps there's a way to utilize wordpress' functionality and that it may be safer. or are there suggestions on another route i should be going on altogether? unfortunately this is pretty time sensitive... the memorial service is coming up in a few days. thank you so much jonah


title: Shall i disable pingbacks and trackbacks in my blog?

text: Under Settings->Discussion there is the following option: [x]Allow link notifications from other blogs (pingbacks and trackbacks) Whats the real benefit for a blog owner to have them enabled? (besides knowing who is linking your content i mean) Is there any downside in turning that off? Thanks a lot


title: Multiple posts with one loop iteration

text:
I want 3 post with one loop iteration, so I'm using `the_post()` to achieve this: (html removed)               <?php while ( have_posts() ) : the_post();              the_title();         the_post();         the_title();         the_post();         the_title();          endwhile; ?>      The problem starts, if number of posts is not divisible by 3. For example, if I have 5 posts, than this loop will still try to display 6 of them, generating empty html. How can I work it out? Or maybe I'm trying to achieve this functionality the wrong way? @edit: Here is HTML I wanna output to clarify my question:

Title

Content

Title

Content

Title

Content

Title

Content

Title

Content

Title

Content

      So I want to surround every 3 posts with `.row`.


title: Getting the parent from the wp_term_taxonomy

text: Is there a built in wordpress function that let's me look up the "parent" field of the `wp_term_taxonomy` table if I pass the `TT_ID` to it? Something like               get_value ( $wp_table_name, $id_fieldname, $id_value,     $the_field_info_to_retrieve )      Example               get_value ( "wp_term_taxonomy", "term_taxonomy_id", "parent");


title: My website not showing 404 error!

text: My self-hosted website is no more showing 404 errors (of course for the pages that don't exist). I edited the 404 template of my theme and just updated the written text of the heading and body text, nothing else, and I get this now. When I open a page that doesn't exist on my website, like (mywebsite).com/anythinguseless, the tab loads in a moment and shows just the link in the tab title. To be technical, it opens a webpage with nothing:               <html>              <head></head>         <body>         </body>          </html>


title: How to add only a (sub) capacity to an user role?

text: I know I can add capabilities to the any role using the role object and add_cap via functions.php               <?php        // get the the role object        $editor = get_role('editor');        // add $cap capability to this role object        $editor->add_cap('edit_theme_options');     ?>       The **list of capabilities** shows that "edit_theme_options" allows access to almost all items under _Appearance_ (all but _edit theme_ ). **What I wold like to do is add capacity to access only _Appearance>Menu_ to a role. Is this possible without modifying the core?** The two most popular ACL editing plugins (Members and User Role Editor) don't allow for this as they only use the default _list of capabilities_


title: WP_Query orderby and tax_query

text:
My goal is to have custom posts type's posts (CPT for simplicity) from a custom taxonomy (CT for simplicity) let say CT Hometown with slug Nebraska to be listed grouped by another CT, let say activity_categories. I've achieved 50% of the task, and i'm able to do the other 50% but not together on the same query. Let see first case where I list all posts from my CPT grouped by a hometown's CT               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $activities_args = array(         'post_type' => 'activities',         'paged' => $paged,         'posts_per_page' => '15',         'orderby'        => 'taxonomy.activity_categories',         'ordertax'       => 'ASC',         'order'          => 'DESC'     );          add_filter('posts_clauses', 'orderby_tax_clauses', 10, 2 );     $activities_query = new WP_Query( $activities_args );     remove_filter('posts_clauses', 'orderby_tax_clauses', 10, 2 );          if ( $activities_query->have_posts() ) {         echo '
';         $current_taxonomy = '';         while ( $activities_query->have_posts() ) {             $activities_query->the_post();                  $first_activities_categories = '';             $terms = get_the_terms( get_the_ID(), 'activity_categories' );                  if ( $terms && ! is_wp_error( $terms ) ) {                 foreach ( $terms as $term ) {                     if (empty($first_activities_categories)) {                         $first_activities_categories = $term->name;                         $first_activities_categories_desc = $term->description;                     }                 }             }                  if($current_taxonomy != $first_activities_categories) {                 if (!empty($current_taxonomy)) { echo '

'; }                 echo '

'.$first_activities_categories.'

'.$first_activities_categories_desc.'
';                 echo '
';                 $current_taxonomy = $first_activities_categories;             }             echo '
';             the_title( '
', '
' );             the_excerpt();             echo '
';         } /* while ( have_posts() ) */         echo '

';     } /* if ( have_posts() ) */     show_pagination($activities_query);      and in my functions.php               function orderby_tax_clauses( $clauses, $wp_query ) {         $orderby_arg = $wp_query->get('orderby');         if ( ! empty( $orderby_arg ) && substr_count( $orderby_arg, 'taxonomy.' ) ) {             global $wpdb;             $bytax = "GROUP_CONCAT({$wpdb->terms}.name ORDER BY name ASC)";             $array = explode( ' ', $orderby_arg );             if ( ! isset( $array[1] ) ) {                 $array = array( $bytax, "{$wpdb->posts}.post_date" );                 $taxonomy = str_replace( 'taxonomy.', '', $orderby_arg );             } else {                 foreach ( $array as $i => $t ) {                     if ( substr_count( $t, 'taxonomy.' ) )  {                         $taxonomy = str_replace( 'taxonomy.', '', $t );                         $array[$i] = $bytax;                     } elseif ( $t === 'meta_value' || $t === 'meta_value_num' ) {                         $cast = ( $t === 'meta_value_num' ) ? 'SIGNED' : 'CHAR';                         $array[$i] = "CAST( {$wpdb->postmeta}.meta_value AS {$cast} )";                     } else {                         $array[$i] = "{$wpdb->posts}.{$t}";                     }                 }             }             $order = strtoupper( $wp_query->get('order') ) === 'ASC' ? ' ASC' : ' DESC';             $ot = strtoupper( $wp_query->get('ordertax') );             $ordertax = $ot === 'DESC' || $ot === 'ASC' ? " $ot" : " $order";             $clauses['orderby'] = implode(', ',                 array_map( function($a) use ( $ordertax, $order ) {                     return ( strpos($a, 'GROUP_CONCAT') === 0 ) ? $a . $ordertax : $a . $order;                 }, $array )             );             $clauses['join'] .= " LEFT OUTER JOIN {$wpdb->term_relationships} as relationship ";             $clauses['join'] .= "ON {$wpdb->posts}.ID = relationship.object_id";             $clauses['join'] .= " LEFT OUTER JOIN {$wpdb->term_taxonomy} ";             $clauses['join'] .= "USING (term_taxonomy_id)";             $clauses['join'] .= " LEFT OUTER JOIN {$wpdb->terms} USING (term_id)";             $clauses['groupby'] = "object_id";             $clauses['where'] .= " AND (taxonomy = '{$taxonomy}' OR taxonomy IS NULL)";         }         return $clauses;     }      this part work really well but that remove me the posibillity of an tax_query args if I add :               'tax_query' => array(         array(             'taxonomy' => 'hometown',             'field' => 'slug',             'terms' => 'nebraska'         )     )      to my `$activities_args` i receive this error               WordPress database error: [Column 'term_taxonomy_id' in from clause is ambiguous]     SELECT SQL_CALC_FOUND_ROWS wp_vnr_posts.ID FROM wp_vnr_posts      INNER JOIN wp_vnr_term_relationships ON (wp_vnr_posts.ID = wp_vnr_term_relationships.object_id)      LEFT OUTER JOIN wp_vnr_term_relationships as relationship ON wp_vnr_posts.ID = relationship.object_id      LEFT OUTER JOIN wp_vnr_term_taxonomy USING (term_taxonomy_id)      LEFT OUTER JOIN wp_vnr_terms USING (term_id)      WHERE 1=1 AND ( wp_vnr_term_relationships.term_taxonomy_id IN (2) ) AND wp_vnr_posts.post_type = 'activities' AND (wp_vnr_posts.post_status = 'publish') AND (taxonomy = 'activity_categories' OR taxonomy IS NULL)      GROUP BY object_id ORDER BY GROUP_CONCAT(wp_vnr_terms.name ORDER BY name ASC) ASC, wp_vnr_posts.post_date DESC LIMIT 0, 15      Thank's in advanced for everyone helping with this question !


title: Make a custom column sortable, by custom post count

text: I have the following code which at the moment displays all posts from post_type `product` in a column called Art in the users section of wp-admin. (slightly modified from https://pippinsplugins.com/add-user-id-column-to-the- wordpress-users-table/)               add_filter('manage_users_columns', 'pippin_add_user_id_column');     function pippin_add_user_id_column($columns) {         $columns['art'] = 'Art';         return $columns;     }          add_action('manage_users_custom_column',  'pippin_show_user_id_column_content', 10, 3);     function pippin_show_user_id_column_content($value, $column_name, $user_id) {         query_posts(array(                  'post_type' => 'product',                 'author' => $user_id,             ) );                  $count = 0;                 while (have_posts()) : the_post();                      $count++;                  endwhile;                 // echo $count;                 $art = $count;             wp_reset_query();         if ( 'art' == $column_name ) {             $pwc_link = admin_url() . "edit.php?post_type=product&author=".$user_id;             return ''.$art.'';         }         return $value;     }      I've found this tutorial, which explains how to make admin columns sortable http://code.tutsplus.com/articles/quick-tip-make-your-custom-column-sortable-- wp-25095 and so I added the following code afterwards:               add_filter( 'manage_users_sortable_columns', 'my_sortable_cake_column' );     function my_sortable_cake_column( $columns ) {         $columns['art'] = 'art';              //To make a column 'un-sortable' remove it from the array         //unset($columns['date']);              return $columns;     }      But the part I'm stuck on now, is telling WordPress how to sort the data. The example they use is:               add_action( 'pre_get_posts', 'my_slice_orderby' );     function my_slice_orderby( $query ) {         if( ! is_admin() )             return;              $orderby = $query->get( 'orderby');              if( 'slice' == $orderby ) {             $query->set('meta_key','slices');             $query->set('orderby','meta_value_num');         }     }      But there is no meta_key or query that I know of where I can orderby a custom post type count... So I'm a bit stuck. I'm sure its a case of doing another query_posts with post count, but how do I order results based from that? Any help would be great, all I want to do is order the users by Art (custom post type product) count when you click on the Art column.


title: Very Quick Custom Pluggable Function Question

text: Lets say I have a function set up like such:               add_action( 'init', 'jigoshop_add_to_cart_action' );          function jigoshop_add_to_cart_action($url = false){     //code     }      To make it pluggable by others plugins, I just need to change this to               add_action( 'init', 'jigoshop_add_to_cart_action' );     if (!function_exists('jigoshop_add_to_cart_action')) { //ADD THIS     function jigoshop_add_to_cart_action($url = false){     //code     }     } //AND THIS      right?


title: Why use wp_send_json() over echo json_encode()?

text: When sending a JSON response back to an AJAX request, why use the WordPress function `wp_send_json()` and not `echo json_encode()`? What is the benefit of using the WordPress function `wp_send_json()` over `echo json_encode()`? Ref: `wp_send_json`


title: Creating Content for Custom Tab in WooCommerce

text: I'm working with a set of three products in WooCommerce, each of which is made up of multiple "items" (custom post types). These are linked to the product using a relationship custom field. In my functions.php file, I set up a custom tab. Then, to populate it with content, I wanted to loop through the Items associated with each post. I would use a standard `the_field("kit_items");` approach, but I first need to loop through each department (custom taxonomy) and then print the items under that taxonomy. In order to accomplish this, I have to create a custom query, so that nixes my original approach. My problem is this: something about the `have_posts();` is breaking the functionality of the tab. The content is being displayed, but not within the tab, and it's causing the footer not to render. I've been debugging and narrowed it down to that code, but I can't find any solutions to fix it. Are there any alternative ways of accomplishing this?               $itemlist = new WP_Query( $args );          echo '<ul class="singleItems">';              while ( $itemlist->have_posts() ) : $itemlist->the_post();               $id = get_the_ID();               $title = get_the_title();                          if (in_array($id, $kitArray)){                   $class = "active";              } else {                   $class = "inactive";              } //end if             endwhile;


title: Wordpress and advanced custom fields subcategory inherit category color automatically

text: ![Adding Category and subcategory](http://i.stack.imgur.com/vjR1c.jpg) Hi is it possible if I added a subcategory and inherit the parent category's color? currently im using advanced custom field plugin. i dont know to show it inthe front end that if the user left the subcategory colorless it should automatically inherit the parent color..


title: How to add a "custom" date field to a custom post type?

text: Hey guys, I'm building a portfolio (which is a custom post type) and I want to store the date of the projects. I can achieve it the "regular" way with a meta box but I would like a "datepicker" or something like it. Any idea how?


title: WordPress - using sessions?

text: http://diovo.com/2009/10/using-sessions-in-wordpress/ This is working on one blog,but not on other,what could be the problem? How to find what is a problem? Tnx in advance


title: RSS Feed setting limit for email subscriptions

text: Hello I set my RSS feed limit to 100 but am getting complaints that when subscribing by email they are sent 100 emails. I would like a Feed Reader to load all 100, but when subscribing by email set the limit to 10.’ Is there a code I can use in functions file to achieve this? Thanks!


title: Multi-site: removing /blog from posts

text: I'm deploying a multi-site network, using subfolders. I've found on the main site the permalinks for news posts can only be placed like so:               /blog/%year%/%monthnum%/%postname%/      I understand that this prefix is needed to lessen the risk of conflict between the main site and sub-sites. Unfortunately this is a serious website, where the word 'blog' isn't really appropriate. Something like `/pressreleases` would be much more appropriate, and still avoid conflicts. I tried various of the 'tricks' people mention, such as editing the permalink structure from the network admin settings. I also tried using rewrite rules (both Apache and the Redirection plugin) without much luck. WordPress needs to believe the posts are at the location in the address bar, so rewriting results in a 404. I could redirect them back to `/blog`, but that still has the same problem. How can I change the permalinks?


title: Is there a limit to number of pages displayed for selection in custom menu?

text: I recently started working with a client who has over 400 pages on their WP site (yes, pages, not posts). Their menu needs to be redone, so I decided to go the 'custom menus' route. However, not more than a third of the pages are available to select from the 'Pages' meta box on the Menus page. And 'search' does not seem to work (typing in the page title, even of pages that do show in the box, results in 'No results found' message. In short, some of the pages I need to add to the menu are not available for me to select. What's up with this? And how do I solve it? Also, if I select on-site pages as 'custom links', will WP still add classes to the links to indicate they are 'current page' or 'current page ancestor'?


title: How do themes provide support for child themes?

text: One of the requests on themeforest is that themes are required to provide child theme support. I know what child themes are, although I haven't worked a lot with them, but I would like to know is there something that my theme must have to _support_ child themes?


title: I need to move the "php_errors.log"

text: I want to move the "php_errors.log" file from the root directory of the website (working with wordpress). Of course if I directly move it into a directory like "logs/", the file will be regenerated, so I need to find where this file is defined, then I can change the path. I found one line in the "php.ini" with -> "error_log = php_errors.log" Can I change the path directly in here ? Do I need to find another way inside the wp-conf.php, or in any wordpress configuration files ? I thank you in advance for your help you can give.


title: $wpdb not being defined in function: Fatal error: Call to a member function query() on a non-object

text: For some reason the $wpdb object is not being defined in one particular function. I have four other functions in the file that are using $wpdb and all are working fine except this one simple delete function where I get the error: **_Call to a member function query() on a non-object..._** The following is the function in question:               function delete_gallery( $gallery_id ) {         global $wpdb;              $sql = "DELETE from galleries WHERE gallery_id = $gallery_id";         $deleted = $wpdb->query( $sql );          }       I have a link (delete gallery) on the plugin admin settings page that links to delete-gallery.php that calls the delete function and returns back to the admin page. The contents of that file are:               include 'ga-functions.php';          if (isset($_GET['gallery_id'])) {         $gallery_id = $_GET['gallery_id'];         delete_gallery($gallery_id);              wp_redirect( $_SERVER['HTTP_REFERER'] );         exit();     }      If I var_dump on the $wpdb after initializing I get the result of NULL. Anyone have any suggestions on what could be causing this in only one particular function like this.


title: get_term_children for immediate children only (not grandchildren)

text:
I want to display term children of a custom taxonomy. Currently, I am able to do this using **get_term_children** , but using this, it displays children and grandchildren, I want to avoid this and make that only immediate children are shown. This is what I have right now ( but it outputs children and grandchildren) :               <?php     $term_id = get_queried_object_id();     $taxonomy_name = 'mytaxname';          $termchildren = get_term_children( $term_id, $taxonomy_name );          foreach ( $termchildren as $child ) {         $term = get_term_by( 'id', $child, $taxonomy_name );         echo '
';             echo '

' .$term->name. '

';  }     ?>      This is what I am trying to get to work so it shows only immediate children:               <?php     $term_id = get_queried_object_id();      $taxonomy_name = 'mytaxname';          $args = array('parent' => $term_id,'parent' => $term_id );     $termchildren = get_terms( $taxonomy_name, $args);          foreach ( $termchildren as $child ) {         $term = get_term_by( 'id', $child, $taxonomy_name );         echo '
';             echo '

' .$term->name. '

';  }     ?>      This gives me a error : **Catchable fatal error: Object of class WP_Error could not be converted to string in...** What did I do wrong? Thanks!


title: Permalink Rewrite for Custom Taxonomy

text: I have added a custom taxonomy called 'Boards' with the following code               function add_custom_taxonomies() {              register_taxonomy('board', 'post', array(             'labels' => array(                 'name' => _x( 'Boards', 'taxonomy general name' ),                 ~snipped~             ),             'rewrite' => array(                 'slug' => 'board',                 'with_front' => false,                 'hierarchical' => true             )         ));     }          add_action( 'init', 'add_custom_taxonomies', 0 );      If I have 2 boards with the same name "My Board", the urls will be   1) mydomain.com/boards/my-board/   2) mydomain.com/boards/my-board-2/ I would prefer to use the board/term ids so that the urls are   1) mydomain.com/boards/15/   2) mydomain.com/boards/16/ Possible?


title: Get $curauth level

text: I am trying to get the user level of the author that is displayed on an author page (not the current user that is logged in, but the user that is presented on the current author page that I am viewing) I am using this code               <?     get_currentuserinfo() ;     global $user_level;     if ($user_level >= 4) {          include (TEMPLATEPATH . '/author_1.php');     } else {         include (TEMPLATEPATH .'/author_2.php');     }     ?>      I tried to replace $user with $curauth but still no results, it is showing only one template for both. Any ideas? thank you


title: Make a plugin work on specified domain only

text: I am developing a custom WP plugin for a client and I wish to make sure that the client does not install it on any other domain other than the one specified. If the client tries to install the plugin on other domains, it should throw out an exception and plugin should get deactivated or self destruct. How can I make this happen? What is the code for this and where do I add it? Thanks!


title: Animated GIF on Wordpress posts?

text: We have included couple animated GIF images on our blog post. They animate in the CMS but not on the post itself (unless you click on them). How can we animated them on the post? Many thanks.


title: If statement for admin page

text: How should I write `if` condition to display specific code only when I enter this page:               /wordpress/wp-admin/post-new.php?post_type=slideshow      This is what i was trying to get ;) Thanks to Krzysiek!               function plu_admin_enqueue($hook) {       $screen = get_current_screen();          if ( 'post.php' == $hook && $screen->post_type == 'slideshow' ) {           wp_enqueue_script('plupload-all');                wp_register_script('cplupload', get_template_directory_uri() . '/js/cplupload.js', array('jquery'));           wp_enqueue_script('cplupload');                wp_register_style('cplupload', get_template_directory_uri() . '/css/cplupload.css');           wp_enqueue_style('cplupload');       };     };          add_action( 'admin_enqueue_scripts', 'plu_admin_enqueue', 10 );


title: Get URL of current post but not the page number

text:
Instead of using a plugin, I am manually adding buttons into my template file, like so:               <div class="fb-like" data-href="<?php get_permalink() ?>" data-width="100" data-layout="button_count" data-show-faces="false" data-send="false">
      However, when I have a multipage post, I don't want that the like button links to `/the/post/2` on the second page, but to `/the/post` (i.e. the first page). I have been looking through the docs but there doesn't seem to be a way to get permalink of the post, without the page number. Can anyone help?


title: Re-write specific custom post type category URL to go to another page

text: I know this general question has been asked before (like here and here), but the problem is with my limited experience, I cannot get the results I need looking at other people's code. So here's my question: What is the best way to change the breadcrumb link "Explore" on this page: http://example.com/explore/photos/ from this: http://example.com/explore/explore/ to this: http://example.com/explore/ ? I know this is a bit of a hack - but with my current theme I believe it would be the easiest way to get things working the way I want. The way my current theme is setup, I have a custom post type of gallery, to which I made the slug to be "explore" (to match my site's menu hierarchy). But then, in order to get the "photos" to correctly show up in the hierarchy in breadcrumbs using the SEO Yoast plugin (from what I understand though, the plugin just follows Wordpress when it comes to permalinks), I had to add a gallery category parent of "explore". So all I want to do it "fake" the url of http://example.com/explore/ whenever http://example.com/explore/explore/ is shown. Ideally, this would happen server side as the breadcrumb is written, so when I mouseover the link in the breadcrumb, http://example.com/explore/ would be shown.


title: Custom options page for themes

text: I used this nettuts tutorial to create an options panel. What I'm trying to figure out how to do and have been unsuccessful doing so far (I keep "breaking" the code/getting a server error) when I try to add current user info... I have 3 custom options I want available to clients while the rest are available to the admin only. I tried adding this code in my functions file but I mentioned the errors above.               if(current_user_can('manage_options')) {     array( "name" => "Site Nav Background Image",         "type" => "section"),     array( "type" => "open"),             array( "name" => "Site Nav Background Image",         "desc" => "Paste URL for site navigation background image",         "id" => $shortname."_nav_bkg",         "type" => "text",         "std" => ""),          array( "type" => "close"),     } else {     array( "name" => "Custom CSS",         "type" => "section"),     array( "type" => "open"),             array( "name" => "Custom CSS",         "desc" => "Want to add any custom CSS code? Put in here, and the rest is taken care of. This overrides any other stylesheets. eg: a.button{color:green}",         "id" => $shortname."_custom_css",         "type" => "textarea",         "std" => ""),                 array( "type" => "close"),              }     }      I also tried creating 2 separate options functions and only one would show. Is there an easy solution to this that I'm missing? Can someone show how I am using the above code incorrectly? TIA!


title: JS error when using https

text: I have a form on my site that does a simple math calculation. When I secure the page (https) the calculation will not work, and I get some errors in my console:               [blocked] The page at https://www.disastersafety.org/ofb-ez/risks/risks-form/ ran insecure content from http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js?ver=3.7.1.      /ofb-ez/risks/risks-form/:1     GET https://www.disastersafety.org/wp-content/themes/snapwire-old/inc/js/script.js?ver=3.7.1 404 (Not Found) www.disastersafety.org:38     [blocked] The page at https://www.disastersafety.org/ofb-ez/risks/risks-form/ ran insecure content from http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js?ver=3.7.1.      I am just learning to debug js, but I can't tell if it's the unsecure cdn url causing the problem, or the missing resource: https://www.disastersafety.org/wp-content/themes/snapwire- old/inc/js/script.js?ver=3.7.1 404 (Not Found) What I do know is that if I do not make the page secure, the form works. And if I deactivate the theme itself and switch to 2013 theme, the form works even with https. If the theme itself is the problem, I'm not sure how to go about remedying that, so would appreciate suggestions for a newbie. Thank you so much for your help-


title: Why is only the first operation run in my loop - except for on the last repeat?

text:
We have a custom walker displaying only the sub menu of the current top menu and while making some changes to it I ran into something I don't get - for some reason only the first echo of each loop in the second foreach-loop will actually echo, while the following echos will only echo on the very last loop. Why is that? This is the code:                   $top_level_elements = array();         $children_elements  = array();         foreach ( $elements as $e) {             if ( 0 == $e->$parent_field )                 $top_level_elements[] = $e;             else                 $children_elements[ $e->$parent_field ][] = $e;         }              foreach ( $top_level_elements as $e )             echo 'One thing
'; // Note 1             echo 'Another thing
'; // Note 2             echo '$e->ID: ' . $e->ID . '
'; // Note 3             if ( $e->current || $e->current_item_ancestor || $e->current_item_parent ) {                 $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output );             }                  return $output;         }      Note 1-3 shows my test values. What is echoed is the following:               One thing     One thing     One thing     One thing     One thing     One thing     One thing     One thing     Another thing     $e->ID: 873      While if I remove Note 1-2 I'll get the following, i.e. all the IDs for the top menu items.               $e->ID: 7     $e->ID: 909     $e->ID: 42     $e->ID: 1326     $e->ID: 871     $e->ID: 872     $e->ID: 1383     $e->ID: 873      It's as if any statement within the loop makes every statement after it invalid, except for the on the last repeat. This isn't only true for echos, but for any operation it's just easier to display with echos. This also means that if I echo test variables like the ones above, the menu won't show as by the time the script reaches the if-statement the variables `$e->current` etc. already seem empty. And while I can get around this at this point, as I really don't need to echo stuff here, I really want to know why this is - as it means I can't do any operations within the loop before the if-statement or it will not run the if statement in most cases.


title: What is the relation between taxonomy table and database in WordPress

text: I am new in WordPress. Somebody says that **taxonomy table** is useful in WordPress database. I don't know what is it. Please give the real idea about taxonomy table in WordPress.


title: Custom message on plugin uninstall

text: I'm writing a small wordpress plugin that creates some custom files, but I'm wondering if there is a way to show a quick "reminder" pop-up or message when a user deactivates the plugin. I just want to remind the user to download their custom files before deleting the plugin data, as it deletes the files when the plugin gets deleted. It's not meant to be intrusive at all, just a simple reminder. I tried the answer here "pop-up asking to confirm data deletion", but I couldn't get it working.


title: Moving an image to the side

text: ![enter image description here](http://i.stack.imgur.com/hmC5Q.jpg) How do I move this image on my WordPress site to the left side? I don't know which file to look for and which code to edit.


title: wp_nav_menu $theme_location parameter ignored

text: This is the first paragraph of the documentation of the function `wp nav menu`: > Given a `theme_location parameter`, the function displays the menu assigned > to that location, or nothing if no such location exists or no menu is > assigned to it. However, I am providing a `theme_location` that I have not registered, and in spite of that a menu item appears. Here's my functions.php:               <?php     function register_my_menu() {         register_nav_menu('header-menu',__( 'Header Menu' ));     }     add_action( 'init', 'register_my_menu' ); ?>      And here's how I call the menu:               <?php wp_nav_menu($args = array('theme_location' => 'nonsense')); ?>      On my page, a menu with the default item "Sample page" appears. According to the documentation I cite, nothing should be displayed, because the location "nonsense" should not exist. Is the documentation wrong, or am I making some mistake?


title: how to implement the slide and push menu in wordpress

text: new to this forum & new to wordpress. I have read about Slide and Push menu functionality in **http://tympanus.net/codrops/2013/04/17/slide-and-push- menus/** How to implement this on a WordPress site? I mean, I go the HTML, css part but where to place/upload the js part. In short, how I make this working in a WP site. More details From that tutorial, I have placed the HTML part in a WP post text editor; placed the CSS part in my sites child-theme style.css file; then uploaded the JavaScript in my themes js folder (../wp- content/themes/MyThemeName/js/menuk.js), Then placed               add_action( 'wp_enqueue_scripts', 'exmaple_enqueue' );          function exmaple_enqueue() {       $ss_url = get_stylesheet_directory_uri();       wp_enqueue_script( 'menuk', "{$ss_url}/js/menuk.js" );     }      But nothing seems to work? Any help will be appreciated. Thanks


title: Hook specific functions if on a specific admin page

text: I am having a problem with my theme's options panel and a plugin. Apparently they don't get along very well. Anyway, I need to hook 3 functions on a specific page when I am in the admin panel. More exactly, I need to hook 3 theme options's functions only on the theme options page. I tried to do it using the code below but I can't get it to work. I already searched the web for a workaround but I can't manage to find something good.               function load_required_scripts()     {         if($_GET['page'] === 'theme_options') {         /* required hooks here */         }     }     add_action('admin_init', 'load_required_scripts');


title: Syntax Highlighting inside Tinymce

text: Is there a way to add syntax highlighing _inside_ the tinymce editor?   I mean inside the wysiwyg area. I like to mark block of text as code and that it's highlighted with colors and all that fancystuff. again, I want the highlighting to be visible _inside_ the wysiwyg-editor. Anybody that can help me on my way?


title: Custom field value link title

text:
I need help with auto detecting the URL's title. The links I am going to use a link to the current website's blog posts. The code I have right now:               <?php       $custom_fields = get_post_custom($post_id); //Current post id       $my_custom_field = $custom_fields['Featured-Blog']; //key name       foreach ( $my_custom_field as $key => $url )       echo $key."Title

";     ?>      Instead of "Title" I need the code auto detect the URL's title. Can someone help? My functions.php code:                       $args = array(              'labels' =>$labels,              'public' =>true,              'publicly_queryable' =>true,              'show_ui' =>true,              'query_var' =>true,              'menu_icon' =>get_bloginfo('template_url').'/images/serviceicon.png',              'rewrite' =>array('slug' => 'Featured-Blog'),              'capability_type' =>'post',              'hierarchical' =>true,              'menu_position' =>'',              'supports' =>array('title','editor','thumbnail','custom-fields','excerpt' ),              'has_archive' =>true            );


title: Request parameters in $_GET do not match URL called

text: I have a WP plugin which uses the request parameter "type" to determine what code-file to load in order to do some processing. The code which handles this is as follows:               add_shortcode ('myplugin_frontend_main', 'MyPlugin_user_dispatcher');          function MyPlugin_user_dispatcher ($args=array())     {         $type = $_GET['type'];         $func = $_GET['func'];              $typefile = ucwords($type). '.php';         require_once(dirname(__FILE__) . "/$typefile");         $class  = 'MyPlugin_Controller_' . ucfirst($type);         $object = new $class();         echo $object->$func($args);     }      The strange thing is this, if I call               http://localhost/wordpress/?page_id=4&type=userform&func=edit&noheader=true&ot=product_add&id=14&store=1      and add               var_dump ($_GET);     exit ();      to the code, my var_dump() prints out the following:               array       'page_id' => string '4' (length=1)       'type' => string 'user' (length=4)       'func' => string 'main' (length=4)       'store' => string '1' (length=1)      So somehow, $_GET does not contain what I call through the address bar (or by clicking on a link with the same content). Does anybody have any idea what's going on here? Greetings/Thanks R


title: Wordpress Stats Plugin: Display Post Views

text: i'am currently using latest version of jetpack. So the stats plugin is also included in this plugin. But now i want to display the number of views the single post get on the single.php file using the data from Stats plugin included in jetpack. So how can i do this?


title: How to make category RSS feeds show full content

text: I'm trying to fix a friend's feed to show full content in the category feed instead of only a summary. He's already done the setting bit, but it still doesn't seem to work. Thoughts? EDIT: The feed in question is http://blogs.gnome.org/happyaron/category/debian/feed/


title: How to show custom post type on homepage and in categories

text: **Details** Wordpress Version: 3.4 Theme Deadline Version 1.2 Site URL: littlenomads Plugin being used to create the Custom Posts Types 1.Types Plugin – Custom Post Types, Taxonomies and Custom Fields 2\. Custom Post Template **Problem:** I have created a custom post type called "Accommodation" which is working fine. However I can't seem to get the custom post types to show up with the categories it shares and on the home page under one of my blocks. This piece of code works on the block, however it only pullsthe custom post type and not the other posts that are also tagged under "pictures".               $tz_recent_posts = new WP_Query(); $tz_recent_posts->query('offset=1&post_type=Accommodation,page,post&caller_get_posts=1&posts_per_page=' . $tz_recent_number . '');      Any assistance that anyone can provide is appreciated.


title: Multisite Backup Plugin

text: Hi Is it possible to backup each blog separately from a multisite installation? Can I do it with: http://wordpress.org/extend/plugins/backwpup/ ?


title: get_terms returns array starting at 4

text: I am using get terms to return a list of terms within a custom taxonomy. It's returning an array but it starts at index 4. How do I get it to start at 0 like normal?


title: Query custom type posts by array of IDs

text: I can't seem to get `post__in` to work with custom post types. Is this true? What's the alternative?               $args = array('post_type' => array( 'post', 'page', 'tf_events', 'duka' ),         'orderby' => 'menu_order', 'showposts' => -1,         'post__in' => explode(',',$mtheme_featured) );     query_posts($args);      `$mtheme_featured` has two ids separated by commas, one post and one tf_event; only the post is shown.


title: wysiwyg is scrambled

text: I have a problem with the wordpress editor. It keeps removing my enters and scrambling the content. How can I solve this problem? ![Error in editor](http://i.stack.imgur.com/xtPMN.jpg)


title: Custom Breadcrumb

text: I have a WP page which Themes supports **projects** (apart from blog posts and pages) Then, I have some subpages with lists of different projects and by clicking on each project, it leads the project single page. Problem is that the Breadcrumb switched from: Home > Page > Sub-page > Projects to Home > Project-name I know it isn't the correct permalink structure to set it as Home > Page > Sub-page > Projects > Project-name But is there a way to create a custom Breadcrumb for a page / project, maintaining the same permalinks structure? Couldn't find any plugin for that


title: Redirection loop error after login from a custom post type post

text: I have created a custom post type called portfolio so such posts have an url like this:               mydomain.com/portfolio/post-name/      This is fine so far, however i just found I am having a problem with my Wordpress login and i believe this is causing it. I have a login link on every post so if you log in from there it is supposed to redirect you back to the same post page but instead you will get a redirection loop error. If you look at the URL which Wordpress is trying to redirect to, you will see something like               mydomain.com//post-name/        notice how "portfolio" is missing from the URL and thats causing the redirection error. How can i address this problem and have the redirection fixed? Thank you.


title: Change default screen option value for posts per page

text: I want to change the default screen option value for posts per page in the wp- admin area when listing posts in `pending` mode. The default value is set to `20`. Changing the value directly in the Screen Options tab will only affect the user, not all users like this answer suggests. Any workable solution?


title: How to add a "data-" attribute to the image tag of native gallery output

text:
While trying to make WordPress and Galleria to become friends I already have a good result. Galleria can easily be used to display native WordPress Galleries. I'm using a plugin but that's not required at all. One thing that already made me pull my hair out, though: The thing I'm missing is a method to _add_ an attribute `data-big` to the image properties of the galleries' thumbnails as that will force Galleria to use the "full" image in fullscreen mode. In HTML this would look like this

      Where Galleria will use `<img>` to display the thumbnail and the `<a href ...>` for the regular image. That works like a charm and almost out of the box. But I didn't find a solution how to   * _add_ an attribute `data-big` to `<img>`   * pass the WP image size (e.g. "full") with that argument Is there anybody who could point me into the right direction or give an example how to do that. Disclaimer: I have some experience with WP filters and hooks but I'm far from being a PHP expert. Thanks in advance. Edit: To be a bit more specific: the value for "data-big" is already available (the large/full-size image) so basically I'd like to add the new attribute to the tag and pass the URL of the full-size image.


title: TinyMCE 4.x : How to customize toolbar on wp_editor()

text: Since upgrading to Wordpress 3.9 (which includes TinyMCE 4.x), I have problems customizing the editor, displayed via `wp_editor()` In the example below, I want to disable the 'fullscreen' button, but this doesn't work.                $settings = array(  'textarea_name' => 'description',                      'quicktags' => false,                      'media_buttons' => false,                      'teeny' => true,                      'tinymce'=> array(                      'theme_advanced_disable' => 'fullscreen'                            )     );     wp_editor( $content, 'description', $settings );      Unfortunately, the documentation for TinyMCE API 4.x isn't as helpful to me as the 3.8 one


title: Utilize Function in Child Theme / Template File

text: With a plugin, I have used require_once in the init.php of a plugin that I have made for my site to make functions available. With a child theme, where should I put the calls to require_once? When I put them into the template file that uses it, it doesn't seem to work. ### EDIT I would have thought that this               locate_template('../../plugins/events-and-bookings/lib/class_eab_event_model.php', true, false);      Would be equivalent to this:               if (!function_exists('jupiter_init')) {         function jupiter_init() {             require_once('../../plugins/events-and-bookings/lib/class_eab_event_model.php');         }     }      But the first code snipper isn't working (but the second one is). I am placing both in the functions.php file of my child theme right after the initial


title: How to exclude custom fields from search queries?

text: I'm building a hotel search engine and I've first created a custom content type "hotel" with Types & Views Toolset. I'm using "Search everything" plugin to query custom fields and custom taxonomy from this custom content and I've excluded the other content types from functions.php. For now, I have these custom fields : title address zipcode city ... I want to exclude "address" and "title" because some addresses or hotel names contain city names and I just want results from city queries. Is it possible to exclude fields or to only include the city field ? Thank very much


title: Retrieve image from Open Graph of an external URL and set as featured image

text: I would want to retrieve an image of an external link in the content of a post, as to feature it as a thumbnail, sort of how a Facebook status or other similar things would look. I guess that an Open Graph image is enough. There's already functions to capture the first link out of the content of a post (like one bundled on a core WP theme) or I could use a custom field just for it, but not sure about how to capture an image from within the URL itself. I'm aware of a WP function for attaching an image to a post given its specific URL (`media_sideload_image`), which may be useful.