title: problem with WP-Post Ratings meta content

text: i use WP-Post Ratings for my site and all thing are good but i have only one major problem with this plugin. i use easy digital downloads plugin too. and I'm disable the default post type of this plugin because i want to use single.php for sell products.and also i use the blew code in the single.php file to show Ratings. `<?php if(function_exists('the_ratings')) { the_ratings(); } ?>` but in the HTML source of the Ratings in the post there is a problem. see blew meta content: `<meta content="http://rokesh.ir/downloads/pinblack/" itemprop="url">` in this meta content you see the URL of the easy digital downloads plugin but i want to see the URL of the post plugin like this: `<meta content="http://rokesh.ir/wordpress-portfolio-theme-pinblack/" itemprop="url">` you can see check it online here http://wordpress.org/plugins/wp-postratings/


title: When I Use function wp_insert_term() function it gives me Invalid taxonomy object

text: if(isset($_REQUEST['review_add'])){               $rw_es_name = $_REQUEST['rw_es_name'];     $rw_cl_name = $_REQUEST['rw_cl_name'];     $rw_cl_email = $_REQUEST['rw_cl_email'];     $rw_cl_review = $_REQUEST['rw_cl_review'];      $postthumbnailid = $_REQUEST['postthumbnailid'];           $rw_term = term_exists($rw_es_name,'review_texanomies',0);          // Create state if it doesn't exist     if ( !$rw_term ) {         $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');         $rw_term = wp_insert_term($rw_es_name,'review_texanomies',$defaults );          }     echo '<pre>';     print_r($rw_term);     echo '</pre>';     die();          $tex = $rw_term['term_taxonomy_id'];          $defaults = array(         'post_status' => 'pending',         'post_type' => 'review',         'post_author' => $user_ID,         'ping_status' => 'open',         'post_parent' => 0,         'menu_order' => 0,         'to_ping' => '',         'pinged' => '',         'post_password' => '',         'guid' => '',         'post_content_filtered' => '',         'post_excerpt' => '',         'import_id' => 0,         'post_title' => $rw_es_name,         'post_content' => $rw_cl_review,         //'tax_input'=> array('review_texanomies' => $tex)         'post_category' => array('review_texanomies' => $tex)     );     $post_id = wp_insert_post($defaults, $wp_error);     //wp_set_post_terms( $post_id, $terms, $taxonomy, $append );          if ($post_id) {         update_post_meta($post_id, 'rw_es_name', $rw_es_name);         update_post_meta($post_id, 'rw_cl_name', $rw_cl_name);         update_post_meta($post_id, 'rw_cl_email', $rw_cl_email);          set_post_thumbnail($post_id, $postthumbnailid );         //wp_set_object_terms($post_id , $rw_es_name, 'review_texanomies', true);     }      } It gives me output like WP_Error Object ( [errors] => Array ( [invalid_taxonomy] => Array ( [0] => Invalid taxonomy )                   )          [error_data] => Array         (         )      ) Or when i m using term_exists() it gives me id of terms.. So how wp_insert_term() function gives this type of error? when terms already gives out put?... please help mefor resolve this problem.


title: Problem installing plugin: unexpected T_STRING, expecting T_FUNCTION

text: i am trying to install plugin tumblrize and got the error > Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in > D:\Projects\Websites\jiewmeng\wp-content\plugins\tumblrize\tumblrize.php on > line 636 Call Stack: 0.0005 332520 1. {main}() > D:\Projects\Websites\jiewmeng\wp-admin\plugins.php:0 0.2249 3035904 2. > plugin_sandbox_scrape() D:\Projects\Websites\jiewmeng\wp- > admin\plugins.php:160 on line 636 is               register_activation_hook(__FILE__, 'tumblrize_activate');      i dont see anything wrong with that, just learnt to develop plugins and that line looks ok? there is the function on line 611               function tumblrize_activate () { ...      i am using wordpress 3.0.1 + PHP 5.3.2 btw


title: What Is The Use Of map_meta_cap Filter?

text: What is the use of map_meta_cap filter? This filter is not documented anywhere. I have an unclear idea of what it could be: Used to map the permissions of the user to operations on posts. What exactly is it meant for? If possible please give some sample code example of its right usage.


title: hook for loading page

text:
I wanted to load my custom plugin when the "Jobs" page is loaded. How am I able to do it? This is my code so far.               <?php          /**      * Plugin Name: wp-retrieve-database      * Description: retrieves data from the database.      * Version: 0.5      * Author: Chan */          global $wpdb;     $table_name = $wpdb->prefix . "Careers";     $retrieve_data = $wpdb->get_results( "SELECT * FROM $table_name" );         function get_scrapy_scraped(){

         Job Name	         Location/Dept	         Complete Info	         Application Link
             foreach ($retrieve_data as $retrieved_data){
             echo $retrieved_data->Job_Name;	             echo $retrieved_data->Job_Department;	             echo $retrieved_data->Job_Link_Info;	             echo $retrieved_data->Job_Link_Apply;
             }
         }     add_action('dont know what to be used', 'get_scrapy_scraped');       ?>


title: How can I get the first 50% of all posts (within a custom post type)?

text:
I'm trying to make a multi column layout. Seen as CSS3 adoption of column layouts is still thin on the ground, I was thinking maybe I could grab the first half of all my posts (and then the second), and add them in their own UL elements. I'm not sure how / if this is possible with a Wp_Query? I want to end up with my posts in alphabetical order, but split into two lists (using two queries, I guess), thus:

a
     .     .     .
m

n
     .     .     .
z

      I could then style each list with CSS and get a layout kind of like a multi column layout in CSS3. Does anyone have any ideas about how to structure my queries here? _**edit to explain how this isn't a duplicate_** It's about forming a two column layout _sure_ , but the question is very different: 'how to get half of all posts', not how to solve a very specific layout use case as is the linked 'duplicate'. (which I didn't find on account of it not being the same question). Further, I was looking for posts sorted alphabetically, vertically descending, not A|B, C|D as in the example.


title: Displaying products from categories in woocommerce

text: I want to display thumbnails of multiple categories on a page, i am having hard time accessing the categories as it shows empty. is something wrong with my code?                                 $args = array(                             'per_page' => '12',                              'category_name' => 'travel',                              'orderby' => 'title',                              );               print_r($args); //nothing gets output, like categories     $query = new WP_Query( $args );     if( $query->have_posts()) : while( $query->have_posts() ) : $query->the_post();              print_r($args); //nothing gets output, like categ              //want to display the thumbnail          endwhile;;         endif;


title: Plugin admin page stylesheet doesn't work

text: I am trying to style my plugin's admin page. Below is the code is use, but neither the stylesheet nor the script shows up on my page.               add_action( 'admin_init', 'myplugin_admin_init' );     add_action( 'admin_menu', 'myplugin_custom_menu_page' );          function myplugin_custom_menu_page(){         $page = add_menu_page( 'My Plugin', 'My Plugin', 'manage_options', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 33 );          add_action( 'admin_enqueue_scripts' . $page, 'myplugin_admin_styles' );          add_action( 'admin_enqueue_scripts' . $page, 'myplugin_admin_scripts' );     }          function myplugin_admin_init() {       wp_register_script( 'myplugin-script', plugins_url( 'myplugin/script.js') );       wp_register_style( 'myplugin-style', plugins_url('myplugin/stylesheet.css') );     }          function myplugin_admin_styles() {         wp_enqueue_style( 'myplugin-style' );     }          function myplugin_admin_scripts() {         wp_enqueue_script( 'myplugin-script' );     }      Any hints would be much appreciated!


title: Get post/page title from ID

text: I'm trying to get the post title of a post_type (post/page/portfolio) in the admin panel outside of the loop. I nearly tried all possible solutions, but without success:               //method 1     $content_post = get_post(3208);     $_menu_item_title = $content_post->post_title; //(Trying to get property of non-object error)          //method 2     $obj = get_post_type_object($_menu_item_type);     $content_post = get_post(3208);  //(Trying to get property of non-object error)     $_menu_item_title = $obj->$content_post->post_title;          //method 3     $_menu_item_title = the_title(3208); //(no error but nothing is store)          //method 4     $_menu_item_title = get_the_title(3208); //(no error but nothing is store)


title: Is there a better way to define options for custom fields in an admin panel?

text: I've currently got this:               $num = 1;          while($num < 6) {            register_setting( 'front_page_options', 'slide_title_'.$num );       register_setting( 'front_page_options', 'slide_description_'.$num );       register_setting( 'front_page_options', 'slide_button_1_text_'.$num );       register_setting( 'front_page_options', 'slide_button_1_url_'.$num );       register_setting( 'front_page_options', 'slide_button_2_text_'.$num );       register_setting( 'front_page_options', 'slide_button_2_url_'.$num );       register_setting( 'front_page_options', 'slide_bg_'.$num );       register_setting( 'front_page_options', 'slide_in_img_'.$num );            ++$num;     }      But is there a better way to write this?


title: do_shortcode close

text: I am using the jscrollpane plugin on WordPress along with the advanced custom fields plugin. The jscrollpane plugin uses the following shortcodes:               [vr_jsp]     [/vr_jsp]      I have two different custom fields that I need to put between their own set of the above shortcodes which are:               <?php the_field('first_content_block'); ?>     <?php the_field('second_content_block'); ?>      I understand you can use the below code to do this but I am a bit stuck on what to use to output the custom field between the two shortcodes.               <?php echo do_shortcode('[vr_jsp]CONTENT HERE[/vr_jsp]'); ?>      Just to clarify I need the custom field (first_content_block) displayed where 'CONTENT HERE' is.


title: conditional search

text: I am looking for help with a conditional search based on four categories/taxonomies; countries/regions/type/no of bedrooms. What I am after is a dropdown search function that when I select a specific country, only regions in that country would appear in the region dropdown and in the type drop down, only types available in that particular region would be listed. I am obviously prepared to pay a fee for customisation. JOHN


title: open all .docs in word online

text: Hey I'm trying to make all .doc/docx .xls/xlsx files open in office online. This would mean that every link to a .doc               http://mywebsite.com/wp-content/uploads.link.doc      would have to instead point to the office online preview link               https://view.officeapps.live.com/op/view.aspx?src=http://mywebsite.com/wp-content/uploads/link.doc      I'm not even sure how to go about doing this? Any help would be greatly appreciated! Thanks!


title: How to display comments and comment form on custom post type?

text: Is it possible in wordpress to display comments and comment form on custom post type, and how to do that? Thanks in advance.


title: Pagination for multiple queries for different authors on author.php

text: I have peculiar requirement. The author.php template is used as a profile page for the author where he can view his own posts and posts by other authors. This template has two custom loops to achieve this. The first loop is for displaying post by the author himself, whose profile is being viewed. So if the URL reads "http://example.com/author/john". The first loop is showing John's posts. Pagination for the first loop works absolutely fine. Arguments for the first loop:               $args = array(         'post_type'         => 'portfolio_post',         'posts_per_page'    => 9,         'paged'             => $paged,         'orderby'           => 'date',         'post_status'       => 'publish',         'author'            => $author_id     );          $custom_query = $wp_query;     $wp_query = new WP_Query( $args );     ?>      Arguments for the second loop:               $authors = '2,3,5';          $args = array(         'post_type'         => 'portfolio_post',         'posts_per_page'    => 9,         'paged'             => $paged,         'orderby'           => 'date',         'post_status'       => 'publish',         'author'            => $authors     );          $custom_query = $wp_query;     $wp_query = new WP_Query( $args );     ?>      The second loop is designed to show posts by other authors. The problem is with the pagination for the second loop. Since, I am viewing John's author page WP_Query is by default set by Wordpress to return posts only from the author John, whereas my second loop is actually looking for posts by other authors. Now, if John does not have any posts then pagination for the loop that fetches other authors post breaks, as $WP_Query->found_posts results "0". I am using Ajax to display results from both loops and it's working absolutely fine. I hoping this behaviour could be modified by using something like the "pre_get_posts" hook or may be something else. I could also be wrong in using the template "author.php" for this. Maybe I should use a different template? Please advise. Desperately need this working.


title: wp_handle_upload() does not list uploaded file in the media library?

text: Is it supposed to? My code:               if ($_POST && $_FILES) {         $tmp_name = $_FILES['file']['tmp_name'];         $item = $_FILES['file'];         $uploads = wp_upload_dir();         if (is_writable($uploads['path'])) {             if (!empty($tmp_name))  {                 if ($tmp_name) {                     $overrides = array('test_form' => false);                     $file = wp_handle_upload($item, $overrides);                 }             }         }     }


title: Cookies in template

text: I need to show some part of the page only once, based on cookies. The main problem that I can set cookies only in plugin, hooking init action. I've read 20 pages of google, this site, asked 2 forums, but I still have this problem. Any help would be appreciated!


title: How to implement a slideshow on WP similar to these examples?

text: I'm a big fan of slideshows like these: _BEST PLACES TO LIVE_ http://money.cnn.com/magazines/moneymag/bplive/2011/snapshots/PL0846355.html _Best places for the rich and single_ http://money.cnn.com/galleries/2011/moneymag/1108/gallery.best_places_rich_single.moneymag/index.html Does anyone have a suggestion how to implement something similar on Wordpress? My intention is to have whole pages load for each slide to increase the pageview count, but this apparently requires a pagination scheme in the URL for each slide. Is there a plugin or for this? _**Using WP 3.1.3, Thesis Theme_**


title: get_the_ID() gives notice in 404 page

text: I'm using get_the_ID() in my wp_enqueue_scripts action due to some needs, But as result I'm getting the following notice (wp-debug is on): > Notice: Trying to get property of non-object in C:\wamp\www\WordPress\wp- > includes\post-template.php on line 29 I know why this happens, My question is why should this happen? Isn't WordPress supposed to know that there is no $post assigned to 404 and return an empty result? Do I have to use:               if( !is_object($post) ) return;      Everywhere I use get_the_ID() in order to get rid of that Notice?


title: User friendly news section in Wordpress without using posts

text: I have a website that has a news section which simply shows the most recent 6 posts with a category of news. The problem is that whenever you create a post, Wordpress automatically creates a page for that post. The client claims Google does not like it when you have content showing up on a news section as well as on useless post pages which are not even being linked to. My question is this: is it possible to duplicate this news section usability (keeping it user-friendly) without having Wordpress create a new post page for every single news item that is published? And I don't mean just simply excluding the posts from a general post page, because that is already being accomplished. I mean not even generating a page for that post.. That would require a different method (rather than publishing a news item through a post), and I was wondering if said method exists **EDIT:** Thanks to @Rarst, I think I may be getting closer. I performed a test with `custom_post_types` with the following code:               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'acme_product',             array(                 'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Product' )                 ),             'public' => true,             'has_archive' => false,             'rewrite' => array(                 'pages' => false                 )             )         );     }      The problem is, I create a new "product" (it should really be "news", but this is just the example provided in the Wordpress documentation), and while it is not archived, a page is still created with the url: http://mydomain.com/?acme_product=test , where 'test' changes based on the name I gave the "product". Is there a way to prevent the site from publishing this page? Thanks!


title: get_post_custom_values problem, please help

text:
i want get the "issue-cover" from archive page list, i done it. but it will cant get the meta value when i update/add new a post to the archice page.
         <?php $values = get_post_custom_values("issue-cover");                if (isset($values[0])) {            ?>         <a target="_blank" href="<?php $values = get_post_custom_values("issue-cover"); echo $values[0]; ?>" class="top-box-images"><img src="<?php $values = get_post_custom_values("issue-cover"); echo $values[0]; ?>" title="<?php echo get_post_meta($post->ID, 'issue', true); ?>"/>         <?php }             // if there's no img do replace it with no-img          else { ?>         <img src="<?php bloginfo('stylesheet_directory'); ?>/images/no-img.gif" title="<?php echo get_post_meta($post->ID, 'issue', true); ?>"/>          <?php } ?>              <?php echo get_post_meta($post->ID, 'issue', true); ?>         <?php echo get_post_meta($post->ID, 'cover-by', true); ?>


title: Disable comments feed, but not the others

text: I'd like to customize my WordPress blog in such a way that it is no more possible to access the comments feed. Other feeds should still be available, and it should still be possible to add comments to any article. I tried to find a plugin to do this, but what I found is a all or nothing feature, without the possibility to finely adjust which feeds are allowed and which are not.


title: How to remove/replace current page template?

text: I am writing a plug-in that creates new front/home page from scratch. Below code works nice and it outputs the text before the themes outputs anything. So the question is how can I remove the theme creating any html code? Basically I want the plug-i to start with blank home page regardless of any theme that is currently active.                 add_action('wp_head', 'new_front_page');         function new_front_page(){          if (is_front_page()){            echo 'is_front_page():'.is_front_page();          }         }       }      I am testing this on wp 3.6 and twenty thirteen. Of course anyone is welcomed to suggest better what how to do that.


title: My meta boxes update wp_postmeta of posts but not of pages. What is wrong with the code?

text: I have a simple checkbox on posts to display posts in a slider, and everything works fine. But I want to switch and add only pages in the slider, but code below is not updating wp_postmeta table of the pages, only posts. Could you please direct me what am I doing wrong               function damad_add_post_metabox() {          $screens = array( 'post', 'page');          foreach ( $screens as $screen ) {              add_meta_box(             'damad_post_meta_id',             __( 'Options', 'damad' ),             'damad_inner_custom_box',             $screen         );     }     }     add_action( 'add_meta_boxes', 'damad_add_post_metabox' );          function damad_inner_custom_box( $post ) {          wp_nonce_field( 'damad_inner_custom_box', 'damad_inner_custom_box_nonce' );            $homepage = get_post_meta( $post->ID, '_post_featured', true);       echo '<label for="post-featured">';            _e("Include in homepage slider", 'damad');       echo "</label>";       echo '<input type="checkbox" id="post-featured" name="post-featured" value="post-featured"';       if ( 'post-featured' == $homepage ) {         echo 'checked="checked"';       }        echo '/>';     }           function damad_save_postdata( $post_id ) {            if ( ! isset( $_POST['damad_inner_custom_box_nonce'] ) )        return $post_id;            $nonce = $_POST['damad_inner_custom_box_nonce'];            if ( ! wp_verify_nonce( $nonce, 'damad_inner_custom_box' ) )          return $post_id;            if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )        return $post_id;            if ( 'page' == $_POST['post_type'] ) {            if ( ! current_user_can( 'edit_page', $post_id ) )         return $post_id;           } else {             if ( ! current_user_can( 'edit_post', $post_id ) )         return $post_id;      }          $featureddata = $_POST['post-featured'];            update_post_meta( $post_id, '_post_featured', $featureddata );     }     add_action( 'save_post', 'damad_save_postdata' );


title: is action hook not working on quick edit?

text: This code is not working on quick edit?               function cpt ($term_id) {       print_r($_POST);     }     add_action('create_post_tag', 'cpt');


title: register_activation_hook for multiple functions

text: I have created a plugin where I want to call two different functions on activation. Is there a best way to do this? Should I use `register_activation_hook` twice? As in:               register_activation_hook( __FILE__, 'function_1' );     register_activation_hook( __FILE__, 'function_1' );      Or call the two functions from within an activation function, as in:               register_activation_hook( __FILE__, 'my_activation_function' );     function my_activation_function () {              function_1();         function_2();          }      Any ideas? Thanks.


title: Custom Taxonomy Relationship (ex: plant classification)

text: I'm trying to implement plant classification as a custom taxonomy for a custom post type. For now, plant classification should be on three levels: `Family`, `Genus`, `Species`. As I see it, there are two possible ways:   1. **Using taxonomy level as an indicator of taxonomy type, ex:**              plant_class                (custom taxonomy)       '-- Rhamnaceae           (level 1 = family)         '-- Ziziphus           (level 2 = genus)           '-- Ziziphus Jujuba  (level 3 = species)      _Advantages:_     * Correct structure; I'd be able to find the family name of a given genus.     * Administrator just selects a species to classify a plant. _Disadvantages:_     * Cannot be extended later on (eg; to introduce sub-species)     * The per-level aspect looks too "magical" to me (unintuitive / confusing to beginners)   2. **Putting each name under the classification type itself, ex:**              plant_class              (custom taxonomy)      |-- Family               (group of families)      | '-- Rhamnaceae      |-- Genus                (group of geni)      | '-- Ziziphus      '-- Species              (group of species)        '-- Ziziphus Jujuba      _Advantages:_     * Easily extensible (to add sub-species or even order at a higher level) _Disadvantages_     * Admin needs to select all applicable classification parts when associating to a plant (eg; a family, genus and species)     * Programatically, I lose the ability to find family from genus (broken hierarchy) Another (and even wilder) idea I've had is to create several taxonomies (`plant_family`, `plant_genus`, `plant_species`) and somehow form a relation between each taxonomy type so that a family can be associated to several geni. I've no idea how this would work. Wondering why there's no code? Well, it's relatively easy to create custom taxonomies, and what I'm missing is purely a system design issue. **Ref:** Biological Classification | Wordpress Taxonomy Reference | Ziziphus :)


title: Set Session Time Limit for Password Protected Posts

text: I have made a series of posts and pages password protected on my website using the built-in Visibility setting. They all use the same password, so the user can view all of them after entering the password once. **The problem:** I need the session to time out after an hour. I have tried using this code in my functions.php file.               add_action( 'wp', 'post_pw_sess_expire' );         function post_pw_sess_expire() {         if ( isset( $_COOKIE['wp-postpass_' . COOKIEHASH] ) )         // Setting a time of 0 in setcookie() forces the cookie to expire with the session         setcookie('wp-postpass_' . COOKIEHASH, '', 0, COOKIEPATH);     }      It successfully clears the cache, but I would like to extend the time rather than expiring the session immediately. Any help would be greatly appreciated!


title: Changing the meta_query of the main query based on custom query_vars and using pre_get_posts

text: I've registered custom rewrite rules and `query_vars` to use for displaying a list of events based on ISO date format. For example when a user requests the URL, `http://site.com/by-date/2013-04-04/`, my `query_var` is the date portion and I'd like to display a list of events who's `meta_key` of `_event_scheduled_date` equals the ISO date value in the `query_var`. Whenever I try the following code to modify the `$query` in `pre_get_posts` WordPress initiates a 404 and no posts are queried. I've been able to use `pre_get_posts` to manipulate other taxonomy listings and archive pages, but have yet been able to get it to work correctly with the custom `query_var` I've created.               function rewrite_rule_by_date() {         add_rewrite_rule('(by\-date)/([0-9]{4}\-[0-9]{2}\-[0-9]{2})$', 'index.php?pagename=$matches[1]&event_date=$matches[2]', 'top');     }     add_action( 'init', 'rewrite_rule_by_date' );          function query_var_by_date() {         add_rewrite_tag( '%event_date%', '([0-9]{4}-[0-9]{2}-[0-9]{2})');     }     add_action( 'init', 'query_var_by_date' );          function custom_event_query( $query ) {         if (  is_page( 'by-date' ) && get_query_var( 'event_date' ) && is_main_query() ) {             $query->set( 'post_type', 'event' );             $query->set( 'post_status', 'publish' );             $query->set( 'meta_key', '_event_scheduled_date' );             $query->set( 'orderby', 'meta_value' );             $query->set( 'order', 'ASC' );             $query->set( 'post_per_page', -1 );                  $meta_query = array(                 array(                     'key' => '_event_scheduled_date',                     'value' => get_query_var( 'event_date' ),                     'type' => 'DATE',                     'compare' => '='                 )             );                  $query->set( 'meta_query', $meta_query );         }              return $query;     }     add_filter( 'pre_get_posts', 'custom_event_query' );


title: Pagination Custom post type

text:
I have a custom post type called 'doel'. I have made a page template to display all the doel items In this page template I loop the 'doel' post type and after 6 of them, I want to have a pagination. Only, the pagination does not appear. I started browsing on the internet and it seemed to be a common problem after version wp version 3.4 I tried some solutions from this site and the wp forums but none of them helped. For Example, what I tried was adjusting the loop, so the pagination would be IN the loop, OUT of the loop or between endwhile and endif. Also I tried the wp pagenavi plugin and the original wp previous and next post links but none of them are working, so I think there is something wrong in my loop. My code atm is:               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $loop = new WP_Query( array(     'post_type' => 'doel',     'posts_per_page' => 6,     'orderby'=> 'menu_order',     'paged'=>$paged     ) ); ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
             <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(array('class' => 'featuredimg')); ?>             <img class="logodoel" src="<?php the_field('logo_doelen'); ?>" />
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?>
             Doneer nu
          <?php endwhile; ?>
      <?php wp_pagenavi(); ?>


title: Problem with wordpress version 3.8

text: ![enter image description here](http://i.stack.imgur.com/z9TG8.png) Hi I have just updated wp version 3.8 and whenever I install plugins , in most of the cases the plugins shows an error or warning that certain variable in the plugin is not defined. In some of the cases I have gone to the code and fixed by declaring the variable myself This is just one case but if I use the same plugin with version 3.7 everything seems to run fine and not just with one plugin but many other plugins as well I want to know what has changed that is causing the problem. I just used php function 'empty($variable)' to remove this error


title: Wordpress changing single quotes to double quotes in title and content

text: My wordpress site has this annoying problem: it converts the single quotes (e.g. it's) into double quotes (it"s) and it looks bad. For example, look at the title of this post: http://www.pcsteps.gr/1408-lost- gigabytes/ I have searched long and hard about this. I have read about php.ini and the magic quotes parameter, but it is already off on my server (and everything other that has to do with magic quotes) I have commented the wp_magic_quotes(); line on wp-settings.php but it changed nothing. I have found some 6+ years old posts on wordpress forums that reference plugins that don't exist anymore and changes on wordpress files that also don't exist. Any help will be greatly appreciated. Thanks Angelos


title: Remove 'product' & 'product-cateogory' from url - woocommerce

text: I'm using WooCommerce for a shopping site and it is adding slug or base to the urls. For instance: http://dev.unwaveringmedia.com/8dim/product-category/all- party-supplies/ http://dev.unwaveringmedia.com/8dim/product/14-snowman- serving-tray/ I don't want slug/base (product & product-category) in urls. Is there any way or plugins to remove them from urls?


title: Edit User Profile From Front End

text:
I have taken reference from this link. I have used Plugin cimy user extra fields for extra users' field. I have taken few extra fields such as picture upload and file upload. Now I want to edit user profile from front end. I am able to edit user text fields(both extra and normal fields), but I am not able to change their picture or file. I have also tried to use few plugins such as profile builder, wp user frontend but have not been successful in doing so. Below is my code which i have used for editing user profile from front Form                <form method="post" id="your-profile" action="<?php the_permalink(); ?>"  enctype="multipart/form-data">

                                             <?php _e('First Name', 'profile'); ?>	                                             <input class="text-input" name="first-name" type="text" id="first-name" value="<?php the_author_meta('first_name', $current_user->ID); ?>" />

                                             <?php _e('Last Name', 'profile'); ?>	                                             <input class="text-input" name="last-name" type="text" id="last-name" value="<?php the_author_meta('last_name', $current_user->ID); ?>" />

                                             <?php _e('Email', 'profile'); ?>	                                             <input class="text-input" name="email" type="text" id="email" value="<?php the_author_meta('user_email', $current_user->ID); ?>" />

                                             <?php _e('Website', 'profile'); ?>	                                             <input class="text-input" name="url" type="text" id="url" value="<?php the_author_meta('user_url', $current_user->ID); ?>" />

                                             <?php _e('Password *', 'profile'); ?> 	                                             <input class="text-input" name="pass1" type="password" id="pass1" />

                                             <?php _e('Repeat Password *', 'profile'); ?>	                                             <input class="text-input" name="pass2" type="password" id="pass2" />

                                             <?php _e('Biographical Information', 'profile') ?>	                                             <textarea name="description" id="description" rows="3" cols="50"><?php the_author_meta('description', $current_user->ID); ?></textarea>

                                     <?php wp_nonce_field('update_user','update_user_nonce'); ?>                                          <?php                                     //action hook for plugin and extra fields                                     do_action('edit_user_profile', $current_user);                                     ?>
                                         <input type="submit" id="updateuser" class="submit button" value="<?php _e('Update', 'profile'); ?>" />
                                 </form>      Code to update profile                       global $current_user;                 get_currentuserinfo();                 /* Load the registration file. */            if (!(function_exists('get_user_to_edit'))) {                require_once(ABSPATH . '/wp-includes/user.php');                require_once(ABSPATH . '/wp-admin/includes/user.php');            }                 $allFields = get_cimyFields();            $error = array();                 /* If profile was saved, update profile. */            if ('POST' == $_SERVER['REQUEST_METHOD'] &&                       !empty($_REQUEST['update_user_nonce']) && wp_verify_nonce($_REQUEST['update_user_nonce'],'update_user') ) {          /* Update user password. */     if (!empty($_POST['pass1']) && !empty($_POST['pass2'])) {         if ($_POST['pass1'] == $_POST['pass2'])             wp_update_user(array('ID' => $current_user->ID, 'user_pass' => esc_attr($_POST['pass1'])));         else             $error[] = __('The passwords you entered do not match.  Your password was not updated.', 'profile');     }               /* Update user information. */     if (!empty($_POST['url'])) {         wp_update_user(array('ID' => $current_user->ID, 'user_url' => esc_url($_POST['url'])));     }          if (!empty($_POST['email'])) {         if (!is_email(esc_attr($_POST['email'])))             $error[] = __('The Email you entered is not valid.  please try again.', 'profile');         elseif (email_exists(esc_attr($_POST['email'])) != $current_user->ID)             $error[] = __('This email is already used by another user.  try a different one.', 'profile');         else {             wp_update_user(array('ID' => $current_user->ID, 'user_email' => esc_attr($_POST['email'])));         }     }          if (!empty($_POST['first-name'])) {         update_user_meta($current_user->ID, 'first_name', esc_attr($_POST['first-name']));     }          if (!empty($_POST['last-name'])) {         update_user_meta($current_user->ID, 'last_name', esc_attr($_POST['last-name']));     }          if (!empty($_POST['description'])) {         update_user_meta($current_user->ID, 'description', esc_attr($_POST['description']));     }               /* Redirect so the page will show updated info. */     /* I am not Author of this Code- i dont know why but it worked for me after changing below line to if ( count($error) == 0 ){ */     if (count($error) == 0) {              //action hook for plugins and extra fields saving         do_action('personal_options_update', $current_user->ID);         do_action('profile_update', $current_user->ID);         foreach ($allFields as $field) {             set_cimyFieldValue($current_user->ID, $field["NAME"], $_POST['cimy_uef_' . $field['NAME']]);         }         do_action('edit_user_profile_update', $current_user->ID);         wp_redirect(get_permalink());            //        exit;     }            }            add_action('wp_enqueue_scripts', 'abc');                 function abc() {                wp_enqueue_script('image-edit');                wp_enqueue_style('imgareaselect');            }


title: Create page when plugin is activated

text: I've made so that everytime my plugin is activated it's supposed to create a page. Although i want it to only create the page if it doesn't exist from before. But what it's doing is that it's creating another page with kns- products-1 instead of not doing it at all. My code so far:               function kns_install() {         global $wp_version;              if( version_compare( $wp_version, '3.5', '<' ) ) {             wp_die( 'Detta tilläget kräver att du har WordPress version 3.5 eller högre.' );         } else {             if(!is_page('kns-products')) {                 $product_page = array(                 'post_type' => 'page',                 'post_name' => 'kns-products',                 'post_title' => 'Produkter',                 'post_status' => 'publish',                 );                      wp_insert_post($product_page);             }         }        }      I thought that the !is_page condition would solve this but there seems to be a built in code to just add numbers after the slug name. Is there any way to solve this or does anyone know of any better approach?


title: add_rewrite_rule not working in Wordpress Multisite

text: I need to rewrite urls on a Wordpress Network/Multisite, so I wrote a plugin that does it for me. This plugin works perfectly when using on a Single Wordpress site that does not make use of the Multisite feature, now when I try to use it on a Multisite setup it just does not want to work, nor writes to the htaccess file. My code is below               function rewrite_builtrules() {            global $wp_rewrite;         //Rule 1         $rewrite_rule1 = get_option('rewrite_rule1');           $rewrite_virtual_rule1 = get_option('rewrite_virtual_rule1');           if(!empty($rewrite_rule1) && !empty($rewrite_virtual_rule1))             add_rewrite_rule($rewrite_virtual_rule1,$rewrite_rule1,'top');              //Rule 2         $rewrite_rule2 = get_option('rewrite_rule2');           $rewrite_virtual_rule2 = get_option('rewrite_virtual_rule2');           if(!empty($rewrite_rule2) && !empty($rewrite_virtual_rule2))             add_rewrite_rule($rewrite_virtual_rule2,$rewrite_rule2,'top');              //Rule 3         $rewrite_rule3 = get_option('rewrite_rule3');           $rewrite_virtual_rule3 = get_option('rewrite_virtual_rule3');           if(!empty($rewrite_rule3) && !empty($rewrite_virtual_rule3))             add_rewrite_rule($rewrite_virtual_rule3,$rewrite_rule3,'top');          //    flush_rewrite_rules(true);         $wp_rewrite->flush_rules( true );     }     add_action( 'init', 'rewrite_builtrules' );      The urls that I need to rewrite are www.site.co.za/multisite/wp-content/uploads/2014/01/images.jpg needs to become www.site.co.za/multisite/images.jpg Is there anything I'm missing? Any help will be appreciated


title: Parse error:syntax error

text:
I'm new to Wordpress. I'm trying to create a Wordpress theme. But i am getting the error:               Parse error: syntax error, unexpected 'meta' (T_STRING) in \xampp\htdocs\wordpress\wp-content\themes\theme\index.php on line 31      Error File **Index.php**                   <?php get_header(); ?>

         <?php /* The Loop — with comments! */ ?>     <?php while ( have_posts() ) : the_post() ?>          <?php /* Create a div with a unique ID thanks to the_ID() and semantic classes with post_class() */ ?>                     <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>     <?php /* an h2 title */ ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?>
          <?php /* Microformatted, translatable post meta */ ?>
                             <?php _e('By ', 'your-theme'); ?>                             <a class="url fn n" href="<?php echo get_author_link( false, $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( __( 'View all posts by %s', 'your-theme' ), $authordata->display_name ); ?>"><?php the_author(); ?>                              |                              <?php _e('Published ', 'your-theme'); ?>                             <abbr class="published" title="<?php the_time('Y-m-dTH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?>                             <?php edit_post_link( __( 'Edit', 'your-theme' ), '|', '' ); ?>
         <?php /* The entry content */ ?>
     <?php the_content( __( 'Continue reading &raquo;', 'your-theme' )  ); ?>     <?php wp_link_pages('before=
' . __( 'Pages:', 'your-theme' ) . '&after=
') ?>
                         <?php /* Microformatted category and tag links along with a comments link */ ?>
                             <?php _e( 'Posted in ', 'your-theme' ); ?><?php echo get_the_category_list(', '); ?>                              |                              <?php the_tags( '' . __('Tagged ', 'your-theme' ) . '', ", ", "|" ) ?>                             <?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?>                             <?php edit_post_link( __( 'Edit', 'your-theme' ), '|', '' ); ?>

          <?php /* Close up the post div and then end the loop with endwhile */ ?>

     <?php get_sidebar(); ?>     <?php get_footer(); ?>      How to fix this?


title: Get category ID after wp_insert_term

text: I'm using `wp_insert_term` to create categories, after the category is created I'd like to get its ID: `$cat_id = wp_insert_term($name, 'category', array('slug' => $slug) );` ...however when I try to print `$cat_id` I get `Array` instead of the actual ID. I guess I have to state which part of the array I need, but I don't really know what the variable for the ID would be?


title: WP http XML response HTML encoding and image display problems

text:
This is my very first WP plugin. Theres probably going to be more than one question here and they're all related so I'm going to ask all here. Working test here Tracking number to use: lc0614061377 Example XML Response from `tracenow.net`:               <Consignment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">         <consignmentNumber>lc0614061377</consignmentNumber>         <customerRef/>         <itemCount>1</itemCount>         <name>six red squares</name>         <address1>unit 7b victoria business park</address1>         <address2>short street</address2>         <town>SOUTHEND ON SEA</town>         <county>ESSEX</county>         <postcode>ss2 5by</postcode>         <country>United Kingdom</country>         <recipient>cannon</recipient>         <status>Delivered</status>         <collected>0001-01-01T00:00:00</collected>         <delivered>2014-07-25T10:00:50</delivered>         <collectionCode/>         <deliveryCode>Delivered OK</deliveryCode>         <comments/>         <created>2014-07-24T15:00:40</created>         <deliveryLatitude>51.54617</deliveryLatitude>         <deliveryLongitude>0.712245</deliveryLongitude>         <deliverySignature>             http://resources.tracenow.net/signatures/d5dbffb4-0336-44bf-b72c-00fb9aaac759/0a630170-1390-4ca4-b104-5ca4b9b6199f.jpg         </deliverySignature>         <deliveryImage>             http://resources.tracenow.net/images/d5dbffb4-0336-44bf-b72c-00fb9aaac759/6de6c2bd-236b-447d-a106-b1a7bd537645.jpg         </deliveryImage>     </Consignment>      This is the current state of my code:               // tracenow.php          <?php      /*      Plugin Name: TraceNow Tracking      Plugin URI: http://www.titandesign.co.uk      Description: A simple parcel tracking plugin for Codeway TraceNow.      Version: 4.0      Author: Richard King      Author URI: http://www.titandesign.co.uk/      License: GPL-2.0+      License URI: http://www.opensource.org/licenses/gpl-license.php       */           wp_enqueue_script( 'my-ajax-handle', plugin_dir_url( __FILE__ ) . 'ajax.js', array( 'jquery' ) );      wp_enqueue_style( 'my-ajax-handle', plugin_dir_url( __FILE__ ) . 'style.css' );      wp_localize_script( 'my-ajax-handle', 'the_ajax_script', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );           // THE TRACKING FUNCTION      if( !class_exists( 'WP_Http' ) )     include_once( ABSPATH . WPINC. '/class-http.php' );           function tracking_function(){       //if ( isset( $_POST['consignmentNumber'] ) && '1' == $_POST['consignmentNumber'] ){         $consignmentNumber = $_POST['consignmentNumber'];         $url = ('http://services.tracenow.net/TraceNowAccess.asmx/GetConsignment?consignmentNumber=' .($consignmentNumber) .'&externalAccessGuid=d5dbffb4-0336-44bf-b72c-00fb9aaac759');         $args = array(                     'method' => 'GET',                     'timeout' => 45,                     'redirection' => 5,                     'httpversion' => '1.1',                     'content-type' => 'application/x-www-form-urlencoded',                     'body' => array(),                     'headers' => array(),                     'blocking' => true,                     'cookies' => array(),                     'connection' => 'close',                     );              $response = wp_remote_get( $url, $args );         if ( is_wp_error( $response ) ) {                 $error_message = $response->get_error_message();                      echo "Something went wrong: $error_message";                 } else {                     /*include ('/render_xml_to_html.php');                             if(function_exists('render_xml_data')){                                 render_xml_data('example_data.xml');                                 }else{                                 echo null;                             } */                         echo '
Consignment Details
' . '
' . print_r($response['body'], true) . '
';// this is passed back to the javascript function                         die();                 } // end if         //} // end if                     }           // THE AJAX ADD ACTIONS     add_action( 'wp_ajax_the_ajax_hook', 'tracking_function' );     add_action( 'wp_ajax_nopriv_the_ajax_hook', 'tracking_function' ); // need this to serve non logged in users          // ADD TRACKING FORM TO THE PAGE          function tracenow_frontend(){     $the_form = '     <form id="theForm" method="POST">     <input id="consignmentNumber" name="consignmentNumber" value="Consignment No" type="text" />     <input name="action" type="hidden" value="the_ajax_hook" />      <input id="submit_button" value="Track" type="button" onClick="submit_me();" />      </form>
         Your tracking details will appear here
';// END DIV RESPONSE AREA     return $the_form;     }      add_shortcode("tn_ajax_frontend", "tracenow_frontend");          // ajax.js     function submit_me(){             jQuery.post(the_ajax_script.ajaxurl, jQuery('#theForm').serialize()             ,             function(response_from_tracking_function){                 jQuery("#response_area").html(response_from_tracking_function);                 }             );             jQuery('#theForm').find('input[type=text]').val('Consignment No');           }          // render_xml_to_html.php     <?php     /*         Written by Gary Hollands Sept 2010         This work is available under the terms of the GNU General Public License, http://www.gnu.org/licenses/gpl.html         render_xml_data is a function that can use XML data and present that data as HTML.     */     function render_xml_data($path_to_xml_file){         if (!file_exists($path_to_xml_file)){             return;         }else{             $chars_to_replace = array('[\r]','[\n]','[\t]');             $xmlstring = trim(preg_replace($chars_to_replace, '', file_get_contents($path_to_xml_file)));         }         $xml = new SimpleXMLElement($xmlstring);         foreach ($xml->consignment as $consign) {                 echo '
'."\n";                 echo '
'.$consign->consignmentnumber.'
'."\n";                 echo '
Customer Ref: '.$consign->customerref.'
'."\n";                 echo '
Number of items: '.$consign->itemcount.'
'."\n";                 echo '
Name: '.$consign->name.'
'."\n";                 echo '
Address 1: '.$consign->address1.'
'."\n";                 echo '
Address 2: '.$consign->address2.'
'."\n";                 echo '
Town: '.$consign->town.'
'."\n";                 echo '
County: '.$consign->county.'
'."\n";                 echo '
Postcode: '.$consign->postcode.'
'."\n";                 echo '
Country: '.$consign->country.'
'."\n";                 echo '
Recipient: '.$consign->recipient.'
'."\n";                 echo '
Status: '.$consign->status.'
'."\n";                 echo '
Collected: '.$consign->collected.'
'."\n";                 echo '
Delivered: '.$consign->delivered.'
'."\n";                 echo '
Collection Code: '.$consign->collectioncode.'
'."\n";                 echo '
Delivery Code: '.$consign->deliverycode.'
'."\n";                 echo '
Comments: '.$consign->comments.'
'."\n";                 echo '
Created: '.$consign->created.'
'."\n";                 echo '
Delivery Latitude: '.$consign->deliverylatitude.'
'."\n";                 echo '
Delivery Longitude: '.$consign->deliverylongitude.'
'."\n";                 echo '
Delivery Signature: deliverysignature.'/"/>
'."\n";                 echo '
Delivery Image: deliveryimage.'/"/>
'."\n";                 echo '
'."\n";         }     }      Link to GitHub Gist So to get started. The tracking function is working and returns the response from the server fine.   1. How do I get the response to render as HTML to be displayed on a page. At the moment it is returning the XML body of the request which is exactly what I need. I need to target the nodes that are not empty and return them with a title. Example for the consignment number I want to add the title `'Consignment No:'`. The same for `address`, `status`, `time`, `GeoLoc` etc. I have considered using jQuery and CSS :before to add the title. I also have a `render_xml_to_html.php` file which I assumed was the correct method, however the only return I get when implimented is 0. Any suggestions?    2. There are links to 2 images in the XML response but they don't have the img tag or classes or ID's, so I'm finding it difficult to target these image files. I tried targeting .jpg but that just did not work at all. I need to add the `img`, `src=""` and `alt=""` tags so I can display the image links as images. Help please.   3. Securing the plugin: I have tried adding wp_nonce to the ajax call to verify the form request. I have also tried creating and adding the nonce to the tracking function but again I get an error. This has really got me stumped. I have now read so many blogs on adding nonce that I am totally confused and could do with a gentle push in the right direction.   4. I would like to send the response to a page called results. This is an existing page. I checked on codex but the only option I could find was `addpage`, which creates a new page everytime. The reason: I would like to be able to add the plugin as a widget.


title: Redirect Issue: Wordpress database

text: I have an issue with my wordpress site that seems to relate to the settings in wordpress. However, it seems to go into a redirect loop. I can confirm upon a fresh installation the issue disappears. I can't actually get into the wp-admin to change any of the settings. All this arose from clicking the update button to update to 4.0 then the wordpress installation went into the redirect loop for every page. Does anybody know what setting needs to be changed in the database to resolve this issue? Or is there a way to debug this issue?


title: Custom Post Type Meta Select Box Get URL for Roya Slider

text: I'am using a snippet i got from here: Populating meta box with select-list of existing posts, and assigning it to custom post types Mikes Code works great and does what i want: Display a MetaBox at my Custom Post Type, also saving works fine! My Problem is that this code puts out the selected Post ID when I call it through Royal Slider Markup, while i need the URL to make a Linked Button out of it. In Royal Slider i use: {{meta._selected_post.0}} which is: _selected_post   or $this->meta_key = " _selected_ {$this->SELECT_POST_TYPE}"; in the code snippet Iam sure this is basically easy.. but my php skills dont go that far to see what part iam using wrong. Hope you guys can help. Here is Mikes Code I edited for my CTP:               // POST SELECT     class slides_meta_post {       var $FOR_POST_TYPE = 'slides';       var $SELECT_POST_TYPE = 'post';       var $SELECT_POST_LABEL = 'Post';       var $box_id;       var $box_label;       var $field_id;       var $field_label;       var $field_name;       var $meta_key;       function __construct() {         add_action( 'admin_init', array( $this, 'admin_init' ) );       }       function admin_init() {         add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );         add_action( 'save_post', array( $this, 'save_post' ), 10, 2 );         $this->meta_key     = "_selected_{$this->SELECT_POST_TYPE}";         $this->box_id       = "select-{$this->SELECT_POST_TYPE}-metabox";         $this->field_id     = "selected-{$this->SELECT_POST_TYPE}";         $this->field_name   = "selected_{$this->SELECT_POST_TYPE}";         $this->box_label    = __( "Beitrag Verlinken", 'wpse-85107' );         $this->field_label  = __( "Wähle {$this->SELECT_POST_LABEL}", 'wpse-85107' );       }       function add_meta_boxes() {         add_meta_box(           $this->box_id,           $this->box_label,           array( $this, 'select_box' ),           $this->FOR_POST_TYPE,           'normal'         );       }       function select_box( $post ) {         $selected_post_id = get_post_meta( $post->ID, $this->meta_key, true );         global $wp_post_types;         $save_hierarchical = $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical;         $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = true;         wp_dropdown_pages( array(           'id' => $this->field_id,           'name' => $this->field_name,           'selected' => empty( $selected_post_id ) ? 0 : $selected_post_id,           'post_type' => $this->SELECT_POST_TYPE,           'show_option_none' => $this->field_label,         ));         $wp_post_types[$this->SELECT_POST_TYPE]->hierarchical = $save_hierarchical;       }       function save_post( $post_id, $post ) {         if ( $post->post_type == $this->FOR_POST_TYPE && isset( $_POST[$this->field_name] ) ) {           update_post_meta( $post_id, $this->meta_key, $_POST[$this->field_name] );         }       }     }     new slides_meta_post();


title: source code: WP_INSTALLING vs. WP_SETUP_CONFIG in setup-config.php

text: I am trying to make sense of the wordpress installation process. The file `setup-config.php` under `wp-admin` has the following. I want to know what the difference is between these two variables, why both are needed, and what exactly the `WP_SETUP_CONFIG` boolean indicates.               /**      * We are installing.      */     define('WP_INSTALLING', true);          /**      * We are blissfully unaware of anything.      */     define('WP_SETUP_CONFIG', true);      When I do a search in Aptana with CTRL-H I can see that `WP_INSTALLING` is referebced in quite a few files and `WP_SETUP_CONFIG` in just a few. What does we are blissfully unaware of anything mean? That we don't have a `wp- config.php` file or what? Thanks.


title: wp_insert_post -> post_content not showing

text: I have a problem with wp_insert_post. When I'm attempting to insert my post, the post_content essentially shows up as just blanks spaces. I even went into MySQL to confirm. Everything else, post_title, post_excerpt, etc shows up just fine. I did a print_r($this->postData) Just prior to passing this to wp_insert_post just to be sure it wasn't empty and the right data was present. The contents of the data are               <object> ... </object>       Would that be an issue? Here's my code that creates the $this->postData variable that's passed into wp_insert_post.               $this->postData = array(             'post_content' => $this->jsonData['data'],             'post_title' => $this->jsonData['title'],             'post_excerpt' => $this->jsonData['description'],             'tags_input' => $this->jsonData['tags'],             'post_date' => date('Y-m-d H:i:s'),             'post_status' => 'publish',             'post_author' => 1,             'post_date_gmt' => date('Y-m-d H:i:s'),         );      thanks in advance!


title: Call Shortcode on wp_footer

text: Is it possible to call shortcode outside of post/ page content area? I am trying to add it to wp_footer with the following codes but it's returning string:               add_shortcode('eps_pop', 'init');     function indtable_display_front_end($atts ) {     global $post;              extract( shortcode_atts( array(         'id' => ''           ),  $atts ) );          echo get_post_meta($id, '_my_meta_value_key', true);     }     echo do_shortcode('[eps_pop id="234"]');


title: How do you add categories to custom post types in WordPress?

text: I'd like to be able to have categories of a custom post type, how do you set this up? update I want to keep the default categories for regular blog posts, but a separate set of categories just CPT.


title: Adding goodies to themes

text: How do I add stuff to themes such as Arjuna-X without losing it when the theme is updated? Are child themes a good way to do it or are there other options? What if a new version of the theme comes out with native support for a feature I added?


title: Convert WordPress SACK code to new admin-ajax

text: I have been using the TW-SACK library in my plugin using the below code:                   <?php wp_print_scripts(array('sack')); ?>         <script type="text/javascript">         //<![CDATA[             where_go_count = new sack("<?php bloginfo( 'url' ); ?>/index.php");                 where_go_count.setVar( "wherego_id", <?php echo $id ?> );             where_go_count.setVar( "wherego_sitevar", document.referrer );             where_go_count.method = 'GET';             where_go_count.onError = function() { return false };             where_go_count.runAJAX();             where_go_count = null;         //]]>         </script>      This used to be the standard format of code on https://codex.wordpress.org/AJAX_in_Plugins, which has since changed. I am not sure as to how I can modify the above code to use the new format with `wp_ajax_ajax` Appreciate any guidance on this.


title: 5 blogs on one WordPress site

text: What is the best way to have multiple blogs on one site? I am not talking about Multisite. What I want is one website with 5 blogs. All accessible from one menu and editable from one backend, I could use categories, though I am looking for something else. Multisite would take a lot of tweaking.


title: How to Combine Two Custom Post Types into Single Permalink Structure

text: The website uses - A) A hierarcical Custom Post Type "Destination" to support the following structure, so each tier of the hierarchy could have its own unique destination guide:   * Territory - Americas   * Continent - North America   * Section -   * Country - United States   * Region -   * State - New York   * Area -   * City - New York City   * District - Manhattan   * Neighborhood - Upper East Side Resulting in the Upper West Side destination guide having 7 tiers and the URL:               site.com/destination/americas/north-america/united-states/new-york/new-york-city/manhattan/upper-east-side/      Note that each tier of the hierarchy is not required to be populated - a second example would be the destination guide for the Caribbean island of Dominica, which would only require four tiers:   * Territory - Americas   * Continent - North America   * Section - Caribbean   * Country - Dominica   * Region -   * State -   * Area -   * City -   * District -   * Neighborhood - The URL for the Dominica destination guide would be:               site.com/destination/americas/north-america/caribbean/dominica/      No issues here - that part works fine. Here is the challenge - B) Each individual destination has a variety of unique features that have their own respective Custom Post Type:   1. Hotels   2. Restaurants   3. Bars   4. Attractions   5. Tours   6. etc. These Custom Post Types are not hierarchical, but must be related to the appropriate page (tier) of a Destination Custom Post Type. To provide logical consistency between the site architecture, permalink structure, breadcrumbs and menus, each of these Custom Post Types should be listed under a specific destination. The various Custom Post Types for these destination features are simple and not hierarchical. Hotel Example: An individual hotel would have a simplistic hotel/hotel-name structure, but always be associated with a parent destination. As a result, the Permalink for The Lowell Hotel on New York's Upper East Side would be:               site.com/destination/americas/north-america/united-states/new-york/new-york-city/manhattan/upper-east-side/hotel/the-lowell/      In Dominca, the hotel Permalink/URL would be:               site.com/destination/americas/north-america/caribbean/dominica/hotel/rosalie-bay-resort/      Restaurant Example: The same approach would hold true for a restaurant, in this case, the Serafina Restaurant:               site.com/destination/americas/north-america/united-states/new-york/new-york-city/manhattan/upper-east-side/restaurant/serafina/      Again, for Dominca, a restaurant Permalink/URL would be:               site.com/destination/americas/north-america/caribbean/dominica/restaurant/romance-cafe/      By using this approach, a number of taxonomies may be added to query/filter, for example, four-star, resort hotels, under 250 rooms, with guest ratings over 7/10, with the Destination (and its child destinations) defining the eligible properties. Ideally, would like to deal with this using rewrite rules to subordinate the otel, Restaurant, etc. Custom Post Types under the Destination Custom post type. Have tried it a number of ways with no success. Any suggestions? Examples would be much appreciated.


title: How to break up php code to avoid echo

text:
I have this php code I am using to list all post (titles) with the taxonomy categories names, and its working fine however I will like to break it up and avoid using echo within the php code so that I can insert some more code. Here's the code I have that works --               <?php     $custom_terms = get_terms('videoscategory');     $other_custom_terms = get_terms('product_category');          foreach ($custom_terms as $custom_term) {     foreach ($other_custom_terms as $other_custom_term) {         wp_reset_query();         $args = array('post_type' => 'product', 'orderby' => 'title',                      'order' => 'asc',             'tax_query' => array(       'relation' => 'AND',     'orderby' => 'title',                      'order' => 'asc',         array(             'taxonomy' => 'product_category',             'field' => 'slug',             'terms' => $other_custom_term->slug,     'orderby' => 'title',                      'order' => 'asc',         ),                 array(                     'taxonomy' => 'videoscategory',                     'field' => 'slug',                     'terms' => $custom_term->slug,     'orderby' => 'title',                      'order' => 'asc',                      ),             ),       );               $loop = new WP_Query($args);          if($loop->have_posts()) {             echo '
'.$custom_term->name.'
';                  while($loop->have_posts()) : $loop->the_post();                 echo '
'.get_the_title().'
';             endwhile;          }     }     } ?>      And here's the code I have now that I have edited to try and accomplish what I would like to do --               <?php     $custom_terms = get_terms('videoscategory');     $other_custom_terms = get_terms('product_category');          foreach ($custom_terms as $custom_term) {     foreach ($other_custom_terms as $other_custom_term) {         wp_reset_query();         $args = array('post_type' => 'product', 'orderby' => 'title',                      'order' => 'asc',             'tax_query' => array(       'relation' => 'AND',     'orderby' => 'title',                      'order' => 'asc',         array(             'taxonomy' => 'product_category',             'field' => 'slug',             'terms' => $other_custom_term->slug,     'orderby' => 'title',                      'order' => 'asc',         ),                 array(                     'taxonomy' => 'videoscategory',                     'field' => 'slug',                     'terms' => $custom_term->slug,     'orderby' => 'title',                      'order' => 'asc',                      ),             ),          );     }     }     }          $loop = new WP_Query($args);          if($loop->have_posts()) : while($loop->have_posts()) : $loop->the_post(); ?>     <div class="box <?php echo $custom_term->slug; ?>">
<?php echo $custom_term->name ?>

<a href="<?php get_permalink(); ?>"><?php get_the_title(); ?>

            <?php endwhile; ?>      Basically what Im trying to do is assign the term name or slug as a class to my div so that I can use isotope filter to filter the list of posts by category. However I am receiving parse/syntax errors, and things are not working. What am I doing wrong? Any help is appreciated, thanks.


title: Get post_meta of children and compare to current page ID

text: I am stumped on a bit of php code in my template. I have a custom field named "services" with a value such as "2402, 2366, 78" These are page ID's. In my template I want to do the following: Get any children of page ID 2526. Then get the value of that custom field for each of the children. Then get the ID of the current page the template is being used for ( get_the_ID() ). Then create an IF statement. IF a number in the value matches the number of the page ID, echo something and wrap the echoed text with a link back to the child page of ID 2526, whose custom field has value that matches the current page ID. I can also enter the values as 2402 2366 78 if its easier without commas. This is where I am so far:               <?php     $currentPageID = get_the_ID();     $child_pages = $wpdb->get_results("SELECT *    FROM $wpdb->posts WHERE post_parent = 2526 AND post_type = 'page' ORDER BY menu_order", 'OBJECT');     if ( $child_pages ) : foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild );     $services = get_post_meta( $pageChild->ID, 'services', true );     if (preg_match('/(^|,)'.$currentPageID.'($|,)/', $services)){         echo "matches";     }      else {         echo "does not match";     }     endforeach; endif;     ?>      I don't get any errors, but nothing shows up either. I also am not sure how to add the link for the related child page. Thanks for any help in advance!


title: Distributing and packaging plugins

text: I have a project where I'll be using WP as a customer portal to an external application. The application is accessed via web services (soap/xml) calls. The application has quite a few forms and for that I plan on using Formidable's Form plugin. I have the login process modified so the login actually is done remotely and a local user is created if one doesn't already exist. Looking ahead a bit I'm trying to understand how I distribute the custom pages I'll need. I don't plan on being theme specific. So I imagine I'll be installing plugins and modify the database (for the custom pages). My question is there a guide/standard methodology for distributing plugins that is applicable to my situation? When plugins have specific pages how are those installed? and how are the menus adjusted accordingly?


title: WordPress 3.8 keeps asking me to upgrade to 3.8

text: It began with version `3.7.1`: > You are using WordPress 3.7.1. Update to 3.7.1 I've installed and usually update WP with git from `https://github.com/wordpress/wordpress`:               cd wordpress     git fetch --tags     git checkout 3.8      Then I usually download localized version (`ru_RU`) and copy over updated language files (`wp-content/languages/`). Everything was smooth until 3.7.1 and it looks like I'm not the only one encountering this issue. Does anybody have any idea how to fix that? Thanks!


title: Search a title word through query_posts (not the exact match)

text: We're working on a database with personal data from different sportsmen such as name, height, weight, etc. We've managed to build a detailed filter through `query_posts`. Every filter field is working as expected except for the text input field that we use to filter the sportsman by name. The problem is that when we are looking for the name of a single sportsman, the form just allows us to find the sportsmen by its exact name. For example: If we are looking for a sportsman called John Doe, we would need to write the exact name of the post title ('John Doe'). Instead, we would like to be able to have results just typing 'John' or 'Doe'. Our `query_posts` filter looks like this:               query_posts( array(         'name' => $sportsman_name,         'post_type' => 'db',         'posts_per_page' => 100,         'paged' => $paged,         'category_name' => $sport,         'meta_query' => array(             $height,             $weight,             $tshirt_size,             $foot_size,              )     ) );      That's how the form field looks like: `<input name="sportsman" type="text">` And that's how we create the string to filter the results in the `query_posts`:               $sportsman = $_GET["sportsman"];              if($sportsman == ''){             $sportsman_name = null;         }else{             $sportsman_name = $sportsman;         }


title: Create an Author Page on Registration

text: I actually want my users to have an active user page upon registration. I know that WP doesn't create an author page until the user has created a post but automatically posting something would work it's not what I want to do. I was going to               add_action('user_register','create_new_user_post');          function create_new_user_post($user_id){             if (!$user_id>0)                     return;             // Create post object             $empty_post = array(                  'post_title' => 'waste of DB space',                  'post_content' => 'an empty post.',                  'post_status' => 'publish',                  'post_author' => $user_id             );                  // Insert the post into the database             $bio = wp_insert_post( $empty_post );                  //and if you want to store the post ids in              //the user meta then simply use update_user_meta             update_user_meta($user_id,'_bio_post',$bio);          }      But it seems like a waste to be creating posts in a post type created just to qualify an "author" to have an author page. Can someone point me in the right direction to get author pages created upon registration without having a post published?


title: How accomplish modification the_content if home/start page?

text: How can I modify the_content **if** the page is the home/start page? I thought this could be done through a function in functions.php, but soon realized after some googling that the functions.php -file runs before parse query, so WP doesn't now if it is the home/start page or not. What I want to do: If the post have one or multiple images in it, grab the first image and display it in the loop before the content of the post on the home/start page. I don't want to go with "Featured image". How do I accomplish this?


title: Extend Custom Post Type

text: A theme I use registers a custom post-type. Unfortunately its supports array misses an item, I would like to add ('thumbnail'). Now, I don't like to overwrite the post-types registration in the theme and instead would like to "extend" it (via my child-theme). Is this possible?


title: Read More Button does not display

text:
I have read through every existing post on this topic and they are all way too technical for me and I think my problem may be different anyway. So, like many others, I need to truncate my blog posts on the main blog page (index.php) so that only a couple of paragraphs are visible until they click a "read more" button which takes them to the single.php single post. I have inserted the code, but all it does is cut it off. There is no button there and no link. How do I put that link there? Here is the code for my index.php:               get_header(); ?>

     <?php     $post_obj = $wp_query->get_queried_object();     $post_name = $post_obj->post_name;     if($post_name == 'blog'){         echo 'Blog';     }else{         $parent_title = get_the_title($post->post_parent);         echo $parent_title;     }     ?>

                      <?php while ( have_posts() ) : the_post(); ?>                               <?php get_template_part( 'content', 'blog' ); ?>                                    <?php comments_template( '', false ); ?>                      <?php endwhile; // end of the loop. ?>

          <?php get_sidebar(); ?>


title: Best way to implement a thumbnail-based gallery in Wordpress?

text: I need to create a gallery like this where clicking on the thumbnails loads a new image and caption in the area above the thumbnails: ![enter image description here](http://i.stack.imgur.com/XAGdS.png) I always prefer to **not** use plugins, but in this case I think I might be forced to as the in-built gallery system for Wordpress doesn't work for me (there's no easy way to remove images from the gallery set without deleting them, no easy reordering and captions seem difficult to implement). Would NextGen be the best choice for this, or is there a paid option that's worth looking at and can this be easily styled? Thanks for any pointers


title: Update a WordPress website FROM Twitter or Facebook

text: I'm looking for a way to update a wordpress website when I post something to a specific twitter or facebook account. Is it possible? Is there any plugin that do this? I find only plugins that do the inverse, updating social networks from WordPress. What I'd like to do is to update WordPress from my social network accounts.


title: How to avoid infinite loop in save_post callback

text: I have been using this site alot for solving my problems, but this time I did not succeed in finding and answer for my problem. I get and infinite loop when using `wp_update_post` inside a function that is called on `save_post`. I know that this is a common issue, but I can't figure out how to avoid it. I want to save the order of my posts (which is of the post-type 'section'). So I have made a custom meta box which contain some sortable html-elements. In each element there is an hidden input tag with name='sectionorder[]'. So when I click the standard WordPress 'Update' buttom, an array containing all the ID's of the posts (in order) are send via POST. So here is the code where I retrieve the array, and wants to save the order:                   // Update section sort order     $sectionorder = $_POST['sectionorder'];     if (isset($sectionorder)) { // Avoid error if there is no sections added yet         foreach( $sectionorder as $no => $sectionID ) {             $post_update = array();             $post_update['ID'] = $sectionID;             $post_update['menu_order'] = $no;             wp_update_post( $post_update );         }     }      But the problem is that it starts an infinite loop. How do I avoid that? Maybe I can do it in a completely different way? Appriciate your help!


title: Custom post type efficiency

text: I want to make a custom post type with many custom meta boxes and data. Let's say that i want to add 50 custom post variables. I see in the db that for every post meta variable a record is inserted in wp_postmeta. That said , a single post creation will result in 50 different inserts in wp_postmeta. That means that if i have 1000 posts in the db what will happen if i make a conditional query? Is this efficient or is there another way? Thanks


title: Show different size featured images (the_post_thumbnail) for 1st, 2nd and 3rd posts?

text: I file all the galleries on my blog under the 'gallery' tag. I use the following code (via) to display the latest 7 gallery posts after the 8th latest post on home page:               <!-- Featured post galleries after 8th post -->     <?php        $homegallery++;        if ($homegallery == 8){     ?>          <!-- Display Gallery Posts -->     <div id="gallery-posts">     <?php         $count = 0;         $some_featured_posts = new WP_Query(array('category_name' => 'apps', 'posts_per_page' => 5));         while ($some_featured_posts->have_posts()):              $some_featured_posts->the_post();             $count++;     ?>          <?php the_post_thumbnail( 'thumbnail' ); ?>          <?php         endwhile;         wp_reset_postdata();     ?>     </div><!-- Display Gallery Posts END -->          <?php        };     ?><!-- Featured post galleries END -->      As you can see, I use a thumbnail to represent each post `<?php the_post_thumbnail( 'thumbnail' ); ?>`, may look weird, but that's how I do it. But I would like to show the thumbnails of first two posts in one size (large), the third one in one size (medium) and the rest in another size (thumbnail). How do I do this? * * * In case it helps, I've got this far with some help:               <?php         $loop_first = 1;         if ( ! isset ( $loop_first ) ) {              // set featured image size for first post         the_post_thumbnail( 'medium' );         } else {              // set featured image size for other posts         the_post_thumbnail( 'thumbnail' );         }     ?>      The above code (I believe) allows me to show a different size image for the first post, and different size thumbnails for the rest of the posts.


title: How to add pagination to buddyPress activity stream

text:
How to add pagination with page numbers rather than load move links for buddyPress activity stream？

<?php bp_activity_pagination_count(); ?>

<?php bp_activity_pagination_links(); ?>

      ps：http://wiinder.com/groups/beauty-said/


title: Why my Plugin keeps deactivating automatically?

text: I have a plugin called 'virtual theme' which I downloaded from the plugin directory, and it works great but i noticed sometimes when there's a change it with other plugins it seems to stop working and shows a page not found. Going to the plugin page it still shows like its active. So what i have to do to make it work again is click on deactivate and then click activate so it could start working. I notice this happens more when I end up deactivating another plugin this one stops working. I also notice that it happens sometimes when making an option change, like bbpress for example, after making a change there, Virtual Theme' stops working. Does anybody knows why it does this.


title: Vote up or like button that uses post meta to allow global sorting

text: I need a plugin that allows user to "vote up" or click a "like" button. The plugin must use the post meta fields because the sorting for the entire site will be by the sum of votes, descending. Bonus points if the algorithm could support a trailing time period. e.g. Top "likes" for the last 90 days. Thank you. I've examined most of the popular plugins and most of them force us to use multiple stars or do not support the post meta field in the database to allow sorting. Please note that I am needing to sort ALL posts, not just have a widget displaying top posts.


title: How to use sharrre plugin for wordpress?

text: Does anyone know how to use sharrre plugin for wordpress ? here are the steps I did but did not work :   * I copied this to **single.php** `<div id="demo1" data-url="http://sharrre.com" data-text="Make your sharing widget with Sharrre (jQuery Plugin)" data-title="share"></div>`   * I Placed this Java in **header.php**               $('#demo1').sharrre({       share: {         googlePlus: true,         facebook: true,         twitter: true       },       buttons: {         googlePlus: {size: 'tall'},         facebook: {layout: 'box_count'},         twitter: {count: 'vertical', via: '_JulienH'}       },       hover: function(api, options){         $(api.element).find('.buttons').show();       },       hide: function(api, options){         $(api.element).find('.buttons').hide();       },       enableTracking: true     });        * and paste this to **style.css**               .sharrre .box{       float:left;     }     .sharrre .count {       color:#444444;       display:block;       font-size:17px;       line-height:34px;       height:34px;       padding:4px 0;       position:relative;       text-align:center;       text-decoration:none;       width:50px;       background-color:#eee;       -webkit-border-radius:4px;       -moz-border-radius:4px;       border-radius:4px;      }     .sharrre .share {       color:#FFFFFF;       display:block;       font-size:11px;       height:16px;       line-height:16px;       margin-top:3px;       padding:0;       text-align:center;       text-decoration:none;       width:50px;       background-color:#9CCE39;       -webkit-border-radius:4px;       -moz-border-radius:4px;       border-radius:4px;      }     .sharrre .buttons {       display:none;       position:absolute;       margin-left:50px;       z-index:10;       background-color:#fff;     }     .sharrre .button {       float:left;       max-width:50px;       margin-left:10px;     }      I dont know why it is not working, I tried to contact developer but there is no contact information. Has anyone used this plugin for wordpress before ? thanks


title: Adding a Custom Field to be used by Posts 2 Posts

text: I'm trying using Gravity Forms and allow for a user to submit a post to my CPT, and choose an optional Connected Post Type. I have two CPTs, CPT1 and CPT2. When they're viewing my form for creating a post under CPT1, I want them to be able to choose an associated post that's under CPT2. I've been following Travis Smith's instructions on creating a custom field, which has gone pretty smoothly. However, I'm trying to follow the Posts 2 Posts documentation about adding custom admin boxes. I'm not sure where to start and how to achieve what I'm looking to accomplish. Any advice?


title: How to create metabox that can be queried in the database?

text: So I've been working on created a catalog based off of wordpress's metabox functionality with a custom post type, but now as it comes time to start searching the database to return specific data sets, I'm realizing that I cannot query the data that has been stored inside a metabox because it is being stored as a serialized array in the database. I have been using Dimas' metabox library (which I much appreciate) to process the metaboxes, but then realized that the data was being serialized. I can't work with serialized data (at least I don't think I can) because I need to be able to query the database to select data sets according to the values of the metabox data. My question is if I go with the straight building of the metaboxes, like Justin Tadlock's tutorial over at Smashing show how to do, will that data still be serialized, even if there is only one value per metabox? From everything I'm reading it seems to suggest that such is the case. If so, I'm afraid I'll have to work outside the metabox functionality, which I wouldn't even know how to begin.


title: Make custom post meta sortable front end

text:
I'm currently trying to make certain custom post meta sortable on the frontend of my site. I wish the Title, Publisher, Developer, Score and Release Date all sortable, not sure what the best method is to do this, either have an arrow next to each title or to use drop down menus in a form above the results. Here is the code I'm using:               <?php get_header(); ?>
              <?php if ( have_posts() ) : ?>
Games Database

             	             Title	             Platform(s)	             Genre(s)	             Publisher	             Developer	             Score	             Release Date (US)
                        <?php while ( have_posts() ) : the_post(); ?>

             <a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'games_database-thumb' ); } ?>	             <a href="<?php the_permalink(); ?>"><?php the_title(); ?>	             <?php the_terms( $post->ID, 'games_database_game_platform' ,  ' ' ); ?>	             <?php the_terms( $post->ID, 'games_database_game_genre' ,  ' ' ); ?>	             <?php echo esc_html( get_post_meta( get_the_ID(), 'game_publisher', true ) ); ?>	             <?php echo esc_html( get_post_meta( get_the_ID(), 'game_developer', true ) ); ?>	                          <?php             $review_link = esc_html( get_post_meta( get_the_ID(), 'game_review_link', true ) );              $game_rating = esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) );             if ( ! empty( $review_link ) ) {                 $game_rating = '' . $game_rating . '';             }             ?>                  <div class="rating-<?php echo esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) ); ?>">                 <?php echo $game_rating; ?>
                  	                          <?php echo esc_html( get_post_meta( get_the_ID(), 'game_release', true ) ); ?>

           <?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( '← Older reviews'); ?>

<?php previous_posts_link( 'Newer reviews →' ); ?>
                      <?php };     endif; ?>
            As you can see I have hard coded the table header elements in so maybe that has to change? I really don't know how to progress with this so any and all help will be greatly appreciated. Cheers!


title: Not being allowed to use some terms in Add New Site in Wordpress

text: The following words are reserved for use by WordPress functions and cannot be used as blog names: page, comments, blog, files, feed This is the error message that I'm getting. I wanted to use /blog as a sub- site in the network. What I require is that my site has the following structure:               Home (only contains links to the other parts)     Part 1     Part 2     Blog      Would using permalinks solve my problem? I want all my blogs to appear in only the 'Blog' part of the site and nowhere else. Another follow-up query is that, since I'm working on this site on my localhost, I'm using sub-folders. But when I eventually transfer the site on a web host, I want to use sub-domains. I'm mentioning this as I fear that any solution to the above problem can influence this.


title: How to update WordPress core or themes and still have my child theme hooks work

text: I made a child theme based on the WordPress twentytwelve theme (i.e., the WordPress 'twentytwelve' theme is its parent). Some of the modification were done very simply by overriding style, using my own css properties and selectors in the child theme's style.css file (like different property values for the #page div, or whatever). Other modifications were done by hooks, introducing my own functions in the child theme's functions.php file, and then calling them by placing code in the child theme's (initially duplicated) header.php, footer.php, or wherever. For instance, I added an extra div into each page by writing a new function in the child theme's functions.php which just echoes out the html, and then inserting the call to that function into the appropriate place in the child theme's copy of header.php. Pretty straightforward stuff, I know. As something of a newbie I was extremely pleased with the results I got - the parent 'twentytwelve' theme was transformed by these child theme modifications into something that looked totally different, and it was just what I wanted. I feel like I could transform the twenty twelve theme into a variety of very different styles. So far so good. But now I face the question of WordPress updates. When I update WordPress to a new version, or even just the 'twentytwelve' theme to a new version, the hooks (that I placed in my child theme's header.php or footer.php, or wherever) might not work, because the structure of the parent theme's code might radically alter. (I realise that much of it probably _wouldn't_ actually alter, at least for a time, being basic stuff, but some day it might, or I might be tempted to modify code that may more easily become changed.) So what do I do? I thought of making an exhaustive list of all the modifications I make. That way, when I need to update, I would have to go through each item on the list and check the new files to see whether or not it looks like my modifications would work as before. But that could be pretty time-consuming, and prone to error. So is there a better way to make all these child theme modifications, and update WordPress core files and themes, without so much trouble? I suppose I'm looking for some mechanism which makes it easier to check that the modification hooks still work in the child theme's header.php or footer.php, or wherever, when I update WordPress - or which save me from having to do such checks. That's if I have all this right of course! I get the impression that the 'genesis' framework does this - have I got that right? If so, how does it do it? But why do I have to buy a theme? The modifications I made to WP's 'twentytwelve' theme work very well for me; if possible I'd like to stick with my modification of that theme. Could I use 'genesis' with the 'twentytwelve' theme?


title: display page title as a search result containing searched word

text: My requirement is such that I want to show page title on searching any word containing in that page. Currently I'm using "Ajaxy Live Search" plugin. This plugin results directly the posts, which I don't want. How to do it? Or is there any other plugin?


title: For a complete backup, is it enough to copy htdocs and export database?

text: I copied the htdocs via FTP from the server which hosts my wordpress blog. Moreover, I used phpMyAdmin to export the MySQL database. When I move to a new server, can I just create a database, run the SQL script and copy the backed up data to the new server's htdocs to rebuild the blog exactly as it was?


title: How to determine if custom menu is active?

text: My theme registers custom menus with this function:               function nav_menus() {         if ( function_exists( 'register_nav_menus' ) ) {           register_nav_menus(             array('main-menu' => __( 'Main Menu' ), 'sub-menu' => __( 'Sub Menu' ))           );         }     }      I need to place code into my sidebar, that checks to see if the "main-menu" is active - for example, has a menu assigned to the "Main Menu" theme location. Anyone know how to test for this?


title: How to add Color Picker in Theme Options for the following?

text: I have a landscaping09 theme. This is what I want: A theme options page with the following options: ->Theme color background change (with colorpicker) or url of the image  ->General Navbar color background change (with colorpicker) or url of the image  ->Header color background change (with colorpicker) or url of the image  ->Set up header height  ->Navbar color background change (with colorpicker) or url of the image  ->Navbar hover color background change (with colorpicker) or url of the image  ->Footer color background change (with colorpicker) or url of the image  ->additional css code box please let me know how to do it or any plugin will do these things? please help me.


title: WooCommerce Email Customization

text: I need to edit the code in the woocommerce new order email to not show the price but I still need to have it show the product purchased and the number of products purchased. Currently there is a single line of code the pulls the whole table of products purchased and the prices.               echo $order->get_order_item_totals( false, true );      How to replace this line of code with something that will show only the products and number of products but not the price paid?


title: How do I pass WordPress's get_bloginfo('siteurl') to Jquery?

text: I'm guessing this is a really dumb question, but I'm far more familiar with PHP/WordPress and I'm just getting started with jQuery so I'm not even sure what to search on. Is there a way to pass the output of               echo get_blogifo('siteurl')      To jQuery? I'm trying to get this to work:               $('a.getstarted').attr('href', '<?php echo get_bloginfo('siteurl'); ?>/payroll-deduction-authorization/?plan=basic');      Thanks in advance for your help!


title: Insert new user with form submit 'init' hook

text:
I'm posting a form to insert a new user and hooking my function to 'init'. This code is in my mu-plugins folder. The user gets inserted fine, but the page is not loaded after wards. My form action is empty, so the form should post the same page (which i want) However, i just get a blank page (with header and footer) and the title says page cannot be found. It looks as if there is a problem with the page's post? Below is my function code               /*     *   Register a new reminder_service user     */     function reminder_register(){         if(@$_POST['reminder_register']){             $user["user_login"] = $_POST["email"];             $user["user_pass"] = $_POST["password"];             $user["user_email"] = $_POST["email"];             $user["display_name"] = $_POST["name"];             $user["user_nicename"] = strtolower(str_replace(" ", "-", $_POST["name"]));             $user["role"] = 'reminder_service';             $user["user_registered"] = date('Y-m-d H:i:s');             $user["show_admin_bar_front"] = false;                  $user_id = wp_insert_user($user);             if(is_int($user_id)){                 echo 'yes';             }else{                 foreach($user_id->errors as $error){                     foreach($error as $e)                         echo $e."
";                 }             }         }     }     add_action('init', 'reminder_register');      This is my form code               <form action="" id="reminder_register_form" method="post">                             <fieldset class="blue">                                 <legend>

 Your Details</legend>

                                         Your Name*                                         <input type="text" name="name" id="name" class="required">

                                         Postcode*                                         <input type="text" name="postcode" id="postcode" class="required">

                                         Your Email*                                         <input type="email" name="email" id="email" class="required">

                                         Mobile No*                                         <input type="text" name="mobile" id="mobile" class="required">

                                         Password*                                         <input type="password" name="password" id="password" class="required">

                                         Confirm Password*                                         <input type="password" name="password_confirm" id="password_confirm" class="required">

                                         I agree with the Terms of Service, the Privacy Policy and Terms & Conditions of the Good Dealer Scheme Reminder Service                                         <input type="checkbox" name="terms" id="terms" class="required" value="yes">

                                         Please select if you are happy to receive further communication from the Good Dealer Scheme.                                           <input type="checkbox" name="communication" id="communication" value="yes">

                             </fieldset>
                                                                <input type="submit" value="Register" name="reminder_register" class="orange">                                 * Please complete these fields before clicking the register button
                         </form>      The way i want this to work is to submit the form to the same page, and show appropriate content based on the result of the user insert


title: How can I add songs to my wordpress site?

text: I would like to share some songs in my Wordpress site for listening. Could you please say some ideas or plugin which would make it easy and helpful? There is no necessity for download option