Shortcode interpreted as text

I have the following shortcode in one of my pages               [[Intern: Termine/News]]      This works on a password protected sub page. Now I want that all news of the category Termine/News are on the parent page. So I put the code on the password protected parent page. Now the text is rendered - I only can see the shortcode text. But I should see all the articles! What is wrong? Or do I missunderstanding something? Edit: Figured it out. There was some code directly in the template and so the content in the WP backend was totally ignored. Added the code in the template php file and now it works.


Not the typical order by posts by date question

I am using WP_Query to get all posts from a custom post type. This works great for listing out all the posts. However, the post itself has a custom date field and I want to list all posts for a certain month under an `H2` tag that list the month without repeating the month. Currently I can loop through all posts but the `H2` with the month gets spit out every time. I don't want to make a month category either. The posts are for show dates. I want to list out all the dates for June but only have one `H2` with June in it and then all the posts under it. Like this:                1. June         a. Show date         b. Show date         c. Show date      2. July         a. Show date          b. Show date         c. Show date      and not this:                1. June         a. Show date      1. June         b. Show date      1. June          c. Show date      2. July         a. Show date      2. July         b. Show date      2. July         c. Show date      Updated code:               $current_month = '';                         while ($query->have_posts()) : $query->the_post();?>       <?php $date = strtotime( get_field('date') ); $month = date('F',$date); ?

          <?php if ($month != $current_month){                    $current_month = $month;                 echo $month; } ?>


List most recently added posts (with a twist)

At first I thought the task was trivial. I'd like to list the most recently added posts (say, 15 of them), but I am adding posts that are dated a few years back, yet I'd like them to show in the list, instead of just the ones that are dated the most recent. This is what I'm doing so far:               <?php         $args = array( 'orderby' => 'modified', 'numberposts' => 15 );         $postslist = get_posts( $args );         foreach ($postslist as $post) :  setup_postdata($post);                  $audio = get_children(                 array(                     'post_parent' => $post->ID,                     'post_status' => 'inherit',                     'post_type' => 'attachment',                     'post_mime_type' => 'audio'                 )             );             $thishref = "";             foreach ( $audio as $attachment_id => $attachment ) :                  $thishref.= wp_get_attachment_url( $attachment_id, 'full' );             endforeach;     ?>
         <a href="<?php the_permalink(); ?>"><?php the_title();?>          (<?php comments_number( '0', '1', '%' ); ?>)           <a title="download" class="downloadlink" href="<?php echo $thishref; ?>">↓
     <?php         endforeach;     ?>      It works, except if I add tags to a post or edit it in any way, the post becomes 'modified' and thus appears in this list, and I'd like to prevent this from happening. In other words, I want to list 15 most recent posts not by their date, not by their modified date, but by the date they were added to the database of posts ('created' date?). Would this be at all possible?


Pagination on category.php and tag.php not working

i'm using a query-loop on my template pages like this:               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $wp_query = new WP_Query();     $wp_query->query('posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);     global $wp_query;         query_posts(array_merge($wp_query->query, array(             'paged'          => get_query_var('paged'),             'posts_per_page' => 2         )));     ?>     <?php if ($wp_query->have_posts()) : ?>     <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
         <a href="<?php the_permalink() ?>">                     <?php the_post_thumbnail( 'portfolioteaser' ); ?>

<?php the_title(); ?>

              <?php endwhile; ?>     <?php endif; ?>       the pagination works fine with this except on the category.php or tag.php. The first page is showing correctly but for example if i click on "category/categoryname/page/2" it shows no content anymore an dthe pagination disappears... i know it must be something wrong with the query loop... help would be nice! thanks alot, Jochen


Where are my js and css links in header?

I just found out that there are no javascript and css links in my header.php.               <?php          /**           * The Header for our theme.           *           * Displays all of the <head> section and everything up till <div id="main">           *           * @package web2feel           * @since web2feel 1.0           */          ?><!DOCTYPE html>          <html <?php language_attributes(); ?>>          <head>          <meta charset="utf-8">          <meta name="viewport" content="width=device-width" />          <title><?php              /*               * Print the <title> tag based on what is being viewed.               */              global $page, $paged;                        wp_title( '|', true, 'right' );                        // Add the blog name.              bloginfo( 'name' );                        // Add the blog description for the home/front page.              $site_description = get_bloginfo( 'description', 'display' );              if ( $site_description && ( is_home() || is_front_page() ) )                  echo " | $site_description";                        // Add a page number if necessary:              if ( $paged >= 2 || $page >= 2 )                  echo ' | ' . sprintf( __( 'Page %s', 'web2feel' ), max( $paged, $page ) );                        ?></title>          <link rel="profile" href="http://gmpg.org/xfn/11" />          <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />          <!--[if lt IE 9]>          <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>          <![endif]-->          <?php wp_head(); ?>     </head>      They appear in source view. Can anyone tell me where can I find my f. css and js? :D


Show Posts From Same Category OR Same Tag

Assume a post is categorized in "Fruit" and tagged with "Apple".   The following code shows posts with category "Fruit" AND tag "Apple"               $args = array(           'tag__in' => $tag_in,           'category__in' => $category_in,       );     query_posts($args);      How to show all posts which are from either category "Fruit" OR tag "Apple"?


How to add add_meta_box to specific Page Template?

I want to add **add_meta_box** to specific **page** type like Page Template, Like Product Template. I am using this article http://wp.smashingmagazine.com/2011/10/04/create- custom-post-meta-boxes-wordpress/ to try it.


how to call files in child theme?

I created a child theme **"my-theme"** . In style.css I wrote nothing just the mandatory details I wrote there.               /*     Theme Name:     my-theme     Theme URI:      http://example.com/     Description:    Child theme for the Twenty Twelve theme      Author:         Bhuvnesh     Author URI:     http://example.com/about/     Template:       my-theme     Version:        0.1.0     */      All the style rules I am writting in **"my-theme/css/style.css"** file. Now in **index.php** I am calling **`<?php get_header(); ?>`** this will call **header.php** now in **header.php** file I am calling that css file as `<link href="css/style.css" rel="stylesheet" type="text/css" />` but this is not loading my css. same like this I am calling some **.js** files which are under **"my-theme/js/"** directory as               <script type="text/javascript" src="js/jquery-1.7.2.min.js"> </script>      this is also not loading. I know I am making some mistakes to call files or may be in functions.php . I just copied the full file **functions.php** of **twentytwelve** . Is there any mistake I am doing ? Please tell me what to write in **functions.php** file and how to call files like js files under js directory .php files under includes directory , images under Images directory. I searched how to create child theme and it's done but unable to call files. Please Help me!I will be very thankful to you!!!!


wp_editor with media buttons

I use `wp_editor()` on the frontend. media_buttons are displayed on default **if** visitor is logged in. I want to display these media buttons whether user is logged in or not. Is there any way to achieve this?


How can i add thumbnails images to particular post (using code not admin pannel) in wordpress

I am trying to set thumbnails for my post. I have `post_id = 285` and I want to add manually a thumbnail (using code) but I'm not succeeding.               update_post_meta( $post->ID, '_thumbnail_id', $attachment_id );      I got this function reference but I do not understand what is the `$attachment_id` and how can I get it. I have also image name and path of image.


WordPress Ajax Problems

## Update I got it to fire using the following curl command: `curl -H "Accept: application/json" -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d "action=vixo_wordpress_signon&data=banjometer" --trace -` Not really sure how to work out to get it to accept json, but hey... ## Original Question I am new to WordPress and I am having problems getting Ajax to work - but I am also having problems understanding how WordPress loads PHP. I have a plugin file:               /usr/share/wordpress/wp-content/plugins/myplugin.php      It has the following code in it:               // set up the ajax calls     add_action('wp_ajax_my_ajax', 'my_ajax');     add_action('wp_ajax_nopriv_my_ajax', 'my_ajax');            function my_ajax () {         debug_log ("My ajax fired...");         echo "banjolalia...";         die ();     }      I want to demonstrate that the ajax has fired using Curl:               curl -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d '{"action":"my_ajax","data":"banjometer"}' --trace -      (The home page is at `http://localhost/wordpress`) I am expecting to see curl return `banjolalia` and a line appear in the debug log. What I see is the function returns `0` The Ajax is standalone because I am writing single-signon code and I need the child service to query WordPress and see if the user is logged in. Because I am new to WordPress/PHP I do not have a robust development cycle. The way I have been (trying) to get the code to reload is by Deactivating/Activating the plugin on the Admin page. This doesn't seem to work. I wasn't sure if my changes were loading into WordPress so I actually switched the lappie off and on again - but still the Ajax didnt' fire. I have 2 debugging Plugins installed:   * Debug-Bar   * Debug-Console-Bar The problems I have from a Dev perspective are:   * how can I use the PHP console to check what code is loaded/force a reload?   * how can I use the PHP console to see what actions are registed on what hooks?


Titles in my sidebar widget appear in all languages - with qtranslate

So here's my code, using the qTranslate plugin:                   query_posts(array('post_type' => 'uk_blog', 'numberposts' => 2));         $i = 0; while(have_posts()): the_post($post);?>         <div class="third-column"<?php if ($i == 1) echo ' style="margin-right:0;"';?>>
<a href="<?php get_permalink($post->ID);?>"><?php the_title();?>

                 <?php $length = strlen(get_the_content());                 echo nl2br(substr(strip_tags(get_the_content()), 0, 500));                 if ($length > 500){                     echo '...
ID) . '">Read more';                 }                 ?>

         <?php $i++; endwhile;?>      The post titles (using the_title();) are actually appearing in all languages at the same time, ie: English titleFrench titleSpanish title. Viewing the HTML source shows that the qTranslate tags that define which bit of a string is for which language are being directly outputted. IE the HTML source is `<!--:en-->English title<!--:--><!--:fr-->French title<!--:-->` The posts are from a custom post type. Any ideas why this might be? Thanks for reading!


Require title for pages

Is there a way to force users to write a page title before publishing? I have found example of requiring post titles, but not page titles.


How to license my commercial WordPress theme?

I am planning to sell themes on Themeforest... But i don't have any idea about Theme stuffs... I include some third party stuffs like jQuery, BootStrap, etc., I will include their license. No problem with that. But what about my work? What license should i use for premium WordPress theme? Is it ok to sell my themes without putting License file ?


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

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();               }          ?>


Mega WordPress Applications WPMU or otherwise

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?


How can I add a button to quicktags-toolbar?

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)?


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

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)


Query posts filter not working

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


Metabox image upload value

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?


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

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?


WordPress won't display errors at all

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.


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

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.


How use Videos from another directory?

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.


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

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.


Menu support for touch devices

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?


How do I use inline SVG in WordPress

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


Add "Write For Us" Option

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?


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

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.


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

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!


How to construct multiple meta boxes

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');


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

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' ));


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

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.


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

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!


What tools are available for managing/writing to WordPress?

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.


Archive widget - limit number of months to 12

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


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

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.


Integrating WP as a CMS with a Bug Tracker

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?


How do I reset a self-hosted Wordpress URL?

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.


Create Read Only Admin

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.


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

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?


posts-2-posts embedding post title of connected posts

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.


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

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?


How to disable empty <p> tags in comment_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?


Disable comments

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?


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

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'); ?>


Multiple variables through wp_get_image_editor

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?


How to remove some media upload icons from post editor?

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.


WordPress keeps altering my embed code

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?


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

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


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

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_


Transfer WP from subdomain to main domain

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.


FTP Widget Location

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.


exposing attachment uploading to the front end -- delicate

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


Shall i disable pingbacks and trackbacks in my blog?

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


Multiple posts with one loop iteration

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`.


Getting the parent from the wp_term_taxonomy

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");


My website not showing 404 error!

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>


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

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_


WP_Query orderby and tax_query

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 !


Make a custom column sortable, by custom post count

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.


Very Quick Custom Pluggable Function Question

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?


Why use wp_send_json() over echo json_encode()?

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`


Creating Content for Custom Tab in WooCommerce

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;


Wordpress and advanced custom fields subcategory inherit category color automatically

![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..


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

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?


WordPress - using sessions?

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


RSS Feed setting limit for email subscriptions

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!


Multi-site: removing /blog from posts

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?


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

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'?


How do themes provide support for child themes?

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?


I need to move the "php_errors.log"

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.


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

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.


get_term_children for immediate children only (not grandchildren)

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!


Permalink Rewrite for Custom Taxonomy

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?


Get $curauth level

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


Make a plugin work on specified domain only

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!


Animated GIF on Wordpress posts?

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.


If statement for admin page

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 );


Get URL of current post but not the page number

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?


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

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.


Custom options page for themes

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!


JS error when using https

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-


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

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.


What is the relation between taxonomy table and database in WordPress

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.


Custom message on plugin uninstall

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.


Moving an image to the side

![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.


wp_nav_menu $theme_location parameter ignored

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?


how to implement the slide and push menu in wordpress

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