Need help using a filter on the default Categories widget

I need to add the "All Categories" item to the default WP categories widget. I can see that there's a filter that I can hook into in the core (line 485 default-widgets.php).               wp_list_categories(apply_filters('widget_categories_args', $cat_args));       I've written the following function, but I must have something wrong as it's not adding the all categories item to the list.               // Add "All Categories" to categories widget     function add_all_categories_to_widget($cat_args) {         $cat_args['show_option_all'] = 'yes';         return $cat_args;     }     add_filter('widget_categories_dropdown_args', 'add_all_categories_to_widget');      Can anyone fill me in on what I've got wrong? Thanks!


Get term name from term ID?

I cannot figure out how to get the taxonomy term name if I have the taxonomy term's ID. This is my current code               // create a dropdown menu of the quantity taxonomy      wp_dropdown_categories(          array('taxonomy' => 'quantity_category', 'name' => 'productQuantity', 'hide_empty' => 0)     );           $quantityTerms = $_POST['productQuantity'];     $quantityTax   = 'quantity_category';      The value of `$quantityTerms` is not the "name" of the quantity but the ID of the quantity category. When it sets the object terms, it creates a new category called "ID#" and not inserting it into the category by name.               wp_set_object_terms( $post_id, $quantityTerms, $quantityTax, $append );


How do I make a shortcode?

Learning as I go... I have this functionality built, but I need it as a shortcode. How do I do that?               $args = array( 'taxonomy' => 'product_cat' );     $terms = get_terms('product_cat', $args);          $count = count($terms); $i=0;     if ($count > 0) {         $cape_list = '
';         foreach ($terms as $term) {             $i++;             $term_list .= 'slug . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '';             if ($count != $i) $term_list .= ' · '; else $term_list .= '
';         }         echo $term_list;     }


Why tinyMCE.editors doesnt work on tinyMCE

<?php      /*     Plugin Name: Taggr     Plugin URI: http://example.com/wordpress-plugins/my-plugin     Description: Premium plugin for image and photo tagging     Version: 1.0     Author: Tee Kai Yang     Author URI: http://wrox.com     License: GPLv2     */               add_action('init', 'register_tagging_post');          //create taggr post type           function register_tagging_post(){                 $tagging_args = array(                'public' => true,                'supports' => array(                    'title',                    'thumbnail'                     ),                 'query_var' => 'tagging',                'rewrite' => array(                   'slug' => 'taggr',                   'with_front' => false                ),                 'labels' => array(                 'name' => 'Taggr Albums',                 'singular_name' => 'Album',                 'add_new' => 'Add New Album',                 'add_new_item' => 'Add New Album',                 'edit_item' => 'Edit Album',                 'new_item' => 'New Album',                 'view_item' => 'View Album',                 'search_items' => 'Search Albums',                 'not_found' => 'No Albums Found',                 'not_found_in_trash' => 'No Albums Found In Trash'             ),                  'menu_icon' => plugins_url() . '/taggr/images/PhotoAlbum.png',                  'menu_position' => 80,                  );                 register_post_type('tagging', $tagging_args);                }              add_action( 'add_meta_boxes', 'taggr_create_meta' );      function taggr_create_meta(){               add_meta_box( 'taggrMeta', 'Upload and edit photos/images', 'taggr_meta_function', 'tagging', 'normal', 'high' );               function taggr_meta_function(){                    ?>                 <?php wp_editor("Enter your text", "my_editor"); ?>              <script>         window.onload = function(){             alert(tinyMCE.editors[0].getContent());         }         </script>                  <?php              }                   }               ?>       Above is my code, I created a custom post and a tinyMCE text editor inside a metabox. But why when execute `alert(tinyMCE.editors[0].getContent());` line, it doesnt work and does not shows the content of the editors. The firebug shows the error of `TypeError: tinyMCE.editors[0] is undefined`


Wordpress query_posts by tag doesn't work anymore(?)

I had this code running fine forever. Some days ago it just started outputting nothing (just the `<ul></ul>`). No errors in logs:
     <?php query_posts('tag=pp&showposts=4'); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
          <?php endwhile; ?>
      Of course there are posts with that tag.


Remove "show sharing buttons" metabox JetPack from custom post type

I have installed JetPack and now my custom post types feature a meta-box that says "Sharing: Show sharing buttons" with a checkbox. This is unnecessary for this custom post type and I would like to remove it altogether (not just hide it via screen options). I tried adding               add_action( 'init', array( $this, 'my_remove_filters_func' ) );          function my_remove_filters_func() {         remove_all_filters( 'the_content', 'sharing_display',19 );         remove_all_filters( 'the_excerpt', 'sharing_display',19 );     }      however it doesn't seem to be working


How to *disable* the post content editor

Any good ideas on how to _disable_ the post content editor? I don't want to hide it, remove it, or remove the page. The goal is to allow users with few permissions to view the edit screen so they can read the content, but not be able to make changes to the content. (I also need to figure out how to disable other elements on the page, but one step at a time). I've done this with Javascript already by just targeting the textarea and added `disabled`, but looking for a less flimsy method. Background for why I need this: https://github.com/post-forking/post- forking/pull/105


Photo gallery on profile page?

Is there a way, (or a plugin), that allows members to have their own photos on their profile page? I want to limit the amount of photos to perhaps 50. Any suggestions??? Thanks in advance!!!


What for is the table "wp_commentmeta" exactly?

I have been reading about the Database Description of Wordpress. I haven't understood the meaning to the use of the table `wp_commentmeta`. The documentation says: > Each comment features information called the meta data and it is stored in > the wp_commentmeta. I have a fair idea of what meta-data is. I know how the table `wp_postmeta` stores custom field, for example. But in the case of the comments, I don't understand:   * What kind of information would go in this table?   * Why wouldn't it be in the same `wp_comments` table?   * What is a practical example of how someone would use it, so that I could test it out and have a more graphic idea of how it works?


How can I allow users to make groupings of posts

I have a site with many research methods. I want to introduce the abilities for users to create groups of posts and save them for others to access, as a way to make the methods more meaningful for different types of people and applications. Any advice for achieving this. The site is http://www.designmethodsandprocesses.co.uk I want front end users to do it. The best analogy would be user-generated playlists.


Stop Attachment image names from taking top level permalink

I don't know why but images uploaded to my site in posts are getting a top level permalink. So if I upload an image into a post called "Apple" then it gets an attachment page at mysite.com/apple and that is a big problem for me. How can add a path between my top level and image attachment page name?


Fallback image size when using wp_get_attachment_image_src / full size compressed image

I am using ACF to pull images using ‘wp_get_attachment_image_src’ as such:               <?php $image = wp_get_attachment_image_src(get_field('image'), 'large'); ?>     <img src="<?php echo $image[0]; ?>" alt="" />      Whatever image size I enter (here it is ‘large’, but it could be a custom image size), if the image that has been uploaded was smaller than the set size, that size will not have been created and Wordpress will use the full, original, uncompressed image as a fallback. This is very undesirable, as the image will often have no compression and be a very large filesize unnecessarily. What are the workarounds for this? Can I make Wordpress create a full pixel- size, yet jpeg compressed image and make it use that as the fallback? Thanks in advance for your help!


Slider Issues using MetaBox Plugin

I'm just now joining a previously launched project. The home page slider is a custom meta_box type from the MetaBox plugin. Here is the code to add the fields.               $meta_boxes[] = array(         'id' => 'homesliderimages',         'title' => 'Slider Images',         'pages' => $post_types,              'fields' => array(             array(                 'name'  => 'Slide Images',                 'desc'  => '940 x 412 images (jpg)

To adjust the link, click Edit and adjust the media information.',                 'id'    => "{$prefix}slideimagesnew",                 'type'  => 'image',                 //'force_delete' => true             ),             // Other fields go here         )     );      The images load into the slider fine. My issue is in the WP admin section. When the client tries to rearrange the sliders my dragging them, they appear to be reordered. But when the client hits update, the order goes back to the original order. **This is the a screenshot for when you're adding images in the admin section** **Before Reordering**   ![before reordering](http://i.imgur.com/YUSbsqs.png) * * * **After Reordering, Before Save** ![after reordering, before save](http://i.imgur.com/bStcZH5.png) * * * **After Reordering, After Save**   ![after reordering, after save](http://i.imgur.com/YUSbsqs.png) Also, as you'll notice in the images: there are lots of blank images. I can't I get an javascript alert that says undefined whenever I click 'delete' on the image. Any advice?


What files to keep after upgrading WordPress?

We were recently handed a few blogs/sites to support, that have started way back when wordpress was on v2.1.3 or even 2.0.4 After upgrading the sites to the latest versions (3.4.2 and 3.5) we found that there are files in the root directory as well as the /admin and /includes that are "leftovers" from the older versions or have been relocated in these recent versions. Here is an example of what I am talking about: ![updated installation - new installation](http://db.tt/GpLJr5P9) Some files state: _"This file is deprecated and only exists for backwards compatibility"_ So... What do you think? Should one just delete these files and go for a beer!!! Should they be left there? Any concrete/tested answers on the subject? PS: I am aware of the this post but not quite happy with the answers provided there. Especially when combining this present question with this one about dbdelta. So I am kind of reopening the issue (if I may do so) hoping for a more definite answer.


Sort post by last commented

I tried this :               <?php if ( have_posts() ) : query_posts(array('orderby_last_comment' => true)); ?>      But it's not working


How can I add a jQuery OnClick event to the Publish posts button?

I want to add a simple confirmation event to the Publish posts button, so when my client hits "Publish" it will ask him if he's sure, to which he clicks "Yes" or "cancel" and the post then publishes or doesn't. I'm new to WordPress...or at least I've only done theme and limited plugin programming. I did find the metabox code for the "Publish" button in `edit- form-advanced.php`:               add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', null, 'side', 'core');      But to accomplish this, I suspect I'll need to add the jQuery code elsewhere - preferably in my theme. For site-specific reasons, I cannot add new plugins to this installation so any changes need to be confined to my theme's `functions.php` file.


Plugin templates vs Parent Theme

I've been building a plugin using a WooCommerce like template system, where the plugin houses the default templates, but allows for overriding via a template folder in your active theme.   It just occurred to me that another option would be to use a base parent theme just for markup, and then build child themes with different styling options. I'm trying to figure out what the pros and cons of both approaches are for development and for the user – or if there are other options. The plugin is designed to be a self contained system, so I could see that being in favor of using a parent theme. But if it ever becomes a plugin that's distributed, I see how using a plugin template system could be more advantageous. How should I provide the templates needed for my plugin?


Pagination with custom query, custom search form, single and pages, ajax and no plugins

I've read a lot of posts here about pagination with custom queries and tried the suggested answers (like this one). It seems however that my situation is a little more complex, and in the existing questions people often mention pagination plugins which I don't want to use (if possible). I have a custom search form. The action URL and destination (results page) of the search form can be a page or one of several singular custom post type pages. This is all working as expected. The pagination works when I directly go to the results page, but it doesn't when I use the custom search form to input values. It does output the correct results though, because when I set `posts_per_page` to `-1` I can see the correct results. **The problem** The thing is that when I click a page number, the div where the page should be loaded (through AJAX) stays empty. **The code** On the results page I have a custom query, which uses input from the search form:               $query = my_function($v1, $v2, $v3, $v4);      The arguments for the query are defined in the function:               function my_function($v1, $v2, $v3, $v4) {              // The $v variables are used to create $args. It's a lot of code and there are several versions of $args. I'm not displaying this information here because the query itself is working like I've described above.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;              $args = array(             'post_type'         => 'events',             'post_status'       => 'publish',             'posts_per_page'    => 20,             'paged'             => $paged,             'meta_query'        => array($meta_query),             'meta_key'          => 'date_from',             'orderby'           => 'meta_value',             'order'             => 'ASC',         );              return new WP_Query($args);     }      Then on the results page, after $query is defined:               if($query->have_posts()):     while ($query->have_posts()): $query->the_post();        // Do stuff here     endwhile;          echo create_pagination($query);          endif; wp_reset_query();      The pagination function:               function create_pagination($query) {              $big = 99999999;              $args = array(             'base' => str_replace($big, '%#%', get_pagenum_link($big)),             'format' => '/page/%#%',             'total' => $query->max_num_pages,             'current' => max(1, get_query_var('paged')),             'show_all' => false,             'end_size' => 1,             'mid_size' => 2,             'prev_next' => true,             'prev_text' => '',             'next_text' => '',             'type' => 'list'         );              return paginate_links($args);          }      And to top things off and make this even more complex :-), the code to use AJAX on pagination:               $('.listcontent').on('click', '#pgn a', function(e){             e.preventDefault();             var link = $(this).attr('href');             $('.yt-listcontent').fadeOut(300, function(){                 $(this).load(link + ' .listcontent', function() {                     $(this).fadeIn(300);                 });             });         });      Please note: like I've described the query is working as expected, also when the using the custom search form. The pagination js above is also working. Like described for the query, the js works when I go to the results page and don't enter information into the search form. What happens is that when I enter information into the custom search form, the pagination is created (and the links also point to `example.com/thecurrentpage/page/pagenumberhere`) and shows up, even with the correct page links. But when a page link is clicked, the `.listcontent` div stays empty (fade effect is visible though). I think there's something wrong with my pagination settings and while I believe my form and query is right, the pagination is still a bit abracadabra to me. **UPDATE** After trying the code from this post as was suggested, the problem is still the same. The solution there uses the search query (hence the `global $wp_query`) so I think the problem has to with the custom query.


Daily class register with monthly invoicing

I'm about to take on the task of creating a daily class register the features of which I have listed below. I am mostly a novice when it comes to wordpress development and I can do some PHP programming but combining the two I'm finding difficult to understand where to start this task. could anyone at least let me know everything I would need to do this, whether free plugins exist to accomplish the task or whether there are tutorials I can follow to do this myself and how I can lay it all out. Thanks   * Protected area (staff only)   * 2 class rates (1 to 1 (charged hourly) and group (charged daily)) with ability to edit the price of each rate   * add/remove/edit class members   * Staff enter the number of hours each person attended that day and at which rate to charge each person   * over-time is charged at minimum of half an hour if more than half an hour then person charged for full hour   * at the end of each month a printable invoice is created for each person based on the daily register detailing the dates and the total monthly charge payable


Detect 404 before headers are sent

I've a piece of code that shows a banner the first time a user visits, then sets a cookie, which prevents it showing again. However, if the page has a 404 error, the 404 page of the requested resource sets the cookie and the banner is not shown. Checking `is_404()` on the init hook does not avoid this situation. So how do I correct this problem and detect the 404 on the init hook?


How can I update custom database table in woocommerce after the successful payment

I am not sure with this. I want every quantity of each order to have equivalent voucher code in custom table TIA!               add_action('woocommerce_checkout_order_processed', 'update_vouchercode');          function update_vouchercode($order_id) {            $order = new WC_Order( $order_id );            $limit = count( $order->get_items() );                 $data = array(            'order_id' => $order_id,        );                 $update = $wpdb->update('tbl_voucher' , $data, "WHERE order_id ='0' LIMIT $limit");      }


set cookies for my whole site is not working

I'm trying to set the cookie to my site to **hide a div on click action**. Description of the problem.   1. I wanna set the cookie for the whole site not for particular page. I'm setting the cookie `on click` the div by  > jquery-cookie.js   1. when I'm clicking the div on home page the div is invisible throughout the site. but if I'm trying to remove my div on other page it is not invisible throughout the site.   2. I've tried the following functions of the **wordpress codex** `site_url()` `get_site_url()` `home_url()` `get_option('home')` by these methods I've named the **domain** but it is not working. I've also tried `/` for the domain name it is also not working. these all are not working for me. please suggest me some other method to do that. My plugin site consist of 4 pages url as follows               site/wordpress/     site/wordpress/contact-us-2/     site/wordpress/sample-page/     site/wordpress/test-page/


How to split existing blog into Wordpress Multisites without breaking links?

I am going to split an existing Wordpress blog with a lot of posts in different languages into multisites which get all posts of one language each. The multisites will be available under different subdomains then. For example `en.example.com`, `de.example.com` and `fr.example.com`. So the URL of all existing articles will change. This is an issue because the old links are indexed by Google and linked by other pages. Does the multisite feature handle old links e.g. `www.example.com/an-english- article` by redirecting to the new article e.g. `en.example.com/an-english- article`? It would be great if the server could send `301 Moved Permanently` responses so that Google can update their index accordingly. How is this handled by Wordpress multisite, and if it isn't properly, how can I set up 301 codes and redirects to the new article by a plugin or even by hand?


Is there a way to measure server resource (CPU) usage by WP plugins?

I have a website who is having a high CPU usage. The only way I know of it, is the information I get from the support people of the hosting company. Is there any other way for me to become informed of the resource usage done by my website? (specifically the plugins, but not only them) Thanks.


Conditional for a Single Post That Belongs to a Category?

I have categories like `gaming` and `movies` on my website and when a user visits any of these categories the content in the sidebar is displayed depending on the category they are in. So gaming content for the gaming category, movie related content for movies. When a user selects a post in either of these categories, I have it defaulting to the sidebar that displays on the home page since I don't know how to keep the sidebar displaying the same content that is on the category pages. The closest I could get would be something like `<?php if ( is_single() ) : ?>`. How would I add `is_category( 'gaming' )` so it can target a `single page` (single.php) that belongs to the category `gaming?`


Fetching full size featured image to insert in RSS Feed

I am trying to fetch a full size Featured Image (or first image) of the post to appear within my RSS feed. See here I am using the following code               function firstImg( $post ) {         $matches = array();         $output = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches );         if ( isset( $matches[1][0] ) ) {             $first_img = $matches[1][0];         }              if ( empty( $first_img ) ) {             return '';         }         return $first_img;     }     add_filter('the_excerpt_rss', 'firstImg');      However, this is only fetching a 200x200 thumbnail size of the image. I want to use the full size which is 600px width. What's missing in the code? Thanks


Exclude pages in archives results

So, i got a custom post type applied to different posts and also a page. When i display this page, it shows some content (text), and at the bottom a link to get the list of the products related to this page (thanks to the CPT also applied to the page). The link is called like this:               echo get_the_term_list( $post->ID, 'prod-cate', 'Products of the cateogry: ', ', ', '.' );       When i hit this link, it displays an archives page with the products but also the page i'm comming from. The question is, how not to display this page in the archives results?


free web host for wordpress blog

I like to host a wordpress blog via free hosting services. **Is there any frre web hosting site host the wordpress blog. Please help me.** Thanks in Advance...


Invision + Wordpress integration

I'm trying to integrate Invision Power Board into our website, Wordpress by using IPB Website Integration (IPBWI). I have used the script sometime before on a static website, but I'm having trouble with the integration in Wordpress. The script is actually working as intended in Wordpress, but I am getting a lot of warning-messages throughout the site, like this:               Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method RCCWP_Query::FilterCustomPostsFields() should not be called statically in [path]\wp-includes\plugin.php on line 220     Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method RCCWP_Query::FilterCustomPostsJoin() should not be called statically in [path]\wp-includes\plugin.php on line 220     Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method RCCWP_Query::FilterCustomPostsOrderby() should not be called statically in [path]\wp-includes\plugin.php on line 220     Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method RCCWP_Query::FilterCustomPostsFields() should not be called statically in [path]\wp-includes\plugin.php on line 220      It is mainly where I have custom queries I get these warnings This might be beyond the scope of support witch this board gives, but hopefulle someone might know some solutions.


Creating external apps Wordpress / How they work

I was wondering how does external app works for `wordpress.com` or `wordpress.org`. Directly connecting to the wordpress database seems a bad idea to me. Questions   * How can I create an app or get / post data from the wordpress database?   * Is there a JSON API or XML API format so that I can easily exchange data between the two?


Does WP, php, or a current framework (woofoo / genesis, etc). Offer a way to schedule text / bg color changes?

I would like to build a site for a religious group that follows a Church calendar year that highlights seasons by different colors. Is there a way with existing WP / php / css / framework to schedule a different color profile for a theme based on the date? casey


How to change the CSS in one file?

Should I go to many files to change the appearance of Wordpress? Isn't it possible to change it form one file? And what should I learn from CSS to be able to modify Wordpress easily? I mean should I reach to an advanced level?


Setting up a members area

I am trying to set-up a members area on a site, I have already come up with one solution but was wondering if anyone one knows of an easier or better way to go about it. The problem is the user doesn’t log into WordPress, they are sent to a separate product for bookings and such. The way I have accomplished this is having two separate themes the guest theme, which blocks all category posts aside from one and only has links to a couple of specific pages and the members theme has access to everything. Once a user logs into the separate product all the links link back with a theme switch using (site.com/?wptheme=memberstheme) with a one hour time limit which resets to the guest theme, thus logging them out after one hour. Is there a better way to go about accomplishing this?? or a good plugin?? Thanks


wp-admin - save options without refreshing?

I have my own plugin options page, but when users hit "Save" button the whole page refreshes. Is there a way of changing my script below to something that will for example popup yellow box saying "settings saved" WITHOUT page refresh? So the data will be passed trough ajax call or something like that. I've seen something like that before, but can't recall for what plugin.               add_action('admin_menu', 'my_plugin_menu');          function my_plugin_menu() {              add_menu_page('My Plugin Options', 'Plugin Options', 'manage_options', 'my-unique-identifier', 'my_plugin_options');           }          function my_plugin_options() {            if (!current_user_can('manage_options'))  {         wp_die( __('You do not have sufficient permissions to access this page.') );       } ?>          <form method="post" action="options.php">     <?php wp_nonce_field('update-options'); ?>     (...)     <input type="hidden" name="action" value="update" />     <input type="hidden" name="page_options" value="option1,option2,option3,etc." />     <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />     </form>


How can I reduce the amount of files loaded/included per plugin?

I have a Wordpress site that uses several plugins, namely 8. Most of these plugins include a lot of their own JS and CSS files, some even include so much as 3 separate CSS files. One can imagine that this does a number on the amount of HTTP requests and thus the load time. Many of these plugins also only get used on certain pages, yet the JS or CSS is still loaded on pages where they are not used. All of theses files are included automatically in the through WP_head();. Is there a way I can manually include these files and then load them conditionally? Preferably without having to adjust the plugin code itself? Are there other common practices regarding the many files included by a bigger number of plugins?


How to move wp-admin login page to another location?

It can be another layer of security..


Post loop created via shortcode not displaying shortcode in content

I've been racking my brain on this. Here is a shortcode loop I've created to display a specific post type:                   function faq_shortcode($atts, $content = NULL) {             extract(shortcode_atts(array(                 'faq_topic' => '',                 'faq_tag'   => '',                 'faq_id'    => '',                 'limit'     => '10',             ), $atts));             $faq_topic = preg_replace('~&#x0*([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $faq_topic);             $faq_tag = preg_replace('~&#x0*([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $faq_tag);                 $faqs = new WP_Query(array(                     'p'                 => ''.$faq_id.'',                     'faq-topic'         => ''.$faq_topic.'',                     'faq-tags'          => ''.$faq_tag.'',                     'post_type'         =>  'question',                     'posts_per_page'    =>  ''.$limit.'',                     'orderby'           =>  'menu_order',                     'order'             =>  'ASC'                     ));                 $displayfaq= '
';                     while ($faqs->have_posts()) : $faqs->the_post();                     $displayfaq .= '
';                     $displayfaq .= '
'.get_the_title().'
';                     $displayfaq .= '
'.get_the_content().'
';                     $displayfaq .= '
';                     endwhile;                 wp_reset_query();                 $displayfaq .= '
';             return $displayfaq;             }          add_shortcode('faq','faq_shortcode');      within one of those loops there is a post that has a shortcode being used               function emailbot_ssc($atts, $content = null) {             extract( shortcode_atts( array(             'address' => '',                 ), $atts ) );             ob_start();             echo ''.$atts['address'].'';             $email_ssc = ob_get_clean();             return $email_ssc;             }     add_shortcode("email", "emailbot_ssc");      the FAQ loop (code item #1) isn't parsing the shortcode. It just displays it raw.


Custom Taxonomy Taxonomies of Same Name point to first created URL

I created a Custom Post type and in that custom post type have a hierarchical taxonomy (categories). Here's an example of the categories I made:               Hats      - Mens      - Womens          Shoes      - Mens      - Womens      The problem is that when I go to the "Mens" sub-category of the "Shoes" Main category it goes to the Mens category of the "Hats" category, i'm guessing it's because the URL of the two is the same. What is the best way around this problem?


Is there any sort of theme dependency management?

I'm developing a Wordpress theme with a few other individuals and am running into a problem where I add a plugin and then I have tell the other developers about the plugin I installed and the settings I set for the plugin so that the theme works. I was wondering if there's a way to associate plugins with a theme, so that when an individual receives the theme, the theme knows which plugins it needs and can automagically install them and their correct versions. I suppose I'm looking for some sort of dependency management for Wordpress themes. Is there something like that out there?


Showcase your wordpress themes

I want to know is there any place on the web where a wordpress theme developer can showcase his/her created wordpress themes for free. Actually I want some place where one can upload one's wordpress themes. There is one page where all his themes are showcased and when some body want to check any of the themes, he simply clicks on any one of them and a separate page open where the theme will be showcased like an active site. Any help in this regard will be highly appreciated.


How can I prevent the post_modified column in wp_posts from being updated?

On my site, I display each post's Last Updated date instead of its Published date in order to let visitors know how recent the post is. I'm currently developing a new theme, and some of the features I'm building will require me to make edits to almost every post's featured image and custom fields. I'd like to prevent the Last Updated date from being changed when I do these updates, as I'm not really updating the content. Any way to do this? My current idea is to simply change the names of the post_modified and post_modified_gmt while I do the update - will this break anything, since WordPress will be trying to update columns that technically don't exist?


How to make Wordpress search prioritise page titles?

The standard search for Wordpress works, but doesn't seem too clever. If I search for 'tomato' and I have a page whose title is 'Tomato' I would expect that to come first in the results. However the results seem to be ordered by date published. So if a page/post mentions 'tomato' somewhere in the text, it will be first in the results if it was just published. How would I make Wordpress prioritise page titles in the search? (I'm using the Starkers theme)


WordPress plugin isn't loading completely

i m running a blog and having problems with some plugins. When I installed them they were running fine, but after few weeks-- I think after I updated my WordPress to 3.1.1, these plugins stopped working. Maybe jQuery isn't loading or conflicting or something else. Please kindly help me to solve this issue.


Asynchronous Javascript Loaders

I'd like to take advantage of loading my scripts while the page is loading. ie. Yepnope, head.js etc... But I also want to be able to enqueue the script so other plugins don't try adding their own. (a la jquery) Does anyone have any suggestions? Thanks in advance...


Hide Category from Blog?

I am using the Boldy theme from Site5 on a v3.1.2 site. The way this theme works, is that there is a portfolio, (which I am using as a case studies gallery) that pulls in posts from a specific category you define under the themes settings _(id=98)_ This is fine if you also set the blog up as per the Boldy instructions, where all blog posts come under a category called blog, but this wasnn't going to give me the slugs I wanted, so I adopted to use a static page called blog to show my posts on. This all works fine, apart from the fact that the posts I create for my portfolio/case studies gallery (category = case studies) now appear in my blog as well. Is there a way to hide posts within a specific category within the blog, but for it not to have the same affect in my case studies gallery? **\--EDIT--** With some help from Wyck via the comments, made _some_ progress. Here is a txt version of my themes default index.php file. If I insert the following onto Line 2:               <?php query_posts($query_string . '&cat=-98'); ?>      = This results in no posts being shown on my Downloads page, but all posts still appearing on my Blog page. I need the vice versa of this. I am sure I am close, but perhaps I need to modify which line I put this on? **\--EDIT x2--** Now using the download monitor for my downloads gallery. But using the portfolio for my case studies. So some of the links above have changed, but the problem is exactly the same.


Notice: Trying to get property of non-object in : custom fields category

I have custom fields in my category. I'm using this tutorial to add custom fields to my categories. I'm trying to output one of the custom fields on my category.php template but I'm unable to do so. The code I added to my template is:               <?php      $term_slug = get_query_var( 'term' );     $taxonomyName = get_query_var( 'taxonomy' );     $current_term = get_term_by( 'slug', $term_slug, $taxonomyName );     $term_id = $current_term->term_id;     $saved_data = get_tax_meta($term_id,'text_field_id');     echo $saved_data;     ?>      I have turned on debugging on and it shows error: > Notice: Trying to get property of non-object in > /var/www/animedownloads.nu/public_html/wp- > content/themes/twentytwelve/category.php on line 26 Here's the template code:               <?php     /**      * The template for displaying Category pages      *      * Used to display archive-type pages for posts in a category.      *      * @link http://codex.wordpress.org/Template_Hierarchy      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */          get_header(); ?>

                          <?php if ( have_posts() ) : ?>
<?php printf( __( 'Category Archives: %s', 'twentytwelve' ), '' . single_cat_title( '', false ) . '' ); ?>
     <?php     $term_slug = get_query_var( 'term' );     $taxonomyName = get_query_var( 'taxonomy' );     $current_term = get_term_by( 'slug', $term_slug, $taxonomyName );     $term_id = $current_term->term_id;     $saved_data = get_tax_meta($term_id,'text_field_id');     echo $saved_data;     ?>                             <?php if ( category_description() ) : // Show an optional category description ?>
<?php echo category_description(); ?>
                             <?php endif; ?>                                                               <?php                             /* Start the Loop */                             while ( have_posts() ) : the_post();                                          /* Include the post format-specific template for the content. If you want to                                      * this in a child theme then include a file called called content-___.php                                      * (where ___ is the post format) and that will be used instead.                                      */                                     get_template_part( 'content', get_post_format() );                                  endwhile;                                  twentytwelve_content_nav( 'nav-below' );                             ?>                          <?php else : ?>                             <?php get_template_part( 'content', 'none' ); ?>                     <?php endif; ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      Anyone know how to fix this?


Create XML sitemap in wordpress

This question has already been asked before, however, I cannot reply to those comments because I am a new user. Therefore, I will post my question here. I am trying to create a XML sitemap for my wordpress site. Someone on this site suggested that a duplicate of the XML export file be made. This file is located here. How can I modify this file in my theme so that it is updated automatically? Where will the exported file be located?


when FS_METHOD = 'direct' is chosen?

According to the Wordpress Codes `FS_METHOD = 'direct'` is chosen when **appropriate**. > (Primary Preference) "direct" forces it to use Direct File I/O requests from > within PHP, this is fraught with opening up security issues on poorly > configured hosts, This is chosen automatically when appropriate. http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants What is the criteria to be appropriate?


wp_mail_from not changing from address

I wish to use the wp_mail_from hook to change the from email address submitted through a form which sends an invitation to a friend by email (I am writing my own plugin to do this). I am using the following code to at present but I cannot see what I am doing wrong as the from email address is not set at all and goes to the default:               function() {         $this->from_email = $_POST['your_email'];              add_filter( 'wp_mail_from', array( $this, 'set_from_email' ) );              wp_mail( $to, $subject, $message);     }          function set_from_email() {         return $this->from_email;     }      As far as I can tell this should work flawlessly and out of the box but I have tried for hours at no avail hence, my question. FYI I am using this function inside a class but I do not think that should change anything. Many thanks, nav


Bug in wp_insert_post script and form, probably something simple I am not seeing

OK, I have been working on debugging this script for 2 and a half days now and am coming up empty. Basically, this is a front end form that will insert posts based on the script that I wrote for it at the top of the template page. I am getting a blank screen every time the page loads and no debug output at all and there are no lines in debug.txt ( do have the proper settings in wp- config). Usually when I work this hard on debugging it ends up being something simple or stupid that my mind is blocked to, here is the code:                   <?php     /*     Template Name: Create Group Pages     */     ?>          <?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['submit'])) {                 $error = "";                  if (!empty($_POST['title'])) {                 $title = $_POST['title'];          } else {             $error .= "Please add a title
";         }                  if (!empty($_POST['cat'])) {                 $post_category = $_POST['cat'];          } else {             $error .= "Please select a school.
";         }                  // ADD THE FORM INPUT TO $new_post ARRAY             if (empty($error)) {                 'post_content'      =>  '',/**MUST STAY BLANK!**/                 'post_name'         =>  $post_title,                 'post_title'        =>  wp_strip_all_tags( $_POST[ 'post_title' ] ),                 'post_status'       =>  'publish',                 'post_type'         =>  'page',                 'ping_status'       =>  'closed',                 'post_parent'       =>  $post_parent, /**Needs to be changed to capture data from parent selections**/                 'post_password'     =>  '12345',                 'comment_status'    =>  'closed',                 'post_category'     =>  wp_strip_all_tags( $_POST[ 'cat' ] ),                 'page_template'     =>  'Teacher Group Page Template'             );                  //SAVE THE POST             $pid = wp_insert_post($new_post);                  //REDIRECT TO THE NEW POST ON SAVE             $link = get_permalink( $pid );                  } // END SAVING POST         } // END VALIDATION     } // END THE IF STATEMENT THAT STARTED THE WHOLE FORM          //POST THE POST NOW     do_action('wp_insert_post', 'wp_insert_post');     ?>          <?php get_header(); ?>

                          <?php                             if (!empty($error)) {                                 echo '
Your page was NOT created
 The following error(s) returned:
' . $error . '
';                             } elseif (!empty($success)) {                                 echo '
' . $success . '
';                             }                         ?>
             <form id="new_post" name="new_post" method="POST" action="" enctype="multipart/form-data">                                  <fieldset name="name">                     Post Title:                     <input type="text" id="post_title" value="" tabindex="5" name="post_title" />                 </fieldset>                                       <fieldset class="category">                     School:                     <?php wp_dropdown_categories('orderby=name&hide_empty=0&exclude=1&hierarchical=1'); ?>                 </fieldset>                                       <fieldset class="parent">                     Pick the school this class is from:                     <?php $parent_args = array( 'depth' => 1 , 'child_of' => '1094'); wp_dropdown_pages( $parent_args ); ?>                 </fieldset>                      <fieldset class="submit">                     <input type="submit" value="Create Page" tabindex="40" id="submit" name="submit" />                 </fieldset>                      <input type="hidden" name="action" value="new_post" />                 <?php wp_nonce_field( 'new-post' ); ?>             </form>

                <?php get_footer(); ?>      I have narrowed it down to the code between the opening php tag and the `<?php get_header(); ?>` because when I remove that section, the form loads, not styled, but it loads. Anything obvious I am missing here? **_EDIT - NEW CODE_** OK, so I basically did more research and started from scratch nearly and took out nearly all of the validation for now to make things simpler. It actually creates the page now, but there are problems...it seems as though it is not passing some of the variables to the page creation. For example, it is passing the fact that it is password protected but nothing else really - no title (it is actually blank), no page template, I believe it does actually get published. So it seems I am getting a little closer. Oh, and another issue is that once it creates a page, it redirects to another page that is actually the parent page of the page I am creating, though the URL is still the one listed above. If I hit refresh, it prompts me to resubmit form, and it will create a new page upon each refresh. Here is the new code:               <?php     /*     Template Name: Create Group Pages     */     ?>          <?php          $post_title_error = '';          if ( isset( $_POST['submitted'] ) && isset( $_POST[ 'post_nonce_field' ] ) && wp_verify_nonce( $_POST[ 'post_nonce_field' ], 'post_nonce') ) {              if ( trim( $_POST['post_title'] ) === '' ) {             $post_title_error = 'Please enter a title.';             $has_error = true;         }          }          $new_post = array(         'post_content'      =>  '<?--All handled by template file, no need to type anything here -->',/**MUST STAY BLANK!**/         'post_name'         =>  wp_strip_all_tags( $_POST[ 'post_title' ] ),         'post_title'        =>  wp_strip_all_tags( $_POST[ 'post_title' ] ),         'post_status'       =>  'publish',         'post_type'         =>  'page',         'ping_status'       =>  'closed',         'post_parent'       =>  wp_strip_all_tags( $_POST[ 'post_parent' ] ), /**Needs to be changed to capture data from parent selections**/         'post_password'     =>  '12345',         'comment_status'    =>  'closed',         'post_category'     =>  wp_strip_all_tags( $_POST[ 'cat' ] ),         'page_template'     =>  'Teacher Group Page Template'         );              $new_pid = wp_insert_post( $new_post );              if ( $new_pid ) {             wp_redirect( home_url());             exit;         }     ?>               <?php get_header(); ?>          <?php if ( $post_title_error != '' ) { ?>         <?php echo $post_title_error; ?>

     <?php } ?>          <form action="" id="create-class-groups-form" method="POST">              <fieldset>             Post Title:             <input type="text" name="post_title" id="post_title" class="required" value="<?php if ( isset( $_POST['post_title'] ) ) echo $_POST['post_title']; ?>" />              </fieldset>
School:
             <?php wp_dropdown_categories('orderby=name&hide_empty=0&exclude=1&hierarchical=1'); ?>
What Class is this school from:
             <?php $parent_args = array( 'depth' => 1 , 'child_of' => '1094'); $post_parent = wp_dropdown_pages( $parent_args ); ?>              <fieldset>             <input type="hidden" name="submitted" id="submitted" value="true" />             <?php wp_nonce_field( 'post_nonce', 'post_nonce_field' ); ?>             <button type="submit">Add Class</button>         </fieldset>          </form>           <?php get_footer(); ?>


How to load a post into an empty div tag anywhere across the pages?

Absolute beginner question: I need to load text into specific div tags across the page. On my html mockup its a lorem ispum text box waiting for wordpress to load the real content. So, how do i control the real content and its relation with the div box text on the page? Can it be a post, so i can manage it from the dashboard? Thanks in advance.


Use Ajax To get posts from custom post type?

I am using isotope to show post from post type. But the problem is i have paging and i cannot filter post by using isotope, its only filter in one page, and cannot get post from other page, So, i need now to change this query by ajax               $wp_query = new WP_Query( array(                    'posts_per_page' => 12,                     'post_type' => 'interviewdoctor',                     'paged' => $paged                      ,'meta_key' => 'category_interviewdoctor' ,                     'meta_value' => '89915'                 ) );         this query must change when select any cat from this :-                 <?php          $rests = get_posts("post_type=catinterview&showposts=-1");                  if(!empty($rests))                  {                     foreach($rests as $rest)                     {                         ?>                         <a href="#" data-filter=".<?php echo $rest->ID?>"><?php echo $rest->post_title?>                         /                                               <?                               }                  }                        ?>      What can i do??


WordPress Featured Image on Custom Import

I'm working on customizing import plug-in and I'm facing hardness assigning a featured image while importing the data. I'm uploading the images to a custom folder via FTP and each post in the CSV import file is assigned with image file name that is already uploaded in my **/root/wp-content/uploads/p** folder.                       $id = wp_insert_post($new_post);                  $arrExt = array(                 "gif"  => IMAGETYPE_GIF,                 "jpg"  => IMAGETYPE_JPEG,                 "jpeg" => IMAGETYPE_JPEG,                 "png"  => IMAGETYPE_PNG             );             if (substr($data['csv_post_url'], -1) !== '/')              {$url_location = $data['csv_post_url'].'/';}              else {$url_location = $data['csv_post_url'];}                  $thumbnail_name = $data['csv_post_thumbnail'];             $ext = pathinfo($thumbnail_name, PATHINFO_EXTENSION);             $wp_filetype = image_type_to_mime_type($arrExt[strtolower($ext)]);             $attachment = array(                 'guid' => $url_location . $thumbnail_name,                  'post_mime_type' => $wp_filetype,                 'post_title' => preg_replace('/\.[^.]+$/', '', basename($thumbnail_name)),                 'post_content' => '',                 'post_status' => 'inherit'             );                  $attach_id = wp_insert_attachment( $attachment, $thumbnail_name, $id );                  // you must first include the image.php file             // for the function wp_generate_attachment_metadata() to work             require_once ABSPATH . '/wp-admin/includes/image.php';             $attach_data = wp_generate_attachment_metadata( $attach_id, $thumbnail_name );             wp_update_attachment_metadata( $attach_id, $attach_data );             add_post_meta($id, '_thumbnail_id', $attach_id); // adds the featured image      The post is getting imported and the image post is being imported in the "wp_posts" table and the "_wp_attached_file" and the "_thumbnail_id" are being imported in the "wp_postmeta" table and I don't know why it's not displaying the photo. The thumbnails are not being generated.I don't see the "_wp_attachment_metadata" imported, how do I generate and import that meta record? What am I missing?


WP Bootstrap Horizontal Menu for Child Items

I have bootstrap 3 integrated into my custom WP theme. I am using navwalker and WP's built in menu. Everything is working great, but I would like the child items of my parent level to be displayed in horizontal lists rather than the default. Something similar to what you see here on the DropDown button. http://bootsnipp.com/snippets/featured/large-dropdown-menu I'm really not sure where to begin. I'm not sure if this can simply be accomplished through some added CSS or if I need to tap into Wordpress more. This is my current menu code:
         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">           Toggle navigation                                          </button>          Menu

             <?php             wp_nav_menu( array(     'theme_location' => 'topmenu',     'depth' => 4,     'container' => false,     'menu_class' => 'nav navbar-nav nav-justified',     'fallback_cb' => 'wp_page_menu',     //Process nav menu using our custom nav walker     'walker' => new wp_bootstrap_navwalker())     );             ?>


WooCommerce Variable Product Price - Where is "From" text generated from?

The following code from github will add "- [max price]" to all variable products displayed in product archives. I am wondering how I could also remove the "From" text inside the same filter.               add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);          function custom_variation_price( $price, $product ) {               $price = '';               if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '' . _x('From', 'min_price', 'woocommerce') . ' ';               $price .= woocommerce_price($product->get_price());               if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) {               $price .= ' ' . _x('-', 'max_price', 'woocommerce') . ' ';                    $price .= woocommerce_price($product->max_variation_price);          }               return $price;     }      I noticed this question answers how to remove the From text using the same filter parameters, but I haven't been able to figure out how this works.


Session alternative for plugins (due to caching)

I'm building a plugin that picks a random post from the database and delivers the result dynamically to the user. For certain aspects I need to know the post ID that's been randomly selected. Session data would work perfectly for this if it weren't for website caching. When a site is cached, the post that is supposed to load dynamically, based on the session data, doesn't load anything. What alternatives do I have to using `$_SESSION`?


How to hide title on 'highlights' - Themify feature

I am using Themify's Flat theme and in the Highlights I want to hide the title of my highlights. Any ideas on how to do this? Thanks in advance.


Wordpress cannot see that plugins require new update

My Wordpress installation is using two plugins that it cannot see actively require an update. I am using several plugins, but the Stop Spammer Registration plugin and the S2member plugin cannot see that there is an update available to them. I am using Wordpress version 2.7.1, which I know uses the auto-update feature, but I don't think this has anything to do with my issue. My plugin update process is to first update the plugin on my localhost, then to merge this code into my master branch with GIT. Then I run the updates on live and pull in the new code. This lets me run a series of tests to make sure the new plugin updates will work, but right now, my localhost is not aware that these plugin updates exist. I can see from the Stop Spammer Registration and the S2member sites that there is a new version of each of these plugins. Is there a way to jump start Wordpress so that it knows to look for these plugins? Are these updates just so new that my machine has not checked for them yet today? I want to be able to update these plugins but I'm not sure how to get Wordpress to let me do this. Thank you to anyone that can help.


Define Mutiple Header Images Using the Theme Customization API

The Header Image control from the Theme Customization API allows for a **single** header image to uploaded and used sitewide. Using this control, is it possible to save to a custom setting to allow for **multiple** header images?               $wp_customize->add_control(         new WP_Customize_Header_Image_Control(             $wp_customize,             'one_of_many_great_header_images',             array(                 'label' => 'One of Many',                 'section' => 'a_custom_section_id',                 'settings' => 'my_very_own_setting',                 'priority' => 10,             )         )     );      The hope is that this would work similar to the `WP_Customize_Image_Control`, but with the added header image functionality (like using `register_default_headers()` and enforcing dimensions).


Cannot access WordPress login pages

I cannot access either wp-admin, or wp-login.php on a wordpress site. I'm **not** getting a 404, or a redirect, it simply says cannot connect in firefox. I have tried everything relevant on this guide and also this guide, but nothing helps, still the same error.


How to retrieve the options from this options page?

I like to write a plugin with an options-page from the WordPress-Codex, but I cannot retrieve the options. `get_option('your_option');` does not work. Here is the options page code:               <?php     class MySettingsPage     {         /**          * Holds the values to be used in the fields callbacks          */         private $options;              /**          * Start up          */         public function __construct()         {             add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );             add_action( 'admin_init', array( $this, 'page_init' ) );         }              /**          * Add options page          */         public function add_plugin_page()         {             // This page will be under "Settings"             add_options_page(                 'Settings Admin',                  'My Settings',                  'manage_options',                  'my-setting-admin',                  array( $this, 'create_admin_page' )             );         }              /**          * Options page callback          */         public function create_admin_page()         {             // Set class property             $this->options = get_option( 'my_option_name' );             ?>
                 <?php screen_icon(); ?>
My Settings
                            <form method="post" action="options.php">                 <?php                     // This prints out all hidden setting fields                     settings_fields( 'my_option_group' );                        do_settings_sections( 'my-setting-admin' );                     submit_button();                  ?>                 </form>
             <?php         }              /**          * Register and add settings          */         public function page_init()         {                     register_setting(                 'my_option_group', // Option group                 'my_option_name', // Option name                 array( $this, 'sanitize' ) // Sanitize             );                  add_settings_section(                 'setting_section_id', // ID                 'My Custom Settings', // Title                 array( $this, 'print_section_info' ), // Callback                 'my-setting-admin' // Page             );                    add_settings_field(                 'id_number', // ID                 'ID Number', // Title                  array( $this, 'id_number_callback' ), // Callback                 'my-setting-admin', // Page                 'setting_section_id' // Section                        );                        add_settings_field(                 'title',                  'Title',                  array( $this, 'title_callback' ),                  'my-setting-admin',                  'setting_section_id'             );               }              /**          * Sanitize each setting field as needed          *          * @param array $input Contains all settings fields as array keys          */         public function sanitize( $input )         {             $new_input = array();             if( isset( $input['id_number'] ) )                 $new_input['id_number'] = absint( $input['id_number'] );                  if( isset( $input['title'] ) )                 $new_input['title'] = sanitize_text_field( $input['title'] );                  return $new_input;         }              /**           * Print the Section text          */         public function print_section_info()         {             print 'Enter your settings below:';         }              /**           * Get the settings option array and print one of its values          */         public function id_number_callback()         {             printf(                 '<input type="text" id="id_number" name="my_option_name[id_number]" value="%s" />',                 isset( $this->options['id_number'] ) ? esc_attr( $this->options['id_number']) : ''             );         }              /**           * Get the settings option array and print one of its values          */         public function title_callback()         {             printf(                 '<input type="text" id="title" name="my_option_name[title]" value="%s" />',                 isset( $this->options['title'] ) ? esc_attr( $this->options['title']) : ''             );         }     }          if( is_admin() )         $my_settings_page = new MySettingsPage();


Post migration - images do not display

Here is migration quandry - going from one host to another. The blog domain name is unchanged.   * backed up the file system with everything to a .bz2   * backed up the SQL DB   * ftp'd the file system bz2 to the new host   * unpacked the file system with cPanel   * locations and permissions appear okay   * created db on new host with mysqladmin under cPanel   * imported the sql backup, seems okay   * adjusted wp-confg.cfg for db name. DB password is correct. Now that the domain has moved the blog on the new host works perfectly EXCEPT pictures in the posts no longer display - just box and the image file name. The pics are where they should be in wp-content/uploads. The references in the post look correct but no joy when viewed. As an experiment I inserted one of the pics into a new post. Same result. Further, in the media menu the picture also does not display but the names show as there. Makes me nuts! Any help greatly appreciated. The site is at http://www.thoughtpaths.com/


Woocommerce Show Single Product on Homepage

I am currently learning PHP & how to customize Wordpress. I have a shop that I set up on Wordpress using the Woocommerce plugin. The shop holds only a single item. Since I only have 1 item to sell, I would like to show the product on my homepage in such a fashion where the complete product page is shown on the homepage. Here is some code i've been trying to get to work (this is placed in the home.php file):               $prodpage = array(     'post_type' => 'product',     'posts_per_page' => 1,     'taxonomy' => 'banner',     'term' => 'banner'     );     $featured_query = new WP_Query( $prodpage );          if ($featured_query->have_posts()) :                 while ($featured_query->have_posts()) :                     $featured_query->the_post();                    $product = get_product( $featured_query->product->ID );                // Product Info Output Here          endwhile;            endif;            wp_reset_query(); // Query Reset      I have also tried using query_posts in this manner:               if ( is_home() ) {     query_posts( 'p=31' );     }      The good news is that I don't get flagged for any syntax errors. The bad news is that I am afraid my logic is off somewhere as I get a page with only the WP header and footer. The mid section where the product should show up is not showing up. I really appreciate any guidance you guys are able to give! :)


Showing the next post's title, even if it's an unpublished post

At the bottom of each post I need to either:   * Offer a link to the next post (if the next post is published); or   * Display the title of the next post with the date it will be published (if it's a future post) Suggestions?


Memory issue only in dashboard

Though I've been using my website's dashboard the last few days without installing any plugin nor touching any piece of code, today my dashboard (but not my website) is unavailable with a message "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/.../public_html/mysite.com/wp-includes/class-wp-admin-bar.php on line 36". The define('WP_MEMORY_LIMIT', '64M'); was already present in wp-config.php. Considering that I haven't touched anything, what could be the cause and how to fix it?


WP Query group/order by category name

I have a requirement for displaying a list of custom post types grouped by category, but in addition to this, each custom post is linked with a meta value (in this example lets say we have a custom meta value of "TEST1"). Basically, my goal is to display a list, grouped by category for all custom posts with a code of "TEST1". The way I am currently doing this is by simply getting all categories linked to my custom post type (ignoring empty), then looping through each category to get all posts within it that have a code of "TEST1". Now this is great, it works fine, however it is **extremely** inefficient. At the moment this isn't an issue but I fear that it won't scale very well as the number of categories increases overtime - because each iteration equals another DB hit (and join to the post meta table). I have had a good look across the web but I am unable to find anything but was wondering if it is possible to perform a WP_Query call that would return all posts with the custom meta value of "TEST1" grouped or ordered by their category name? This would be a lot more efficient (basically 1 DB hit I would assume). If anyone can advise anything here I would be really grateful, if it is not possible then I assume my only way to achieve this would be to do a direct query to the database from within my plugin (which from what I've read is not advised when working with plugins).


Twenty Ten Theme: Replace the Logo by a picture without moving the code

I would like to replace the twenty ten's theme logo (text) by a picture, Is there any plugin allowing me to do that. I know how to do it, but every time wordpress gets updated (often) the code comes back to how it was before I changed it. Thanks in advance.


Using Image insert control in code

I am adding additional pages to wordpress backend and I would like to use the built-in image uploader and browser. I couldn't find any examples on how to add it to my form. Assuming that I have a text input or something similiar - what do I have to do to allow users pick a previously uploaded image so that the image link would show up in the textfield? edit: I've created an iframe that's loading media-uploader.php but now I have no idea how to get the picked image to go to my textfield.


Why does blog page not reveal it's template?

I've got a CMS style setup. The blog part is not on the home page. I'm trying to add certain things to the side-bar according to which template the page is using. That all works fine, except for the blog page, which does not even reveal its template name.               echo get_post_meta($post->ID,'_wp_page_template',true);  // produces nothing for blog template blog-page.php, but does show standard-page.php          if ( is_page_template('blog-page.php')) {      // show blog sidebar stuff.... never gets called     }     if ( is_page_template('standard-page.php')) {      // show blog sidebar stuff.. this works     }      What else can I use to check if the page is a blog page rather than then template? UPDATE Doesn't seem to be actually using blog-page.php, but index.php instead... what if statement can i use to check if its a blog-style page?


Any advantage to using get_header() over include('header.php')?

The basic theme - in fact every theme I've looked at - uses get_header() to include the header file, but I don't see any reason for doing so. What's are the advantages of using `get_header()` instead of a simple `include('file.php')`?


Hide Trackbacks/Pingbaks if none exists

I managed to get my comments numbered and then to separate the comments from the pingbacks and trackbacks. The only problem I have now is that I don't want to show the title of this section (where the trackbacks/pingbacks are) unless there are any. This is the code I'm using in comments.php:

Trackbacks/Pingbacks:
             <?php                wp_list_comments(array(               'callback'=>'list_pings',               'style'=>'ol',               'type'=>'pings',             ));             ?>
      And this is the code from functions.php:               <?php     function list_pings($comment, $args, $depth) {     $GLOBALS['comment'] = $comment;     ?>     <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?>     <?php } ?>     <?php     add_filter('get_comments_number', 'comment_count', 0);     function comment_count( $count ) {     if ( ! is_admin() ) {     global $id;     $comments_by_type = &separate_comments(get_comments('status=approve&post_id=' . $id));     return count($comments_by_type['comment']);     } else {     return $count;     }     }     ?>      I think I should do an `if/else` statement but I can't figure out where to start.


Minimal custom permalink structure

I'm aware that there are posts discussing this issue already (e.g. http://wordpress.stackexchange.com/questions/1364/what-is-the-best-permalink- structure-for-seo) but I have a specific set of requirements according to my wordpress site structure, namely:   1. 6 pages   2. A small number of posts (~ 3 at launch, maybe 1 new one per month) I'd like to include the post name in the URL (for both SEO and easier stats analysis), but I've seen references to 'problems' arising from using _just_ the post name.   * Would this be the case, even on such a small site?   * Would `/%post_id%/%$postname%/` be a 'better' alternative? I notice that, even with this configuration, the Pages don't use the post_id in their URL.


WordPress UPME plugin shortcode problem

I have a problem with wordpress(3.9.2) UPME plugin. Shortcodes, that I'm supposed to add to a page, break those pages. All of them except,[upme_login]. The pages show only header and page title and nothing else below, including other content and footer. I tried to put [upme_login] too on other pages, it works only if [upme_login] is placed above other shortcodes, if it's placed below other shortcodes, same blank space appears. I tried to activate various themes, it is always the same. I deactivated all other plugins, nothing's change ...


Get userdata inside custom build plugin

So I am working on a custom plugin which will get the option to set Roles & Capabilities per user to enable/disable certain pages/parts inside the plugin. So I wanted the get the logged in users roles value by using `get_userdata()`but this trows in an error `Call to undefined function get_userdata()`, I have seen that this is an common issue but I haven't found any solution for this. So how do I get the user data inside a plugin?


Obtaining the original unchanged Theme

Quite a few months back, I had used a third party theme v 2.9 in my wordpress site. I made a few custom changes to css/.php based on my needs. Now, I plan to upgrade the theme to v3.8. Before doing that, I wanted to get the diff of changes that I had made to ver 2.9. As I didn't have a copy of the original theme, I contacted the developers of the theme; unfortunately, they also don't seem to have a copy of that. What are my options to obtain the diff, get an original copy of the theme? Does wp store a copy of original theme somewhere? My site is hosted on bluehost. Thank You.


Replace audio links with jplayer using the_content filter

I am attempting to use :               add_filter( 'the_content', 'filter_function_name' );      To find all of the anchor tags in my post which link to a .mp3 file, and then replace them with a jplayer instance that would play the file, instead of just having the link to be file being displayed. So, I am trying to get all of the anchors tags that are output by the_content to be replaced by instances of the following html and js: html:

play

pause

stop

mute

unmute

max volume

repeat

repeat off

Music Player

             Update Required             To play the media you will need to either update your browser to a recent version or update your Flash plugin.

      Javascript:                     Any help is appreciated. Thanks.


if (is_page(**PAGE ID**)) not working

I'm following this tutorial on adding Google Content Experiments code to `header.php`. I added the following code to `header.php`:               <?php if (is_page('346') ):?>         <!-- Google Analytics Content Experiment code -->             ...         <!-- End of Google Analytics Content Experiment code -->     <?php endif; ?>      This didn't produce the content experiment code on the front end. I tried:               <?php if (is_page(346) ):?>         <!-- Google Analytics Content Experiment code -->             ...         <!-- End of Google Analytics Content Experiment code -->     <?php endif; ?>      This didn't work either. Can you see why this code is not working? Thanks.


WP_List_Table inside metabox not working on submit

I'm trying to display a WP_List_table inside a metabox. The metabox is for a custom taxonomy called 'service' which is registered to a custom post type called 'office'. The table columns contain input fields which manipulate the taxonomy and allow me to link additional data to each individual taxonomy term. I don't think the fact that I'm trying to this for a custom taxonomy which is on a custom post type edit screen is relevant. I only merely mention to for clarity sake. What's happening is that it all looks fine until I click the Publish/Update button on the custom post type edit screen. If the WP_List_Table has bulk actions it will redirect back to the /wp-admin/edit.php page, it I remove the bulk actions then it displays a Wordpress Failure Notice "Are you sure you want to do this? - Please try again", which is a nonce validation error. And in both cases, the none of the data I change for the post is saved. I've included a link below to the full script that registers the taxonomy, creates the table and saves the metabox data. Feel free to fiddle with it to get it working if you like. http://www.writeurl.com/text/aawwgq1od5913fmyfjyu/0y84g3vcyptvrkvvfxq4/0dow449a06lj6ctkqjqo **A NOTE TO THE STACKOVERFLOW EDITORS:** I have already checked through questions suggested while I type mine and also all questions tagged with wp- list-table plus scoured the depths of Google and none of them seem relevant to my situation. **UPDATE:** If possible I'd prefer to not to have to use any bulk_actions. I've no need for them on this table. I only added the delete action for testing purposes. And the class method "process_bulk_action" doesn't even get called on submit anyway.               <?php     if(!class_exists('WP_List_Table')) {         require_once(ABSPATH.'wp-admin/includes/class-wp-list-table.php');     }          class servicesTable extends WP_List_Table {         private $allServices;         private $currentServices;         private $currentServicesData;              public function __construct(){             parent::__construct(                 array(                     'singular' => 'service',                     'plural' => 'services',                     'ajax' => false                 )             );         }              private function table_data() {             $this->currentServices = wp_get_object_terms(get_the_ID(),array('service'),array('fields' => 'ids'));             $this->currentServicesData = (array) maybe_unserialize(get_post_meta(get_the_ID(),'currentServices',true));             $this->allServices = array();             foreach((array) get_terms(array('service'),array('hide_empty' => false)) as $service) {                 $this->allServices[] = array(                     'id' => $service->term_id,                     'serviceTitle' => $service->name,                     'attachments' => array_key_exists($service->term_id,$this->currentServicesData) ? explode(',',$this->currentServicesData[$service->term_id]['attachments']) : array(),                     'lastServiced' =>  (array_key_exists($service->term_id,$this->currentServicesData) && strlen($this->currentServicesData[$service->term_id]['last_serviced']) > 0) ? date('Y-m-d',strtotime($this->currentServicesData[$service->term_id]['last_serviced'])) : '',                     'nextService' =>  (array_key_exists($service->term_id,$this->currentServicesData) && strlen($this->currentServicesData[$service->term_id]['next_service']) > 0) ? date('Y-m-d',strtotime($this->currentServicesData[$service->term_id]['next_service'])) : '',                     'invoices' => ''                 );             }             return $this->allServices;         }              public function column_default($item,$columnName) {             return array_key_exists($columnName,$item) ? $item[$columnName] : print_r($item,true);         }              public function get_columns(){             return array(                 'cb' => '<input type="checkbox" />',                 'id' => 'ID',                 'serviceTitle' => __('Title','brokertech'),                 'attachments' => __('Attachments','brokertech'),                 'lastServiced' => __('Last Service Date','brokertech'),                 'nextService' => __('Next Service Date','brokertech'),                 'invoices' => __('Invoices','brokertech')             );         }              public function get_hidden_columns() {             return array('id');         }              public function get_sortable_columns() {             return array(                 'lastServiced' => array('lastServiced',true),                 'nextService' => array('nextService',true)             );         }              private function sort_data($a,$b) {             $orderby = empty($_GET['orderby']) ? 'nextService' : $_GET['orderby'];             $order = empty($_GET['order']) ? 'asc' : $_GET['order'];             $result = strcmp($a[$orderby],$b[$orderby]);             return ($order === 'asc') ? $result : -$result;         }              public function prepare_items() {             usort($this->table_data(),array(&$this,'sort_data'));             $this->_column_headers = array($this->get_columns(),$this->get_hidden_columns(),$this->get_sortable_columns());             $this->items = $this->allServices;             wp_enqueue_script('services',JS_URI.'servicesSelector.js',array('thickbox','media-upload'));             wp_enqueue_style('thickbox');             wp_localize_script(             'services',             'servicesData',                 array(                     'editAttachment' => __('Edit'),                     'removeAttachment' => __('Remove')                 )             );         }              public function column_cb($item) {             return sprintf('<input type="checkbox" name="services[%s][enable]" value="%s" %s />',$item['id'],$item['serviceTitle'],checked(true,in_array($item['id'],$this->currentServices),false));         }              public function column_id($item) {             return sprintf('<input type="hidden" name="services[%s][id]" value="%s" />',$item['id'],$item['id']);         }              public function column_attachments($item) {             $html  = sprintf(                 '<input type="hidden" name="services[%s][attachments]" value="%s" class="listAttachments" />',                 $item['id'],                 empty($item['attachments']) ? '' : implode(',',$item['attachments'])             );             $html .= sprintf('<input type="button" value="%s" class="button button-secondary addServiceAttachment" data-service-id="%s" />',__('Add'),$item['id']);             $html .= " ";             if(empty($item['attachments'])) {                 $html .= sprintf('<input type="button" value="%s" class="button button-secondary clearAll" data-service-id="%s" disabled="disabled" />',__('Clear'),$item['id']);             }             else {                 $html .= sprintf('<input type="button" value="%s" class="button button-secondary clearAll" data-service-id="%s" />',__('Clear'),$item['id']);                 $html .= "

";                 foreach($item['attachments'] as $attachment) {                     if(is_numeric($attachment)) {                         $html .= sprintf(                             "
%s
%s<input type='button' class='removeServiceAttachment button button-secondary' value='%s' style='float:right;' />

",                             get_the_title($attachment),                             get_admin_url(get_current_blog_id(),'post.php?post='.$attachment.'&action=edit'),                             __('Edit'),                             __('Remove')                         );                     }                 }             }             return $html;         }              public function column_lastServiced($item) {             return sprintf('<input type="date" name="services[%s][last_serviced]" value="%s" />',$item['id'],$item['lastServiced']);         }              public function column_nextService($item) {             return sprintf('<input type="date" name="services[%s][next_service]" value="%s" />',$item['id'],$item['nextService']);         }              public function column_invoices($item) {             $html  = sprintf(                 '<input type="hidden" name="services[%s][invoices]" value="%s" class="listInvoices" />',                 $item['id'],                 empty($item['invoices']) ? '' : implode(',',$item['invoices'])             );             $html .= sprintf('<input type="button" value="%s" class="button button-secondary addInvoice" data-service-id="%s" />',__('Add'),$item['id']);             $html .= " ";             if(!empty($item['invoices'])) {                 $html .= "

";                 foreach($item['invoices'] as $invoice) {                     if(is_numeric($invoice)) {                         $html .= sprintf(                             "
%s
%s<input type='button' class='removeInvoice button button-secondary' value='%s' style='float:right;' />

",                             get_the_title($invoice),                             get_admin_url(get_current_blog_id(),'post.php?post='.$attachment.'&action=edit'),                             __('Edit'),                             __('Remove')                         );                     }                 }             }             return $html;         }     }          function saveServices($postID) {         if(empty($_POST) || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {             return;         }         $servicesData = array();         $services = array();         foreach($_POST['services'] as $service) {             if(isset($service['enable'])) {                 $services[] = (string) $service['enable'];                     $servicesData[$service['id']] = $service;             }         }         empty($servicesData) ? delete_post_meta($postID,'currentServices') : update_post_meta($postID,'currentServices',$servicesData);         wp_set_object_terms($postID,$services,'service');     }     add_action('save_post','saveServices');          function servicesMetaBox() {         $servicesTable = new servicesTable();         $servicesTable->prepare_items();         $servicesTable->display();     }          $serviceTaxonomy = new brokertechPostType;     $serviceTaxonomy->createTaxonomy(         'service',         array(             'office'         ),         __('Service'),         __('Services'),         array(             'public' => true,             'hierarchical' => false,             'query_var' => true,             'update_count_callback' => '_update_post_term_count',             'show_ui' => true,             'rewrite' => array(                 'slug' => __('services')             ),             'meta_box_cb' => 'servicesMetaBox'         )     );          function addServicesTaxonomyPage() {         add_submenu_page(             'edit.php?post_type=company',             __('Services'),             __('Services'),             'edit_posts',             'edit-tags.php?taxonomy=service&post_type=office'         );     }     add_action('admin_menu','addServicesTaxonomyPage');          function changeServicesMetaBoxPosition() {         global $wp_meta_boxes;         unset($wp_meta_boxes['office']['side']['core']['tagsdiv-service']);         add_meta_box(             'tagsdiv-service',             __('Services'),             'servicesMetaBox',             'office',             'normal',             'low'         );     }     add_action('add_meta_boxes','changeServicesMetaBoxPosition',0);


Remove default post types on all sites except primary blog. WPMU

I'm trying to come up with a solution that would allow me to remove the default post types (pages, posts, comments, links, etc) from all the multi- site blogs EXECEPT the primary blog. It will remain fully functional. My purpose is to apply a custom post type to all the multi-site blogs to replace the defaults. Any help in the right direction would be much appreciated. -Phil


How do I paginate a list of categories?

I recently added thumbnails for my categories, which has had the side effect of making the page they are listed on unbearably long. Because of that, I am hoping to paginate the list of categories. Here is what I am using to generate the list of categories and thumbnails (unstyled):               <?php      $args=array(       'orderby' => 'name',       'order' => 'ASC'       );     $categories=get_categories('child_of=504&order_by=name&style=none&title_li=');       foreach($categories as $category) {        echo '       term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '> '. get_the_term_thumbnail ( $category->term_id, category, $size = 'medium', $attr = '') . '        term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'';       }      ?>      In trying to find a solution, I came across another question ( How to paginate a list of tags ) regarding tags that seems to do exactly what I am hoping, but have been unsuccessful merging the two together so far. Any help would be wonderful, Thank you


Short messages widget

i'm looking for a widget that can show short news messages in the sidebar sorted by date (sticky's would be nice too) and manageble in the backend. I don't want to create posts because these messages are max 200 characters and don't need a dedicated page. Is there something like this? My english is giving me problems finding it, or maby it just doesn't excist? PV


get parent fields title, content excerpt etc

can't seem to get this but how can i load info in a child's page from its parent? ie, i'm looking at an attachment and i can get the parents ID easy enough but not sure how to get the parents title, excerpt etc.               // attachment content above here then want to get and show some parents' content          echo $parent = get_post_field('post_parent', $id);          echo the_title(); // this still shows the childs title...      any help appreciated! Dan


Integrating plugins in themes

I could not find a thread discussing this, so starting this one. I am currently working on a rather elaborate theme for 3.1+, and by elaborate I mean that in addition to styling and regular front-end functionality, I am including plugins at the core of the theme, both for back-end and front-end. So, to keep this a little more organized, I split this into three questions:   1. Is integrating plugins a common practice?   2. What are the implications/complications in regards to auto-updating the theme/plugins?   3. What would be the most optimized way of including each plugin without breaking pre-existing functionality?


Reason for Lowercase usernames

I can see `validate_user()` calls `sanitize_user()` with strict argument as true, which means uppercase letters are not allowed too. In source code, I found this comment               // If strict, reduce to ASCII for max portability.         if ( $strict )             $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );      I would like to know how does this affect portability?


How to display blog posts on a dedicated page?

I'm in the middle of moving to WordPress from another CMS. I definitely have to keep the links intact, which are like this:   * example.com (Redirects to /blog)   * example.com/blog (The blog, displaying all the articles)   * example.com/blog/article (A specific article)   * example.com/about (A static page)   * example.com/portfolio (Another static page) Right now, however, only the static pages work as expected. I cannot figure out how to create a new custom "blog" page and display the blog posts on that, and how to remove the front page alltogether, making it redirect to the blog instead. Furthermore, I'm using the zBench theme, which always displays the "Home" tab which will lead to the front page. Instead, I want my tabs like this: "Blog", "About", "Portfolio" - no "Home". A similar question has been asked before: How to get the list of posts in a static page other than front page? But this seems like a hack, and not really the same problem I have. I do want to display the blog on the front page, I just want to rename it in both URL and on the tab.


Change media attachment author via mysql query

How does one bulk change the media attachment author via an sql query? I have hundreds of media attachments that need to be moved to another author so the original author can be deleted; but that author has no posts, only media attachments. (The images were attributed to the author when importing and running a query to take the first post image and make it a featured image.) I think I need to specify the `post_type' in a query, like this: `update wp_posts and post_type = ‘attachment’` **Update:** As answered below, this works `UPDATE wp_posts SET post_author = [NEW_ID] WHERE post_author = [OLD_ID]` with or without the `AND post_type = 'attachment'`


Back up uploads folder outside of wp-content?

I've changed the default uploads location to mysite/media instead of wp- content/uploads because the url looks better. That said, backup programs like WP Clone seem only to backup media when it's in wp-content/uploads. Is it possible to backup the uploads folder wherever it may be within the installation?


How do you force a sidebar widget to have a container div around all child widgets?

My theme creates several widget areas for the end user. However, I've got a slight problem in that, if multiple widgets are dropped onto any sidebar container, the resulting code in "view source" is not wrapped in a single container div. For example, here's what it looks like Start of a single widget container:

Widget title

             contents of widget 1

Widget title

             contents of widget 2

      What do I need to do to the way I'm creating this widget so that a single wrapper div encloses all of the widgets added to the container?               if ( function_exists('register_sidebar') )     register_sidebar(array(         'name' => 'Inside Header Area',         'id' => 'inside-header-widget',         'before_widget' => '
',         'after_widget' => '
',          'before_title' => '
',         'after_title' => '
',     ));


The simplest way to let clients edit pages

I'm building a wordpress site for a client. I want to let him edit pages (just so he won't bother me), but I know that going to /wp-admin and entering a password, and than navigatin in the dashboard is way beyond his reach. I need to think of a really simple way to let him edit pages. preferably something on the page. But of course, I don't want anything weird to appear to regular users... Any thoughts?


Have a Custom Post Type index page display taxonomy items instead of posts

I have a CPT registered that is called `lessons` with a custom taxonomy (category) that is called `courses`. I want the `/courses` page (archive- courses.php?) to display the individual courses (i.e. "online marketing", "paid advertising") and not the individual posts (lessons). Would this mean I'd just customize the loop, or a complete custom WP_Query?


sub.menu's not working

working on a wordpress install that is in a subdirectory of another wordpress install (( thecloud99.info has wp in the root )) there is a folder in the root called clients w/ another wordpress install in chamber :: http://thecloud99.info/clients/chamber/ the problem i'm running into is that the sub.menu under members shows up correctly but doesn't actually take me to the page, instead it returns me to the home page. ??


Default .htaccess file for wordpress?

My .htaccess files are intercepting with wordpress .htaccess files, which modules and which settings (specified by .htaccess) are required for WD site to work? In other words, where can I find default WD .htaccess file?


How to prevent posts duplicating when viewing a custom taxonomy term

My question is fairly basic. I have an archive.php and inside I have the main loop like so:               <?php if (have_posts()) : while (have_posts()) : the_post(); ?>          Do stuff here          <?php endwhile; endif; ?>      Works fine for categories but not for custom taxonomies. I have a custom taxonomy called "Type". I go to the WordPress menu and add the term "Spa Break" from the "Type" taxonomy. This works, however I get about 10 of each post for every post. All the ID's for the duplicate posts are the same, it just decides to list 10 of each. I have added no custom queries or anything like that. Any clues to what might be happening? Here is my taxonomy:               function build_taxonomies(){     register_taxonomy("type", array("venue"), array("hierarchical" => true, "label" => "Types", "singular_label" => "Type", "rewrite" => array('slug' => 'type')));       } Here is my post type code:               function create_post_type()      {         $labels = array(             'name' => __( 'Venue' ),             'singular_name' => __( 'Venue' ),             'rewrite' => array('slug' => 'venues'),             'add_new' => _x('Add New', 'venue'),             'add_new_item' => __('Add New Venue'),             'edit_item' => __('Edit Venue'),             'new_item' => __('New Venue'),             'view_item' => __('View Venue'),             'search_items' => __('Search Venue'),             'not_found' =>  __('No venues found'),             'not_found_in_trash' => __('No venues found in Trash'),              'parent_item_colon' => ''           );                $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,              'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title','editor','thumbnail', 'custom-fields', 'comments')           );                 register_post_type('venue',$args);     }      Thanks in advance.


How do I display a friendly URL link in the frontend?

I'm creating a separate (simple) directory that does not use any internal WP permalinks or pretty link structure. I've been studying how to make my own custom SEF URLs for _this_ part of my site, and almost have it (or thought so). I have a separate table with records like this:               id   |   section    |  category   | co_name     1    |  Consulting  | Innovation  | Innocentive.com     2    |   Tasks      | Employment  | Microtask.com     ....      The directory shows a page of all the sections & categories from the database at this URL: dailycrowdsource.com/companies/ (I did this with a companies.php file & created a 'page' with the slug 'companies') I want this URL to display all the 'employment' category listings: dailycrowdsource.com/companies/tasks/employment/ I can handle the php & mySQL, but I don't know how to make the links pretty. This works http://dailycrowdsource.com/companies/?category=poll This helped using an extra parameter in an URL, & I think I got it working, but I couldn't figure out how to convert the < a href=.... into the SEF link. I prefer to do this in my functions.php file, as I haven't written a plugin yet. I've done this in Joomla with the router.php file. In my research ( Need help with friendly URL's in Wordpress, Custom Post Type Rewrite Rule for Author & Paging?, Rewrite API ), I'm seeing a lot of the same tags & buzzwords, but no one explains how to change the actual link. Does WP do it automatically? (In Joomla you have to do: JRoute::_('index.php?var1=great&var2=more'); for the conversion to take place.) I realize the first answers will tell me to use some built in taxonomy of WP, but I need this to be updated easily. And by adding a record to the database with a brand new section or category, my directory needs to be instantly updated (that's why I've chosen this method - no administration). I would appreciate someone showing me how to add in hooks/filters/etc to make a custom SEF URL. (All URLs will start with dailycrowdsource.com/companies/ ). (I'm hoping Mike Schinkel reads this - as I got a lot of help from his responses to similar posts) Thank You -David