title: How do I display a custom field from a custom taxonomy in single.php?

text: I know that the following mysql query produces the exact results I wish to echo within single.php:               SELECT meta_value     FROM `wp_taxonomymeta`     WHERE `taxonomy_id` =565     AND `meta_key` LIKE 'baseurl'      First, I need to be able to use $wpdb to output that result, and no matter what I try I can't get it to work. My final try:               <?php global $wpdb;         $toc = $wpdb->get_row("     SELECT meta_value     FROM `wp_taxonomymeta`     WHERE `taxonomy_id` =565     AND `meta_key` LIKE 'baseurl'     ");          echo $toc; ?>      produced the following error: Catchable fatal error: Object of class stdClass could not be converted to string in /wp-content/themes/new/single.php on line 22 Second... and it's important. The value 565 I am using for the taxonomy_id was only for testing... the actual value I need to insert in place of the number 565 can be displayed in single.php using:               <?php $term = get_term_by('id', $termID, 'dataset'); echo $term->term_id; ?>      For reference, so you can understand what I'm trying to do... I have assigned a custom field to a taxonomy and am trying to get the results of that custom field to display in single.php... while I found a plugin (Ultimate CMS) that would do this for me, it also chooses to display a filter for all taxonomies at the top of my Post Screen... when you have 50,000+ rows in your taxonomy that causes way to much page load in the admin, and I can't find a way to suppress it. Any help with my NOOB try at coding would be appreciated! Thanks


title: Upload a custom csv file, read contents and delete that file

text: Can someone please direct me to a resource or give me some pointers on:   * How to upload a csv file to wordpress (media uploader or alternate methods, ajax powered preferred)   * Access that file so I can read the contents I am not looking for a plugin as this is a custom file that I need to read and process inside a plugin. Ideally, this workflow is desired: **Choose a file** > **Click Upload** > **Plugin accesses the file after upload** and processes file content > **Plugin deletes the file**. Bold steps interest me the most.


title: Add a excerpt to a custom WYSIWYG

text: I have a secondary WYSIWG on my post and I am using it to display content under a thumbnail. I am trying to figure out how to limit the amount of words I can display with the code I am using to display the secondary WYSIWG. I know how to do it using excerpt when it triggers the_content, but the same effect does not happen when I assign it to my code. Here is my code that display the content on my post                <?php echo wpautop( get_post_meta( get_the_ID(), $ingredients . '_cmb_fe_wysiwyg', true ) );?>      I do not know if this matters but this is the code I am using in my function to display the WYSIWG                function cmb_sample_metaboxes( array $meta_boxes ) {             $prefix = '_cmb_';             $meta_boxes['fe_metabox'] = array(                'id'             => 'fe_metabox',                'title'          => __( 'Post Scope', 'cmb' ),                'pages'          => array( 'post', ), // Post type                'context'        => 'normal',                'priority'       => 'high',                'show_names'     => true, // Show field names on the left             // 'cmb_styles' => true, // Enqueue the CMB stylesheet on the frontend      'fields'       => array(      array(           'name' => 'Test wysiwyg',           'desc' => 'field description (optional)',           'id' => $prefix . 'fe_wysiwyg',           'type' => 'wysiwyg',           'options' => array(),      ),      Is there also a way to only display the content instead of the images in the WYSIWG as well?


title: Get content from one page and show it on another page

text: So, I've been googling and reading and testing and failing. I'm fairly new to php, so don't expect to much :) I'm working on a new design, and I want to show content from the about page on my homepage, which is dynamic. So, I've been looking into that the_content thing, but I havent gotten any luck so far.               <?php        $id=about;        $post = get_page($id=);        $content = apply_filters('the_content', $post->post_content);        echo $content;     ?>      the ID of the page is "about", if that is any help. Please get back to me :)


title: YARPP php question

text: I'm trying to put a border under `related_posts()` ,it works, but the border is showing even when the there are no posts. How do I make the border show only when there are related posts to show?


title: Prevent Authors from viewing each others Posts

text: I am setting up a site where there will be multiple users as Author, the owner doesn't want the authors to be able to view each others posts, since there are some meta fields with information he'd rather not have shared between the authors. Is there a way to remove the ability to view other authors posts? Thanks, Chuck To clarify a bit more, this is for the admin side, at the top underneath Posts, there are links for mine, all, and published. I only want Authors to see "mine".


title: Taxonomy template for all taxonomies attached to certain post type

text: For instance, I have a product post type and I would like all the taxonomies associated w/ this type, such as size, color, material etc to display using the same template without having to 1. create a catch all taxonomy.php that might interfere w/ taxonomies on other post types and 2. without having to manually create taxonomy-size.php, taxonomy-color.php, etc since new taxonomies can be created at any time. can i do this by hijacking template redirect?


title: Is this robots.txt making Google not to show some of my content?

text: http://chineselearnonline.com/               User-agent: *          Disallow: /feed/     Disallow: /trackback/     Disallow: /wp-admin/     Disallow: /wp-content/     Disallow: /wp-includes/     Disallow: /xmlrpc.php     Disallow: /wp-          Sitemap: http://chineselearnonline.com/sitemap.xml      I just changed to a new server. And my site started to not to appear in the top search results s before. I was wondering if the robots.txt above is blocking some of my WordPress content? **EDIT:** I changed the path from `http://chineselearnonline.com/v4` to `http://chineselearnonline.com/` also, not sure if this is the real problem and no `robots.txt`


title: Multiple Loops Homepage?

text: I have been pretty impressed with the recent redesign at WebDesignerDepot and I am curious about the mechanics of their homepage. I like how they have featured post sections that break up the monotony of the page, but I haven't figured out how to incorporate something similar in my own designs. I'm guessing that they are using multiple loops and it seems like it's something like [main loop chronological] --- > [custom loop] ---> [main loop continues chronologically]. How would I break off into a custom loop and then continue where I left off in the main loop?


title: Wordpress Search not picking up text provided by a Plugin

text: I have a site plugin that fills in text on pages remotely. Wordpress does not search the pages created by the plugin. I tried Google custom search engine code, no good. How can I search this text? Also how can I show search snippets not entire posts listed out? Site is at www.SiteNamePro.com. The domains listed are filled in by the plugin. I want users to find domain names by search, not using CTRL+F, just using normal Wordpress search, or by what appears to them to be normal WP search. Thanks!


title: Custom wp_query time filter on meta_value

text: My goal is to only show posts with opening hours after business hours, for a given day. So, e.g. I have a (custom) post with following meta_key and meta_value: meta_key = 'monday, meta_value = '14:00 - 22:00' The business hours are fixed: '08:00 - 18:00' I'd like to add a filter to my custom wp_query. Only, I am getting stuck at defining a function. My logic input (definitely not correct & complete) for the function:               $from_std = strtotime("08:00");     $to_std = strtotime("18:00");                             $open = $my_meta['monday'];     list($from, $hyphen, $to) = explode(' ', $open);     $from_bus = strtotime($from);      $to_bus = strtotime($to);          if ($from_bus < $from_std) { $show = 1; } // before standard starting time - so SHOW       else {if ($to_bus > $to_std) { $show = 1; }} // after standard closing time - so SHOW          if (empty($from_bus)) { show = 0; } // $var is either 0, empty, or not set at all - so do NOT show      Help on a function is very much appreciated.


title: How to get a list of all users registered before a given date?

text: I was expecting to be able to do something like the following which I thought would return all users that have registered before a given date:               $args = array(         'post_type' => 'post',         'date_query' => array(             array(                 'before' => current_time( 'mysql' )             )         )     );     $query = new WP_User_Query( $args );      However, unlike `WP_Query`, `WP_User_Query` doesn't support the `date_query` parameter so the above code doesn't work. How can I get a list of all users registered before a given date?


title: Gist shortcode is not working

text: I freshly installed a brand new Wordpress for testing purpose as I am intending to refresh my current website. One of the requirement I have is to be able to embed code from Gist. Following the Wordpress documentation, newer version comes with a specific shortcode for Gist : Gist Shortcode The issue is that it does not work at all. I tried pasting simply the url on a single line or wraping it around [gist] tags but nothing works. The url simply displays as raw text inside the post. I do know that some plugins provide the same functionality but I really wish to use the Wordpress builtin functionality. My site has been automatically hosted and installed on an Azure website, is running PHP 5.4 and Wordpress 3.8.1. Thanks for your help.


title: Post metadata deletes itself

text: I'm using a custom post type for a portfolio. I have a few option in there, bring saved by `update_post_meta()`, it seems to work fine, but then out of the blue (within the hour), the data deletes its self. I have looked in the DB and all custom metadata values are empty. I'm a little stumped really. Here's the code that's saving one of the options.               function update_colour_palette(){         global $post;         $color = get_post_custom($post->ID);      $palette = $color["palette"][0];         update_post_meta($post->ID, "palette", $_POST["palette"], $palette);     }      Any help, tips & tricks would be useful.


title: Display additional page templates and a sidebar on plugin activation

text: I'm developing a child-theme off of the Twenty Twelve (1.1), using Wordpress (3.5.1) and the Woocommerce plugin (1.6.6). I've noticed that the problem with creating the online shop, single product page and the taxonomy pages (categories and tags), is that it uses it's own templates to display these pages ( _which can be customized_ ), but making changes to the other pages such as the checkout, cart, my account etc. won't be affected because they are referenced from the theme’s `page.php` template. Because of this, I would like to display additional template pages to choose from when the Woocommerce plugin is activated in the Page Attributes list and hidden/not displayed otherwise. For example, by default: >   * Full-Width >   * Full-Width, Sidebar Right >   * One-Third, Two-Thirds Columns >   * Three Columns, Sidebar Right > And when the Woocommerce is activated: >   * Full-Width >   * Full-Width, Sidebar Right >   * One-Third, Two-Thirds Columns >   * Shop, Sidebar Left <\------- >   * Shop, Sidebar Right <\------- >   * Three Columns, Sidebar Right > Is this possible and can an additional sidebar in the widgets menu (Shop Sidebar) also be created on the plugin activation? Thank you.


title: get_post_meta not working inside a function in functions.php but works outside

text:
function notify_new_posts($post_id) {               $keyval = get_post_meta( $post_id);                 $buyer_wdistance   = get_post_meta( $post_id, 'cf_wdrive');               //$buyer_wdistance   =   $keyval['cf_wdrive'][0];     $buyer_location    =   $keyval['cf_address'][0]." , ".$keyval['cf_zipcode'][0];               //$buyer_location    = '3302 23rd street, astoria, ny';     //$buyer_wdistance   = '10';                  $post          = get_post($post_id);             $author        = get_userdata($post->post_author);             $author_email  = $author->user_email;             $email_subject = " New car request posted ";          $blogusers = get_users( 'blog_id=1&orderby=nicename&role=dealership' );          foreach ( $blogusers as $user ) {               $target_email    =  $user->user_email;          $current .= " targetemail: ".$target_email ." | " ;                    $dealer_location = get_usermeta($user->id,'company_name')." , ".get_usermeta($user->id,'rep_name') ;                      $current .= " dealerlocation: ".$dealer_location . " | " ;                $from = $buyer_location;     //echo "
";      $to   = $dealer_location;               $from = urlencode($from);     $to   = urlencode($to);     $data = file_get_contents("http://maps.googleapis.com/maps/api/distancematrix/json?origins=$from&destinations=$to&language=en-EN&sensor=false");     $data = json_decode($data);     $time     = 0;     $distance = 0;          foreach($data->rows[0]->elements as $road) {         $time += $road->duration->value;         $distance += $road->distance->value;     }          $distance = round($distance*0.000621371);     $time = round($time/60);     //echo "distance to this dealer in miles ".$distance."
";          $current .= " distance: ".$distance . " | " ;               if ($distance  <= $buyer_wdistance ){                    ob_start(); ?>                  <title>New post at <?php bloginfo( 'name' ) ?></title>
Hello <?php echo $author->user_firstname ?>,

A new lead was posted: <a href="<?php echo get_permalink($post->ID) ?>"><?php the_title_attribute() ?> .
                                   <?php                  $message = ob_get_contents();   ob_end_clean();             wp_mail( $target_email, $email_subject, $message );          } //end of if statememnt          }          $file = 'people.txt';     // Open the file to get existing content     //$current = file_get_contents($file);     // Append a new person to the file          $current .= " postid: ".$post_id." | " ;     $current .= " author: ".$post->post_author       . " | " ;     $current .= " author_email ".$author_email       . " | " ;     $current .= " buyerlocation: ".$buyer_location.$buyer_wdistance  . " | " ;          $current .= " buyerwdistance: ".$buyer_wdistance . " | " ;                    // Write the contents back to the file     file_put_contents($file, $current);                         }          add_action( 'publish_post', 'notify_new_posts', 10, 2 );      so the problem is               $buyer_wdistance   = get_post_meta( $post_id, 'cf_wdrive');     //$buyer_wdistance   =   $keyval['cf_wdrive'][0];         $buyer_location    =   $keyval['cf_address'][0]." , ".$keyval['cf_zipcode'][0];      these values work perfectly in a template.php file. but inside functions.php function hook they dont work. $post_id returns a value. all the other variables return values besides those metas. I checked them manually in phpmyadmin and their all have values for the appropriate post id.


title: wp_enqueue_scripts in a plugin's class

text: I'm trying to enqueue jQuery UI in a plugin under a class method. I have this so far:               class AV_Slider {          function slider_load_js(){             wp_register_script('jquery-ui-core', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js');             wp_enqueue_script('jquery-ui-core', array('jquery') );             wp_enqueue_script('av_slider_js', AV_SLIDER_BASE_URL . 'includes/js/av_slider.js', array( 'jquery' ));     }               function __construct(){         $this->hooks();     }     function hooks(){         add_action('wp_enqueue_scripts', 'slider_load_js');     }      And I get this error on the page: > Warning: call_user_func_array() expects parameter 1 to be a valid callback, > function 'slider_load_js' not found or invalid function name I'm not sure how __construct() works other than that it creates a new Simple XML object. I also tried adding the action `add_action('wp_enqueue_scripts', 'slider_load_js');` after the function but this caused an error as well. Any help?


title: Import media to online WordPress from local development

text: I have a site being developed locally and I want to import the contents to an online installation. I used wordpress "import" but it cant get the media files. Is there any "wordpress" was of doing this or will I have to get access to my LDE from outside or upload the entire installation which I would rather avoid?


title: Display Related Posts by Category in Random

text:
I use one of smthemes and there is this code in theme to show related post. it shows the last created related posts, but I want to show related post by random, How can I do that?               global $SMTheme;     if ($SMTheme->get( 'layout', 'related' )) { ?>

<?php echo $SMTheme->_( 'relatedposts' )?>:

         <?php         $postid=$post->ID;         $showed_posts=array();         $tags=get_the_tags($postid);         $categories = get_the_category($postid);         $post_cnt=0;         $first=0;              if ($categories&&($post_cnt<$SMTheme->get( 'layout', 'relatedcnt' ))) {             $category_ids = array();             foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;             $showed_posts[]=$postid;             $args=array(             'category__in' => $category_ids,             'post__not_in' => $showed_posts,             'showposts'=>$SMTheme->get( 'layout', 'relatedcnt' )-$post_cnt,             'caller_get_posts'=>1);             $posts=get_posts($args);             if( count($posts)>0 ) {                 foreach ($posts as $p) {                     $ttl=iconv_substr( $p->post_title, 0, 150, 'utf-8' );                     ?>                     <li<?php echo (!($first%4))?" class='first'":""?>><?php                     $post_cnt++;                     if ($SMTheme->get( 'layout', 'colors' )) {                         $r=rand(1,150);                         $g=rand(1,150);                         $b=rand(1,150);                     } else {                         $r=$g=$b=1;                     }                     $first++;                if(has_post_thumbnail($p->ID))  {                     ?><a href="<?php echo get_permalink($p->ID); ?>" title="<?php printf( $SMTheme->_( 'permalink' ), $p->post_title ); ?>" class='img'><?php                     echo get_the_post_thumbnail($p->ID,array(126,126), array('title'=>$p->post_title, 'alt'=>$p->post_title));                     ?><?php                   } else {                     ?><a href="<?php echo get_permalink($p->ID); ?>" title="<?php printf( $SMTheme->_( 'permalink' ), $p->post_title ); ?>" class='img'><img src='<?php echo get_template_directory_uri(); ?>/images/smt/article_related.png' width='126' height='126' alt='article' /><?php                   }             ?>
<a href="<?php echo get_permalink($p->ID) ?>" title="<?php printf( $SMTheme->_( 'permalink' ), $p->post_title ); ?>" rel="bookmark" class="related-ttl"><div class='related-bg' style='background:rgb(<?php echo $r.",".$g.",".$b?>)'>
<?php echo $p->post_title ?>
                     <?php                 }             }         }              if (!$post_cnt) {             ?>
<?php echo $SMTheme->_( 'norelatedposts' )?>
<?php         }         ?>

     <?php } ?>


title: Removing title from page

text:
Hello attempting to remove the title from static front page using the following code is (not working) in my functions.php                   function remove_page_title() { if (is_front_page() )     {           add_filter( 'the_title', '__return_false' );     }}      IS there something missing? Thanks in advance PS I know I can hard code it in to my page template with               <?php if(!is_front_page()) { ?>
<?php the_title(); ?>
<?php } ?>      but I'd rather not change the template


title: How to make a conditional statement that checks if the page is the child of a certain page?

text: I know that you can use `is_page` to check the current page. How to check if the current page is the child of a certain page?


title: Add custom directory in URL

text: How can i add custom "directory" in my URL for pages and posts? So the main website url is: `http://www.example.com`, but when i go to a page I want this kind of URL: `http://www.example.com/SOMETHING/new_page` How can I put that "SOMETHING" in URL without affecting Wordpress functions?


title: Changing color of specific tab of top menu

text: I am messed up with a problem and still i am unable to find it's solution. I am trying to change color of only 1 tab in whole navigation menu. I mean if my navigation bar include 5 tabs and i want to highlight one tab with a specific background color. But i don't have any idea to do this. Can you suggest some solution to this?


title: Return current page type

text: Is there a function that simply returns the current "page type" instead of using is_page(), is_preview(), is_single(), is_archive(), etc? For example: I can find the current "post type" but I can't find it's corresponding "page type".


title: Looking for a simple calendar/events plugin

text: am looking for a simple calendar/events plugin with a list view by months and a pagination between months. Events would be simply made of a tile, description and the date of the event. Here's a quick sketch: ![enter image description here](http://i.stack.imgur.com/F9AOP.png) I've tested already plugins like: http://wordpress.org/extend/plugins/event-calendar/ \- doesnt suits my needs and gives me errors in the admin (brand new wp 3.3.1) http://wordpress.org/extend/plugins/event-calendar-scheduler/ \- too complex, and not events list http://wordpress.org/extend/plugins/events-calendar/ \- Just a widget http://wordpress.org/extend/plugins/kino-event-calendar-plugin/ \- Just a widget http://wordpress.org/extend/plugins/my-calendar/ \- list view but not by month and gives me an error when i open the page with events on first load after adding an event: `Warning: usort() expects parameter 1 to be array, string given in C:...\plugins\my-calendar\my-calendar-output.php on line 850` http://wordpress.org/extend/plugins/simple-events-calendar/ \- list view but not by month and no pagination http://wordpress.org/extend/plugins/the-events-calendar/ \- list view not by month and although great, pretty complex for waht i need http://wordpress.org/extend/plugins/wordpress-event-calendar/ \- Doesnt save any event in the admin... Am runnin glow on ideas so any help would be appreciated.


title: Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions

text: I need add a rewrite rule in my plugin, and distribute it with my code. All works fine if I put the rule in the .htaccess in the WordPress root folder, but I need distribute the plugin with my rule. I try to put a .htaccess inside the plugin folder and try to use the add_rewrite_rule function but doesn't works either. Here the .htaccess code that works correctly in WordPress root folder but doesn't works in my plugin folder:               <IfModule mod_rewrite.c>          RewriteEngine On     RewriteRule my-plugin/pages/tp(.*)\.php$ wp-content/plugins/my-plugin/pages/request.php?pid=$1          </IfModule>      I try the follow code in my plugin but doesn't works either:               add_filter( 'query_vars', 'add_query_vars' );     function add_query_vars( $query_vars )     {         $query_vars[] = 'pid';         return $query_vars;     }     add_action( 'init', 'add_init' );     function add_init()     {         $plugin_url = 'the-path-to-my-plugin-folder';         add_rewrite_rule('my-plugin/pages/tp(.*)\.php'                       , $plugin_url . 'pages/request.php?pid=$matches[1]','top');              global $wp_rewrite;         $wp_rewrite->flush_rewrite_rules(); // I know this should be called only one time, but I put it here just to keep simple the sample code     }      But I always get the error that the URL wasn't found. What I'm doing wrong? How can I do what I need? I searched for similar questions but none solve my problem.


title: W3 Total Cache "Preview mode could not be disabled"

text: I receive the message: > Preview mode could not be disabled. Please run chmod 777 /wp- > content/w3-total-cache-config-preview.php to make the configuration file > write-able, then try again. I have chmodded the file to 777 and the error message remains.


title: Export xml use/import images from theme directory

text: Is it possible to create demo.xml for a theme that when imported into fresh theme installation will use/import images from theme directory folder (e.g. theme/images/demo) rather than import media from previous wordpress installation? If possible, how it can be achieved?


title: Moving wp-content outside of web root?

text: Is it possible to move the entire wp-content folder outside of the Web root? I need to prevent anyone to view any asset file (images, pdfs, movies etc) with a direct url to the file... Any ideas? Or could I do this safely with htaccess?


title: unautomated subscription plugin

text: I need to send some data to my subscribed visitors periodically.   Is there any plugin that just let users subscribe (enter their email) in my site that don't send anything automatically and I be able to use it manually?   I need a plugin that collect user emails (Using a subscription form) and let me send mass mails to them manually and nothing more!. thanks


title: Cannot Upload Custom Header Image into Wordpress Dashboard

text: I'm having trouble uploading a custom image into Wordpress' dashboard. It says that it needs to be a custom 1000x288 image. When I upload it, I get the error of:               Warning: copy(/var/sites/zeldezine/wordpress/wp-content/uploads/2012/02/header.jpg) [function.copy]: failed to open stream: Permission denied in /var/sites/zeldezine/wordpress/wp-admin/includes/file.php on line 348               Warning: getimagesize(/var/sites/zeldezine/wordpress/wp-content/uploads/2012/02/header.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /var/sites/zeldezine/wordpress/wp-admin/custom-header.php on line 665      When I open /includes/file.php, I get this block of code on line 348               // Set correct file permissions         $stat = stat( dirname( $new_file ));         $perms = $stat['mode'] & 0000666;         @ chmod( $new_file, $perms );      but I am not experienced enough in PHP to be able to know how to set the permissions correctly. If anyone can give me a heads up on what I need to modify to set permissions correctly, I'd appreciate it.


title: How to CPT with meta box, output navigation links to front end (but not ?cpt=value)

text: I have a custom post type with meta box. The output is paginated, so that my custom page will output one post at the time which works just fine. What I need is to be able to create a menu link on the front-end so a user can select from any of the custom post type posts. I was using next and previous links like this:               <?php previous_posts_link('« Newer') ?>     <?php next_posts_link('Older »') ?>      The problem with this approach is the user only sees links to the next and previous posts, not all of the custom post type posts. However, this system does use correct links NOT "?cpt=value" If I use a plugin to automatically generate a menu for the custom post type it uses "?cpt=value" links. I can't use a plugin since I am using a custom page template to output info, so if I use it it gives me wrong links. (http://wordpress.org/plugins/custom-post-type-auto-menu/) I could not find anything that would help me to figure the way to output correct link. How do I output correct link for all post types in that category? This is actual link to custom page with cpt(links I need):   ![enter image description here](http://i.stack.imgur.com/eIoCg.png) ![enter image description here](http://i.stack.imgur.com/JKHMs.png) But if I generate automatic link it will give me:   ![enter image description here](http://i.stack.imgur.com/1G4Ym.png) ![enter image description here](http://i.stack.imgur.com/JwoWD.png) UPDATE: I learned that I can use paginate_links function to get all cpt pages, but it displays numbers of pages not post titles, and I can't find any info if this supports titles..   src: http://codex.wordpress.org/Function_Reference/paginate_links Any help is much appreciated! Thanks


title: wp_query issue with post_type = page

text: I am using a custom query to get pages. I need them all displayed on the front page for a one page WordPress theme. For the most part, I have the theme working and things are fine. I have this problem with the code where it doesn't recognize page templates and other custom stuff like shortcodes. For the life of me, I can't figure out why. Some shortcodes work and others do not. I had to make a query that checks to see if the page has a page template asssigned and then run the template part for content-page. Here is my code for my loop                   $page_query = new WP_Query(array(         'post_status' => 'publish',         'post_type' => 'page',         'order' => 'ASC',         'orderby' => 'menu_order',         'posts_per_page' => '-1',         'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1     ));                  if ( $page_query->have_posts() ) : while ( $page_query->have_posts() ) : $page_query->the_post(); ?>             <?php $template = get_post_meta( get_the_ID(), '_wp_page_template', TRUE ); ?>             <?php if( $template && $post->post_content != '' ) { ?>                         <li id="page_<?php echo str_replace(' ','_',strtolower( get_the_title())); ?>">                             <?php get_template_part( 'content', 'page' ); ?>                         </li>              <?php }                   endwhile;             endif;             ?>      I have to load all my content by a shortcode. If I try to set a custom page template to a page then when I load that page, it will be blank. The page ignores the content of the custom template. The loop does notice that a page template was assigned though. what I would like to know is if there is a better way to load all pages into the front page and make WordPress recognize all content like it does for a regular page. I have been trying for months to come up with another way to no avail. Thank you for your help.


title: wp_nav_menu(); Outside WordPress installation

text:
I wanted to use WordPress menu management then show it on outside wordpress installion php file with html but I got this error               PHP Fatal error:  Call to a member function get_queried_object() on a non-object in .../blog/wp-includes/nav-menu-template.php on line 395      Here how I do it in on php file with test.php               <?php      $documentroot = $_SERVER['DOCUMENT_ROOT'];     include_once($documentroot.'/blog/wp-load.php');     ?>     <!DOCTYPE html>               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title>Test</title>

     <?php if ( has_nav_menu( 'landingpage-menu' ) ) { /* if menu location 'secondary-menu' exists then use custom menu */ ?>     <?php wp_nav_menu( array( 'theme_location' => 'landingpage-menu', 'container' => '', 'depth' => 1 ) ); ?>     <?php } ?>

                is there wrong on how I implement it? or I'm missing something?


title: Link to blogg-page

text: Im trying out wordpress and wondering of from the theme i have installed. Im not using the blog as the start page. How do i add a link to the menu that shows the blog with posts in order of date?


title: Dashboard Widgets - Add Admin Page With Same Functionality

text: I have a plugin that has its own dashboard with basically quick-views of relevant data and I wanted to know if there was an "easy" way to mimic the functionality of the admin dashboard where you can move/minimize/maximize the widgets? UPDATE: I am assuming I would have to add metaboxes similar to when you add metaboxes to a custom post type...is this the direction I should go in?


title: Wordpress remove Submenus

text: I found an answered question here Remove menus and submenus **2 Answers** for my problem but is there a way of changing the code a bit so that it removed the submenus for all Editor roles. not only for one user? and is there a way of improving this code? I am using 3.5.1 version of wordpress code that I am using:               add_action('_admin_menu', 'remove_editor_submenu', 1);     function remove_editor_submenu() {         global $current_user;         get_currentuserinfo();         if($current_user->user_login == 'username') {             remove_action('admin_menu', '_add_themes_utility_last', 101);         }     }          add_action('admin_init', 'remove_theme_submenus');     function remove_theme_submenus() {         global $submenu, $current_user;         get_currentuserinfo();         if($current_user->user_login == 'username') {             unset($submenu['themes.php'][5]);             unset($submenu['themes.php'][7]);             unset($submenu['themes.php'][15]);         }     }


title: How to avoid filling up an array each time I run a WP_query?

text: I am making a following user system and need some help for retrieving the users ids a user is following. At the moment I am using the following SQL query for retrieving the users ids a user is following:               $following_users_ids = $wpdb->get_results("SELECT follows_id FROM $table_name_users WHERE user_id = $current_user_id");      Now, here comes my main problem. To feed the WP_Query with users ids, I am filling up an array like this:               foreach ( $following_users_ids as $following_user_id ) {         $authors[] = $following_user_id->follows_id;     }      If the user is following thounsands of users, filling up the array would take a long time. My arguments for the WP_Query is as follows:               $args = array(       'author__in'     => $authors,       'posts_per_page' => 12,       'paged'          => $paged,     );      So I need a faster way to retrieve those users ids and feed the WP_Query with it.


title: WP_Query and using a variable for 'cat'=> in the args array = WP Bug?

text: For the sake of this discussion, here's a version of my query within category.php:               wp_reset_query();     $category_id = get_cat_ID(single_cat_title('', false));     $my_query = new WP_Query(array(     'posts_per_page' => SOME_DEFINED_VALUE,     'cat'  => $category_id,     'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),     'post_type' => array('post','post_custom_1','post_custom_2','post_custom_3')     ));     // print_r($my_query);      In short, it doesn't work. Here's what I've noticed. When I do the print_r($my_query); I can see the query_vars in the first line. They do not match my array args. For example, the posts_per_page defaults to some other value (not the CONSTANT), and the post_type list no longer includes post (which is should / must). If I remove the line with 'cat'=> or hardcode the value ('cat'=> 3) then every thing works as expected. The remaining query_vars show up in the print_r. Life is good :) I have tried the following but found no success:   * Making the var into a CONSTANT, just like posts_per_page (which doesn't cause a problem).    * Concating quote around the $category_id number - The result is the same as no quotes at all. It doesn't work.   * 'cat' => array($category_id) - I pulled an error - It didn't like   that it was an array. Anyone have any suggestions? Now here's what did "work" (read: I could use my $category_id and doing so didn't muck up the rest of the args in the WP_Query() array list).               'cat'  => '"-'$category_id'"',      That is, I could not that cat ID. Crazy, right? Unless I can resolve it properly, I'm going to have a comma separated sting of all my cat not'ed, parse out the current cat and then use that string to do the query. In other words if my cats were A, B and C, instead of doing a query for A (as one would expect to do)               'cat' => A      I'm going to query for not B, not C.               'cat' => -B,-C      Hopefully there's a less hack-y solution. I've been on this too many hours now and I'm desperate enough to use this hack and be done with it. That said, this sure feel like a bug in the core to me. Yes, I'm using 3.5.1 (or are we up to .2 or .3 now?). My point is, I'm on the latest version (and this did the same in 3.2.x). btw, I've seen this issue posted elsewhere (e.g. WP forums). The one solution suggested the args array not be an array but a string. Even if that's possible with WP_Query, how would I do the list / array for the post_types as a string? Finally, if I'm doing something wrong then the Codex help page needs an update, eh? Help. :)


title: Advanced Custom Fields | how to use conditional statements in repeatable group display

text: _**Hi there, I'm just getting started with ACF and writing php statements. Although I've been working with them for a little while I'm still building confidence._** ## My aim To display a block of code if a radio value is 'value1' and if not value1 but 'value2' then to display this block. I have the code working, but I'm stuck as to how I would do the same with a repeatable group. ## Here is what I have so far               $oriantation = get_field('oriantation');     if ( $oriantation == 'left' ) {               Run Code           }     elseif ( $oriantation == 'right' ) {               Run Code          }     else {         return false;     }      So far I think that I should be using a foreach statement but I'm getting stuck as to how to use that with the above code. I'm just beginning to write my own statements and functions at the moment so any direction would really help.


title: WooCommerce create new product and add to cart on form submit

text: I am customizing woo-commerce plugin to add product from the front end into the cart. I have written the function in functions.php, but i am getting a Fatal error. Getting this error--> > Fatal error: Call to a member function add_to_cart() on a non-object in   >  C:\wamp\www\cutting-edge_server\wordpress_theme\wp- > content\themes\cutting_age\responsive\functions.php on line 56 Any body have any idea how to resolve it? My function.php file               if (isset($_POST["addcustomcarts"]))             {            echo $_SERVER[QUERY_STRING];           // echo $_SERVER[REQUEST_URI];             echo "i am in if";             //exit();         add_filter('woocommerce_before_cart', 'customcart');              function customcart() {             echo "i am in function";              //global $woocommerce;              $my_post = array(           'post_title'    => 'My post',           'post_content'  => 'This is my post.',           'post_status'   => 'publish',           'post_author'   => 1,           'post_type'     =>'product'              );                   // Insert the post into the database          $product_ID=wp_insert_post( $my_post );               add_post_meta($product_ID, '_regular_price', 100, $unique);          add_post_meta($product_ID, '_price', 100, $unique);           add_post_meta($product_ID, '_stock_status', 'instock', $unique);                     //Getting error on this line.           $woocommerce->cart->add_to_cart( $product_ID, $quantity=1 );                              exit( wp_redirect( home_url( "cart" ) ) );         }              customcart();           }      My html file               <form name="addpro" method="post" action="">         <input type="submit" name="addcustomcarts" value="ADD TOO CART" />       </form>


title: Wordpress removing <p> tags?

text: I'd already come across a case where Wordpress added `<p>` tags. However now I'm dealing with the opposite situation. When I add [] shortcodes inside `<p>` tags WordPress automatically removes `<p>` tags.               <p>[anyshortcode]Hello World[/anyshortcode]</p>      Becomes:               Hello World      Adding dir="ltr" to `<p>` tags seems to fix the issue, maybe there is a way to add it programatically to all `<p>` tags? Any ideas on how to fix this?


title: difference between querying database and using the loop

text: I know this is a very general question, but I have been reading tuts on both wp Query, and The Loop, and it seems that you can go either way. Am I misunderstanding this? What I think I am reading is that you can bypass the loop more or less, and just query the db. If this is the case, what is better?


title: Adding post tags to custom post types

text: Standard WordPress post types have "Post Tags" which can be used to "tag" posts with similar content, makes those similar posts easily accessible just by opening that particular tag page and receiving the list of all posts. I need exactly the same thing with my custom post types:   * ability to tag the post with multiple tags   * ability to list all custom posts tagged with the same tag by opening that tag page How do I add support for adding tags to my custom post types?


title: How do I get category and page ID's?

text: I want to insert the category or page ID of the current page into my HTML so that I can use CSS to style each page based on what it is. For example, if had a category called "News" and it's ID was 5, my source code would end up having in it. Then I could use CSS to style #category-id-5 to suit my needs. How would I accomplish this?


title: Can I upload media to a specific folder?

text: By default, media uploaded through the Wordpress dashboard goes into a folder determined by the current date. For example: /wp-content/uploads/2011/09/. Once the media is uploaded I'm not seeing any options in Wordpress to change the location of my file to something else. Can I tell Wordpress to place my media in a separate folder? **Not all my media.** Just ones that I specifically select.


title: Condition function for is parent category?

text: I have a parent category with many sub-categories and I am trying to display the page differently when it is in that specific parent category. But instead of writing the code like is_category('parent', 'sub-1', 'sub-2')...etc, is there an easy way to say if it is in the parent category it is true?


title: Add Category Taxonomy Support to Custom Post Type

text: I'm writing some code that makes extensive use of custom post types- and I'm looking for a means of programatically adding a category to a defined custom post type, and then accessing its category ID. I had a poke around but I can't seem to find a robust means of achieving this - wp_create_category would be the obvious choice but of course this doesn't support custom post types.


title: Adding a div at the bottom of a sidebar

text: I can't find a way to place a div at the bottom of a wordpress sidebar, after all the widgets are displayed. Though I can acheive this by tweaking the themes I need a way to do this programmatically. Please help..


title: Use Post as Front Page

text: Is there a way to use a post as the front page? I'd like to be able to call the latest post from a given custom post type, in a certain custom taxonomy and with a specific term and use this as the front page - similar to using a page as the front page, but using a post instead (showing comments, trackback, etc. too)?


title: Why does Facebook not want to display my post thumbnails?

text: Recently when I try to share my content on Facebook, everything appears normal except I cannot get it to display a picture. I'm using WordPress SEO to handle all of the SEO and Social metadata, but it doesn't really cover images that well. When I use the Facebook Debugger, my webpages do not contain errors yet it still refuses to display images. I think the problem is happening because it is selecting the photo media using this format of link: http://media.detailsofmylife.net/uploads/2012/03/Alesso-Essential- Mix-200x125.jpg , but I am not sure why:   * Why Facebook chooses that as the default image even though I have the full size version selected as the Featured Image.   * Why Facebook has a problem with that format style of link image? Any ideas or suggestions would be much appreciated as it's doing my head in!


title: Is it possible to get a different header.php on language switch with qtranslate?

text: the problem is that on home page I have a lot of code which is added through header.php and it is not amendable through admin panel. What I want to do is to switch header files on language switch. Whenever a user press on the language icon, lets say on the English language icon the header should also switch from `<?php get_header('mylanguage') ?>` to `<?php get_header('english') ?>` or etc. Is it possible to do like this? Regards,


title: Static Front Page problem

text: My theme uses the front-page.php file to display a number of items on the front page including a slideshow and some featured items. I have also designed it so the static front page as set in the wordpress settings is displayed **as an excerpt** within this template. I then planned on having a read more button so the full page could be viewed on it's own without the slideshow etc( i presumed using page.php ) but it appears I've outsmarted myself, as that static page seems to be destined to display using front-page.php according to the WP hierarchy. Can anyone suggest anything that might help me. What i need is some way to tell that page to open in page.php if it's accessed via the read more button.


title: Wordpress Unknown Query

text: I have the following query and i can't find where is executed               SELECT count(ID) FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC;      Does anybody know where could be executed?


title: WordPress Multisite. Can domain be used instead of subdomain?

text: i am new to multisite. It is a simple question. I know WordPress multisite can be setup for subdomains. Is it possible to use domains along with subdomains? I have searched google but have not had really good results. Perhaps I have used the wrong keywords. **so i can use a single wordpress installation for:** domain.com sub1.domain.com sub2.domain.com example.com example2.com sub1.example2com Hope you get it. Thanks in advance!


title: Only display custom fields that are associated with template

text: I am in a predicament where I have entirely too many custom fields displaying in my admin. Ideally I would like to filter through all custom fields created for my site and only display the ones created for the template I have selected. If there is anyway possible to achieve this, someone PLEASE let me know! Thanks!


title: Can I manage more wordpress sites with one wordpress administrator page?

text: I would like to find a solution, where I can administer multiple wordpress sites (50 plus) using one wordpress admin interface or other tool. I would like to manage plugins and content on these sites. Is there such tool exists?


title: Only get_posts of certain post formats

text:
I'm trying to create a archive list with only my "normal" post format articles (not link, aside, quote, etc formats). How would I implement `has_post_format( 'standard' )`, or something similar, into the code below? I haven't been able to find a query for `get_posts` that only requests specific format types.               <?php             // Get the posts         $myposts = get_posts('numberposts=-1&orderby=post_date&order=DESC');          ?>          <?php foreach($myposts as $post) : ?>             <?php             // Setup the post variables         setup_postdata($post);              $year = mysql2date('Y', $post->post_date);         $month = mysql2date('n', $post->post_date);         $day = mysql2date('j', $post->post_date);         ?>
                      <a href="<?php the_permalink(); ?>"><?php the_title(); ?>                                           <?php the_time('j F Y'); ?>
          <?php endforeach; ?>      My php skills are at the beginner level at best, so any help would be much appreciated.


title: What's the order of loading wordpress elements?

text: I currently try to make a theme for wordpress and I'm confused about lots of things. I'm not sure what's the order of loading wordpress elements, where some variables are available, where they are saved, etc. So, about get_option(), in documentation says it's for retriving informations from database, but when you make some fields in theme options and user saves something he entered, that is not stored in database. So this variable is available only during loading wordpress each time? Thanks for any help


title: How to manually add an item to a submenu in a menu generated by wp_nav_menu?

text: Hey. I've been trying to figure this out for a long time but can't seem to crack it. I have created a menu using Wordpress 3 menu editor and it's all fine and working. But I want to manually add an item (or few) to a submenu so that the item will only show up in the submenu if logged in user is admin (can add_users). How can I achieve this? I already came up with a solution of having two separate menus for another purpose. But that is not what I want in this case. Say I have a menu called "Archives" It has a submenu with items "One" "Two" "Three". This I have built using the Wordpress menu system. Now I want to manually add a new item to the Archives menu, let's call it "Four" but I only want this to appear in the menu when a user is logged in and is admin. @MikeSchinkel - still haven't figured this one out... if you know, could you help me out? Thanks!


title: Loading Scripts on Specific Pages

text: In child theme I created a functions.php file that loads scripts and style files, the code is below. The section that loads libraries and scripts to all pages other than admin, in other words the first two functions, works as expected. However, the third function, which is designed to load a script for a specific page does not load. It appears that my problem has to do with specifying the page condition. The rest of the code for register and enqueue works if it is placed in the general function that loads scripts for any page other than admin pages. I've researched this can can't find any examples showing why the approach I've used is not working. I've swapped the page id with the name of the page but to no avail. Any suggestion on the source of the problem would be much appreciated. Thanks.                   <?php          function scripts () {         if ( !is_admin() ) {              wp_enqueue_script('jquery');             wp_register_script('jqueryUI', "path", array('jquery')); //register custom UI library             wp_enqueue_script('jqueryUI');             wp_register_script('popUp1', ("path"), array('jquery', 'jqueryUI'));             wp_enqueue_script('popUp1');             wp_register_script('popUpText', 'path', array('jquery', 'jqueryUI'));             wp_enqueue_script('popUpText');         }     }          add_action('init', 'scripts');          //INSERT CSS    files into the header     function styles () {         if ( !is_admin() ) {             wp_register_style('jqueryUIcss', "path");             wp_enqueue_style('jqueryUIcss');             wp_register_style('valuecss', "path");             wp_enqueue_style('valuecss');         }     }            add_action('init', 'styles');          //Add scripts for pop ups on "how to estimate value" page     function pagePopUps1 () {         if ( is_page(16)) {              wp_register_script('popUpVideo1', "path", array('jquery', 'jqueryUI'));             wp_enqueue_script('popUpVideo1');              }     }          add_action('init', 'pagePopUps1');                      //End of file     ?>      Note for the sake of brevity I removed the src's but these have been validated and are not the source of the problem.


title: wp_insert_post - duration

text: i try to import a custom DB to the WP DB with about 2000 rows (custom post type). the problem is that the insert by `wp_insert_post` takes about a second per insert. Is this normal ? Is there a fast/alternative solution... I think that a insert query should not take over some milliseconds. **Edit** its a remote server and both databases are on it. the queries are in quite normal speed (already tested), just the inserting is the problem. Need some code ? Ask in comments.. thanks guys.


title: Rename image uploads replacing "width" and "height" in filename with "medium", "large", "small"

text: Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and rename filenames to different combinations of "desert-landscape-{WIDTHxHEIGHT}.jpg" (dipending on thumbnail sizes). Is there a way to remove width & height attribute from filename and replace them by "{medium}-desert-landscape.jpg", "{large}-desert-landscape.jpg" and "{small}-desert-landscape.jpg"? Have been looking at this post Rename image uploads with width in filename me not able to fix it right way. Thank you               // The filter runs when resizing an image to make a thumbnail or intermediate size.     add_filter( 'image_make_intermediate_size', 'rename_intermediates_wpse_82193' );          function rename_intermediates_wpse_82193( $image )      {         // Split the $image path into directory/extension/name         $info = pathinfo($image);         $dir = $info['dirname'] . '/';         $ext = '.' . $info['extension'];         $name = wp_basename( $image, "$ext" );              // Build our new image name         $name_prefix = substr( $name, 0, strrpos( $name, '-' ) );         $size_extension = substr( $name, strrpos( $name, '-' ) + 1 );         $new_name = $dir . $size_extension . '-' . $name_prefix . $ext;              // Rename the intermediate size         $did_it = rename( $image, $new_name );              // Renaming successful, return new name         if( $did_it )             return $new_name;              return $image;     }


title: Next Post Link in format

text: I'm after a wordpress function that can give me the link to the next post with the same format as the current post. I've been looking and struggling to find one. I expected to find an option similar to the `in_same_cat` option from the `next/prev_post_link` function. Anyone know of one I don't or have other options on how to achieve this? Thanks.


title: add comments custom fields after user is logged in

text:
I want to add two custom fields inside comments on a CPT after the user is logged in on. This is the code for creating the custom fields:               function debate_comment_fields( $fields ) {          if( is_singluar('debate') ) {                   /* Add our custom fields */         $fields['first'] = '
' .                           __( 'Age' ) .                           '' .                           '<input id="first" name="category" type="radio" value="'.get_post_meta($post->ID, 'agree', true).'" />
';                   $fields['second'] = '
' .                             __( 'Town' ) .                             '' .                           '<input id="second" name="category" type="radio" value="'.get_post_meta($post->ID, 'disagree', true).'" />
';              return $fields;          }          }          add_filter('comment_form_default_fields','debate_comment_fields');      LATER EDIT: some relevant code from my theme comments.php file:               // Don't output the comment form if CPT and user isn't logged in     if ( 'debate' != get_post_type() || is_user_logged_in() ) {     comment_form( $args );     }     ?>      The current code adds the fields when the user is not logged in, and I want to add them after the user is logged in. How can I do this ?


title: Custom template pagination

text: I have a custom post type "news". I created the page "News" with the id 55 and a custom template file. I want to implement pagination. The problem is when I access the news with a page number set I get an error "404 not found". URL looks like this "/news/page/2/". I use `paginate_links` function to display pagination. How to display the correct page?


title: how to show single post in a custom template

text:
hi i used the below code to list out the posts in a particular category.
                         <?php if ( have_posts() ) :                                   ?>                         <?php query_posts('category_name=services&showposts=5'); ?>             <?php while ( have_posts() ) : the_post(); ?>                        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_post_thumbnail(); ?><?php echo '  '; the_title(); ?>

            <?php the_excerpt();?>

             <?php endwhile; ?>                     <?php endif; ?>      it works fine. but now when i click on the excerpt read more link the post shows in a unordered template. i need to show them as like the subpages are showing. i have a subpage template file. how can i use that file for displaying single posts??


title: How to change to local video player on shortcode ultimate to video.js?

text: I have Shortcodes Ultimate plugin, and I would like to change this plugin video player to Video.js player.   That's becouse, the original player is very afful, and instabil, and you can't control volume, can't replay the video,so this player very insufficient.   I can't use the original wordpress player,becouse the plugin use the same short code as the wordpress short code and this do a little conflict.   Example for the plugin shortcode:               [video url="http://www.neocsatblog.mblx.hu/wp-content/uploads/2013/10/Cas-és-a-sex.mp4" poster="http://www.neocsatblog.mblx.hu/wp-content/uploads/2013/10/not-bad.png" title="Castiel találkozása a szex-el"]      I can't delete this plugin,becouse I use some usefull function in here.   So the bestway be if I can change the video player to Video.js player.


title: How to hook in to the "output buffer" and add html content

text:
I want to be able to hook into the output buffer flow and add some conditional content to my WP pages. What I want to do is test cookies and display a semi-transparent screen with a content box based on a cookies' condition. I know how to construct the html and css to make this happen. I know how write the php to test cookies. What I don't know is what `add_filter()` or what `add_action()` to use to make this hook in my `functions.php` file. Can anyone provide direction or point me to the codex? I am just not sure what search arguments to use when I look at the codex. Thanks **AMENDED** Here is what I want to accomplish: I want the following to be added to each and every page on my site, regardless whether the page exists today. If I add a new page in the future, I want this to appear as well. (I wil handle all styling and positioning, etc. myself).
something to display


title: js Conflict in admin panel - I guess it's from the core WP installation

text: A client's site: causing serious js conflict or js loading disabilities, is under custody. Activating DEBUG, Deactivating all Plugins, and Activating Default theme "T13" found that, still the problem resides. The DEBUG is totally fine - no disabilities or mis-functionalities. It was in an Old WP version, I updated everything - so now it's all UPDATED. (WP version 3.6.1 as on today) **Symptoms**     * Can't add/edit any post/page content -- isn't loading the default editor, can't even switch to the HTML mode, because tab's not working   * The sub menus are not opening on hover, suppose I want to go to the Widgets page, then I need to click on the Appearance link then to the Widgets link. Hover is not working there.   * Tabs are not working - tried Skitter slide show in an instant, can't configure it from back-end because it's not functioning with its tabs. The client's site is an Online Newspaper site and have many news - the database size is huge. If I take the theme and install a new fresh WordPress then:   * What would I do with the old database? How can I import all the posts etc. into the new installation of WordPress so that I get them nicely work with the new WP installation? -- is simply a WordPress Import (Tools » Import) can solve the problem or can it cause much greater problems? Otherwise,   * How can I resolve the js conflict or js loading disabilities in wp-admin?


title: Add term for custom taxonomy from front end

text:
I'm having problems trying to create a custom type post with taxonomies using a form at the Front End. I have tried to add several lines of code and use 'tax_input' but I always get errors. The custom post type is: `pet` and the taxonomies are `pet-category` and `pet- city`. This code is working fine but is only posting the title, and the content. Please if somebody could tell me what I need to add in order to also post this two taxonomies wold be appreciated. but I have tried and tried without success,               <?php /* Template Name: Insert Posts */          $postTitleError = '';          if(isset($_POST['submitted']) && isset($_POST['post_nonce_field']) && wp_verify_nonce($_POST['post_nonce_field'], 'post_nonce')) {          $postTitle = trim($_POST['postTitle']);          $new_post = array(     'post_title' => wp_strip_all_tags( $_POST['postTitle'] ),     'post_content' => $_POST['postContent'],     'post_type' => 'pet',     'post_status' => 'publish'          );          $post_id = wp_insert_post($new_post,$wperror);          if($post_id)     {          // Update Custom Meta     update_post_meta($post_id, 'vsip_custom_one', esc_attr(strip_tags($_POST['customMetaOne'])));     update_post_meta($post_id, 'vsip_custom_two', esc_attr(strip_tags($_POST['customMetaTwo'])));          // Redirect     wp_redirect( home_url() ); exit;     }          } ?>          <?php get_header(); ?>
     <form action="" id="primaryPostForm" method="POST">          <fieldset>     <?php _e('Post\'s Title:', 'framework') ?>     <input type="text" name="postTitle" id="postTitle" value="<?php if(isset($_POST['postTitle'])) echo $_POST['postTitle'];?>" class="required" />     </fieldset>          <?php if($postTitleError != '') { ?>     <?php echo $postTitleError; ?>

     <?php } ?>               <fieldset>     <?php _e('Post\'s Content:', 'framework') ?>     <textarea name="postContent" id="postContent" rows="8" cols="30"><?php if(isset($_POST['description'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['description']); } else { echo $_POST['description']; } } ?></textarea>     </fieldset>
     Categoria: *     <select name="pet_category" id="pet_category" tabindex="9" class="required">     <option value=""></option>     <?php     $categories = get_terms('pet-category', array('hide_empty' => 0));     foreach ($categories as $category) {     echo "<option id='pet_category' value='$category->slug'>$category->name</option>";     }     ?>     </select>

     City: *     <select name="pet_city" id="pet_city" tabindex="9" class="required">     <option value=""></option>     <?php     $cities = get_terms('pet-city', array('hide_empty' => 0));     foreach ($cities as $city) {     echo "<option id='pet_city' value='$city->slug'>$city->name</option>";     }     ?>     </select>
               <fieldset name="site-image" class="site-image">     <input type="file" name="image" class="file_input_hidden site-image file_upload" onchange="javascript: document.getElementById('fileName').value = this.value;" />
Al menos de 200 de ancho x 200 de alto     </fieldset>                <fieldset>     <?php wp_nonce_field('post_nonce', 'post_nonce_field'); ?>     <input type="hidden" name="submitted" id="submitted" value="true" />     <button type="submit"><?php _e('Add Post', 'framework') ?></button>     </fieldset>     </form>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>


title: Make theme translatable for WPML

text: I have been really hard time to get my site translated.   I have MO and PO files, but my theme is not compatible with WPML and the developer team doesn't to change it. Therefore I may have to build a plugin or compatibility coding by myself. But I can't really find how to do and what I need to do. Does anybody know how to do? Or any tutorial for it? I can't really find WMPL site as well.


title: Sessions in plugin development?

text: I'm developing a plugin. At present I have two files. **dotmailer.php** and **dotmailer-add.php**. I'm creating a newsletter widget. My `dotmailer.php` plugin adds an admin menu, with options. It allows the admin to store an email address which is used as authentication for the API I'm using. This is taken from the options page form and stored as such:               $apiemail = get_option('apiemail');      I've also created a widget, this is the front-facing bit. The user inputs their email in the form and the form POSTs to a new file called **dotmailer- add.php**. So this file has the variable `$useremail` taken from the form. Now I'm stuck, because I need the var `$useremail` to be useable witin dotmailer-add.php. There is no way to send this through a form or anything because the form already posts through to the wordpress **options.php** file. I know when working with PHP sessions are often used to store variables that are needed across multiple files. My issue is that the admin will not be submitting the API emal to the Wordpress options page every time they log in, so they won't be starting a new session each time. I need the var `$useremail` to be available across all my plugin files at all times. I tried using `include` but unfortunately I get whitescreened with no errors (error messages are on). **How can I set a global variable through Wordpress options and have it available across multiple files within a plugin?**


title: Category Ajax Chain Selects - search results

text: Hello, I have a problem with my custom taxonomy and plugin Category Ajax Chain Selects... When I select a region, country, appeals etc. and push the submit button I got "page not found" and that takes me to the main page - `index.php`. PS: I set my permalink to `/%category%/%postname%/`   My site is here


title: How to modify an add_action() inside a loop of core function

text:
Ok I want to edit bp_core_screen_signup() is which is a function of buddypress that used to process the registration form. Basically this funtion checks for any errors produced and then loops through them using add_action() to inject them into register.php. Well I need to change the html tags it's using and I don't understand how. So first here is this big nasty function.               function bp_core_screen_signup() {     global $bp;          if ( !bp_is_current_component( 'register' ) )         return;          // Not a directory     bp_update_is_directory( false, 'register' );          // If the user is logged in, redirect away from here     if ( is_user_logged_in() ) {         if ( bp_is_component_front_page( 'register' ) )             $redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );         else             $redirect_to = bp_get_root_domain();              bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );              return;     }          $bp->signup->step = 'request-details';          if ( !bp_get_signup_allowed() ) {         $bp->signup->step = 'registration-disabled';          // If the signup page is submitted, validate and save     } elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {              do_action( 'bp_signup_pre_validate' );              // Check the base account details for problems         $account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );              // If there are errors with account details, set them for display         if ( !empty( $account_details['errors']->errors['user_name'] ) )             $bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0];              if ( !empty( $account_details['errors']->errors['user_email'] ) )             $bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0];              // Check that both password fields are filled in         if ( empty( $_POST['signup_password'] ) || empty( $_POST['signup_password_confirm'] ) )             $bp->signup->errors['signup_password'] = __( 'Please make sure you enter your password twice', 'buddypress' );              // Check that the passwords match         if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] )             $bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' );              $bp->signup->username = $_POST['signup_username'];         $bp->signup->email = $_POST['signup_email'];              // Now we've checked account details, we can check profile information         if ( bp_is_active( 'xprofile' ) ) {                  // Make sure hidden field is passed and populated             if ( isset( $_POST['signup_profile_field_ids'] ) && !empty( $_POST['signup_profile_field_ids'] ) ) {                      // Let's compact any profile field info into an array                 $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );                      // Loop through the posted fields formatting any datebox values then validate the field                 foreach ( (array) $profile_field_ids as $field_id ) {                     if ( !isset( $_POST['field_' . $field_id] ) ) {                         if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) )                             $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) );                     }                          // Create errors for required fields without values                     if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) )                         $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' );                 }                  // This situation doesn't naturally occur so bounce to website root             } else {                 bp_core_redirect( bp_get_root_domain() );             }         }              // Finally, let's check the blog details, if the user wants a blog and blog creation is enabled         if ( isset( $_POST['signup_with_blog'] ) ) {             $active_signup = $bp->site_options['registration'];                  if ( 'blog' == $active_signup || 'all' == $active_signup ) {                 $blog_details = bp_core_validate_blog_signup( $_POST['signup_blog_url'], $_POST['signup_blog_title'] );                      // If there are errors with blog details, set them for display                 if ( !empty( $blog_details['errors']->errors['blogname'] ) )                     $bp->signup->errors['signup_blog_url'] = $blog_details['errors']->errors['blogname'][0];                      if ( !empty( $blog_details['errors']->errors['blog_title'] ) )                     $bp->signup->errors['signup_blog_title'] = $blog_details['errors']->errors['blog_title'][0];             }         }              do_action( 'bp_signup_validate' );              // Add any errors to the action for the field in the template for display.         if ( !empty( $bp->signup->errors ) ) {             foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) {                 // addslashes() and stripslashes() to avoid create_function()                 // syntax errors when the $error_message contains quotes                 add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "
" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "
" );' ) );             }         } else {             $bp->signup->step = 'save-details';                  // No errors! Let's register those deets.             $active_signup = !empty( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : '';                  if ( 'none' != $active_signup ) {                      // Make sure the extended profiles module is enabled                 if ( bp_is_active( 'xprofile' ) ) {                     // Let's compact any profile field info into usermeta                     $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] );                          // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile()                     foreach ( (array) $profile_field_ids as $field_id ) {                         if ( ! isset( $_POST['field_' . $field_id] ) ) {                                  if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) {                                 // Concatenate the values                                 $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year'];                                      // Turn the concatenated value into a timestamp                                 $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) );                             }                         }                              if ( !empty( $_POST['field_' . $field_id] ) )                             $usermeta['field_' . $field_id] = $_POST['field_' . $field_id];                              if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) )                             $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility'];                     }                          // Store the profile field ID's in usermeta                     $usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids'];                 }                      // Hash and store the password                 $usermeta['password'] = wp_hash_password( $_POST['signup_password'] );                      // If the user decided to create a blog, save those details to usermeta                 if ( 'blog' == $active_signup || 'all' == $active_signup )                     $usermeta['public'] = ( isset( $_POST['signup_blog_privacy'] ) && 'public' == $_POST['signup_blog_privacy'] ) ? true : false;                      $usermeta = apply_filters( 'bp_signup_usermeta', $usermeta );                      // Finally, sign up the user and/or blog                 if ( isset( $_POST['signup_with_blog'] ) && is_multisite() )                     $wp_user_id = bp_core_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta );                 else                     $wp_user_id = bp_core_signup_user( $_POST['signup_username'], $_POST['signup_password'], $_POST['signup_email'], $usermeta );                      if ( is_wp_error( $wp_user_id ) ) {                     $bp->signup->step = 'request-details';                     bp_core_add_message( $wp_user_id->get_error_message(), 'error' );                 } else {                     $bp->signup->step = 'completed-confirmation';                 }             }                  do_action( 'bp_complete_signup' );         }          }          do_action( 'bp_core_screen_signup' );     bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );     }     add_action( 'bp_screens', 'bp_core_screen_signup' );      Now on line 98 you'll see.. // Add any errors to the action for the field in the template for display. Then it loops through the errors and you come to..               add_action( 'bp_' . $fieldname . '_errors', create_function( '', 'echo apply_filters(\'bp_members_signup_error_message\', "
" . stripslashes( \'' . addslashes( $error_message ) . '\' ) . "
" );' ) );      I need to edit those html tags in my bp-custom.php file without reproducing the entire function. How do I hook in correctly to do this?


title: How to get author ID when an author page is being viewed?

text: I'm having problems getting the author ID in my plugin's `init()` method. I've hooked `init()` to `wp`:               public function __construct() {         add_action( 'wp', array( $this, 'init' ) );     }      My `init()` method:               public function init() {         // Get the author ID if the author page is being viewed.         if ( is_author() ) {             $author = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );         }         // I want to be able to do $author->ID here but I get a debug notice.     }      I'm getting the debug notice "Trying to get property of non-object". I suspect this is because the following statement hasn't worked:               $author = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );      Inside `init()`, how can I get the author ID when an author page is being viewed? **Update:** As pointed out by TheDeadMedic, I should be hooking to `wp` instead of `plugins_loaded`. That doesn't solve the problem though. `$author` remains a 'non-object'


title: Updated/Tagged/Stable-Tag'ed plugin does not up in wordpress plugin repository

text: I have a plugin (http://wordpress.org/plugins/scoutnet-kalender) and I update it quite a few times from 0.2.0 (0.2.1, 0.2.2, 0.2.3 ...) to the new major release 1.0.1. I previously did this like decribed in http://wordpress.org/plugins/about/svn/#task-3; updating the "Stable tag:" in readme.txt (locally in my TRUNK folder), commited that and tagged a new release to the TAGS folder (tortoiseSVN makes this very easy). As soon as I update my local plugin folder, the new release is downloaded and shows up as expected. Now the strange part: The plugin directory (as you can check on the plugins' website) still shows 0.2.1 as the newest release (from a long time ago). If I use WP to install the plugin, I get the code of 0.2.2 (?) and the readme file with the changes of 0.2.5 (?!?). Interestingly the 'Compatibility' dropdown on the plugin page (bottom right) show _all_ tagged releases correctly (as "other versions"), but the old 0.2.1 as "current". What did I do wrong? And more important: How do I clean up this mess? :-)


title: how to reorder the content of the single post?

text:
actually i install "related post" plugin. and i use               <?php the_content(''); ?>      to show up my single post in single.php file . so when i want to add the writer name after the post i write this               <?php the_content(''); ?>     <?php the_author(); ?>      but the writer name or the author is showing after the related posts ... i don't want that !! i want to put the author name after the last word in this post. so is there a way to do this ,or to have an array of "the_content" to reorder the inter content. here is my code                       <?php while ( have_posts() ) : the_post(); ?>

                  <a href="<?php the_permalink(); ?>" title="<?php the_title();?>">  <?php the_post_thumbnail(); ?>
             <?php the_content(); ?>
بقلم :  <?php the_author(); ?>

             <?php endwhile; ?><?php comments_template('',true); ?>      even if i use the add_filter in the functions.php or try to combine them by `echo` is do the same thing ... any help ?


title: Add a custom left and right eyes filter in woocommerce?

text: I using wordpress 3.9.2 and woocomerce 2.11. I need at achieve something like this http://www.specsavers.com.au/contact-lenses/monthly-disposables/air-optix-aqua Here user can purchase either left eyes lenses or right eye or both based on the choice he selects. How can i do this in woocommerce? Any suggestions would be appeciated!!!!


title: How to hide 'Home' button from appearing on supages - twenty eleven theme

text: How could I make it so the ' _Home_ ' button / text link doesn't appear in the top menu as the user navigates to a subpage?? _(So the menu stays the same accross)_


title: How to notify users of blog updates a la Admin Plugin Update notifications?

text: What I would like to do is mimic how Wordpress shows an administrator how many new updates there are for installed plugins (a tiny number displayed next to a link). The main difference is that I want to serve this info to a logged-in user on the front end (since they last visited):   * new messages they've received (Buddypress)    * new forum posts (Buddypress)    * new posts for "favorited" categories Not sure where to find the code that provides plugin update notices but that would be a start...


title: Client system for media review?

text: I'm looking for a plugin, or a system, for wordpress, that would allow a client to login and see the graphic designs, video, documents, etc... that i'm currently producing for them, and allow them to leave comments. Is there anything like this out there?


title: add_rewrite_rule and custom variable

text: I have been wanting to do something similar like this for a long time. I have a url http://studionumberone.com/portfolio/obey-clothing/ which just shows the jquery gallery of images, I then have studionumberone.com/portfolio/obey- clothing/?view=all. Which shows all of the images in the gallery one above each other. I would like the url to be studionumberone.com/portfolio/obey-clothing/all The custom post type just does a basic:               <?php get_header();      $view = $_GET['view'];     ?>     <?php if ($view == "all") { ?>     show all images     <?php } else { ?>     show gallery shortcode      <?php } ?>     <?php get_footer(); ?>      I have tried (no luck):               add_action( 'init', 'ss_permalinks' );     function ss_permalinks() {         add_rewrite_rule(             '([^/]+)/all/?',             'index.php?view=all&service=$matches[1]',             'top'     );     }     add_filter( 'query_vars', 'ss_query_vars' );     function ss_query_vars( $query_vars ) {         $query_vars[] = 'view';         return $query_vars;     }


title: Unable to use custom taxonomy with front end post form

text: I have a front-end posting form configured for a custom post type. By using the form I am able to send the title, content, and image attachments without a hitch, but my custom taxonomy selection doesn't register. I've patched this functionality using various bits of code I have found and I'm not sure exactly what I screwed up. add-new-listing.php               if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) &&  $_POST['action'] == "new_post") {              // Do some minor form validation to make sure there is content         if (isset ($_POST['title'])) {             $title =  $_POST['title'];         } else {             echo 'Please enter the listing name';         }         if (isset ($_POST['description'])) {             $description = $_POST['description'];         } else {             echo 'Please enter a description';         }              $tags = $_POST['post_tags'];              // ADD THE FORM INPUT TO $new_post ARRAY         $new_post = array(         'post_title'    =>  $title,         'post_content'  =>  $description,         'post_category' =>  array($_POST['booru_locations']),  // Usable for custom taxonomies too         'post_image'    => $newupload,         'post_status'   =>  'publish',           // Choose: publish, preview, future, draft, etc.         'post_type' =>  'booru_directory'  //'post',page' or use a custom post type if you want to         );              //SAVE THE POST         $pid = wp_insert_post($new_post);                   //REDIRECT TO THE NEW POST ON SAVE         $link = get_permalink( $pid );         wp_redirect( $link );          //INSERT OUR MEDIA ATTACHMENTS     if ($_FILES) {     foreach ($_FILES as $file => $array) {     $newupload = insert_attachment($file,$pid);     // $newupload returns the attachment id of the file that     // was just uploaded. Do whatever you want with that now.     }          } // END THE IF STATEMENT FOR FILES          } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM          //POST THE POST YO     do_action('wp_insert_post', 'wp_insert_post');      functions.php               $labels = array(         'name'                          => 'Locations',         'singular_name'                 => 'Location',         'search_items'                  => 'Search Locations',         'popular_items'                 => 'Popular Locations',         'all_items'                     => 'All Locations',         'parent_item'                   => 'Parent Location',         'edit_item'                     => 'Edit Location',         'update_item'                   => 'Update Location',         'add_new_item'                  => 'Add New Location',         'new_item_name'                 => 'New Location',         'separate_items_with_commas'    => 'Separate Locations with commas',         'add_or_remove_items'           => 'Add or remove Location',         'choose_from_most_used'         => 'Choose from most used Locations'         );          $args = array(         'label'                         => 'Locations',         'labels'                        => $labels,         'public'                        => true,         'hierarchical'                  => true,         'show_ui'                       => true,         'show_in_nav_menus'             => true,         'args'                          => array( 'orderby' => 'term_order' ),         'rewrite'                       => array( 'slug' => 'place', 'with_front' => false ),         'query_var'                     => true     );          register_taxonomy( 'booru_locations', 'booru_directory', $args );               // Add new taxonomy, NOT hierarchical (like tags)         $labels = array(             'name' => _x( 'Services', 'Service Type' ),             'singular_name' => _x( 'Service', 'Service' ),             'search_items' =>  __( 'Search Services' ),             'popular_items' => __( 'Popular Services' ),             'all_items' => __( 'All Services' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Services' ),             'update_item' => __( 'Update Service' ),             'add_new_item' => __( 'Add New Service' ),             'new_item_name' => __( 'New Service' ),             'separate_items_with_commas' => __( 'Separate Services With Commas' ),             'add_or_remove_items' => __( 'Add or Remove Services' ),             'choose_from_most_used' => __( 'Choose From Most Used Services' )         );          register_taxonomy( 'services', 'booru_directory', array(             'hierarchical' => false,             'labels' => $labels, /* NOTICE: the $labels variable here */             'show_ui' => true,             'query_var' => true,             'rewrite' => array( 'slug' => 'services' ),         ));                         register_post_type( 'booru_directory',         array(             'labels'                => array(                 'name'              => __( 'Directory' ),                 'singular_name'     => __( 'Listing' )                 ),             'public'                => true,             'show_ui'               => true,             'show_in_menu'          => true,             'supports'              => array( 'title', 'editor', 'thumbnail' ),             'rewrite'               => array( 'slug' => 'directory', 'with_front' => false ),             'has_archive'           => true         )     );


title: individual images as navigation design TwentyTen

text: I can't figure out a solution for changing the black bar in Twenty Ten to individual background images behind each link. Using an image I created in Photoshop I have tried changing a few things in the CSS file but probably not the right changes. Do I need to edit the functions file too?


title: Nivo Slider Pulling In Wrong Size Image

text: I have tried changing the CSS, although I'm fairly sure the problem is not with the CSS. The theme has the slider at 940px by default, but I want to change this to be full width (or at least wider). Why is Wordpress setting the images to 940px? It puts -940xheight at the end of every slide. I have checked all the image sizes in wordpress and even used the Simple Image Sizes plugin and regenerated thumbnails which hasn't helped.


title: Show field if it has contents on Advanced Custom Fields

text:
I have a custom field set that is look to display like so:
Lease Rate:             <?php the_field('lease_rate'); ?>

 NNN Expenses:             <?php the_field('nnn'); ?>

 Monthly Rent:             <?php the_field('rent'); ?>

 Site Area:             <?php the_field('site_area'); ?>

Sale Price:           <?php the_field('building_size'); ?>

Building Size:           <?php the_field('Address'); ?>

Contact Name:           <?php the_field('contact_name'); ?>

Phone Number:           <?php the_field('phone_number'); ?>
      I need to change it so that:   IF the field is filled in, THEN the title shows up. For example, if `the_field lease_rate` has a value then the paragraph "Lease Rate" shows up. I was thinking some kind of if statement then echoing the p?


title: How to set Active plugins as the default screen?

text: In my testing environment, I've got one hundred plugins. I'm more interested in seeing first the **Active** plugins than the complete list (`All`). How can I change the default screen for the `Plugins` menu item? ![enter image description here](http://i.stack.imgur.com/TPpqo.png)


title: Edit custom taxonomy description programatically

text: I've added a custom taxonomy and I wanted to know if there is a way to edit a custom taxonomy's description. Here's the description field. ![image of custom taxonomy](http://i.stack.imgur.com/whql5.png) IS there a function that provides access to this field? And if so, would I be able to use it in the New Posts page?


title: Change /search to /somethingelse

text: How do I change the search url? I already have something like: /search/keyword But I want to change /search to something else. How can I do it? Thank you!


title: Impossible to get Attachments Outside Wordpress?

text: My page (outside the wordpress install) begins something like this:               global $wpdb, $wp_query;      define('WP_USE_THEMES', false);     include_once 'word/wp-blog-header.php';          $args = array(       'posts_per_page'  => 10,       'post_type'       => 'post'     );     $queryObject = new WP_Query($args);      I start the loop like so:               <?php while (have_posts()): the_post(); ?>      In the loop I call this:               <?php the_post_thumbnail();?>      But nothing is returned.               print_r(get_post(4));      (Where 4 is the id of an attachment) also returns nothing. Calling               <?php the_content(); ?>      echoes the post content, minus the gallery - which also doesn't get rendered, but the shortcode is removed. Inside wordpress everything works fine, outside it seems that attachments are simply ignored. Why does this happen? Is there a workaround? Is there something wrong with my query? . . . **I found an alternative solution to my original problem - using a subdirectory, but I still feel this is a valid question. The original is here:** I'm using the wordpress engine as a CMS for a website that can't be integrated into wordpress right now because of time constraints (but will be eventually), so I need to get hold of things like post thumbnails outside of the wordpress directory. I'm using the following to set up my loop:               global $wpdb, $wp_query;      define('WP_USE_THEMES', false);     include_once 'word/wp-blog-header.php';     $args = array(       'posts_per_page'  => 10,       'post_type'       => 'leather_swatch'     );     $loop = new WP_Query($args);          if ($loop->have_posts()) : while ($loop->have_posts()) : $loop->the_post();      However, in index.php this works, but returns nothing in my external loop:               $thumb = get_post_thumbnail_id($post->ID);     echo '<img src="'.wp_get_attachment_url($thumb).'" />';      What I find really odd is that               print_r(get_post($thumb));       returns a post object inside the wordpress directory, but nothing in my custom loop - it doesn't recognise attachments. However I can still print out the content of my post type in the custom loop using the standard the_content() function. Can anyone illuminate what's going on/how I might fix this? I don't really want to use custom meta data to replicate standard functionality.


title: I keep getting Javascript error messages

text: I think something in my code must be utterly wrong because as soon as I manage to fix one error that I found, the next one pops up. I just managed to solve this problem. Now this error message keeps popping up: ![enter image description here](http://i.stack.imgur.com/5pwiF.jpg) Here's my blog. I might have some jquery conflict somewhere, but I implemented everything correctly and I just can't see what is causing the issue. Could somebody with more experience have a look and tell me what might be causing the Javascript error messages that I keep getting?


title: Related posts popup

text: I want to retain visitors on my blog by showing them other posts related to the post they are reading. But it seems they don't see this widget at all. So I have an idea to show this list in a popup (DIV) which appears in the bottom (or any side) of the page after the user scrolls the post for some extent. Does anybody know the best way to do this?


title: Create a post with user_register doesn't create title

text: I've got my user registration to automatically create a post with the user_register hook however the title shows up as (no title) can someone help me with what I'm doing wrong here?               add_action('user_register','create_new_user_post');          $userinfo = get_userdata($user_id);     $disname = $userinfo->display_name;          function create_new_user_post($user_id){             if (!$user_id>0)return;                  // Create post object             $my_bio_post = array(                // 'post_type' => 'ggs_user_post_type',                  'post_title' => $disname,                  'post_content' => 'Put cool content here!',                  'post_status' => 'publish',                  'post_author' => $user_id             );                  // Insert the post into the database             $bio = wp_insert_post( $my_bio_post );                  //and if you want to store the post ids in              //the user meta then simply use update_user_meta             update_user_meta($user_id,'_bio_post',$bio);     }


title: disable trashability for certain pages

text: Im building a wp site, that has some pages that only shows when a form has been completed. (think of "thank you for gettin in touch, we'll get back to you as soon as possible" - type pages). I have created this as a page, and then i use wp_redirect after the form has been submitted to get to it. But now the client will be able to delete this page, and it will then go 404 on the redirect. So the question: Is there a way that i can lock certain pages in the wp-admin? Im interested in both a solution where the certain page will disappear from a specific role, and/or a way where specific roles can't trash specific pages - but still edit it. Thank you so much.


title: How to hide the year in archive link

text: I am using the following code to show the archive link by month.               <?php wp_get_archives('type=monthly&limit='.date('m').'&show_post_count=1'); ?>      but it shows as   * december 2013 (3)   * november 2013 (2) but i need to just months only as..   * december (3)   * november (2) how can I do that in some easy steps?


title: TGM plugin error in Theme Check Plugin

text: Errors generated by theme-check plugin and with the code REQUIRED: plugin-activation.php. Themes should use add_theme_page() for adding admin pages. Line 335: add_submenu_page(               add_submenu_page(         $this->parent_menu_slug,                // Parent menu slug         $this->strings['page_title'],           // Page title         $this->strings['menu_title'],           // Menu title         'edit_theme_options',                   // Capability         $this->menu,                            // Menu slug         array( &$this, 'install_plugins_page' ) // Callback     );      REQUIRED: innovative_panel_functions.php. Themes should use add_theme_page() for adding admin pages. Line 143: add_menu_page(theme_name.' Settings', theme_name ,'install_themes', 'panel' updated the list.               $icon = get_template_directory_uri().'/innovative_panel/images/ipanel-settings.png';         add_menu_page(theme_name.' Settings', theme_name ,'install_themes', 'panel' , 'panel_options', $icon  );         $theme_page = add_submenu_page('panel','Settings', theme_name.' Settings','install_themes', 'panel' , 'panel_options');         add_submenu_page('panel',theme_name.' Documentation', 'Documentation','install_themes', 'docs' , 'redirect_docs');         add_submenu_page('panel','Support', 'Support','install_themes', 'support' , 'innovative_get_support');      I get this error. Please help me to sort out this issue. Can my theme be submitted for approval with these errors?


title: Put a link to a category round a hard coded A HREF

text: In my footer I have hard coded the links and would like to link some to there category, I could just copy the full URL to it and paste in the href="" but I would rather call it using php. My knowledge of WordPress and PHP is little and I have tried searching for something that will do this but none work, my last go used this:               <a href="<?php echo get_permalink( get_page_by_path( 'cooking-sauces' ) ); ?>">Cooking Sauces      and I tried this:               <a href="<?php echo get_permalink( get_page_by_path( 'cooking-sauces')->ID); ?>">Cooking Sauces      but did not work. So the full URL would be http://woloped.co.uk/blog/products/cooking-sauces/ Please can some one help, many thanks Dave UPDATE: Could it be called using the SLUG and if yes have is this done please.