Get post meta retrieving wrong value

I created a custom meta box with a textbox where the user can enter a custom value in as an additional identification tag. I thought I had it right but when I try to retrieve the value it is giving me the post ID instead of the custom value that was input. I am sorry if the post gets too long but I want to be thorough. To get the post meta I am using this:                    <?php $meta_values = get_post_meta( the_ID(), newtheme_section_id); ?>      I am adding the code I used to create the meta box, and I am hoping someone can give me a helping hand. Thanks.               /**      * Sets up custom section ID meta box in admin post and edit pages.      *      * @since newtheme 1.0      */     add_action( 'load-post.php', 'section_id_meta_box_setup' );     add_action( 'load-post-new.php', 'section_id_meta_box_setup' );          /* Meta box setup function. */     function section_id_meta_box_setup() {              /* Add meta box on the 'add_meta_boxes' hook. */         add_action( 'add_meta_boxes', 'newtheme_section_id_meta_boxes' );          /* Save post meta on the 'save_post' hook. */     add_action( 'save_post', 'newtheme_save_section_id_meta', 10, 2 );     }          /* Create meta box to be displayed on the post editor screen. */     function newtheme_section_id_meta_boxes() {              add_meta_box(             'newtheme-section-id',          // Unique ID             esc_html__( 'Custom Section ID', 'ID' ),        // Title             'newtheme_section_id_meta_box',     // Callback function             'post',                 // Admin page (or post type)             'side',                 // Context             'default'                   // Priority         );     }          /* Display the post meta box. */     function newtheme_section_id_meta_box( $object, $box ) { ?>              <?php wp_nonce_field( basename( __FILE__ ), 'newtheme_section_id_nonce' ); ?>
             <?php _e( "You can give your section a name and it will appear in the menus. ", 'Optional' ); ?>
             <input class="widefat" type="text" name="newtheme-section-id" id="newtheme-section-id" value="<?php echo $text; ?>" size="30" />
     <?php }          /* Save the meta box's post metadata. */     function newtheme_save_section_id_meta( $post_id, $post ) {              /* Verify the nonce before proceeding. */         if ( !isset( $_POST['newtheme_section_id_nonce'] ) || !wp_verify_nonce( $_POST['newtheme_section_id_nonce'], basename( __FILE__ ) ) )             return $post_id;              /* Get the post type object. */         $post_type = get_post_type_object( $post->post_type );              /* Check if the current user has permission to edit the post. */         if ( !current_user_can( $post_type->cap->edit_post, $post_id ) )             return $post_id;              /* Get the posted data and sanitize it for use as an HTML class. */         $new_meta_value = ( isset( $_POST['newtheme-section-id'] ) ? sanitize_html_class( $_POST['newtheme-section-id'] ) : '' );              /* Get the meta key. */         $meta_key = 'newtheme_section_id';              /* Get the meta value of the custom field key. */         $meta_value = get_post_meta( $post_id, $meta_key, true );              /* If a new meta value was added and there was no previous value, add it. */         if ( $new_meta_value && '' == $meta_value )             add_post_meta( $post_id, $meta_key, $new_meta_value, true );              /* If the new meta value does not match the old value, update it. */         elseif ( $new_meta_value && $new_meta_value != $meta_value )             update_post_meta( $post_id, $meta_key, $new_meta_value );              /* If there is no new meta value but an old value exists, delete it. */         elseif ( '' == $new_meta_value && $meta_value )             delete_post_meta( $post_id, $meta_key, $meta_value );      * * * EDIT: I am trying to display the value that the users input into a new ID tag on the page that the posts appear so each post will display the custom id tag that the user entered. Here is the code I am trying to do so with.                   <?php $post_id = get_the_ID(); ?>         <?php $value = get_post_meta($post_id, 'newtheme_section_id'); ?>         <id="<?php $value; ?>">      It seems when I do this I am getting a blank value. As in it is not returning anything. I know forsure that it is saving the data from the post page because the custom tag appears in the input box when you go to edit the post. What exactly am I doing wrong here?


Exclude child pages args array

I have the following code and need it to exclude the child pages of a page ID;               <?php           $args = array(                         'post_type' => 'page',                         'post_status' => 'publish',                         'numberposts' => -1,                         'exclude' => '3984,1939,6006,28,2784',                         'depth' => 1                     );                          $postslist = get_posts($args);                          foreach ($postslist as $post) :                             setup_postdata($post);                          ?>
                         <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">                             <?php if ( has_post_thumbnail() ) { the_post_thumbnail('portrait');} else { echo '';}?>                                                          <?php meta('issue-number'); ?>
               <?php endforeach; ?>      The 'Depth' does not seem to have any effect... Thanks!


How to let authors only see website stats for their posts?

Is there a way to show each author website stats, just for the posts that they have published? I run WP as a directory service (1 post each) and thought it would be handy for authors to be able to gauge how many hit/unique visitors/etc they are getting each day/week/month. I'm familiar with Google Analytics, and have played around with the google analytics dashboard plugin, but there doesn't seem to be any way to achieve what I am after. Any ideas?


Plugin used to expand - collapse text

Do you know which plugin was used to expand collapse text like in this page? http://www.hilyamedia.com/resources Thanks!


Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?

I am looking for the filter that enables me to modify the subject of the "Retrieve Password" notification Email. If you know which filter to use, please let me know.


how to set from address according to the form input email address for wp_mail()?

I am trying to create form and send it to my e-mail address using wp_mail. my wp_mail() code is:               if($_POST["submit"]) {         $to="am.riparz@gmail.com";         $subject ="Arugambay Bookings : New reservations request";               $sender=$_POST["sendername"];         $senderEmail=$_POST["senderEmail"];         $message=$_POST["message"];         $name_title=$_POST["name_title"];                 $mailBody = "Name: $name_title $sender\n
                      Email: $senderEmail\n\n

                      Message: $message";              $mail_sent = wp_mail( $to, $subject, $mailBody );         }      and for changing the from address I've added the following filters into my functions.php               /* adding support for html emails*/     add_filter( 'wp_mail_content_type','wpse27856_set_content_type' );     function wpse27856_set_content_type(){         return "text/html";     }          /* from address */     add_filter( 'wp_mail_from', 'my_mail_from' );     function my_mail_from( $email )     {         return $senderEmail;     }          /* from name*/     add_filter( 'wp_mail_from_name', 'my_mail_from_name' );     function my_mail_from_name( $name )     {         return $sender;     }      and the form HTML is:               <form id="" name="" action="<?php echo get_permalink(); ?>" method="post">
         <select name="name_title" class="name-title-input">         <option value="" selected="selected">Select Title</option>         <option value="Mr">Mr</option>

Name

<input type="text" name="sendername"/>

E-Mail

<input type="email" name="senderEmail" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$" required />

         <input type="submit" value="Submit" name="submit">     </form>       It's not sending the mail form to my email. but It sends form to my email if I change the filters as following:               /* from address */     add_filter( 'wp_mail_from', 'my_mail_from' );     function my_mail_from( $email )     {         return "my@email.com";     }          /* from name*/     add_filter( 'wp_mail_from_name', 'my_mail_from_name' );     function my_mail_from_name( $name )     {         return "my name";     }      So how can make it possible to get the senders email on from header?


Wordpress Website with Login system

I am new to WordPress but have been developing in PHP (CI specially). I stumbled into problem when I have to integrate a website developed in CI with a WordPress website. This wordpress component is another website that is extension of current site (You know Clients make you do weird stuffs at times!) . The customers have a code provided by my client which they will use in a section of CI segment, and if the code matches, then the customers are to be redirected to the wordpress site. The customer should not be directly able to access the wordpress site without using the codes i.e. directly through the url! From my research I have found that header.php is included everytime in wordpress, so I am planning to , initiate a php native session (as CI uses its own) if the code matches, then check the session in the header.php file. What I do not understand is how can I modify this header file to do so? I mean, I will be needing custom functions right? Thanks in advance!!


If post type = forum then breadcrumbs Home > Forums

I have an issue with breadcrumbs working with bbpress forums on my website. I have tried a few different ways to overcome this & I think a simple solution would be something which states if the post type = forum then the breadcrumbs for that page should be Home > forum. I have tried to integrate this within my breadcrumb functions php snippet with no joy, can anyone give me a pointer of what im doing wrong?                   <?php     function the_breadcrumb() {         global $post;         $post_type = $post->post_type;         echo '
';         if (!is_home()) {             echo '
';             echo ' Home';             echo '

 /
';             if (is_category() || is_single()) {                 echo '
';                 the_category('

 /

 ');                 if (is_single()) {                     echo '

 /

';                     the_title();                     echo '
';                 }             } elseif (is_page()) {                 if($post->post_parent){                     $anc = get_post_ancestors( $post->ID );                     $title = get_the_title();                     foreach ( $anc as $ancestor ) {                         $output = '
'.get_the_title($ancestor).'

/
'.$output;                     }                     echo $output;                     echo ' '.$title.'';                 } else {                     echo '
 '.get_the_title().'
';                 }             }         }         elseif (is_tag()) {single_tag_title();}         elseif (is_day()) {echo"
Archive for "; the_time('F jS, Y'); echo'
';}         elseif (is_month()) {echo"
Archive for "; the_time('F, Y'); echo'
';}         elseif (is_year()) {echo"
Archive for "; the_time('Y'); echo'
';}         elseif (is_author()) {echo"
Author Archive"; echo'
';}         elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "
Blog Archives"; echo'
';}         elseif (is_search()) {echo"
Search Results"; echo'
';}         elseif (is_post_type('forum') && is_post_type('post') && is_post_type('topic') && is_post_type('reply')){     echo"
FORUM BREADCRUMBS"; echo'
';     }         echo '
';     }     ?>      Thank you


Remove .htaccess portion upon plugin deactivation?

I have a plugin that inserts some rewrite rule in the .htaccess file. However, upon deactivating it, doesn't remove said rule. The rule is nested in `# BEGIN My plugin` and `# END My plugin`. I want to create an uninstall.php file for this plugin to remove the rule created on acrivation. I've never done this before. I suppose I can get the .htaccess with               $htaccess = dirname(__FILE__) . '/../../../.htaccess';      should I use a regex or is there a proper way to remove a specific rule from the .htaccess?


How to Create Category Template list Subcategory?

im have database category               -Category 1     --S1 Category 1     --S1 S1 Category 1     --S2 S1 Category 1     --S2 Category 1     -Category 2     --S1 Category 2     -Category 3      How to create check in Category as: Is go to Category 1 & Sub of Category 1:   * If Category 1 => echo lopcategory1   * If Sub of Category 1 have sub => echo lop-categorysub1   * If Sub of Category 1 no sub => echo lop-categorynosub1 Thanks


How to get link and title of next and previous post on single page

Guys How can I get the link and title of both next and previous post on the single page? Just like in the screenshot below. I try to use this but nothing shows up.               $prev = get_previous_post();     $next = get_next_post();     $prev_title = $prev ? get_the_title($prev) : 'Current is First Post';     $next_title = $next ? get_the_title($next) : 'Current is Last Post';      ![next and previous post with link and name](http://i.stack.imgur.com/zFv0H.jpg) Thank you so much.


Serialize $_POST global in wordpress

I'm new here in the community, and I would like to ask if it is best practice to do this in Wordpress? `maybe_serialize( $_POST );` and then store it to the db? I'm a newbie in using Wordpress, so please bear with me.


WordPress Custom Query

I have posts that use a custom field for start date and end date. `query_posts` returns an array of posts that exist in the category I'm filtering. How do I query posts using this custom field that has date i.e. 03/11/2010 and not the full array. Pagination works on the full array so it returns all posts. I can use an if else to only show the posts newer that today, then pagination doesn't work. Would I have to build a custom mysql query?


Wordpress Orderby Numeric Value Not Working

I am trying to get all products from the wpsc-product post type and then display them by a custom meta field called release_date_year. However, it doesn't appear to be ordering my posts by this custom meta value. I have read through countless blog posts, support posts on the Wordpress forums and a lot of questions and answers here on Wordpress Answers. However, I could not find a solution to my issues. Here is the code that I am using to get the products and then order them by a custom meta field. Ignore the each_connected argument as that is for the plugin Posts to Posts by Scribu. A quick note: I have also tried remove the each_connected part to see if it fixed the issue, but as I suspected, it didn't change a thing. It appears as though the below code gets the products okay, that's not the issue. The issue seems to be that they are being ordered by the date they were published and not the custom meta field value which is a numeric value.                   $products = new WP_Query(array(             'post_type'         => 'wpsc-product',             'nopaging'          => true,             'meta_key' => 'release_date_year',             'each_connected' => array(                 'post_type' => 'artists',                 'nopaging'  => true,             ),             'suppress_filters' => false,             'orderby' => 'meta_value_num',             'order' => 'asc',         ));      I then looked at what queries were being run and the following is the result:               SELECT   wp_posts.* FROM wp_posts  INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id) WHERE 1=1  AND wp_posts.post_type = 'wpsc-product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') AND wp_postmeta.meta_key = 'release_date_year' GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order, wp_posts.post_date DESC                 Now is it just me or should the 'ORDER BY' part of my query have wp_postmeta.meta_key in it? Because it looks to me it's ordering by the menu order and then the post date descending. The other weird thing is that I am also seeing posts ordered descending instead of ascending. Like I said, I also tried using meta_query in my WP_Query query as I am using Wordpress 3.1 using the following code and it was still ordering posts by post_date:               $products = new WP_Query(array(         'post_type'         => 'wpsc-product',         'nopaging'          => true,         'meta_key' => 'release_date_year',         'meta_query' => array(array(             'key'  => 'release_date_year',             'type' => 'NUMERIC'         )),         'each_connected' => array(             'post_type' => 'artists',             'nopaging'  => true,         ),         'suppress_filters' => false,         'orderby' => 'meta_value',         'order' => 'desc',     ));      Have I incorrectly formatted my WP_Query statement or is something else at play here? I have also confirmed there is data in the wp_postmeta table and there are values for each product there. * * * **Update and Solution** After some messing around, I found the culprit. A plugin called 'Post Types Order' which was modifying my Wordpress queries and hence causing the suppress_filters argument to be completely ignored, amongst other things like orderby. See my answer below.


List all native posts in template page?

I've created a page template and I want to do a really simple task: List all (native) posts I have this code inside the template-file:               $args = array(             'posts_per_page'   => -1,             'post_type'        => 'post'     );               $all_posts_query = new WP_Query($args);     while ($all_posts_query->have_posts()) : $all_posts_query->the_post();      echo '*' . get_the_title() . '*';     endwhile;     wp_reset_query();     echo 'DEAD END';     exit;      **I want to get all posts** , but I get some error in the returned object which tells it's incorrect post-type (IF I understand it correctly). It does NOT go into the WHILE-loop either. No title is returned. This is the output of `$all_posts_query`:               object(WP_Query)[2627]       public 'query' =>          array (size=2)           'posts_per_page' => int -1           'post_type' => string 'post' (length=4)       public 'query_vars' =>          array (size=61)           'posts_per_page' => int -1           'post_type' => string 'post' (length=4)           'error' => string '' (length=0)           'm' => string '' (length=0)           'p' => int 0           'post_parent' => string '' (length=0)           'subpost' => string '' (length=0)           'subpost_id' => string '' (length=0)           'attachment' => string '' (length=0)           'attachment_id' => int 0           'name' => string '' (length=0)           'static' => string '' (length=0)           'pagename' => string '' (length=0)           'page_id' => int 0           'second' => string '' (length=0)           'minute' => string '' (length=0)           'hour' => string '' (length=0)           'day' => int 0           'monthnum' => int 0           'year' => int 0           'w' => int 0           'category_name' => string '' (length=0)           'tag' => string '' (length=0)           'cat' => string '' (length=0)           'tag_id' => string '' (length=0)           'author' => string '' (length=0)           'author_name' => string '' (length=0)           'feed' => string '' (length=0)           'tb' => string '' (length=0)           'paged' => int 0           'comments_popup' => string '' (length=0)           'meta_key' => string '' (length=0)           'meta_value' => string '' (length=0)           'preview' => string '' (length=0)           's' => string '' (length=0)           'sentence' => string '' (length=0)           'fields' => string '' (length=0)           'menu_order' => string '' (length=0)           'category__in' =>              array (size=0)               empty           'category__not_in' =>              array (size=2)               0 => int 4               1 => int 1           'category__and' =>              array (size=0)               empty           'post__in' =>              array (size=0)               empty           'post__not_in' =>              array (size=0)               empty           'tag__in' =>              array (size=0)               empty           'tag__not_in' =>              array (size=0)               empty           'tag__and' =>              array (size=0)               empty           'tag_slug__in' =>              array (size=0)               empty           'tag_slug__and' =>              array (size=0)               empty           'post_parent__in' =>              array (size=0)               empty           'post_parent__not_in' =>              array (size=0)               empty           'author__in' =>              array (size=0)               empty           'author__not_in' =>              array (size=0)               empty           'ignore_sticky_posts' => boolean false           'suppress_filters' => boolean false           'cache_results' => boolean true           'update_post_term_cache' => boolean true           'update_post_meta_cache' => boolean true           'nopaging' => boolean true           'comments_per_page' => string '50' (length=2)           'no_found_rows' => boolean false           'order' => string 'DESC' (length=4)       public 'tax_query' =>          object(WP_Tax_Query)[2593]           public 'queries' =>              array (size=1)               0 =>                  array (size=5)                   ...           public 'relation' => string 'AND' (length=3)       public 'meta_query' =>          object(WP_Meta_Query)[2594]           public 'queries' =>              array (size=0)               empty           public 'relation' => null       public 'date_query' => boolean false       public 'request' => string 'SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND ( wp_posts.ID NOT IN (                              SELECT object_id                              FROM wp_term_relationships                              WHERE term_taxonomy_id IN (1,4)                          ) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order, wp_posts.post_date DESC ' (length=322)       public 'posts' =>          array (size=0)           empty       public 'post_count' => int 0       public 'current_post' => int -1       public 'in_the_loop' => boolean false       public 'comment_count' => int 0       public 'current_comment' => int -1       public 'found_posts' => int 0       public 'max_num_pages' => int 0       public 'max_num_comment_pages' => int 0       public 'is_single' => boolean false       public 'is_preview' => boolean false       public 'is_page' => boolean false       public 'is_archive' => boolean false       public 'is_date' => boolean false       public 'is_year' => boolean false       public 'is_month' => boolean false       public 'is_day' => boolean false       public 'is_time' => boolean false       public 'is_author' => boolean false       public 'is_category' => boolean false       public 'is_tag' => boolean false       public 'is_tax' => boolean false       public 'is_search' => boolean false       public 'is_feed' => boolean false       public 'is_comment_feed' => boolean false       public 'is_trackback' => boolean false       public 'is_home' => boolean true       public 'is_404' => boolean false       public 'is_comments_popup' => boolean false       public 'is_paged' => boolean false       public 'is_admin' => boolean false       public 'is_attachment' => boolean false       public 'is_singular' => boolean false       public 'is_robots' => boolean false       public 'is_posts_page' => boolean false       public 'is_post_type_archive' => boolean false       public 'query_vars_hash' => string '2d0de38f6a4ebb9acf2b3533d94fd229' (length=32)       public 'query_vars_changed' => boolean true       public 'thumbnails_cached' => boolean false       private 'stopwords' => null          boolean true      OR with `print_r`:               WP_Query Object ( [query] => Array ( [posts_per_page] => -1 [post_type] => post ) [query_vars] => Array ( [posts_per_page] => -1 [post_type] => post [error] => [m] => [p] => 0 [post_parent] => [subpost] => [subpost_id] => [attachment] => [attachment_id] => 0 [name] => [static] => [pagename] => [page_id] => 0 [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0 [w] => 0 [category_name] => [tag] => [cat] => [tag_id] => [author] => [author_name] => [feed] => [tb] => [paged] => 0 [comments_popup] => [meta_key] => [meta_value] => [preview] => [s] => [sentence] => [fields] => [menu_order] => [category__in] => Array ( ) [category__not_in] => Array ( [0] => 4 [1] => 1 ) [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( ) [post_parent__in] => Array ( ) [post_parent__not_in] => Array ( ) [author__in] => Array ( ) [author__not_in] => Array ( ) [ignore_sticky_posts] => [suppress_filters] => [cache_results] => 1 [update_post_term_cache] => 1 [update_post_meta_cache] => 1 [nopaging] => 1 [comments_per_page] => 50 [no_found_rows] => [order] => DESC ) [tax_query] => WP_Tax_Query Object ( [queries] => Array ( [0] => Array ( [taxonomy] => category [terms] => Array ( [0] => 4 [1] => 1 ) [include_children] => [field] => term_id [operator] => NOT IN ) ) [relation] => AND ) [meta_query] => WP_Meta_Query Object ( [queries] => Array ( ) [relation] => ) [date_query] => [request] => SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND ( wp_posts.ID NOT IN ( SELECT object_id FROM wp_term_relationships WHERE term_taxonomy_id IN (1,4) ) ) AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order, wp_posts.post_date DESC [posts] => Array ( ) [post_count] => 0 [current_post] => -1 [in_the_loop] => [comment_count] => 0 [current_comment] => -1 [found_posts] => 0 [max_num_pages] => 0 [max_num_comment_pages] => 0 [is_single] => [is_preview] => [is_page] => [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] => [is_search] => [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => 1 [is_404] => [is_comments_popup] => [is_paged] => [is_admin] => [is_attachment] => [is_singular] => [is_robots] => [is_posts_page] => [is_post_type_archive] => [query_vars_hash] => 2d0de38f6a4ebb9acf2b3533d94fd229 [query_vars_changed] => 1 [thumbnails_cached] => [stopwords:WP_Query:private] => )      **_When I use this code (custom post type) it works (in the same template)..._**               $args = array( 'post_type' => 'personnel',                     'posts_per_page' => -1                    );      $all_posts_query = new WP_Query( $args );     while ($all_posts_query->have_posts()) : $all_posts_query->the_post();      echo '*' . get_the_title() . '*';     endwhile;     wp_reset_query();     echo 'DEAD END';     exit;      What am I doing wrong?


How can I bulk upload images and automatically create posts for each one at the same time?

I know how to upload multiple images into an existing post, but this is a different scenario. This is for a large catalog of assets, with each custom post-type post representing an image asset (thus a single image is assigned as the "featured image" for each post). The whole system works great for one-at-a-time asset creation, but far too time-consuming. I need to be able to "batch" upload multiple images at once, then have a new post created for each image, then attach the image to the new post as the "featured image". There will be no text content entered for each post - just some metadata and custom taxonomy assignments, so it should be possible to batch-assign the metadata and taxonomy during this batch creation process. I've researched solutions from XML-RPC post creation (which doesn't usually handle image upload/assignment) to plugins that pull files from a server directory to the media library (which doesn't cover post creation), and jquery multiple file uploaders (that basically just dump files in a directory). I am relatively versed in php, having built plugins and themes, but I'm stumped at how to handle this process, as it requires the first step of getting the files to the server in some temporary capacity, then generating posts based on the files uploaded, and assigning some identifying metadata to the whole batch. I'm hoping this can be done in a custom admin panel, but if I have to do this outside of wp-admin, that's fine too... Ideas?


Wordpress Image Editor not working - conflict?

I am having a strange issue with the built in wordpress image editor. I have no problem uploading files or preforming any other media functions. The only thing I seem to be unable to do is utilize the image "edit" capabilities (the area where you can crop, resize, rotate...) When I click on "edit" for an image I see the editor and I see the thumbnail on the right, wordpress just won't show me the actual image in the main area and thus I can't utilizing any of the editing capabilities. I am assuming this must be some type of JavaScript conflict however I not sure the best way to diagnose this other than what I have already done (disabling all plugins and ensuring no functions.php file is modifying a setting or including other javascript). How can I diagnose this issue to see what might be going wrong?


Changing the visible url path to css & js files

Does anyone happen to know how I can automatically turn: http://www.domain-name.com/wp-content/themes/theme-name/css/stylesheeet.css into http://www.domain-name.com/css/stylesheet.css Naturally I could just create the applicable folder within the root of the website, place the files there and just reference them but that is now what I am after. I am looking for a way to keep all css & javascript files within the theme folder but I would like for wordpress to show the above outlined url path if you view the source of the page. In an ideal situation I am looking for a piece of code which can be added that automatically does this for all files referenced within my theme folder including any images. Thank you in advance


Will removing revisions positively impact database performance?

As per this question over on DBA.SE, I'm having quite a few issues with database optimisation. I'm just wondering if removing/disabling revisions will positively impact my database usage? We don't seem to use them as often as I was expecting. Currently I've got it set so that each post can have up to 3 revisions. If removing these will improve performance, what's the "up to date" way of removing revisions from the database? Thanks in advance,


Wordpress manually installed on a remote server

I followed all these steps but I can access my web site only as an administrator. The pages that I create inside the wordpress web app are not being shown from a browser or I can't find their exact link or something... Why is that so? (I have never installed a wordpress on a remote server before).


Plug-in (Slickr Flickr) works on local machine, but not server

I am running Wordpress (3.1.4) with Slickr Flickr (1.3.2). I built a theme on top of thematic (0.9.7.7). Everything seems to work fine on my local machine and I can render Slickr Flickr galleries in the them templates without issue. However, when I enable the plug in on our server I get this error:               Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/amsfcom/public_html/2011/wp-content/plugins/slickr-flickr/slickr-flickr-oauth.php on line 5      I saw a few questions with answers that seemed to be due to PHP 4 and protected methods. I don't think this is the issue because the server uses PHP version 5.2.9 on Linux. Locally I am using a Mac with PHP version 5.2.15. Could this difference cause the problems? Is there a way I can start to track down why this is?


How did I enable atom feeds in a fresh WP3 install?

I've just install Wordpress 3, and I can't figure out how to put an atom link in the sidebar, under (or otherwise near) the RSS links. I looked at sidebar.php, but it simply references a meta 'widget', and I can't figure out how to modify or configure this widget (or any widget for that matter). Can somebody guide me as to how to enable atom feeds?


How can I make the user names of commentors clickable links to the user's profile from the admin comment screen?

I've set up my wordpress blog to only allow logged in users to leave comments, but I need a way for the administrator to be able to go to a user's profile from the comment moderation screen. I don't have profile pages set up, just the regular edit profile pages. Any advice is much appreciated. Thank you!


Send Email to Users after Deleting Account

It is possible send email for deleting account on wordpress?? Like this: http://i.stack.imgur.com/Lt6Ks.png Ok after click send email to user with ex text: "your account has been deleted" ??


Add filter to get_posts

So I am attempting to filter out certain posts in the get_posts call. Essentially, I want to be able to specify a certain block of posts, and only get the posts that correspond with the block. Right now I have a table that contains both block IDs and post IDs, so I have been looking into using the posts_join and the posts_where hooks. However, I need to be able to dynamically modify the block retrieved depending on what the client currently has chosen. To this end, I am tracking what the client has selected using a cookie. I feel that I should be able to pass the block ID as a another value in the array given to get_posts, but I have no idea how to retrieve that value. So my question is: how should I go about doing this? It seems that the simplest, most elegant solution would be to just add something like:               $postargs = array(         'blockID' => $id     );     $posts = get_posts($postargs);      I just don't know how in my hooked function:               function set_block_filter($id){         /* This should probably use the posts_join hook */         /* $join = 'LEFT JOIN wdpress.$table_name ON wdpress.$table_name.post_id = wdpress.wp_posts.ID'*/         /* something like that ^ http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join*/         /* $where = ' AND block_id=$id '*/     }      can retrieve the blockID from the $postargs array. EDIT: So the solution was actually very simple, and I think most of my confusion was born from my misunderstanding about how cookies work. Since they are apparently accessible server-side, my answer was this:               function set_block_filter($query){         if($query->is_category){             $query->set('meta_key', 'block');             $query->set('meta_value', $_COOKIE['block']);             return;         }     }          add_action('pre_get_posts','set_issue_filter');


Insert pagination links - wp_link_pages() - before filters on posts

I'm trying to add pagination support for some longer posts on my site. I've added the `wp_link_pages()` function to my single.php file, after `the_content`, but this causes the pagination links to display under some end- of-post plugins I have (YARPP and Better Author Bio, if that matters). I'd like the pagination links to appear at the end of the actual content, before any filter hooks are added. How can I do this without editing the the `get_the_content` function in wp-includes/post-template.php? Do I need to write a plugin?


How to determine (via php) if site is using a static home page?

I have a script that needs to know if the site is using a static home page. In other words, at "Settings > Reading > Front Page Displays > a Static Page ___ _" Is there a a get_option() or method call that can be used to determine this?


what's meaning of it when submit a theme?

**REQUIRED:** Comments are displayed as "Off" while they aren't in wp-admin. Comment form is not displayed in these cases, while it is when a unit test post already has comments. i have installed the **Test data** . and on some **post** and **comment test post** pages. these pages had some comments. and there is also a Comment form under all the comments. why it notices me,"Comment form is not displayed in these cases, while it is when a unit test post already has comments." comments are displayed as "Off" while they aren't in wp-admin, what's this meaning? how to correct it?


Wordpress custom post type page dysplay 404 error

Hi I am trying to create a custom post type display page but for some reason the page is not working and I get sent to the 404.php.Here is my code: add_action('init' , 'business_manager_register');               function  business_manager_register(){         //add custom post type         $args = array(             'label' => 'Business Managers',             'singular_label' => 'Business',             'public' => true,             'shouw_ui' => true,             'capability_type' => 'post',             'hierarchical' => true,             'has_archive' => true,             'supports' => array('title','editor','thumbnail'),             'rewrite' => array('slug' => 'businesses' , 'with_front' => false)         );              register_post_type('businesses' , $args);     }      Now in order to display it I have created the file archive- businesses.php.Accoding to the slug I added the link should be something like this: link/businesses But when I try link to it I get the 404 error same thing happenes for the single-businesses.php.What am I doing wrong here?


Is email post notify visitor on new media upload possible?

Is there a plugin or snippet that would:   1. Add an email input form to each post    2. Send a predefined message when new media (or attachments) has been uploaded for that post only The requested functionality here is different from other plugins I am aware of because it targets only the end user and only on new media upload (as compared to comments). Any insight at all would be helpful!


Wrap the widget content with a div and get the widget title outside?

In this subject you can wrap a widget with the title outside but if you don't want a title, a `<div>` will not be closed, and the template is broken. So I would like to do this in jQuery instead of the widget function. I tried many times but it doesn't work! My jsfiddle code here


Help with a TV series Rewrite structure

Not sure if this is possible, but bear with me. I think I am halfway there. First a little background: I'm using the build in hierarchy in WordPress to form relationships between post types. I have a post type called series that holds info on a TV series. I have another post type called content that has info on specific episodes and I use the built in post_parent field on the posts data table to point to a series. So basically, I'm trying to do a rewrite/permalink structure similar to this for content: http://website.com/%series-name%/%content-type%/%postname% content-type is a taxonomy attached to content that has a few terms; episode, movie and special. My idea to prevent rewrite collisions was to use this code, inspired by a previous question I had asked here               add_filter( 'rewrite_rules_array', 'content_rewrite_rules',10,1);     function content_rewrite_rules( $rules ) {             $custom_rules = array();             $type_terms = get_terms('veda_content_type', array('hide_empty'=>false));             if(!is_wp_error($type_terms) && sizeof($type_terms) > 0) {                 foreach ($type_terms as $term) {                     $custom_rules['([^/]+)/'.$term->slug. '/([^/]+)/?$'] = 'index.php?post_type=veda_content&series_name=$matches[1]&pagename=$matches[2]';                 }             }                  return array_merge($custom_rules , $rules);         }      Using the rewrite analyzer, it seems that it sorta works, except it shows that the series_name query_var is crossed out in red and I'm not sure what that means. ![Rewrite 1](http://i.stack.imgur.com/8bhhC.jpg) My question is: is there another, more efficient way to create the permalink that I want? Also, what the cross out mean? EDIT: I'm trying to see if the rewrite works and my server is giving me bad request errors


Change the style of h1, h2, only in post entry

I would like to change the style of h1, h2, ... ONLY in post entry (when writing a new post). ![enter image description here](http://i.stack.imgur.com/eb4KY.png) Default settings is just too big and has a different format, because I use Google fonts. I was using just bbcode for writing articles and want to start using the headings in articles. The best solution would be to have the same format as used Google font on the site, but just use bold and different size.


How do I exclude the current post from listing in recent posts

I list my two most recent posts from a widget on the sidebar. When I'm viewing one of these posts from single.php, I want that post to be excluded from the list and instead show the next post in order. single.php looks something like this:               <?php if ( have_posts() ) : ?>              <?php while ( have_posts() ) : the_post(); ?>              [Content]              <?php endwhile; else : ?>              [If no post is found]          <?php endif; ?>      and here's the code in the PHP-widget:               <?php $the_query = new WP_Query( 'showposts=2' ); ?>     <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>              [Recent posts]          <?php endwhile;?>      **Edit - the solution:**               <?php global $post; $args = array('showposts' => 2, 'post__not_in' => array( $post->ID )); query_posts( $args ); if (have_posts()) : while (have_posts()) : the_post(); ?>              [Recent posts]          <?php endwhile; wp_reset_query(); endif; ?>


Add class to all links created by tinyMCE

I'm attempting to automatically add a class to all links created when clicking the "link" button in tinyMCE. I've found this snippet in the tinyMCE docs:               // Adds a class to all paragraphs in the active editor     tinyMCE.activeEditor.dom.addClass(         tinyMCE.activeEditor.dom.select('p'),         'myclass'     );      I think this will be what I need if I change it to apply to anchors. Do you think this will work? Do you know of a better way to do it? How and where do I add this snippet to my theme? The theme I'm using has a `tinyMCE` folder in the `functions` directory.


Seperate WordPress catagories into sepeat list on seperate pages

Having issues showing my post in separate list based on category I have a static home page set my page: "home" and I have the blog set to my page: "Inspiration" I have 2 main categories "inspiration" and "Portfolio" and those catagories are also the titles of my menu items. So I have Home, Inspiration, and Portfolio. But when I go to portfolio it is just a page not a list of the post in the Portfolio category. I have no problem editing the code since the whole theme is completely custom I am just not sure what to add to make the portfolio page a blog as well. You can see the half finished site here. www.2020mediaonline.com/wordpress I am using WordPress 3.1.1. Any help would be awesome.


Pulling in a particular post into a single page based on the post id passed into the code

I currently have a page on a site that I am developing and that contains a loop which loops through 4 posts contained in a custom post type called Treatments. http://wptest.lancscps.co.uk/treatment-approaches/ As you can see there is a post_excerpt and I would like the user to be able to click through to a single custom post which contains the entire information.                           <?php                         // Custom loop that adds a clearing class to the first item in each row                         $args = array('numberposts' => -1, 'order' => 'ASC', 'post_type' =>  'treatments' ); //For this example I am setting the arguments to return all posts in reverse chronological order. Odds are this will be a different query for your project                         $allposts = get_posts($args);                         $numCol = 2; // Set number of columns                              // Start Counter                         $counter = 0;                         foreach ($allposts as $post) {                             $content = '
'; // Add class to the columns depending on if it is odd or even                             $content .= '
';                             $content .= '
'.get_the_post_thumbnail( $post->ID, 'post-two-column' ).'
';                             //we need to provide a fallback image in the form of an if else statement?                             $content .= '
'.$post->post_title.'
';                             $content .= '
'.$post->post_excerpt.'
';                             $content .= 'ID ).'"class="button">Find Out More';                             $content .= '
';                             $content .= '
';                             echo $content;                             $counter ++;                         }                     ?>      Is it straightforward to pass the post id when the user clicks on the read more button using something like a hidden form field through to a single page template. This is so that the entire contents of that post could be spit out using a loop that can output the content based on the id that was passed in. I don't know how to code something like that?


Define Wordpress image size in img tag

Is there a way to output a image in a pre-determined size (Ie; using add_image_size) using just the img tag? For example, how can I make sure that the image that is echoed using this tag is the exact size I determined in functions.php under 'slider'               <img src="<?php echo of_get_option('slideshow_1');?>" alt="#"/>      I hope that made some sort of sense.


twentythirteen h1 and h2 not resizing responsively

I'm using the twentythirteen theme which is supposed to be responsive, here on my site. On this static homepage, the text-headers are generated as follows, using the heading tags:
Hello!
      If you narrow the width of the page, you will see the page title "Home" shrink in size, but the text-headers don't. How can I fix this?


Change default screen option value for media items per page (in media library)

I want to remove pagination by changing the default screen option value for **posts per page** , **pages per page** and **media items per page** , in the admin area, to `999`. The default value is set to `20`. I found the answer I need (I have pasted below from @KrzysiekDróżdż's answer in this question: Change default screen option value for posts per page) but am looking to also add a filter for the media library so it's consistent for all areas of the admin.               function my_edit_per_page( $result, $option, $user ) {         if ( (int)$result < 1 )             return 20; // or whatever you want     }     add_filter( 'get_user_option_edit_page_per_page', 'my_edit_per_page', 10, 3 );  // for pages     add_filter( 'get_user_option_edit_post_per_page', 'my_edit_per_page', 10, 3 );  // for posts      I've tried these, to no avail:               add_filter( 'get_user_option_edit_media_per_page', 'my_edit_per_page', 10, 3 );  // for media library     add_filter( 'get_user_option_edit_media_item_per_page', 'my_edit_per_page', 10, 3 );  // for media library     add_filter( 'get_user_option_edit_media_items_per_page', 'my_edit_per_page', 10, 3 );  // for media library


Automatically add another subpost of the same parent when a subpost is saved

I figured it out how to add one subpost when a post is saved. But now I need to know how I can get another subpost of the same parent when a subpost is saved. Could anybody help me out? **This is what I have:** //Subpage automatically created when Parent is saved Parent 2014   * Subpage **This is what I need:** //NEW SUBPAGE is created when Subpage is saved Parent 2014   * Subpage   * NEW SUBPAGE Here is my current code (of what I have): Source: Automatically create child pages when saving a (parent) page               // Automatically add one subpost when a post is saved     function wpa8582_add_show_children( $post_id ) {           if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )             return;              if ( !wp_is_post_revision( $post_id )         && 'show' == get_post_type( $post_id )         && 'auto-draft' != get_post_status( $post_id ) ) {               $show = get_post( $post_id );             if( 0 == $show->post_parent ){                 $children =& get_children(                     array(                         'post_parent' => $post_id,                         'post_type' => 'show'                     )                 );                 if( empty( $children ) ){                     $child = array(                         'post_type' => 'show',                         'post_title' => 'About',                         'post_content' => '',                         'post_status' => 'draft',                         'post_parent' => $post_id,                         'post_author' => 1,                         'tax_input' => array( 'your_tax_name' => array( 'term' ) )                     );                     wp_insert_post( $child );                 }             }         }     }     add_action( 'save_post', 'wpa8582_add_show_children' );


WooCommerce Emails Firing Multiple TImes

I am having a problem with my WooCommerce install where order update emails (which I think are scheduled using WP Cron??) are fired multiple times - some times as many as 7 or 8. Would it be WPCron causing this issue? Would increasing the cron lock time interval fix this issue? Also, if I have around 12k visits to my site each month, will WP Cron be having a considerably negative effect on site performance? In other words, will it be noticably faster and use noticably less resources if changing to manual cron jobs? Lastly, if you do think manual cron jobs are better, what time interval would you recommend we set for triggering manual cron jobs - about every 15 minutes? Or more/less frequently? Cheers


Why can't I update the post status?

I am struggling to work out why a simple sql update is not changing the post status. Help would be greatly appreciated. I'm running woocommerce on wordpress 3.8 I'm running the following code:               $update_string = "UPDATE $wpdb->posts SET post_status='draft' where $wpdb->posts.ID=".$post_id;     $wpdb->query($update_string);      Where the $post_id is pulled from another table (correctly). The post status doesn't update. I've also tried running wp_update_post() with similar lack of success.


Link Pop-up in custom plugin

I am trying to build a plugin, for one of my current task, and at a field it requires user to provide the URL their content would link to. I have added a text-box where user could paste the link they refer to. But I am looking towards a solution, where I could provide a button, which opens up a pop-up ( _like the one available on tinyMCE editor button_ ) for user to select links from various pages/posts already submitted.


Custom post types and child theme

Okay, here's the deal. I am working with a child theme and I want a custom post type. ## What I did Added the following code the `functions.php` of the parent theme.               add_action( 'init', 'create_fb_foto_post_type' );     function create_fb_foto_post_type() {         register_post_type('fotos',             array(                 'labels' => array(                     'name' => __( 'Foto\'s' ),                     'singular_name' => __( 'Foto' )                 ),             'public' => true,             'has_archive' => true,             'taxonomies' => array('post_tag')             )         );     }      Created a template file `single-fotos.php` which contains this code:               <?php get_header(); ?>

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

          <?php get_footer(); ?>      And uploaded it to the child theme's directory. ## What goes wrong I can choose to create a new 'Foto' page when I'm in Wordpress and it contains the tag field. But! When I want to view an example, Wordpress does nothing. When I choose to submit and publish the page it works but when I then want to view it, I get a 404. ## What I tried I tried uploading the template to the parent theme's directory (after I had created the page) but this doesn't work either. Any ideas?


Calling widget using shortcode

I am using shortcode to call a widget. All is working fine but I want to pass some $instance(parameters) to the_widget. I am using $content to pass paramets to the_widget but I dont see any chnages after setting parameters. Here is my shortcode function               add_shortcode('widget','widget');     function widget($atts) {         // Configure defaults and extract the attributes into variables         extract( shortcode_atts(              array(                  'name'  => ''             ),              $atts          ));         $args = array(             'before_widget' => '
',             'after_widget'  => '
',             'before_title'  => '
',             'after_title'   => '
',         );              ob_start();         the_widget( $name, $content, $args );          $output = ob_get_clean();              return $output;         }      And this is shortcode               [widget name="WP_Widget_Pages"]title=Pages&sortby=post_title[widget]      Please tell me what is the problem


Custom post types with their own permalink structure

My main posts are news items (category "news"). Therefore, I used global URI writing in the following format: `/year/month/post-name` I also have posts that contain photo albums (category "photo") but I want these to have another URI structure, namely: `/category/post-name` in which category is `photos` I've been looking over the Internet and I found this link (has category, but I think in category is better) that contains quite some information. I also vaguely remember a hook in functions.php that could do this:               'rewrite' => ...      Unfortunately, for a Wordpress Newbee as myself, it's not enough. I can't figure out how to do this. Any help? Thanks. So, if the category is news => `/year/month/post-name` e.g. `/2012/10/test- post` If other category, such as photos or videos => `/category/[sub- category/)post-name` e.g. `/photos/(2012/)France` or for videos: `/videos/(2011/)concert-u2` ## EDIT: the comments tell me that it is wiser to use custom post-types. I have done that. So far I have two custom post types (`videos` and `photos`). I don't think that there will be any other. What needs to happen: change the permalink structure of the custom post-types. I want them to be `/photos/post- name` and `/videos/post-name`. The regular posts should be `/year/month/post- name`. I added this to my functions.php               /* Add custom post-type (fotos) (added by Bram Vanroy) */          add_action( 'init', 'register_cpt_foto' );          function register_cpt_foto() {              $labels = array(              'name' => _x( 'fotos', 'foto' ),             'singular_name' => _x( 'foto', 'foto' ),             'add_new' => _x( 'Nieuw fotoalbum', 'foto' ),             'add_new_item' => _x( 'Voeg nieuw fotoalbum toe', 'foto' ),             'edit_item' => _x( 'Bewerk fotoalbum', 'foto' ),             'new_item' => _x( 'Nieuw fotoalbum', 'foto' ),             'view_item' => _x( 'Bekijk fotoalbum', 'foto' ),             'search_items' => _x( 'Zoek in fotoalbums', 'foto' ),             'not_found' => _x( 'Geen fotoalbums gevonden', 'foto' ),             'not_found_in_trash' => _x( 'Geen fotoalbums gevonden in de prullenmand', 'foto' ),             'parent_item_colon' => _x( 'Parent foto:', 'foto' ),             'menu_name' => _x( 'Foto\'s', 'foto' ),         );              $args = array(              'labels' => $labels,             'hierarchical' => true,             'description' => 'Het posttype dat alle foto-albums verzorgt.',             'supports' => array( 'title', 'editor', 'excerpt', 'comments', 'page-attributes' ),             'taxonomies' => array( 'post_tag', 'page-category' ),             'public' => true,             'show_ui' => true,             'show_in_menu' => true,                       'show_in_nav_menus' => true,             'publicly_queryable' => true,             'exclude_from_search' => false,             'has_archive' => true,             'query_var' => true,             'can_export' => true,             'rewrite' => true,             'capability_type' => 'page'         );              register_post_type( 'foto', $args );     }          /* Add custom post-type (videos) (added by Bram Vanroy) */     add_action( 'init', 'register_cpt_video' );          function register_cpt_video() {              $labels = array(              'name' => _x( 'videos', 'video' ),             'singular_name' => _x( 'video', 'video' ),             'add_new' => _x( 'Voeg nieuwe video toe', 'video' ),             'add_new_item' => _x( 'Voeg nieuwe video toe', 'video' ),             'edit_item' => _x( 'Bewerk video', 'video' ),             'new_item' => _x( 'Nieuwe video', 'video' ),             'view_item' => _x( 'Bekijk video', 'video' ),             'search_items' => _x( 'Zoek video\'s', 'video' ),             'not_found' => _x( 'Geen video\'s gevonden', 'video' ),             'not_found_in_trash' => _x( 'Geen video\'s gevonden in de prullenmand', 'video' ),             'parent_item_colon' => _x( 'Parent video:', 'video' ),             'menu_name' => _x( 'Video\'s', 'video' ),         );              $args = array(              'labels' => $labels,             'hierarchical' => true,             'description' => 'Dit posttype wordt gebruikt om filmpjes te publiceren',             'supports' => array( 'title', 'editor', 'excerpt', 'comments', 'page-attributes' ),             'taxonomies' => array( 'post_tag', 'page-category' ),             'public' => true,             'show_ui' => true,             'show_in_menu' => true,                       'show_in_nav_menus' => true,             'publicly_queryable' => true,             'exclude_from_search' => false,             'has_archive' => true,             'query_var' => true,             'can_export' => true,             'rewrite' => true,             'capability_type' => 'page'         );              register_post_type( 'video', $args );     }      And I suppose I need some rewrite rules here, but I don't know how to!


Custom Post Type with archive page but no detail page

I want to have custom post type that have only title and archive page, but no detail page. Here is what custom post type code:               add_action( 'init', 'register_cpt_trivia' );          function register_cpt_trivia() {              $labels = array(              'name' => _x( 'Trivia', 'trivia' ),             'singular_name' => _x( 'Trivia', 'trivia' ),             'add_new' => _x( 'Add New', 'trivia' ),             'add_new_item' => _x( 'Add New Trivia', 'trivia' ),             'edit_item' => _x( 'Edit Trivia', 'trivia' ),             'new_item' => _x( 'New Trivia', 'trivia' ),             'view_item' => _x( 'View Trivia', 'trivia' ),             'search_items' => _x( 'Search Trivia', 'trivia' ),             'not_found' => _x( 'No trivia found', 'trivia' ),             'not_found_in_trash' => _x( 'No trivia found in Trash', 'trivia' ),             'parent_item_colon' => _x( 'Parent Trivia:', 'trivia' ),             'menu_name' => _x( 'Trivia', 'trivia' ),         );              $args = array(              'labels' => $labels,             'hierarchical' => false,             'description' => 'Few line text with no detail pages.',             'supports' => array( 'title' ),                  'public' => false,             'show_ui' => true,             'show_in_menu' => true,             'menu_position' => 20,                  'show_in_nav_menus' => false,             'publicly_queryable' => true,             'exclude_from_search' => true,             'has_archive' => true,                  'can_export' => true,             'rewrite' => true,             'capability_type' => 'post'         );              register_post_type( 'trivia', $args );     }


WordPress: Getting "Newer Posts" and "Older Posts" links on a Specialized Page Template

I am using a Specialized Page Template to display list of posts. I am using the following code for that:               <?php      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array(         'paged' => $paged     );     $all_posts = get_posts($args);      ?>          <?php foreach ( $all_posts as $post ) : setup_postdata( $post );  ?>     /* the loop */     <?php endforeach; ?>      Now I want to put "Newer Posts" and "Older Posts" links below it. `next_posts_link()` and `previous_posts_link()` prints nothing here. How can I add these two links on this page?


Making the thumbnails in the backend Media section bigger

So I uploaded a lot of similar looking photos, and uploaded a duplicate or two. I go into the backend to the Media panel, but alas, each row has a small thumbnail, making it time consuming to figure out which ones are the duplicates, or just to tell them apart. How would I make the image bigger? At the moment it is 60x60 but 128x128 would be nicer or maybe even larger! Just to clarify, I am talking about the admin area, not the frontend/theme


wordpress + cyrillic characters with SQL server 2008 r2

I have a blog running on a windows 2008 machine with SQL server 2008 r2. WP version 3.3.2 I have an English blog, but I would like to post some content in Russian. When I try and post the content I get question marks where the Cyrillic characters should be. I see the same question marks stored in the DB. I tried inserting the post manually in to the database and it works, i.e. the issue is not the sql server itself, since it can store Cyrillic characters. I already tried disabling all plug-ins, and that did not help. Is this a known issue? Is there any work around?


Why use if function_exists?

I noticed a lot of developers of WordPress themes would use this in **functions.php**               if (function_exists('register_nav_menus')) {         register_nav_menus (array('primary' => 'Header Navigation'));     }      For me, I alwayse use add_action for every function I am using in **functions.php** So, the above would be written as:               add_action('init', 'my_register_nav_menus');          function my_register_nav_menus() {         register_nav_menus (array('primary' => 'Header Navigation'));     }      I have two questions:   1. Why use the if statement in the first method?   2. Which one is the correct way?


WordPress database error Unknown column

I get this error in my database log: > [05-May-2013 21:13:31 UTC] WordPress database error > > Unknown column 'region' in 'order clause' for query >   >   >     SELECT * FROM tmp1db_wpuf_customfields ORDER BY `region` DESC >   > > made by require('wp-blog-header.php'),   >  require_once('wp-includes/template-loader.php'),   >  include('/themes/ExtraGrid/single.php'),   >  get_template_part,   >  locate_template,   >  load_template,   >  require('/themes/ExtraGrid/content-single.php'),   >  the_content,   >  apply_filters('the_content'),   >  call_user_func_array,   >  wpuf_show_meta_front What should I change?


My posts section for logged in user

I would like to create a page that shows only posts written by the user logged in and get a link (such as www.example.com/AuthorPostsID) to put on the menu. I'm trying for two days. Does anyone know how to fix it? Thanks EDIT: I tried using the following code, putting it in the function.php file, but I do not know how to proceed:               if ( is_user_logged_in() ):             global $current_user;         get_currentuserinfo();         $author_query = array('posts_per_page' => '-1','author' => $current_user->ID);         $author_posts = new WP_Query($author_query);         while($author_posts->have_posts()) : $author_posts->the_post();         ?>             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>                <?php                    endwhile;         else :             echo "not logged in";         endif;


Add body class based on existance of post thumbnail. Code works but receiving PHP Notice

What I'm trying to do is add a body class based on whether there is a post thumbnail. The following works, but I get a PHP Notice. How can I fix the PHP Notice below?               function add_featured_image_body_class( $classes ) {              if( has_post_thumbnail() ) {             $classes[] = 'has-featured-image';         }              return $classes;     }     add_filter( 'body_class', 'add_featured_image_body_class' );      PHP Notice:               PHP Notice:  Trying to get property of non-object in /wp-includes/post-template.php on line 30      This is the function in post-template.php               function get_the_ID() {       global $post;       return $post->ID; // this is line 30     }      **Update:** Here's what I have now, which seems to work fine without PHP Notices               function add_featured_image_body_class( $classes ) {             global $post;              if ( isset ( $post->ID ) && get_the_post_thumbnail($post->ID)) {           $classes[] = 'has-featured-image';         }              return $classes;     }     add_filter( 'body_class', 'add_featured_image_body_class' );


Hook before & after plugin / core update

I'm working on a maintenance plugin for my website and I want to enable it before plugin/core upgrade starts and disable it after plugin/upgrade ends. Any ideas ? Thanks! :) PS: all I know is I can use "update_feedback" hook after core upgrade ends


Change Bookmark Name without Changing TITLE Tag

Is it possible to change the name of the bookmarked page when a user adds my page as a bookmark without changing the title tag?


WP_Delete_user link creation

I am trying to create a user management via front end but i am not sure how to implement wp_delete_user Delete link               add_action( 'wp_head', 'my_action_javascript' );          function my_action_javascript() {     ?>          <?php     }          add_action( 'wp_ajax_delete_user_action', 'delete_user_action_callback' );     add_action( 'wp_ajax_nopriv_delete_user_action', 'delete_user_action_callback' );          function delete_user_action_callback(){       check_ajax_referer( 'security-special-string', 'security' );       wp_delete_user( $_POST['user_id'] );       die();     }               add_shortcode('listuser', 'listsubscriber');     function listsubscriber() {     $blogusers = get_users( array(  'fields' => array('display_name','ID' )) );          echo '
';     foreach ( $blogusers as $user ) {              echo '
' . esc_html( $user->display_name )  . '|' . esc_html( $user->ID )  . 'ID . '" href="#">Delete User
';          }     echo '
';          }              }


How to change the category in URL for posts in multiple categories?

How can I change the category slug that appears in the URL of a post that's in multiple categories? I'd like to change the default WordPress behaviour of using the category with the lowest id. I thought this would do it:               add_filter('post_link', 'mspc_post_link', 1, 2);     function mspc_post_link($link, $post) {         if (strpos($link, 'bad-category-slug')) {             $cats = get_the_category($post->ID);             foreach ($cats as $cat) {                 if ("Bad Category Name" != $cat->cat_name) {                     $slug = $cat->category_nicename;                     break;                 }             }             $link = str_replace('bad-category-slug', $slug, $link);         }         return $link;     }      But while this kind of does work as expected, it doesn't change the URL visible to user.


how to create site exit messages with destination url displayed

i'm looking for a way to show an exit page or message when a user leaves my site. we have a uk version of our site, and some of the nav links lead back to our us site. i want to let users know that they are leaving the uk site and "are now being redirected to this page at our us site. you will be redirected in 10 seconds, or click here to stay" etc. i've seen a few plugins that can do this, but is seems like the only redirect to one page, and they don't tell the user where they're going - just that they are leaving the site. are there any plugins that can handle this, or is it something i have to create from scratch? if the latter, where do I start? thanks so much!


Custom sortable column with WPAlchemy

I'm a WPAlchemy enthusiast, this class really enhance my productivity, but there is some things I don't understand. I started to create a custom post type for **products** , with description, price and available stock. Then I added some columns to this custom post type listing like the price and stock. And then, I tried to make the stock column sortable, so I read the tutorial from Scribu but it seems to not work with the storage mode of WPAlchemy. The ID of my metabox is **"_sk"** , the name of my value is **"stock"** , the name returned by the method `get_the_name()` is **"_sk[stock]"** , and I use this code:               add_filter( 'manage_edit-products_sortable_columns', 'products_sortable_columns');     function products_sortable_columns( $columns ) {         $columns['stock']   = 'stock';         return $columns;     }          add_filter('request', 'stock_column_orderby');     function stock_column_orderby($vars) {         if (isset($vars['orderby']) && 'stock' == $vars['orderby']) {             $vars = array_merge( $vars, array(               'meta_key' => '_sk[stock]',               'orderby' => 'meta_value_num'             ));         }         return $vars;     }          But when I try to sort by stock, the list return me "No products". Can you see the point? Is there trouble with the storage mode of WPAlchemy? Thanks in advance for your help!


Delete Post Link to delete post, its meta and attachments

I used               // Delete Post Link     function wp_delete_post_link($link = 'Delete This', $before = '', $after = '', $title="Move this item to the Trash", $cssClass="") {         global $post;         if ( $post->post_type == 'page' ) {             if ( !current_user_can( 'edit_page' ) )                 return;         } else {             if ( !current_user_can( 'edit_post' ) )                 return;         }         $delLink = wp_nonce_url( site_url() . "/wp-admin/post.php?action=delete&post=" . $post->ID, 'trash-' . $post->post_type . '_' . $post->ID);         $link = ''.$link."";         return $before . $link . $after;     }      to add a delete post link in my custom theme,               <?php echo wp_delete_post_link(); ?>      but for some reason it is not deleting all the attached info. Only the post is deleted. I checked the Media Library and the attachments were still there. How can I implement to delete everything linked to the post? Note that I am implementing this on the front end and not the admin side. Ok additionally, i added action for delete_post and in that called wp_delete_attachment function to delete the attachments. But the delete link generated by above mentioned tutorial is giving wp failure page due to invalid nonce calculated. But it works perfect if i change action to trash. I need delete to be working. Can anyone help? ![sample image](http://i.stack.imgur.com/0KIgk.jpg)


easy steps to make front end form without plugin

i don't know this topic might covered else where. but i am trying to find step by step simply tutorial. to make a plugin where i can add a new page to site. and in that page i put some form. and only registered user can access that. i managed to make plugin at admin side. but not able to find the tutorial to make a form at front end of website. for registered user only. please give me some link for it. my core issues are   1. how can i display custom coded php form in only one page in front end.   2. how can i make that page ristricted for registered user only.   3. how can i customize the login/registration form to add custom fields without using any plugin. Thanks in advance.


Query custom post type by custom field

# General Info I used the plugin WP Types (wp-types.com) to create a custom post type called " **artist** ".   In WP Types you can also set another post type as parent post type. This is not possible by default; they implemented this feature by a meta query with the key:   "_wpcf_belongs_%POSTTYPE%_id" (in my case " **_wpcf_belongs_artist_id** ")   and the value is the ID of the parent post. # The Problem Normally if you set a page X as a child of page Y you would have the following permalink structure:   /page-y/page-x/ I thought this plugin would adopt this but it does not. For example I use " **painting** " with the ID **24** as the parent page and " **picasso** " with the ID **72** as the child post with the post type "artist". So this:   /painting/picasso/   does redirect me to:   /artist/picasso/   but outputs the right content. ## My solution approaches As the paid support could not help me I have to try on my own. For writing my own "custom" rewrite rules I have to know the correct query at first. I tried to get my content manually: index.php?_wpcf_belongs_artist_id=24&artist=picasso   redirects me to:   /artist/picasso?_wpcf_belongs_artist_id=24&artist=picasso   with the correct output of the single artist post. This:   index.php?_wpcf_belongs_artist_id=24   just outputs my front page. The only more or less _working_ variant is:   /painting/picasso/?artist=picasso&_wpcf_belongs_artist_id=24 and:   /painting/picasso/?artist=picasso   These _don't_ redirect me to /artist/picasso/… or anywhere but output the correct single artist post. Here you can find some more variants and the whole thread in the support forums of WP Types. First step probably would be to get the right content with a queryvar like "parent_id". After that I can start dealing with the rewrite rules itself, there might be problems because of the double usage of the top level (%pagename% and %parent_id%). This probably will confuse WordPress. # UPDATE 12/17 I tried this code to get all posts with the meta field '_wpcf_belongs_artist_id' and the meta value retrieved from the URL (/?parent_id=24). Unfortunately, it doesn't seem to work. It crashes my submenu's auxiliary queries and outputs just the result of the normal query.               add_filter('query_vars', 'custom_query_vars');     function custom_query_vars($vars) {         $vars[] = 'parent_id';         return $vars;     }          function parent_query( $query ) {         // Exclude         if( $query->is_admin == 1 && !$query->is_main_query() && !$query->is_archive == 1 ) {             return;         }         // retrieve field name / value from URL if exist         $custom_field = '_wpcf_belongs_artist_id';         $custom_value = ( $_GET['parent_id'] ) ? stripslashes( $_GET['parent_id'] ) : '';         if( $custom_field ) {             // add meta key requirement -- we’ll return all posts with some ‘color’             $query->set( 'meta_key', '_wpcf_belongs_artist_id' );             if( $custom_value ) {                 // build meta value requirement -- we’ll return only blue                 $query->set( 'meta_value', $custom_value );             }         }     }     add_action( 'pre_get_posts', 'parent_query' );


Create a link to full-sized image attachment?

I'm using some transitional css to "slide" up a div (".mask") which contains a short excerpt of the post when you hover over the post thumbnail. This works very well, but I'd also like to add a text or icon link to each "mask" div which will link directly to the full size version of the image (and hopefully open automatically in fancybox). Here's the code I'm using so far - thanks

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

     <?php tt_thumb(300,185); ?>

     <?php the_content_limit($hp_mid_content_length,'');      ?>


Is there a plugin that can replace WP comments with Facebook comments as used by TechCrunch?

I've long been impressed by TechCrunch's Facebook comments, is there a plugin for WordPress self-hosted websites which achieves the same effect?


Graphing libraries for WordPress

I had asked question like this long ago at WPTavern and it fizzled. Hope it fares better this time. :) Drawing graphs can be done with multiple methods (generating image files, JS, Flash) and there are a lot of libraries available overall. However there are some specific factors in context of WordPress:   * it might be efficient to use lighter library with dependency on scripts bundled with WP (like jQuery);   * it needs to be licensed under GPLv2 or compatible to fit in official repository (note that it has more harsh requirements than WP itself);   * there are probably some specifics that make things easier/harder to use with WP techniques, like passing data to JavaScript with localization functions. What libraries or other solutions had you used to build graphs in WordPress? Please one thing per answer, so it is easier to discuss and vote on.


Plugin To Insert Chinese Characters in Posts or Pages

My daughter is blogging from China. She wants to insert Chinese characters occasionally into her post so that she can explain what these mean. She has a Mac, which lets her type these quickly. When she tried to post them, she got ?? symbols. I checked the blog theme (TwentyEleven) and it's HTML5 and has this tag:               <meta charset="UTF-8" />       So, she's doing that properly at least. I imagine she'll need some kind of plugin that lets her use a shortcode or something in order to properly display the character. What plugin do you suggest? Note that I may have needed to turn on UTF-8 setting in MySQL, that it might have been MySQL that was the problem? When you use Fantastico in cPanel to create a blog, it sets the encoding to Latin1 instead of UTF8. So, I had to use phpMyAdmin to find her blog database (difficult -- you have to click wp_options table and see if it's the right blog database). Then, I clicked the SQL tab and pasted the following, then clicked Go:               alter table wp_posts convert to character set utf8 collate utf8_general_ci;      I will report back if this fixes it.


how wordpress generates permalinks as /%category%/%post%/

I am not here to discuss the efficiency of using categories as the base for permalinks. I would like to know in **what file and what line is the code to how Wordpress picks out a category for the permalink if the post is in multiple categories**. I asked this on IRC a while ago and I can't find the code anymore. Thanks.


Auto post Spams on my wordpress blog?

i don't know what the hell are these spam links on my friend's photo-blog posts! when i publish a post, this texts shown there! what should i do? (sorry for my very bad English) blog: http://www.bius87.com http://i.stack.imgur.com/YdSY3.jpg


Different Language for Frontend and Backend

I use a English WordPress package and this is very well. Now, I would like to translate some elements of the blog (like "posted on", "comments") etc, but do leave the dashboard interface intact in English. Is there any mecanism to translate just the site elements?


Best practices: Custom theme sidebar menu - hardcode or widget?

Is it best to hardcode a sidebar menu using functions.php or sidebar.php OR use the custom menu widget? Are there times when each is appropriate?


How can I get WP to build a feed based on multiple taxonomy terms

Currently, the best way to get a feed generated for a single taxonomy term is by letting wordpress generate the content automatically:               example.com/wordpress/feed?tax_slug=term_slug      However, is there a built in way of being able to produce a feed using multiple terms from the same taxonomy? For example:               example.com/wordpress/feed?tax_slug=term1,term2,term3&another_tax_slug=term4,term5      The idea is to use built in wordpress functionalities to generate the feed, and not have to manually create one.


How can I get category ID by category name?

I have a few categories with the same name [some of them are sub-categories]. And I want to get an array of ID's for certain cattegory name. I tried this:                $term = get_term_by('name', $cat_name, 'category');      but it seems that `get_term_by()` returns only the first term that match the query.


AJAX call fails when sending JSON but works with URL style string

When making an AJAX request is works when my data is a URL style string.               var options = {         type: 'post',         data: 'action=my_action'     };      The function will get called and return some fake data just fine. If I try to make the same call but use JSON, it doesn't work. I've tried several different ways of doing it, but admin.php just return -1. Is there something in jQuery or Wordpress that I need to change to allow this? Here are a couple of the other ways I've tried.               var options = {         type: 'post',         data: { action: 'my_action' }     };          var options = {         type: 'post',         data: JSON.stringify({ action: 'my_action' })     };      The example in the docs have it using a JSON object too. http://codex.wordpress.org/AJAX_in_Plugins


wp_nav_menu() mark current item ancestor of custom post type

This solution does almost what I want it to. Only thing is, I have my menu set up as follows:               Menu item 1     Menu item 2        Custom post type 1        Custom post type 2        Custom post type 3     Menu item 3      Using the solution I mention adds the tag "current_url" to the sub menu of the custom post type I'm in ("Custom post type 1"). But I want it to add a "current_menu_item" (or something) to "Menu item 2". Any way to do this?


Multisite - 404 when accessing sub-sites

Setting up a multisite on a blog which root url is dev.domain.com, using subdomains. So, for example, a subsites address : site1.dev.domain.com Everything works fine as long as i stay on the main site (dev.domain.com) When i try to access any of the other sites, I get a 404 error. Here is my .htaccess sitting in the root               <IfModule mod_rewrite.c>     # BEGIN WordPress     RewriteRule ^index\.php$ - [L]          # uploaded files     RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]     RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]     RewriteRule . index.php [L]     # END WordPress          </IfModule>      Any hint as to what is causing the 404 or suggestions to solve it would be much appreciated.


Generate a WP post from Youtube Feed

Normally when you get a Youtube feed, it will display the description/title from the YT video. However, I want a post to be generated when a new video is posted on YT so that an admin/editor can go back and change the title or add a teaser.


How to skip woocommerce checkout out page?

I use woocommerce plugin for my shop. I want to skip the checkout page where users give shipping details. So the system will be when they select a product and after go to the cart page they will go to paypal and from paypal we will get the adress. Any idea how i can build this, Please help me. I am newbie.


How to remove contextual help on WP 3.3.2?

How to remove the contextual help and its tab completely from Wordpress v3.3.2? The add_filter for contextual help that used to work like wonder on older version no longer work now. Update: (trimmed solution from Chip Bennett)               function wpse50787_remove_contextual_help() {         $screen = get_current_screen();         $screen->remove_help_tabs();     }     add_action( 'admin_head', 'wpse50787_remove_contextual_help' );


2 tick boxes appearing below comments

In my site I have two tick boxes appearing above each other underneath the comments section. I have tried disabling pingbacks etc. How do I remove these? example - http://vikingsandc.co.uk/2012/11/test-text-test-text/


wp_list_pages sort order is different for different languages

I'm using the following code               wp_list_pages(array('exclude' => '','title_li' => '','sort_column' => 'menu_order'))      If I switch the language the sorting is different. One of the main menu points is listed at the end of the page when switching to my second language. Why does this happen? The pages have a sorting of zero when editing a page ...


can the_excerpt function also get images?

Not sure if im going about this in the right way but, overall, ive been told to create, kind of like a news box on my home page and so, the "latest news" is going to be this clients posts. now i know i can control `the_excerpts();` content length etc but, i cant seem to find any way for it to also allow an image. when i showed the client the "news box" he wants whatever image is associated with the post, to come through. so i thought of `"the_content();"` but i dont think thats what i need(though im not sure which one will work best with what i need) so the main questions here for me are   1. Can i somhow get the image to come through with the excerpt, or   2. If the excerpt function doesnt allow it, then what can i use?


Tabbed content for WordPress sidebar

Is there a tutorial that will show me how to create a custom tabbed content area for my sidebar? I want to have two tabs - one for a specific category each (news & events) This tutorial http://net.tutsplus.com/tutorials/javascript-ajax/create-a-tabbed-interface- using-jquery/ shows how to create the tabs but how do I add the code for WordPress to show the excerpts of posts with thumbnail images from the categories so it shows in the selected tab?


WP_Query returns no results

I'm using wp_query to create a custom query that retrieves search results but it is returning 0 results. Here is the code:               $query = 's=the&posts_per_page=5&paged=1';     $custom_query = new WP_Query();     $custom_query->query($query);          if( $custom_query->have_posts() ) {             while ( $custom_query->have_posts() ) : $custom_query->the_post();                         $this->get_article();             endwhile;     }     else             $this->posts_404();      When I search for the word 'the' through the search box on the UI, it returns 37 hits, but searching for the word 'the' with my custom query returns 0. So, I suspect there must be a problem with my query. Result: of `print_r($Custom_query)`:               WP_Query Object (       [query_vars] => Array        ( [s] => the          [posts_per_page] => 5          [paged] => 1          [error] =>          [m] => 0          [p] => 0          [post_parent] =>          [subpost] =>          [subpost_id] =>          [attachment] =>          [attachment_id] => 0          [name] =>          [static] =>          [pagename] =>          [page_id] => 0          [second] => [minute] => [hour] => [day] => 0 [monthnum] => 0 [year] => 0          [w] => 0          [category_name] => [tag] => [cat] => [tag_id] => [author_name] => [feed] => [tb] => [comments_popup] => [meta_key] => [meta_value] => [preview] => [sentence] => [fields] =>          [category__in] => Array ( )          [category__not_in] => Array ( )          [category__and] => Array ( ) [post__in] => Array ( ) [post__not_in] => Array ( ) [tag__in] => Array ( ) [tag__not_in] => Array ( ) [tag__and] => Array ( ) [tag_slug__in] => Array ( ) [tag_slug__and] => Array ( )      [ignore_sticky_posts] => [suppress_filters] =>      [cache_results] => 1      [update_post_term_cache] => 1     [update_post_meta_cache] => 1      [post_type] => any [nopaging] =>      [comments_per_page] => 50 [no_found_rows] =>      [search_terms] => Array ( [0] => the ) [order] => DESC )      [tax_query] => WP_Tax_Query Object ( [queries] => Array ( ) [relation] => AND )         [meta_query] => WP_Meta_Query Object ( [queries] => Array ( ) [relation] => )         [post_count] => 0      [current_post] => -1      [in_the_loop] =>      [comment_count] => 0      [current_comment] => -1      [found_posts] => 0      [max_num_pages] => 0      [max_num_comment_pages] => 0      [is_single] => [is_preview] => [is_page] => [is_archive] => [is_date] => [is_year] => [is_month] => [is_day] => [is_time] => [is_author] => [is_category] => [is_tag] => [is_tax] =>      [is_search] => 1      [is_feed] => [is_comment_feed] => [is_trackback] => [is_home] => [is_404] => [is_comments_popup] => [is_paged] => [is_admin] => [is_attachment] => [is_singular] => [is_robots] => [is_posts_page] => [is_post_type_archive] =>      [query_vars_hash] => 16a0222409543c8384496148e5b60565      [query_vars_changed] => [thumbnails_cached] =>      [query] => Array ( [s] => the [posts_per_page] => 5 [paged] => 1 ) [request] => SELECT * FROM wp_posts WHERE 1=2 [posts] => Array ( ) )


change url for portfolio image

I am working on champer theme , I add portfolio by guideness of documentation, but when i click on image , its go on another page, but I want to stay in similar page, not changing. how can I do this. i am wanted my portfolio Image behaviour like seo Optimization In this link. http://www.gallyapp.com/tf_themes/?theme=Chamber my portfolio.php code is                     <?php          session_start();                 if(!isset($hide_header) OR !$hide_header)               {           get_header();                }                 if(isset($_SESSION['pp_portfolio_style']))                {              $pp_portfolio_style = $_SESSION['pp_portfolio_style'];             }             else          {     $pp_portfolio_style = get_option('pp_portfolio_style');            }                if(empty($pp_portfolio_style))           {     $pp_portfolio_style = '2';            }                   include (TEMPLATEPATH . "/templates/template-portfolio-     ".$pp_portfolio_style.".php");                 ?>


Woocommerce - Specific template for product category?

I'd like to create a specific template for specific category (not for single product). Is it possible and how to do it? Thanks,


Cookie is not marked as HttpOnly

I am trying to get my wordpress driven website to be PCI compliant and the report states that we have a failure due to: "Cookie is not marked as HttpOnly: 'wordpress_test_cookie=WP+Cookie+c heck; path=/; domain=..." I read wordpress documentation and it seems that this security is automatically set. Can anyone enlighten me on how I can fix this? http://tr.im/4v8sv


Have different site location for wp-admin in IIS

I'm attempting to put a WordPress blog on a Windows server. PHP and WordPress installed just fine, and I have a working website, and admin site. However, I want to access the wp-admin directory using SSL (with a self-signed cert that I installed). I'm also looking to have the SSL cert only be used for admin, by me - I understand the browser warnings, and it will be on a funky port, but obviously I don't want regular users to have to deal with this. Everything works fine if I tell the WordPress settings that my site lives on https://example.com:4443/ - I can get to the entire site, including admin, using that URL. However, http://example.com/ does not work when I do this. I'm looking for a way to have the best of both worlds - SSL on a funky port for admin, and regular HTTP on port 80 for the rest of the site, but I can't seem to figure out how to have two different URLs. Is this possible? The issue is definitely with WordPress - IIS and PHP are perfectly fine running in both worlds simultaneously, but the app itself doesn't work. I've got full server rights, so I can do whatever crazy IIS settings or php.ini settings are needed. Windows Server 2008R2


Image rotation fails to regenerate custom sized thumbnail

I'm using custom image dimensions in functions.php like this:               add_image_size( 'custom-size-thumbnail', 120, 120, true );      I uploaded some pictures with wrong orientation, so I used "edit" options to rotate them... Problem is, that only original size pictures (full, large, medium, thumbnail) are regenerated (as a new file in the FTP directory - original picture.jpg, rotated picture-e1384125509778.jpg). My custom sized, however, are not :-( (no new file is created, theme is still loading one with wrong orientation). Any idea how to fix this? Thanks


Add template meta box to category edit page?

Is there any non-plugin solution to add template meta box on the category edit screen? Template meta box like that on the page edit screen, but this one for category. I'd like to have this function built into the theme page. Something similar to the one Mike Schnikel did for Scott B here.