title: Unable to get_the_content(); of a post in Wordpress via AJAX

text: I'm trying to ajaxify my Wordpress theme and I use the method described here and I'm now trying get_the_content of post via functions.php. Using jQuery, when I do alert(data) I get the 'title' echo but not the content of the existing post I want (returns 0). The jQuery part               $('.ajaxed,.ajaxed a,.menu-item-home a,.menu-item-object-page a').live('click', function(event) {             event.preventDefault();             var link = $(this).attr('href');             var toRemove = MySettings.url;             var rewritepath = link.replace(toRemove,'');             var handler = function(data) {                 $('title').html($('title', data).html());                 $('#primary').html($('#primary', data).html());                 $('#primary').hide().fadeIn('slow');                 $.address.title(/>([^<]*)<\/title/.exec(data)[1]);             };             $.post(ajax_object.ajaxurl, {                 action: 'ajax_action',                 post_id: $(this).find('input.post_id').attr('value')             },function(data) {                 alert(data.title);                 alert(data.content);             });             $.address.state(MySettings.path).crawlable(true).value(rewritepath);             return false;         });      The functions.php part               <?php     function javascripts() {         if( !is_admin()){             $blogurl = get_bloginfo('url');             $thumbnail_width = get_option('thumbnail_size_w');             $thumbnail_height = get_option('thumbnail_size_h');             $path = parse_url(get_bloginfo('siteurl'), PHP_URL_PATH);             $url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js';             wp_deregister_script('jquery');             if (get_transient('google_jquery') == true) {                        wp_register_script('jquery', $url, array(), null, true);             }              else {                 $resp = wp_remote_head($url);                 if (!is_wp_error($resp) && 200 == $resp['response']['code']) {                     set_transient('google_jquery', true, 60 * 5);                     wp_register_script('jquery', $url, array(), null, true);                 }                  else {                     set_transient('google_jquery', false, 60 * 5);                     $url = get_bloginfo('wpurl') . '/wp-includes/js/jquery/jquery.js';                     wp_register_script('jquery', $url, array(), '1.7', true);                 }             }             wp_enqueue_script('plugins.js', get_bloginfo('template_directory') . "/js/plugins.js" , array('jquery'));             wp_enqueue_script('ajax-script', get_bloginfo('template_directory') . "/js/scripts.js", array('jquery'));             wp_localize_script('ajax-script', 'ajax_object', array('ajaxurl' => admin_url( 'admin-ajax.php' )));             wp_localize_script('jquery', 'MySettings', array('width' => $thumbnail_width,'height' => $thumbnail_height,'url' => $blogurl,'path' => $path));         }     }     add_action('wp_enqueue_scripts', 'javascripts');     add_action('wp_ajax_ajax_action', 'ajax_action_stuff'); // ajax for logged in users     add_action('wp_ajax_nopriv_ajax_action', 'ajax_action_stuff'); // ajax for not logged in users     function ajax_action_stuff() {         $post_id = $_POST['post_id'];              //Query the post and set-up data         $post = get_post($post_id);         setup_postdata();              update_post_meta($post_id, 'post_key', 'meta_value');              //Return response as an array. This will give us data.title and data.content browser-side.         $response = array();         $response['title'] = get_the_title();         $response['content'] = get_the_content();              echo json_encode($response);         exit;     }     ?>      What am I doing wrong? Thanks


title: Is there a plugin to record querystring parameters for a page (for customer tracking)?

text: I am creating an information landing page that I intend to cold email out to a bunch of potential clients. I need to track customers that not only open the email (I know how to do that) but track which email recipients actually navigated to the landing page. In a custom web application I would do this by sending them a link to the landing page that's something like www.site.com/landing?rec=my@email.com, and upon seeing the querystring I would put that in the database. Are there any wordpress plugins to do something like that?


title: Plugin for a static piece of text on homepage

text: I have this site where most of the Homepage is programmed into the php page. For example: a photo slider, a list of the most recent products, etc. I also need to add a piece of static text to only the Homepage. It's easy just to add it on the php page, but it should be editable from the admin area. Is there a plugin that will allow me to do something like that?


title: Plugin to email a post or page to someone

text: Is there a plugin that will allow visitors to email a page or post to someone? I found WP-EMail but it was updated last on April 2010 so I'm not sure if I should use it.


title: Are Wordpress Plugins essential?

text: I'm new to WordPress. I recently read an article about how hackers can exploit vulnerabilities in plugins. Various sources such as Google Pagespeed has also disssuaded me from using plugins or at least keep it to the minimum. Personally, I also try to avoid plugins because I feel more in control of what happens on my site, and downloading one almost feels like 'Great, another thing I have to learn how to use'. I understand that 'Plugins-recommendation' are off-topic, but what I'm after is actually explanation to why/if some plugins are essential in WordPress. Take these for example: **Security** - A few top plugins has to do with security. But are WordPress sites vulnerable in general? Why do I need an additional plugin to avoid exploitation? **Back Up** - I'm new to the blogging world, but don't most hosts provide backup services? Or do I need special plugins for that with WordPress? **AdSense Click-Fraud Monitoring** - Supposed to block click bombs to avoid banishment from Google. But I don't understand, are a few fake clicks all people have to do to shut your revenue down unless you download a plugin? _Edit: Might be better to ask this one in Google support, ignore it if so_


title: REmoving sensitive information from comment notifications - notify_post_author

text: Basically I need to remove or comment our lines 1114 - 1116 in pluggable.php, and edit line 1113 These are the lines               $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";     $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";     $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";     $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";      They are all part of function - wp_notify_postauthor I can replace the whole thing by creating a plugin (which is what I've done) - but is there a way to just change those affected lines - without replacing the whole function? Thanks


title: How to handle form submission?

text: I'm new to wordpress and hence facing some issues. **The use case scenario is as follows:**   1. A user is displayed an application form to start a club in his school.   2. The user fills the form and hits the 'Submit' button.   3. The form needs to be validated.   4. If the validation is successful, then data is stored in custom table `club_details` in db and the user is shown some message(eg: Thanks for submission. Your application is sent to the admin for approval.) else appropriate error messages are shown to the user.   5. The admin goes to the Wordpress admin panel to approve the pending requests for the club. (The data is fetched from db and shown to the admin). **I have done the following:**   * for 1) I have created a application form/page using the Wordpress HTML editor.    * for 3) I have a javascript file (`validation.js`) that has the validation code.   * for 4) I have a php file (`club-functions.php`) that has a function `storeInDB()` to store the application details in custom table in db.   * for 5) I have created my own plugin folder and added a php file (`club.php`) that displays the application details to the admin on the Wordpress admin panel. I'm stuck up at the following place: How to handle the form submission. Where should I place the code that calls the javascript's validate function and later calls the `storeInDB()` function. Please provide me some suggestions on how do I achieve this and is this approach good? Thanks a lot in advance.


title: Is it possible to install a different wordpress installation in a subdirectory?

text: What I'm trying to say is, I have this wordpress site called www.mysite.com which is a one pager site that only contains static pages and I want to install a new wordpress installation called shop and use it as an ecommerce page. So it will be called www.mysite.com/shop and shop will be a completely different installation. Is this possible and How am I going to do this? and on the nav bar I'll have something like, Home - About Us - Contact - Shop. and Shop will automatically direct to the new installation?


title: Is wp3.8 / twenty fourteen's Sticky Nav & Responsive - core or theme based

text: I want to have a twenty fourteen like sticky nav & responsive menu button, in my Genisis 2.0 theme. Before I go to figure this out, is it somehow now native to 3.8 or is it theme dependant. Casey


title: Image rotator plugin

text: I have tried two Rotator plugins so far. Nivo-slider and EasyRotator. Nivo- slider was great, but i could only have an image caption, and i need both image caption and image title. Also, i couldn't get the "bullets" for indicating the current slide to work. So i Googled and found the "EasyRotator"-plugin. Great, except it rescales the images, even if i upload in the correct resolution, the generated HTML is all inline styling so it's kind of hard for me to style it as i want from css. Now im wondering, is there any plugin that does the following?   1. Image Title   2. Image Caption   3. Bullets to indicate current slide Any tip is appreciated! Thank you!


title: Should I custom code drop down menus or use a wordpress plugin?

text: **EDIT** -- Hopefully my question is more clear What is the best practice for wordpress dropdown menus:   1. Custom CSS (editing styles.css)   2. Using a WP Plugin I'm leaning toward coding it myself from scratch, but I don't want to reinvent the wheel if there's a plugin that is standard.


title: How to disable WordPress trackback?

text: I have higher PR as a result of that lots of spammers make trackbacks, everyday I have to delete them. Those trackbacks will negatively affect my site SEO? How do I disable my site all the posts trackback at once? I have run following code in my MySQL admin and WotdPress manage DB plugin,, it show me an error. UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post'; UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'page';


title: Page speed error: "serve scaled images"

text: I made a test on GTmetrix.com and I got a pretty bad grade regarding the Page Speed (D or F). The worse error is the following: **Serve scaled images (grade F):**   _some image URL_ is resized in HTML or CSS from 1024x539 to 530x279. Serving a scaled image could save 70.3KiB (73% reduction). What should I do to get a better grade? How can I solve this issue? What can I do to prevent the resizing in HTML? Is it better to upload to WP smaller images? What would be the best resolution?


title: Allow users to add custom functions to wordpress theme

text: I'd like to allow users to add functions to the theme I'm developing, but don't want users to change functions.php directly, as this file may be updated with theme updates. In other words, I'd like this to work in a similar fashion to custom CSS files. How can I setup a user-functions.php file for users and ensure those functions are also run when the theme is activated?


title: How do I translate: "2 hours and 15 minutes"?

text: I want to translate the generic phrase "x hours and y mintues". Of course, if it's only one hour, it should say "1 hour and y mintutes". The same goes for minutes, "x hours and 1 minute." I know `_n()` handles the single/plural issue, but what is the best practice on handling two numbers in a phrase? **Method 1**               printf(_n("%d hour", "%d hours", $hours), $hours);     _e(" and ");     printf(_n("%d minute", "%d minutes", $mins), $mins);      Works, but concatenating strings makes translation inflexible. I'd expect not all languages would work with "[hour phrase] [and phrase] [minutes phrase]". **Method 2**               printf(         "%s and %s",         sprintf(_n("%d hour", "%d hours", $hours), $hours),         sprintf(_n("%d minute", "%d minutes", $mins), $mins)     );      This seems right, but seems like it would be hard to translate without context. Maybe I need to add context with `_x()`? # Solution I went with: something more readable @toscho               function nice_time($minutes) {         $hours = floor($minutes/60);         $minutes = $minutes % 60;              if ($hours == 0 && $minutes == 0) {             return __("no length of time", 'context');         } else if ($hours == 0 && $minutes == 1) {             return __("1 minute", 'context');         } else if ($hours == 1 && $minutes == 0) {             return __("1 hour", 'context');         } else if ($hours == 1 && $minutes == 1) {             return __("1 hour and 1 minute", 'context');         } else if ($hours == 0) {             return sprintf(__("%d minutes", 'context'), $minutes);         } else if ($minutes == 0) {             return sprintf(__("%d hours", 'context'), $hours);         } else if ($hours == 1) {             return sprintf(__("1 hours and %d minutes", 'context'), $minutes);         } else if ($minutes == 1) {             return sprintf(__("%d hours and 1 minutes", 'context'), $hours);         } else {             return sprintf(__("%d hours and %d minutes", 'context'), $hours, $minutes);         }     }


title: Rich text editor settings persist throughout all rich text editors

text: I have an issue I'm trying to better understand in order to force mce to true in the script check below. Background: I'm applying a rich text editor to the category description textarea to allow users to apply rich text formatting to the category descriptions. The problem I'm having is when the user happens to leave the post or page editor on the "HTML" tab. In this case, WordPress apparently is setting a global flag that results in the mce variable in the script below to initialize as false. This has the effect of disabling my rich text editor on the category description field. How can I overcome this?               <script type="text/javascript">         (function(){             var init, ed, qt, first_init, mce = false;          //mce needs to be true!!!                  if ( typeof(tinymce) == 'object' ) {                 // mark wp_theme/ui.css as loaded                 tinymce.DOM.files[tinymce.baseURI.getURI() + '/themes/advanced/skins/wp_theme/ui.css'] = true;                      for ( ed in tinyMCEPreInit.mceInit ) {                     if ( first_init ) {                         init = tinyMCEPreInit.mceInit[ed] = tinymce.extend( {}, first_init, tinyMCEPreInit.mceInit[ed] );                     } else {                         init = first_init = tinyMCEPreInit.mceInit[ed];                     }                          if ( mce )                         try { tinymce.init(init); } catch(e){}                 }             }                  if ( typeof(QTags) == 'function' ) {                 for ( qt in tinyMCEPreInit.qtInit ) {                     try { quicktags( tinyMCEPreInit.qtInit[qt] ); } catch(e){}                 }             }         })();


title: similar of my posts in all over the internet sites and blogs

text: i asked here in WordPress first and next asked there in webmasters Stack but i think here is very useful for WordPress users but close my question. I'm using the similar posts plugin http://wordpress.org/extend/plugins/similar-posts/, but I want the similar posts in all over the internet. is there any tools that when someone copy and paste my article in their own site alert to me? some of the bloggers don't link to my articles and i want to


title: Shortcodes: closing shortcode not being processed

text: I have been using shortcodes in my templates successfully, apart from when a closing tag is required to wrap some other code or content. The problem is that the closing tag, eg [/shortcode], doesn't get processed, and is simply printed to screen as plain text. Am I missing something obvious? Thanks! Austen


title: Pagination and Custom Search page

text:
I am stuck on an issue for the last two days. I have a CPT - 'listings'. This is it's archive page   * Till here, everything is fine.   * I put in a search form there, and added this to `pre_get_posts`:              if ($query->is_main_query() && $query->is_post_type_archive('listings') &&  !is_admin() && is_search()) {          echo '
me runnning
';          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $query->set('paged', $paged);          $query->set('posts_per_page', 1);        * Another code in 'functions.php' that redirects my search to 'archive_listings.php', which is the same archive page for 'listings' CPT   * When I do a search the results that appears are fine. Problem arises when I try to get on the second page in the search results.   * When I click on next page for search results, it takes me to the  > wwwsitename.com/listings/page/2 which is the page of archive-listings default results.   * In other words, when I try to move to next page - the query forgets about the search terms, and get the second page of default archive for listings. I am not sure, if I was able to clearly explain it. So, I have`print_r($wp_query)` which can help understand the issue I have tried several code blocks from support forums, stack exchange, and other blogs. Any suggestions will be heartily appreciated.


title: Limit page template choice by page title or ID?

text: I'm developing a multisite and creating my own themes for it. All the themes will feature some standard pre-defined pages eg. homepage, about, blog, contact us etc. Each page will also have a number of page template options available, eg: homepage1, homepage2, blog 1, blog 2, contact. **The problem is that some of the page templates will not be appropriate for all pages.** For example, if I have a template designed as a "blog" page, it will not work well if applied to a "contact us" page. The Question (finally): **_How can you limit or restrict the templates available to choose depending on the page title or ID?_** "Human" code required: if the page is the about page, then only show page template options x & y etc. Thanks!


title: Altering HTTP Headers when Serving Certain Files

text: I'm trying to use jquery.filedownload within a site but it requires that my files (a pdf, for instance) be served with specific headers.               header('Set-Cookie: fileDownload=true; path=/');     header('Cache-Control: max-age=60, must-revalidate');     header("Content-type: text/csv");     header('Content-Disposition: attachment; filename="'.$title.'-' . $timestamp . '.csv"')      I've found how to alter headers via an action hook. Does this mean I need to create an intermediary page which alters the headers and the sends the file, e.g. with readfile() ?


title: why is are these rewrite_tags and rules not working?

text: im trying to get this to work for 3 different pages it was working fine with 1 rewrite, then when i added 2 more its not working for any of them. heres the code:               function add_video_rewrite ()      {         add_rewrite_tag("%video_id%", '([^/]*)');         add_rewrite_tag("%video_slug%", '([^/]*)');         add_rewrite_rule('^video/([^/]*)/([^/]*)', 'video/?video_id=$matches[1]&video_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_video_rewrite' );          function add_team_rewrite ()      {         add_rewrite_tag("%team_id%", '([^/]*)');         add_rewrite_tag("%team_slug%", '([^/]*)');         add_rewrite_rule('^videos/team/([^/]*)/([^/]*)', 'videos/?team_id=$matches[1]&team_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_team_rewrite' );          function add_league_rewrite ()      {         add_rewrite_tag("%league_id%", '([^/]*)');         add_rewrite_tag("%league_slug%", '([^/]*)');         add_rewrite_rule('^videos/league/([^/]*)/([^/]*)', 'videos/?league_id=$matches[1]&league_slug=$matches[2]', 'bottom');     }     add_action( 'init', 'add_league_rewrite' );


title: Remove multisite "blog" slug from specific custom post type

text: I have wordpress multisite, by default multisite has the word "blog" added to all post types excluding "pages" How would i only remove it from a specific custom post type. If I go to setting and remove the "blog slug" from setting it gets remove from the actual blog section of the website which i don't want because i need to keep the URL the same.


title: Set loop format & have a loop inside other one

text:
I have few questions on wordpress loop. The question may be strange, but it was fit for the jquery requirement. What I want to do are:   1. Loop the "page" div with two "threads" show in each by NOT using any transition like page number(pagination??), but just to paste all the posts("thread" div) in below format inside one php. All the class name of div no need to be changed in loop.   2. "title" div come from another loop, as it is not related to "thread", that's "loop inside loop"?

             <--title from another loop-->

             <--content of 1st thread-->

             <--content of 2nd thread-->


title: User File Upload Repository?

text: I am trying to make a user-uploaded file repository on my wordpress site, but have been unable to find any plug-ins or tutorials on how to accomplish such a task. Basically I want a page where users can go and upload files via an upload file dialogue. Then I want to have a page that lists all user-submitted files that is sortable. I have seen some tutorials on how to add an upload option to a users dashboard, but I'm not using the normal dashboard because I think it is clunky. Are there any such plug-ins out there? Or does anyone have any recommendations? Thanks, Tre!


title: In what files I can change country names of wp-ecommerce plugin?

text: I am using the newest wp-ecommerce plugin and as I am selling to a non-english speaking country I would like all country names listed in my language in the cart. I search and all the files and changed in several files, but it did not help. Maybe, somebody know where I should change country name what it would be in my language in the cart?


title: Change order of comment fields

text: Is there a way to display the comment field first and then the Name / Email / Website fields? I am using               <?php comment_form( ); ?>      in my theme. I am not looking for a CSS solution.


title: Advertising: Every page refresh counts as 3 ad impressions

text:
I have tried multiple plug-ins for ads and for each page refresh they all count it as 3 impressions. Any idea why this is happening or how to fix it? Currently using the Ad Engine plugin, and already tried Simple Ads Manager. Using an Image. **Example Code:**                                   <!doctype html>                                            <meta charset="utf-8">                   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">                   <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>         <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />              <?php wp_head(); ?>            <meta name="description" content="Saint Petersburg SociaBulls">       <meta name="author" content="Austin Piazza">                   <meta name="viewport" content="width=device-width,initial-scale=1">                        <link rel="stylesheet" type="text/css" href="<?php bloginfo('wpurl'); ?>/wp-content/themes/sociabulls/js/jcar/skins/tango/skin.css" />                            <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen,projection" />                                                                                <link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>               <body <?php body_class($class); ?>>

St. Pete Sociabulls

                 <?php wp_list_pages('title_li='); ?>

<?php the_title('');?>
                          <?php if (have_posts()) : while (have_posts()) : the_post();?>

                                 <?php the_date( 'M d' ); ?>

                                       <?php the_content(); ?>

                        <?php endwhile; endif; ?>
                                                        <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'rightsidebar' ) ) : ?>      <?php endif; ?>
                         <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'Ads' ) ) : ?>      <?php endif; ?>

                         <?php if ( !function_exists('dynamic_sidebar')               || !dynamic_sidebar( 'extra' ) ) : ?>
This is the deafult sidebar, add some widgets to change it.
       <?php endif; ?>

                                                                 <?php wp_footer(); ?>                       **Update: Added all my code together** Thanks!!


title: Does the lazyload plugin make this server disks busy?

text: Some people claim that this plugin make many read/writes to the disks making them too busy. Increasing IOps rate. Is this correct? http://wordpress.org/extend/plugins/lazy-load/


title: What is the scope and persistence of add_filter() and remove_filter()?

text: I understand that using add_filter() or remove_filter() directly within a themes' functions.php would make the changes global across the theme unless you override them elsewhere. But believe this is a result of WordPress initialization.               add_filter( $tag, $function_to_add, $priority, $accepted_args );      However if a call to add_filter() or remove_filter() is made within a function or class:               function example(){         ...         add_filter( $tag, $function_to_add, $priority, $accepted_args );         ...     }      What is the scope and persistence of the change?


title: query_posts - slightly more advanced query

text: I'd like to edit the front page posts query to be slightly more advanced. Right now it excludes all posts in the Featured category. I'd like it to exclude the first 5 posts (or first n posts, really), but include the rest in the results. Here is the current call:               <?php query_posts("cat=-".$GLOBALS['ex_feat'].",-".$GLOBALS['ex_vid'].",-".$GLOBALS['ex_aside']."&paged=$paged"); ?>      How would I edit this to include all featured posts as well, except the first 5?


This is a follow up to Display Post by taxonomy and taxonomy child if exist I need to display a list of Accomodation, first by Type of Accomodation, then by Regions. I have a post-type, called `accomodation`, a taxonomy `Country`, a taxonomy `accomodation-type`, a taxonomy `Region` I am in the Country page, where I retrieve the value of the country via               $taxonomy = 'country';     $terms=get_the_terms($post->ID,$taxonomy);          if($terms) {         foreach( $terms as $termcountry ) {      So I am successfully getting `$termcountry->name;` as the value of current country. Next I need to do my query for the Accomodation based on that country, filtered by Accomodation Type, and by region in this type. So it should be   * Acc-Type 1      * Region1        * Acco 1       * Acco 2       * Acco 3     * Region 2        * Acco 1       * Acco 2   * Acc-Type 2   * etc.... I am trying to do it this way               $taxonomy2 = 'accomodation-type';     $termsacc = get_terms("accomodation-type",array('orderby' => 'slug', 'order' => 'ASC'));            //Loop through Acc-Type             foreach ($termsacc as $termaccomodation) {                 //Loop through Region in this type                 $taxonomyregion = 'region';                 $termsreg = get_terms("region",array('orderby' => 'slug', 'order' => 'ASC'));                  foreach ($termsreg as $termregion) {                 $args = array(                     'post_type' => 'accomodation',                     'country' => $termcountry->name,                     'tax_query' => array(                         'relation' => 'AND',                         array(                             'taxonomy' => 'accomodation-type',                             'field' => 'slug',                             'terms' => array($termaccomodation->name),                         ),                         array(                             'taxonomy' => 'region',                             'field' => 'slug',                             'terms' => array($termregion->name),                         )                     )                 );                           $query = new WP_Query($arg);                   //Do the loop      but this is not doing it.... Scratching my head proper on this one and will appreciate some help/solution thx in advance


title: Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

text: I really need some help, I dont know where else to turn with this request. I'd like to add a shortcode to one of my posts. The template tags get_next_post() and get_previous will not work for me since I dont want post navigation on each post page and I want to control where it displays. In a DIV in an HTML structure I've created in a post. So what I need is to generate shortcodes from get_next_post() and get_previous_post()


title: Stop Wordpress Redirection From /keyword to /some-post-containing-keyword/

text: I have tried everything I've found. I can't stop webhostingbreak.com/ipage/ from redirecting to webhostingbreak.com/hosting-directory/ipage-hosting/ I tried remove_filter('template_redirect', 'redirect_canonical'); in my theme's functions.php. I tried removing or commenting out add_action(‘template_redirect’, ‘redirect_canonical’); in /wp-includes/canonical.php I even removed EVERY line of code in canonical.php and still no result... It still redirects like I've done nothing. I changed webhostingbreak.com/hosting-directory/ipage-hosting/ to webhostingbreak.com/hosting-directory/test/ and then I cleared the database of any attachements/old slugs that might cause redirect. It STILL redirects. I'm out of ideas. I've spend 20 hours trying to find answers on this.


title: Produce a plain page with only a message

text: I am integrating a payment gateway into a distributed wordpress plugin. The notification page (page that the gateway sends info to after the payment has been made) requires only a message of "success" or "fail" to be printed. In that page, I need access to the database and some org options. Can someone please tell me how to produce such a page (i.e. no menu, no header, no footer and etc.)? The gateway in question is alipay.


title: How-to leverage WordPess for creating Extended Social Profiles

text: My question is actually quite simple, but I think there are a number of answers to choose from: **If one were to use WordPress, what would be the most elegant way of creating a part of the website that has "People Profiles", whereby; they can update their own mini-blog, add images, assign them a multitude of taxonomies, etc. (basically having a very light version of Facebook functionality plus some e-commerce products specific to the person). Scalability would obviously be key too, would need to work for 10, 100, 1000+ profiles.** I think my first instinct would be to try and go with BuddyPress as a support application from which these profiles would originate, but there are possibly other solutions? What do you think? Thank you!


title: Save checkboxes of a metabox with a foreach loop (invalid argument)

text: I'm new to Wordpress plugin development and I'm trying to create a list of checkboxes (from a WP Query) to associate as custom fields for a specific post type. Nothing wrong with the display function, but when I'm trying to save I get the error > Invalid argument supplied for foreach(). How can I check what the save function sees in my global array `$loop_brands`? Someone can helps me to solve and understand?               <?php          function brands_display_meta_box( $post ) {               global $loop_brands;         $loop_brands = array();              wp_nonce_field( plugin_basename( __FILE__ ), 'brands-nonce-field' );              $args = array(             'post_type' => 'page',             'post_parent' => 7,             'orderby' => 'title',             'order' => 'ASC'         );              $query_brands = new WP_Query($args);              while ($query_brands->have_posts()) : $query_brands->the_post();                   $id_brand = get_the_ID();             $brand = get_post($id_brand, ARRAY_A);             $slug_brand = $brand['post_name'];             $titolo_brand = $brand['post_title'];                  $loop_brands[] = $slug_brand;          ?>                  <p>                 <input type="checkbox" id="<?php echo $slug_brand; ?>" name="<?php echo $slug_brand; ?>" value="yes" <?php checked( get_post_meta($post->ID, $slug_brand, true ), 'yes' ); ?>>                 <label for="<?php echo $slug_brand; ?>"><?php echo $titolo_brand; ?></label>                  </p>          <?php endwhile;          }          function brands_add_meta_box() {              add_meta_box(             'brands-meta-box',             'brands Meta Box',             'brands_display_meta_box',             'stores',             'side',             'high'         );          }          add_action( 'add_meta_boxes', 'brands_add_meta_box' );          function brands_user_can_save( $post_id, $nonce ) {              $is_autosave = wp_is_post_autosave( $post_id );         $is_revision = wp_is_post_revision( $post_id );         $is_valid_nonce = ( isset( $_POST[ $nonce ] ) && wp_verify_nonce( $_POST[ $nonce ], plugin_basename( __FILE__ ) ) );              return ! ( $is_autosave || $is_revision ) && $is_valid_nonce;          }          function brands_save_meta_box( $post_id ) {              global $loop_brands;              foreach ( $loop_brands as $brand ) {                  if ( brands_user_can_save( $post_id, $brand ) ) {                      if ( isset( $_POST[ $brand ] ) ) {                          update_post_meta( $post_id, $brand, $_POST[ $brand ]);                      } else {                          delete_post_meta( $post_id, $brand);                      }                  }              }          }          add_action( 'save_post', 'brands_save_meta_box');


title: WordPress SEO by Yoast: Hide Meta boxes in posts for non-admins

text: I have multi-author website and I am not very comfortable for allowing all members to enter SEO details in the posts they are publishing. I would like this would be visible only to Administrator of the website. Any ideas?


title: How can i add custom field inside custom post taxonomy?

text: I need to add one image uploading field to my custom post type. But it should be inside the taxonomy (product category). How can i add that field?.               <?php     add_action('init', 'wlg_cstm_register');             function wlg_cstm_register() {                $product_labels = array(         'name' => _x('Products', 'post type general name'),         'singular_name' => _x('Product', 'post type singular name'),         'add_new' => _x('Add New', 'Product'),         'add_new_item' => __('Add New Product'),         'edit_item' => __('Edit Product'),         'new_item' => __('New Product'),         'view_item' => __('View Products'),         'search_items' => __('Search Products'),         'not_found' =>  __('No Products found'),         'not_found_in_trash' => __('No Products found in Trash'),          'parent_item_colon' => ''     );              $product_args = array(                'labels' => $product_labels,                'public' => true,                'show_ui' => true,                'capability_type' => 'post',                'hierarchical' => false,                'rewrite' => true,              'supports' => array('title', 'editor', 'thumbnail'),             'taxonomies' => array( '' ),             'menu_icon' => get_bloginfo('template_directory') . '/resources/img/Products-icon.png',  // Icon Path             'has_archive' => false                    );               register_post_type( 'products' , $product_args );           register_taxonomy( 'item', 'products', array( 'hierarchical' => true, 'label' => __('Product Category'), 'query_var' => 'item' ) );      }


title: Declaring arguments for taxonomy

text: Just a bugbear about declaring taxonomies, reading Justin Tadlocks article about Taxonomies and want to find what does the 0 mean in this snippet from the above article:               add_action( 'init', 'create_pc_db_taxonomies', 0 );      In the codex article on taxonomies they've omitted it but I see it used just about on every tutorial published so far. Lastly is there a benefit to calling the above function before the actual function?


title: If metabox has content display content

text: I know how to display field content if the field has content.               $monday = get_post_meta($post->ID, '_cmb_open_monday', true);     if ( ! empty ( $monday ) ) {         echo 'content';     }      How do I display the content if one of the fields from the metabox "store_openingtimes" has content? Maby this explains better what i want to do:               $storeopen = Get all meta from metabox id "store_openingtimes"     if ( ! empty ( $storeopen ) ) {         echo 'content';     }


title: Contact Form 7: Redirecting on a condition?

text: I am doing a survey using the plugin "Contact Form 7". I want to insert an acceptance box. ONLY if people check this box and click "submit", they should be redirected to another page, where I am going to ask for their e-Mail- addresses. If they don't check "acceptance" there should be no redirecting. How can I do this? I ready inserted on_sent_ok: "location = "" - BUT: This ignores if the acceptance box is check or not.


title: Inherit plugin settings to new site in Multisite

text: I use the Breadcrumb NavXT plugin for a WP Multisite. I activated the plugin for all sites so I can use it throughout my network. My problem is that every time I add a new site I have to change the default settings of the plugin, but I’d like WP to use the settings I already customized for the main site because on all future sites they would be the same. Is there a way to force WP adopting the plugin settings of the main site?


title: Trying to get property of non-object error using get_post_meta()

text:
I made a simple function for post_meta, in `functions.php`:               // Top Sub Heading (top_sub) FROM CUSTOM FIELD     function topSub( $Trunckvalue = null ) {         global $post;         $TopSub = get_post_meta( $post->ID, 'top_sub', $single=true );         $shortTopSub = trunck_string( $TopSub, $Trunckvalue, true );         if ( !$TopSub == NULL  ) { ?>
<?php echo $shortTopSub; ?>
          <?php }         return $shortTopSub;     }          add_action( 'init', 'topSub' );      And in my theme I'm using it like: `topSub(300);`. Here, `trunck_string()` is another acting function - no need to worry about it. The function is working fine. But with `WP_DEBUG` **true** - it's showing error: > **Notice: Trying to get property of non-object ... line 88** And in line#88 resides:               $TopSub = get_post_meta( $post->ID, 'top_sub', $single=true );      I used this many times, but this time, I'm getting error. What's wrong with my code? For your kind information: `top_sub` is an optional custom field. There can be many _blank_ custom fields on `top_sub` and there can be many _filled_.


title: JQuery Issues With Wordpress Theme Interface

text: I'm having a back-end script issue with a recently installed theme. I took it up with the theme developer, but they are of no help (that's another story for another time). I apologize if this is outside the scope of this site, but I'm at a loss for help. Basically, I had a fully functional WP site running 3.4.2. I decided to add a new theme (MikMag by ThemeDutch) and it actually works fine on the front end. The problem I'm having is in the theme's UI, trying to create sliders. I have the theme installed on another site and it works fine. However, on this install it's throwing script errors when I try to use the slider interface. I have disabled all plugins with no change. I'm comfortable with CSS, HTML, and even minor PHP, but this stuff is beyond me. Since the site is live I don't want to start messing around with anything without knowing what I'm doing! Below is a link to a screen cap showing the errors. All of the called upon scripts appear to be exactly where they need to be when I look at the site via FTP. Here is the working version: http://www.unitytactical.com/screen2.jpg And the broken version: http://www.unitytactical.com/screen.jpg As you can see a whole section is missing, and clicking the "Add Slide" link does nothing. Hopefully this is something simple and stupid. Regardless, I truly appreciate any help. Thanks!


title: Insert code on specific taxonomy archives

text: On a woocommerce site, I am trying to insert a piece of code on all category pages. The code I am using is:               function my_code() {         if ( ! is_tax('product_cat') ) return;         ?>         <!-- my code goes here-->         <?php     }      Why does this not work?


title: Create a "feed" from one WordPress site to another?

text: I know there a way to use XML-RPC to transfer past posts from one WordPress site to another, but I am wondering if there is a way to create a constantly updating feed of posts of a certain type. That way when a post is added to one site it is simultaneously added to the other (one site being the feeder and the other only being able to display the posts). any help would be appreciated!


title: How to add Default Post Type "Custom" category to custom post type

text: Hi I have three custom post types 1- student 2 - teacher 3 - academy All three types share should have three categories 1 - subjects 2 - area 3 - qualification level First I thought I should add all three categories for each post type but I decided to add three categories to default post type and than add these categories to each individual custom post type. Here is a problem I have successfully added all these categories. When I query categories for custom post type It does show up but when I see number of posts attached to these categories It shows null means these categories are not linked properly with custom post type even though they are added. Is there anyway to add these categories to all three custom post types or shell I switch to adding all three custom categories for each individual custom post?


title: Login problem after installing my written plugin

text: I have create a simple widget plugin, it's so simple and it make no changes in cookie setting, also it work great in my local site , but in the host i have a problem after activate this plugin and try to login the WordPress again, it says: > ERROR: Cookies are blocked or not supported by your browser. or a whitepage show after logging in, and dashboard do not appear. after deactivating the plugin every thing will work correctly! what is the problem? is there any thing that i must add to my plugin for setting an special cookie?


title: get a specific taxonomy term name

text: I need to print a specific term with its id. I get that for categories with this code:               <a href="<?php echo get_category_link(1); ?>" title="<?php echo get_cat_name(1);?>"><?php echo get_cat_name(1);?>      … where 1 is the id I have to print. Is there something like the following?               <?php echo get_term_link(1); ?>      or               <?php echo get_term_name(1); ?>


title: Visiting Webpage ONLY after another page was visited. Possible?

text: I am looking for a way to solve the following problem: User should only be able to visit mywebsite.com/page2 after they visited mywebsite.com/page1. If a user was not on page1, he or she should not be able to visit page2. Is this possible? Further specification: On page1 should be a survey (plugin: "Contact Form 7") and people are redirected to page2 after submitting their answers.


title: Can Wordpress used as a CMS?

text: I saw many people use WordPress as a CMS, is that common? but the problem I noticed is that the download in such sites is slow, is WordPress slow?


title: Pagination not working on Custom Page Template

text:
I searched a lot on this but I can't figure out why my code is not working. I published a page with slug "blog" that uses a custom built template "page- blog.php" that I build from editing the original "page.php". I want to loop latest posts, with pagination. For numbered pagination I tried several plugins. They all works on archive and category pages, but on page-blog.php I always get the same result. Any page I try to view gives me a 404 error. Only the loop on first page is working. URLS are like this: > www.mywebsite.com/blog/ (page url, with first page loop, ok) > > www.mywebsite.com/blog/page/2/ (404 error) > > www.mywebsite.com/blog/page/3/ (404 error) This is My page-blog.php full code.                   <?php get_header(); ?>
                                   <?php while ( have_posts() ) : the_post(); // page loop ?>                      <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                                              <?php the_title( '
', '
' ); ?>                         <?php edit_post_link( __( 'Edit', 'mywebsite' ), '', '' ); ?>
                         <?php the_content(); ?>

                      <?php endwhile; // end of the page loop. ?>                 <?php wp_reset_postdata(); ?>                      <?php                  // Begin secondary loop (pagination not working)                 $paged = ( get_query_var('page') ) ? get_query_var('page') : 1;                      $args = array (                     'post_type'              => 'post',                     'post_status'            => 'publish',                     'paged' => $paged,                 );                      // The Query                 $news_query = new WP_Query( $args );                      // Preserving main query                 $temp_query = $wp_query;                 $wp_query   = NULL;                 $wp_query   = $news_query;                      ?>                 <?php if ( $news_query->have_posts() ) : ?>                     <?php while ( $news_query->have_posts() ) : $news_query->the_post(); ?>                         <?php get_template_part( 'content', get_post_format() );?>                     <?php endwhile; ?>                          <?php  if(function_exists('wp_paginate')) {                         wp_paginate();                     } ?>                          <?php wp_reset_postdata(); ?>                      <?php else : ?>                          <?php get_template_part( 'content', 'none' ); ?>                      <?php endif; ?>                 <?php                  // Reset main query object                 $wp_query = NULL;                 $wp_query = $temp_query;                     ?>
          <?php get_sidebar('blog'); ?>     <?php get_footer(); ?>


title: $wpdb doesn't like to store arrays

text: I'm attempting to store an array that looks like the one below, into a cell in a database using the code below the sample array. Unfortunately, WordPress doesn't seem to want to save it, and continually throws a database error (like the one on the bottom). Changing the order of the data in the array changes the location of the error, which is not tied to any particular character. Sample Array (the actual array is a bit different):               $data = array();     $data['twitter'] => array( 'key1' => '64 digit long string', 'key2' => '63 digits');     $data['facebook'] => array( 'key1' => '64 digit long string', 'key2' => '63 digits');      It should be noted the column this is being inserted to is set to varchar 1000 (thus not an issue of the data being too long) Sample Insertion code:               $serialized_data = maybe_serialize($data);     $fire = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET oauth = %s WHERE email = %s",  $serialized_data, $email ) );      Sample Error: (note the real payload has been swapped out for security reasons, but the demo data is anatomically correct. Same format, same type of characters. Just randomized)               WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''wp_custom_4' WHERE email = 'chriscct7@gmail.com' SET tasks = 'a:1:{s:7:\"twitte' at line 1]     UPDATE 'wp_custom_4' WHERE email = 'sample@gmail.com' SET tasks = 'a:1:{s:7:\"twitter\";a:4:{s:11:\"oauth_token\";s:50:\"128310837-uY4xWwegwegmwIUBxWWf7gilcqQWRGWRGWzeV3tU26N\";s:18:\"oauth_token_secret\";s:45:\"MPfJMJULgjD8JwoyAsZUEHRWRGPXMrqMgzBOyvVFPtm5s\";s:7:\"user_id\";s:9:\"1282424237\";s:11:\"screen_name\";s:9:\"sampleuser\";}}'      This also isn't a consequence of the serialization method employed. I've attempted using serialize(), json_encode(), and also not serializing it at all


title: media_handle_sideload on a file already on server

text: I want to attach a file already on server but outside the wp uploads directory to a post, so I tried the `media_handle_sideload` and used the `download_url()` on the file's URL I'm trying to attach, however for some reason, the `download_url` cannot access my server, is there a work around that I can do so instead of giving `media_handle_sideload` a $_FILES array I can give it the file absolute path? Or can I move a file already on server to the temp folder?


title: How to show number of unpublished articles?

text:
I recently started an article directory using wordpress, and theme by dimox and plugin and plugin by artilcesss dot com. On homepage it shows number registered authors and and published posts. It is using %2$s for registered authors and %1$s for number of published articles in main index template. I have so many unpublished articles too, so my question is that is there any way to show the number of unpublished articles (only counts) on the homepage? Update: thanks for the answers, it is useful for users like me, I am not expert in this, here is the code.
<?php global $numposts, $users; printf(__('We have %2$s registered authors and %1$s published articles till the date.', 'article-directory'), $numposts, $users); ?>
      And this will show the output: We have 24 registered authors and 43 published articles till the date. (24 and 43 numbers are current statistics)


title: problem with quotes on new post

text: i have a little form to post:               $post_content = '"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."';          $post = array( 'post_author' => 1,                    'post_title' => 'title',                    'post_content' => $post_content,                    'post_category' => $categories,                    'post_type' => 'post'                  );      but, once my post is published shows :               &;Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…&;      please note the `&;` I've tried to escape before like this:               \"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...\"      but still the same. Any ideas?


title: Multiple Author with link and image

text: I have a blog with multiple authors. Each author has an image inside the "/ wp-content/themes/mytheme/img/authornamecomeshere.png" directory, and each image has the author's name. I would like to put a link from these sites reviewers along with the image, and each image automatically appear under the name. The code I'm using is this:               <?php _e('Posted by'); ?>           <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author">                    <?php the_author_meta('display_name'); ?>                I'd like to do something like this:               Posted by:      if author1:           Posted by:      if author2:       I'd like do this without plugin. Could anyone help me?


title: Detect CURLOPT_SSL_VERIFYPEER programatically?

text: I have setup a somewhat intricate MailChimp plugin using their latest PHP class wrapper. One of the settings towards the top of the class wrapper is : ` /** * CURLOPT_SSL_VERIFYPEER setting * @var bool */ public $ssl_verifypeer = true; ` Some of the users of our plugin have to manually change this setting to 'false' to get the plugin to function correctly, and I'm not sure why or what this setting is doing. What server setting would force a user to need to set this to false? I'm looking for two things here: 1) What exactly is this setting doing? Why are some users required to set it to true and others false? 2) Is there a way to programatically detect which setting should be used, based on the users server settings? I had set up a way to detect if cURL was enabled at the server level, and am looking to do something similar here. Thanks!


title: New users must comment when requesting username

text: Does any one know of a Plug in that will help with reducing the number of unknown user requests to my site? current when a new user requests access I can only see an email address and username. Is it possible to ask the user to also make a short comment, to make it easier to see what is spam and what is valid? Regards aaron


title: How to edit the get_price_html on woocommerce

text: I am trying to edit the price value for a single product. In single- product/price.php there is a template call to $product->get_price_html. How can I edit that function/method to change the way the HTML is presented. At the moment even if I delete all the contents of the function located in `class-wc-product` it still miraculously displays? Anyone know why?


title: Is it possible to create an action hook using do_action() within add_action()?

text: Is it possible to create a new action hook like `do_action('my-hook-name');` inside a call to `add_action();`? I'm aware this code doesn't work, but I was thinking something along the lines of... `add_action('init', do_action('my-hook-name'));` or Is the only way to actually add a callback function to `init`, then inside my callback function create my hook?               add_action('init', 'my_callback');     function my_callback(){         do_action('my-hook-name');     }


title: Custom Post Types on Custom Categories

text: Can some one let me know how I can create custom Category and Post type including the items in side the red box (Please take a look at following image link) and add them to WordPress dashboard? There is an image a this link, sorry I wasn't allowed to attach image on the post Thanks


title: WP List Table custom quick edit box - post meta data missing and columns change on submit

text: I have extended class WP_List_Table to create a custom sortable table of posts along with a quick edit box with custom meta boxes. The meta boxes populate and save but when I click submit the field values disappear and the defaults ( cb, title, tags, cats, etc) which are not even included in my class get added back to the column saved. This throws off the other columns on the page. The saved custom field values return when the page is refreshed. It seams like on submit the $post_object is missing. I'm using a hacked get_inline_data function that includes the meta_values in my quick edit form instead of calling get_inline_data in my class. My save function for the meta boxes:               add_action( 'save_post', 'save_inline_edit_meta' );     function save_inline_edit_meta( $post_id  ) {         global $pagenow;              if ( $pagenow == 'admin.php' ) {          if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'standinghead' ] ) )             update_post_meta( $post_id, '_wnd_standing_head', $_POST[ 'standinghead' ] );              if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'headline' ] ) )             update_post_meta( $post_id, '_wnd_alt_title', $_POST[ 'headline' ] );              if ( isset( $_POST[ 'is_quickedit' ] )  && isset( $_POST[ 'deck' ] ) )             update_post_meta( $post_id, '_wnd_deck', $_POST[ 'deck' ] );         }       return $post_id;          }      My Javascript save function:               save : function(id) {             var params, fields, page = $('.post_status_page').val() || '';                  if ( typeof(id) == 'object' )                 id = this.getId(id);             $('table.widefat .inline-edit-save .waiting').show();             params = {                 action: 'inline-save',                 post_ID: id,                 post_type: 'post',                 edit_date: 'true',                 post_status: page             };             fields = $('#edit-'+id+' :input').serialize();             params = fields + '&' + $.param(params);                  $.post('admin-ajax.php', params,                 function(r) {                     $('table.widefat .inline-edit-save .waiting').hide();                          if (r) {                         if ( -1 != r.indexOf('<tr') ) {                             $(inlineEditPost.what+id).remove();                             $('#edit-'+id).before(r).remove();                             $(inlineEditPost.what+id).hide().fadeIn();                         } else {                             r = r.replace( /<.[^<>]*?>/g, '' );                             $('#edit-'+id+' .inline-edit-save .error').html(r).show();                         }                     } else {                         $('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();                     }                 }             , 'html');             return false;         },      ![enter image description here](http://i.stack.imgur.com/tQziA.jpg)


title: Insert wp gallery shortcode into custom textarea

text: Is there a way to insert wp gallery shortcode into custom metabox textarea ? I would like to have something like this: New metabox in post/page with textarea and below textarea there are a button to open wp browse media gallery lightbox. then when we have done to select few images as gallery, click the "insert gallery" button will insert the shortcode to the textarea custom field. is it possible ? Thanks **====== Update: ======** I was able to show media library, now I don't have idea how to insert shortcode to the custom textarea when click button "insert gallery" Here my code so far: HTML               <div class="uploader">      <textarea name="settings[_cs_shortcode_gallery]" id="_cs_shortcode_gallery"></textarea>      <input class="button tf-browse-btn" name="_cs_shortcode_gallery_button" id="_cs_shortcode_gallery_button" value="Browse Gallery"/>     </div>      JS               var _custom_media = true,           _orig_send_attachment = wp.media.editor.send.attachment;       $('.tf-browse-btn').live('click', function(e) {         var send_attachment_bkp = wp.media.editor.send.attachment;         var button = $(this);         var id = button.attr('id').replace('_button', '');         _custom_media = true;         wp.media.editor.send.attachment = function(props, attachment){           if ( _custom_media ) {             $("#"+id).val(attachment.url);           } else {             return _orig_send_attachment.apply( this, [props, attachment] );           };         }         wp.media.editor.open(button);         return false;       });       $('.add_media').on('click', function(){         _custom_media = false;       });      What I want to achieve now are:   * How to set Create Gallery Tab as default tab when open the modal   * Insert gallery shortcode to the custom textarea Please see the screenshot below for details http://i.stack.imgur.com/m1l2e.png http://i.stack.imgur.com/y9Fi5.png


title: Get register wp_customize settings in the front end

text: The `customize_register` is hooked to `wp_loaded` which runs on the front end too, but when in the frontend I access the global wp_customize variable, it's empty. I'm wondering, does WordPress removes the registered settings and section when the site is viewed? Is there a way to access the registered options in the body_class hook for example?


title: Symbolic Links on dev box with plugins and stylesheets

text: I'm using mac os x 10.6 with xampp. `http://wp3.1/` is the url to where I have WordPress installed. The physical path is `/Users/myUserName/Sites/wp3.1/` I do not install plugins or themes in the "natural" way. I have created a directory named "git" which is located in `/Users/myUserName/git/`. This is where all my git repositories live. When I want to install a plugin, I just create a symbolic link in `/Users/myUserName/Sites/wp3.1/wp-content/plugins/`. This works great for simple plugins, but if the plugin enqueue's a style sheet or script, the url displays as: `http://wp3.1/wp-content/plugins/Users/myUserName/git/options-framework- plugin/css/colorpicker.css?ver=3.1.1` How do I fix this?


title: Something is generating spam pages on my site

text: The site is Videos-de-musica.com it is a simple wordpress blog with music videos. Somehow the subdomain stats.videos-de-musica.com filled up with spam, I remember setting the domain for pwiki stats, but then uninstalled it and I don't remember what happened to it. This is an example spam page stats.videos-de-musica.com/aal-0exe.htm When you search PRINTABLE SUPERMAN EMBLEM BATMAN on Google that is the first result, and when you access it you are redirected to a "Google has found malicious software may be installed onto your computer if you proceed" scam site. I have tried disabling all the plugins with no change. Does anybody know what happened and how to remove this? I am downloading all the site directory to search for any clues. Thanks.


title: Show css depending on activity type in BuddyPress activity-loop

text: I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type? This is what I had an idea of:               function mycustom_act_type() {     if ('friendship_created' != bp_get_activity_type() )     echo ' style="background:red;" ';     }      and this is in the `<li>` whithin the loop:               <li <?php mycustom_act_type()?> >blah </li>      but obviously doesn't work. Any ideas?


title: How can I make some themes usable only by admins?

text: I want to restrict certain themes so they can only be usable by the an admin. If I network a theme then everyone has access to it. How can I do this?


title: Add Search Form to Dropdown menu

text: I am wondering if its possible to have a search form within a dropdown menu. I can add it to the main menu (base) but not quite sure how to actually go about adding it to a sub-menu of one of the main menu items. Has anyone encountered this issue before and is there a fix I can use ? Hopefully something linked to Wordpress it self (even a plugin if one exists).


title: w3 total cache and post__not_in

text:
I'm using a modified version of the Recent Posts plugin together with WP Total Cache. I'm using post__not_in as I don't want to display the current post again. It works well, but if Object Cache is activated, on some posts post__not_in does not work. Here is my code:               <?php function nothing_recent_posts_init() {                     register_widget('nothing_recent_posts');                 }                 add_action('widgets_init', 'nothing_recent_posts_init');                           class nothing_recent_posts extends WP_Widget {                          function __construct() {                         $widget_ops = array('classname' => 'nothing_recent_posts', 'description' => __( "Customized version of Recent Posts. You can choose what to display and add custom classes.") );                         parent::__construct('nothing-recent-posts', __('Customized Recent Posts'), $widget_ops);                         $this->alt_option_name = 'nothing_recent_entries';                              add_action( 'save_post', array($this, 'flush_widget_cache') );                         add_action( 'deleted_post', array($this, 'flush_widget_cache') );                         add_action( 'switch_theme', array($this, 'flush_widget_cache') );                     }                          function widget($args, $instance) {                         $cache = wp_cache_get('nothing_recent_posts', 'widget');                              if ( !is_array($cache) )                             $cache = array();                              if ( ! isset( $args['widget_id'] ) )                             $args['widget_id'] = $this->id;                              if ( isset( $cache[ $args['widget_id'] ] ) ) {                             echo $cache[ $args['widget_id'] ];                             return;                         }                              ob_start();                         extract($args);                              $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' );                         $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );                         $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10;                         if ( ! $number )                             $number = 10;                         $show_title = isset( $instance['show_title'] ) ? $instance['show_title'] : false;                         $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;                         $show_img = isset( $instance['show_img'] ) ? $instance['show_img'] : false;                         $custom_class = ( ! empty( $instance['custom_class'] ) ) ? $instance['custom_class'] : ' ';                         $query_by_cat = isset( $instance['query_by_cat'] ) ? $instance['query_by_cat'] : false;                              if( $query_by_cat ){                             $current_category = wp_get_post_categories( get_the_id() );                             $r = new WP_Query( apply_filters( 'widget_posts_args', array(                                 'category__in' => $current_category,                                 'posts_per_page' => $number,                                 'no_found_rows' => true,                                 'post_status' => 'publish',                                 'ignore_sticky_posts' => true,                                 'post__not_in' => array(get_the_id())                             ) ) );                         }else{                             $r = new WP_Query( apply_filters( 'widget_posts_args', array(                                 'posts_per_page' => $number,                                 'no_found_rows' => true,                                 'post_status' => 'publish',                                 'ignore_sticky_posts' => true,                                 'post__not_in' => array(get_the_id())                             ) ) );                         }                         if ($r->have_posts()) : ?>                         <?php echo $before_widget; ?>                         <?php if ( $title ) echo $before_title . $title . $after_title; ?>                              <?php while ( $r->have_posts() ) : $r->the_post(); ?>                              <article class="hentry <?php echo $custom_class; ?>">                             <a href="<?php the_permalink(); ?>" rel="bookmark" title='Den Beitrag "<?php the_title(); ?>" ansehen'>                                      <?php if ( $show_img ) : ?>
                                     <?php the_post_thumbnail( 'thumbnail' ); ?>
                                 <?php endif; ?>                                      <?php if ( $show_title ) : ?>

<?php the_title(); ?>

                                                                  <?php endif; ?>                                      <?php if ( $show_date ) : ?>                                     <?php echo get_the_date(); ?>                                 <?php endif; ?>
                         <?php endwhile; ?>                              <?php echo $after_widget; ?>                         <?php wp_reset_postdata();                              endif;                              $cache[$args['widget_id']] = ob_get_flush();                         wp_cache_set('nothing_recent_posts', $cache, 'widget');                     }                          function update( $new_instance, $old_instance ) {                         $instance = $old_instance;                         $instance['title'] = strip_tags($new_instance['title']);                         $instance['number'] = (int) $new_instance['number'];                         $instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;                         $instance['show_title'] = isset( $new_instance['show_title'] ) ? (bool) $new_instance['show_title'] : false;                         $instance['show_img'] = isset( $new_instance['show_img'] ) ? (bool) $new_instance['show_img'] : false;                         $instance['custom_class'] = strip_tags($new_instance['custom_class']);                         $instance['query_by_cat'] = isset( $new_instance['query_by_cat'] ) ? (bool) $new_instance['query_by_cat'] : false;                         $this->flush_widget_cache();                              $alloptions = wp_cache_get( 'alloptions', 'options' );                         if ( isset($alloptions['nothing_recent_entries']) )                             delete_option('nothing_recent_entries');                              return $instance;                     }                          function flush_widget_cache() {                         wp_cache_delete('nothing_recent_posts', 'widget');                     }                          function form( $instance ) {                         $title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';                         $number    = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;                         $show_title = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : true;                         $show_date = isset( $instance['show_date'] ) ? (bool) $instance['show_date'] : false;                         $show_img = isset( $instance['show_img'] ) ? (bool) $instance['show_img'] : false;                         $custom_class     = isset( $instance['custom_class'] ) ? esc_attr( $instance['custom_class'] ) : '';                         $query_by_cat = isset( $instance['query_by_cat'] ) ? (bool) $instance['query_by_cat'] : false;                 ?>
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?>                         <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" />

<label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show:' ); ?>                         <input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" />

<input class="checkbox" type="checkbox" <?php checked( $show_title ); ?> id="<?php echo $this->get_field_id( 'show_title' ); ?>" name="<?php echo $this->get_field_name( 'show_title' ); ?>" />                         <label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Display post title?' ); ?>

<input class="checkbox" type="checkbox" <?php checked( $show_date ); ?> id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" />                         <label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Display post date?' ); ?>

<input class="checkbox" type="checkbox" <?php checked( $show_img ); ?> id="<?php echo $this->get_field_id( 'show_img' ); ?>" name="<?php echo $this->get_field_name( 'show_img' ); ?>" />                         <label for="<?php echo $this->get_field_id( 'show_img' ); ?>"><?php _e( 'Display post image?' ); ?>

<label for="<?php echo $this->get_field_id( 'custom_class' ); ?>"><?php _e( 'Custom class:' ); ?>                         <input class="widefat" id="<?php echo $this->get_field_id( 'custom_class' ); ?>" name="<?php echo $this->get_field_name( 'custom_class' ); ?>" type="text" value="<?php echo $custom_class; ?>" />

<input class="checkbox" type="checkbox" <?php checked( $query_by_cat ); ?> id="<?php echo $this->get_field_id( 'query_by_cat' ); ?>" name="<?php echo $this->get_field_name( 'query_by_cat' ); ?>" />                         <label for="<?php echo $this->get_field_id( 'query_by_cat' ); ?>"><?php _e( 'Filter by current category?' ); ?>
                      <?php                     }                 }


title: How can I limit posts when using template_redirect?

text: I'm trying to redirect a query (http://example.com/custom-post- type/?action=create) to a template file (page.php) while also replacing the_content. I've more or less gotten it to work. But the end result show duplicate content on a page, so I guess it's being treated as archive page. I tried using a pre_hook to limit the query to 1 result, but that didn't work. Any suggestions? Here's my code.... http://pastebin.com/1SwaKKxW


title: Is there any way to set default for "Insert/Edit Link" to "Open link in new window"?

text: I almost always select "Open link in new window" when creating an URL/HREF. Is there any way to default this choice. Even if it requires a small source code change, I think it would be worthwhile (if someone can tell me where that might be.)


title: WP script versioning breaks cross-site caching?

text: I am loading JQuery from the google CDN using the following code:               wp_deregister_script('jquery');       wp_register_script(         'jquery', // handle - WP uses this name to refer to script         'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js',          array(), // Array of handles representing scripts that this one depends on.          false, // Version number - defaults to false.          false // false = put script in header, true = put in footer      );     wp_enqueue_script('jquery');      In firebug I see that wordpress appends '?ver=3.0.4' to the URL to control caching. In fact there doesn't seem to be any way to stop WP from appending **something** to the URL - I can provide my own string in the call to wp_register_script() but WP will use the default 'ver=3.0.4' if i leave it blank (or "false") I believe the appended version string stop the user's browser from re-using a cached copy of the file that it might have downloaded from a **different** website. E.g.   1. User visits www.example.com which loads ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js so it is now in browser cache.   2. User then visits my site which loads ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js?ver=3.0.4   3. The user's browser not use it's cached copy because the URLs are different. Since cross-site caching is one of the main reasons I want to use Google's CDN, are there any solutions to this other than loading the script manually (not ideal) or hacking WP core? TIA /Eoin/


title: wp_schedule_event() set daily, but processed every second

text: Reading wp_schedule_event() documentation got me code something like this:               add_action('cr_paid_link_manager_generate_expiring_link_email_action','cr_paid_link_manager_generate_expiring_link_email');     wp_schedule_event(time(), 'daily', 'cr_paid_link_manager_generate_expiring_link_email_action');      The problem is, `cr_paid_link_manager_generate_expiring_link_email()` is generated everytime page load, or so it look's like. This code supposed to send email only once a day. I try to set first parameter of `wp_schedule_event()` to `$timestamp_start`:               $timestamp_start = '2011-01-26 00:00:00';     add_action('cr_paid_link_manager_generate_expiring_link_email_action','cr_paid_link_manager_generate_expiring_link_email');     wp_schedule_event($timestamp_start, 'daily', 'cr_paid_link_manager_generate_expiring_link_email_action');      Still no result. The code keep sending email Every minute. Is there something missing on my code?


title: Wordpress.com post editor replacement

text: I love Wordpress, and I keep a blog on a domain hosted at wordpress.com. However, it's so damn slow! (Blogger wasn't much better.) Are there any full- featured substitutes available? I use several computers, depending on where I am and what I'm doing: An older mac, a windows netbook, and a ChromeOS laptop, so the best solutions for me will be web-based, but I won't rule out desktop apps. Aside from the slowness, I can't stand the little tiny window in the posyst editor (there's a fullscreen view, but not in code view), and as I tend to edit the HTML directly, syntax highlighting would be extremely helpful.


title: After server migration only the homepage works

text: I have recently changed hosting of my WordPress site to VPS.net. I have moved all of my files and imported the database. Everything appeared to be fine until I clicked a link and noticed that all of my pages are bringing back a 404 except the homepage. Site URL is http://inksquared.com


title: wp_list_categories pagination

text: I was wondering if I can paginate wp_list_categories? I had a go with paginate_links but no luck. Or is there a good workaround? Thank you!!               <?php   $orderby = 'name';         $show_count = 0;         $pad_counts = 0;         $hierarchical = 1;         $taxonomy = 'categories';         $title = '';         $exclude = '16';              $args = array(         'orderby' => $orderby,         'show_count' => $show_count,         'pad_counts' => $pad_counts,         'hierarchical' => $hierarchical,         'taxonomy' => $taxonomy,         'title_li' => $title,         'exclude' => $exclude,         'hide_empty' => 0         );         ?>         <ul class="resourcelist">         <?php wp_list_categories($args); ?>         </ul>


title: Get top items number from wordpress menu

text: I've made a menu in Wordpress backend with 3 levels depth. (4 main tabs with 2 sub level items) I would like to know how I can get the number of tabs created automaticly and add this number to a class on the ul (i.e: .item-4) Any ideas? I'm already using a custom Walker. Thanks


title: Passing a variable via wp_head and then calling it on the page

text: As my question suggests I'm having difficulty creating a variable in the header, via functions.php and wp_head, and then calling that variable further down the page. For example, in functions.php               add_action( 'wp_footer', 'add_ran_var' );          function add_ran_var () {            $random_variable = "1";          }       And before the               </head>       tag include               <?php wp_head(); ?>      in header.php The problem arises if i try to call $random_variable later on in the page. It returns nothing.               <?php echo $random_variable; ?>      Could anyone please shed some light as to why this does not work? Has it something to do with the order the different files (header.php, functions.php) are called? Thanks in advance to anyone who can offer me some advice on the above. Cheers Noel


title: Is it possible to integrate Wordpress *posts* and social media (Facebook, Google+, Twitter)?

text: Is there a plugin available that will automatically post an excerpt of a blog post (perhaps up to the more tag) to specified social media groups/pages. So, for example, on posting an excerpt would be posted with a 'Read more' link to a user-defined Facebook group, G+ page and, possibly, twitter feed? If not, is there a method for automating this process? Or is copy>paste the only realistic option? (I know that Dsiqus provides the ability to link comments and social media but this functionality doesn't extend to posts, as I understand it.)


title: Managing database tables in WordPress multisite

text: I'm working on plugin that creates and stores some data in database table (using global $wpdb->base_prefix). In WordPress multisite I want sub-website owners to have access only to data that they've created. What is the best way to handle this? Should I create new table for each sub-website, or add "blog_id" column to table and check it every time? Thanks for help.


title: How to translate "ERROR: Invalid username. Lost your password?"

text: I want to translate the above message which appears on invalid username. I know the answer is very similar to the one proposed here by I cannot find the exact handler. Thank you.


title: Does anyone have a plugin that could automatically tag custom post types in wordpress?

text: I was looking at http://wordpress.org/extend/plugins/web-ninja-auto-tagging- system/ and unfortunately, it wont work on custom post types. Can anyone suggest (with what changes are needed) to have this work for custom post types?


title: Allow non-logged in users to see a future post after clicking on a list of future posts

text: I have been able to list out pages that are set for future in a custom template like this:               query_posts('post_type=page&post_status=future&posts_per_page=100&order=asc&orderby=date&meta_key=_wp_page_template&meta_value=show.php');      However, when I try to then click on one of the pages listed there I get a 404 (as a non-logged-in user). How do I alter a thematic page.php template to show a future page? We are already using a bunch of things in function.php and have a special page template for this particular type of post... I tried adding the following to the functions.php with `add_filter`, but it didn't help:               function show_future_where($where) {         return $where . ' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'future\')';     }      BTW, I saw a post about automatically setting a post with a future date would be overridden with 'published' state, but couldn't get that to work. If I can edit the page template is there something else I can do? I am using 3.3, if that helps. Thanks.


title: How to override existing plugin action with new action

text: I'm using a plugin. It has an action like this.               add_action('publish_post', 'old_action');     function old_action($pid) {         "code goes here"         }     }      I'm writing a module for this plugin. So i need to override that old action function with my new action function. This is my new function.               function new_action($pid) {           "code goes here"             }         }      I want to replace that old_action function with my new_action function using hooks. Can anyone help me? Thanks


title: Finding the index page using the admin panel of wordpress

text: I am helping out a non profit and they wanted some help in modifying the home page of their site .I looked around the admin area but I couldnt not find the index page anywhere so that I could make the changes. Where should I be looking and if I cant find it from the admin page ,what other ways can I go about finding it.


title: Column sorting with emtpy meta values

text: I am trying to sort my custom post type columns in the admin area. There's two ways I found to do this: At first this was my way to do it, however I got some strange behaviours. If a meta value is not set, the filter will remove the post from the list, rather than sorting it.               add_filter('request', array($this, 'sort_columns') );     public function sort_columns( $vars ) {          if ( isset( $vars['orderby'] ) && 'startdate' == $vars['orderby'] ) {             $vars = array_merge( $vars, array(                 'meta_key' => '_start_event_datetime',                 'orderby' => 'meta_value_num'             ) );         }     }      Hoping to solve this strange behaviour I came across another way to do it, but I got the same behaviour.               add_action('pre_get_posts', array($this, 'sort_columns') );     public function sort_columns( $query ) {          $orderby = $query->get( 'orderby');                if( 'startdate' == $orderby ) {               $query->set('meta_key' , '_start_event_datetime');               $query->set('orderby' , 'meta_value_num');           }       }      How do I get my posts that have no meta value set to be sorted instead of removed?


title: WordPress permalinks  Yahoo hosting(no .htaccess allowed)

text: I have moved a Wordpress install to a client from sub folder to the root folder. Right now, everything works fine, except for the friendly URLs. I currently have to set the Permalink feature in "Common settings" to "Default", which means URLs with ?p=434... At least they work. Otherewise I get a very short 404 not found error message on a white screen. I was following this tutorial, but I found I cannot write an .htaccess to my Yahoo host account and so I could not follow one of the last steps... I wonder if the 404 not found errors have to do with this problem I have had uploading the .htaccess file... I currently do not have any .htaccess file up there... So maybe MOD_REWRITE is disabled... I have just ran phpinfo() and did not find any entry on mod_rewrite. Before moving the website, when it was still on a subfolder, the friendly URLs used to work, but now they don't. Has anyone came accross this experience and has successfully restablished the permalinks feature? Any help is appreciated. Thank you.


title: admin_notices on runtime in function

text:
I have a function that is called at a post updated, inside of this function I am doing something and if this went wrong I want to display an `admin_notices`. **Inside** of my **function** I tried the following:               if($error) {         add_action( 'admin_notices', 'my_admin_notice' );     }      `my_admin_notice` looks like:               function my_admin_notice() {         ?>

Error happend

         <?php     }      If I call `add_action( 'admin_notices', 'my_admin_notice' );` outside of my function it's working, but unfortunately the notice is display always... :/ **Update - Context details:** My function is called with `add_filter ( 'publish_post', 'my_function' );` Inside of this function I check if the post is published the first time, than I am doing some stuff and if there is something wrong I want to call the `add_action( 'admin_notices', 'my_admin_notice' );` to display an error message... My function is working well and is only getting called if I want, so that's not the problem... What I think is that the `add_action( 'admin_notices', 'my_admin_notice' );` that I call inside of my function is getting ignored! **Update Code for Context:**               function my_admin_notice() {         ?>

Error happend

         <?php     }          function checkEdit()  {              if( ($_POST['post_type'] == 'post') && ( $_POST['post_status'] == 'publish' ) &&          ( $_POST['original_post_status'] != 'publish' ) ) {              $title =  get_the_title();              $postId = (string) get_the_ID();              $postUrl = get_site_url() . "?p=" . $postId;         $wp_category_array = get_the_category();                    $categoryArray = array();         foreach ($wp_category_array as $wp_category => $value) {             $categoryArray[] = $value->cat_ID;         }              $postDate = get_the_date('Y-m-j H:i:s');         $subTitle = get_the_date();              $parse = new parseRestClient(array(             'appid' => 'XXXXXXXXXXXXXXXXXXXXXXX',             'restkey' => 'XXXXXXXXXXXXXXXXXXXX'         ));              $params = array(             'className' => 'News',             'object' => array(                 'Title' => $title,                 'SubTitle' => $subTitle,                 'array' => $categoryArray,                 'code' => $postId,                 'Date' => $postDate,                 'Url' => $postUrl             )         );              $request = $parse->create($params);              $responseArray = json_decode($request, true);              $objectId = $responseArray['objectId'];              if ($responseArray ['error'] == true) {             // Called if error (working)             add_action( 'admin_notices', 'my_admin_notice' );         }else {             $sql = "UPDATE wp_posts SET parseId = '$objectId' WHERE ID = '$postId'";              $result = mysql_query($sql);         }              }     }          add_action ( 'post_updated', 'checkEdit');


title: Can't get the_content of the parent page from its single post?

text:
This is a page that list posts witht he category `Content (CDs)`:

             <?php // Run main loop (The Loop). ?>             <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                 <?php the_content(); // <- I want to get this ?>
             <?php endwhile; ?>

                 <?php $custom_posts = new WP_Query(); ?>                 <?php $custom_posts->query('category_name=Content (CDs)'); ?>                 <?php while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
                         <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_post_thumbnail('large'); ?>
<?php the_content(); ?>

                 <?php endwhile; ?>      `single.php` has the following:                   <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
             <?php $parent = get_post($post->post_parent); ?>             <?php $parent->post_content; ?>
         <?php endwhile; ?>      But still can't get `the_content` of the parent page. Any suggestions?


title: Load search results into a div

text: Is there anyway to load the search results into a div in wordpress? I am currently searching a custom post type only and am searching from a small box that pops up in a fancybox. is there anyway to just have the search results load into that same box? iframe maybe?


title: Adding 'current_post_item' class to current post in the loop

text: I'm using a loop in the sidebar of my site to show all the posts that are in that category. Now I'd like to include a 'current_post' class to the current post that is being displayed to style that item in the list. I've tried looking for conditional tags or this custom wp_list_post_types function but both haven't worked. Does anybody know if there's a way to do this? EDIT: Adding Loop from comment below               <?php foreach((get_the_category()) as $category) {      $postcat= $category->cat_ID;      $catname =$category->cat_name; }      $args = array( 'cat' => $postcat );      $my_query = new WP_Query();      $my_query->query($args); // Equivalent of query_posts()          while($my_query->have_posts()) : $my_query->the_post();      $id=get_the_ID();        $currentClass= ($post->ID == $id) ? "current_post": ""; ?>     <a class="<?php echo   $currentClass; ?>" href="<?php the_permalink();?>">ni      <?php endwhile; ?>


title: How to enable users to down-vote in this simple voting counter (that uses the post meta)?

text:
This simple tutorial teaches you how to make a voting counter using the post's meta data. I would like to know how to add down-votes to this small script (e.g. -1, -2). In the following way: If the post has 0 votes and it gets down-voted, it ends up with -1. If the post has 1 vote and it is down-voted it ends up with 0 (only one counter). **the jQuery part:**               <?php wp_enqueue_script( 'jquery' ) ?>     <?php wp_head(); ?>               > When a member clicks on the vote link, the above code will get the post ID > and the member’s user ID and send it to a file called vote.php using a post > method. The vote.php file will perform everything we need to add the vote. **vote.php:**               <?php     $file = dirname(__FILE__);     $file = substr($file, 0, stripos($file, "wp-content") );          require( $file . "/wp-load.php");          $currentvotes = get_post_meta($_POST['post'], 'votes', true);     $currentvotes = $currentvotes + 1;          $voters = get_post_meta($_POST['post'], 'thevoters', true);     if(!$voters) $voters = $_POST['user']; else $voters = $voters.",".$_POST['user'];          update_post_meta($_POST['post'], 'votes', $currentvotes);     update_post_meta($_POST['post'], 'thevoters', $voters);          echo $currentvotes;     ?>      > Once the information is posted to vote.php two custom fields are created. > One to count the vote and one to add the voter to a list so that they can’t > vote again. **functions.php:**               // voting function     function voting($id) {     global $user_ID;     $currentvotes = get_post_meta($id, 'votes', true);     $voters = get_post_meta($id, 'thevoters', true);     $voters = explode(",", $voters);     foreach($voters as $voter) {         if($voter == $user_ID) $alreadyVoted = true;     }          if(!$currentvotes) $currentvotes = 0;     echo '
'.$currentvotes.'';     if($user_ID && !$alreadyVoted) echo '
'.__("Vote").'';     if($user_ID && $alreadyVoted) echo '
'.__("Voted").'';     echo '
';     if(!$user_ID) echo '

'.__('Register').' '.__('to vote').'.

';     }      any suggestions?


title: Retrieving list of Custom Post Types

text:
I'm using the following two strips of code to retrieve a list of categories (1st code) then displaying them in a select menu (2nd code), for my theme options page. I was wondering how I could change this code to do the same, but, retrieve custom post types instead?? _Code used to retrieve categories_               $tp_categories[0] = array(     'value' => 0,     'label' => ''     );     $tp_cats = get_categories(); $i = 1;     foreach( $tp_cats as $tp_cat ) :     $tp_categories[$tp_cat->cat_ID] = array(         'value' => $tp_cat->cat_ID,         'label' => $tp_cat->cat_name     );     $i++;     endforeach;      _Code used to display categories in a dropdown select menu_
Choose Category	          <select id="choose_cat" name="tp_options[choose_cat]">     <?php     foreach ( $tp_categories as $category ) :         $label = $category['label'];         $selected = '';         if ( $category['value'] == $settings['choose_cat'] )             $selected = 'selected="selected"';         echo '<option style="padding-right: 10px;" value="' . esc_attr( $category['value'] ) . '" ' . $selected . '>' . $label . '</option>';     endforeach;     ?>     </select>


title: Modify Post Status Arguments

text: Is it possible to edit existing registered post statuses? I am using the Edit Flow plugin to create custom statuses, however, the plugin does not offer the option to set whether the statuses are 'public' or not. I went in to the code and was able to insert that in, but obviously that will get overwritten with any updates. Essentially, I am looking for a complimentary function to add_post_type_support() for post statuses. So something like               add_action('init', 'my_custom_init');     function my_custom_init() {                add_post_status_support( 'custom_status', array('public'=>true) );          }


title: Advanced Custom Fields functionality without plugin

text: I am always looking to minimise my reliance on plugins. I currently use Advanced Custom Fields plugin for pretty much every site I build. I can't help but feel that the functionality this plugin brings should be (and probably is) something the WP supports, i.e. multiple WYSIWYG blocks per template/specific pages. Could anyone suggest a way of having multiple editable content sections (specifically WYSIWYG) on a page without using plugins? I am aware of the capability of adding meta boxes for single text fields, etc, but that's not what I am actually after.


title: How do I remove all traces of a plugin?

text: I am busy writing a plugin (called _supermail_ ), so I install, activate, deactivate, and delete the plugin fairly often. However, quite often one or more of these operations doesn't go smoothly, and I just manually delete the files. When I install the plugin again by uploading a zip file, called _supermail.zip_ , I find the plugin installed under a directory called _plugins/supermail1_. I assume this is because WP still has a record of the plugin, somewhere in the DB, or even maybe just in session. Short of restarting Apache, is there anything I can do, both in my plugin code to help ensure this doesn't happen, and as administrator, to result the issue when it does happen?


title: Adding schema itemprop image to the_post_thumbnail with filters

text:
I have tried to apply filters to the_post_thumbnail() function using               apply_filters( 'post_thumbnail_html', $html, $post_id, $post_thumbnail_id, $size, $attr );      Here's the code I have come up with but doesn't seem to work completely                   function red_adjust_image_schema($html, $id, $caption, $title, $align, $url, $size, $alt)      {         $html = '
'. $html . '
';              return $html;     }     add_filter('post_thumbnail_html', 'red_adjust_image_schema', 20, 8);      How can I add itemprop="image" to the actual image element so it registers properly? Right now it seem like I can only do a container and wrap around $html? Thanks


title: Notify users whenever a new post is published based on their preference

text: I have put together a custom registration form on my WordPress site and one of the items on the registration form is an ability to select an interest. Essentially I have the following code from the registration form...                update_usermeta( $user_id, 'interests', $_POST['interests'] );      I would need a code that does something like, if "interestes" matches "tag" of a new post, then send an email to the user. Anything like that possible? Thank you in advance!


title: Set Wordpress settings programmatically

text: Is it possible to set certain settings from the theme functions file for example the setting `Enable threaded (nested) comments` ca I set it to allow `2` as the answer without having the user go into the admin panel and setting it for there wordpress comment settings?