title: Comments_template doesn't work

text:
If I use               comments_template();      it does not work at all. But if I change it to               global $withcomments;     $withcomments = 1;     comments_template( 'comments.php', true );      it displays the comments template but I need to setup the Disqus plugin, and the plugin does not work. I don't understand, getting comments to display is being incredibly difficult for some reason.. dev link * * * _(tried to truncate non-pertinent code to keep it short)_ **index.php**               if ( have_posts() ) {         while ( have_posts() ) {             the_post();             get_template_part( 'content' );         }     } ?>      * * * **content.php**                         <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">              <?php get_template_part( 'content', 'header' ); ?>
                  <?php             $entrycontent = $lithograph_theme_options['excerpt_content'];                  if ( $entrycontent != '' ) {                 switch ( $entrycontent ) {                     case 'excerpt':                         if ( $lithograph_theme_options['slideout_content'] == 0 ) the_excerpt();                         else : ?>                                                              <?php                                     if(!empty($post->post_excerpt)) the_excerpt();                                     else : echo get_first_paragraph(); ?>                                 + more                                                                                <?php echo get_the_post(); ?>                                 - close                                 <?php                                      get_template_part( 'content', 'footer' );                                     comments_template( 'comments.php', true );                                 ?>                                                      <?php }                         break;                     case 'content':                         the_content();                         global $withcomments;                         $withcomments = 1;                         comments_template( 'comments.php', true );                         break;                 }             } ?>

      * * * _(generic comments template)_ **comments.php**               <?php if($comments) { ?>
             <?php foreach($comments as $comment) { ?>                 <li id="comment-<?php comment_ID(); ?>">                     <?php if ($comment->comment_approved == '0') { ?>
Your comment is awaiting approval
                     <?php }                     comment_text(); ?>                     <?php comment_type(); ?> by <?php comment_author_link(); ?> on <?php comment_date(); ?> at <?php comment_time(); ?>
             <?php } ?>
     <?php } else { ?>
No comments yet
     <?php } ?>


title: Missing items on page

text: I'm missing items on my web page and I think it is due to some jQuery problems. But I'm not sure and I am unable to find the bug. On this site, on the upper-right corner there is a shopping bag 'widget', and on my site there is none but the white space indicates that it's trying to be there. Now I made a gist of the differences of both sites (https://gist.github.com/mvaneijgen/d5784918e202ac19070f/revisions), but still cant find a bug maybe a more experienced WordPress developer sees it in a second. I have tried disabling all the plugins, flushing the cache and ask for theme support on GetBowTiedSupport - Ticksy, but there's no response from the developer so I hope to fix it through this channel.


title: How to add order in goods catalog plugin in wordpress?

text: https://wordpress.org/plugins/goods-catalog/ I'm using Goods Catalog Plugin to add the products.Now i waht to order it. But there is no option for it. Kindly Help me to add the order in this plugin


title: approve,spam,trash etc. options are not coming on comments in admin panel

text: I made some changes in **comment-template.php** , **wp-comment-post.php** so now I am storing the comments withot attaching with any post or page (I am setting the comment_post_id to 0). But now the problem is When I go on admin panel and see all comments the comments with 0 comment_post_id are not having option of spam , trash , approve etc. how to resolve it? Actually I want to store comments separately from post or page but with complete functionality as in comments of any post or page like whether logged in or not otherwise fields for name, email etc. and in admin panel options for approval,trash,spam etc.. Can I achieve this with any other plugin that performs same as comment form.


title: Extending WC_Cart in woocommerce

text: I am trying to extend WC_Cart in woocommerce, from what i understand my code should be correct. However when I load the cart I get the following message.               Fatal error: Call to undefined method WC_Cart::get_prediscount_total() in ...      Code in my plugin:               class My_WC_Cart extends WC_Cart {          public function get_prediscount_total() {             return apply_filters( 'woocommerce_cart_total', woocommerce_price( $this->total * 5 ) );          }      }      The output code is                echo $woocommerce->cart->get_prediscount_total();      This works when the codes in `/wp-content/plugins/woocommerce/classes/class- wc-cart.php` but the moment I try to extend it it fails.


title: Multi-part form and wp_redirect()

text: For starters, it's a plugin (with a shortcode) or at least I would prefer it to be. I've got two issues both related to wp_direct. If form 1 validates I want to redirect to form 2, and continue the process. If the visitor tries to start at form 2 without first having filled out form 1, then I want to redirect them back to form 1. I've tried a number of different things and I continue to get "Cannot modify header". Even when the __construct() uses add_action ''send_headers' I still get the header error. How do I validate a form, redirect and then display a second form. This hardly seems like an advance need. Yet I've spend a good part of the day looking for answers and here I am begging for help :) Thanks in advance. p.s. wp_safe_redirect() doesn't show up in the tags list.


title: List of all existing Wordpress plugins

text: Is there a place from where I can get a list of all existing Wordpress plugins located in http://wordpress.org/extend/plugins/ I am trying to test my website for vulnerabilities and need such list. Thanks


title: Remove a menu item created by a plugin

text: I'm trying to remove a menu item and tried several approaches, but have not had any luck. It was created from a FAQ plugin. If I use this line:               remove_menu_page( 'edit.php?post_type=question' );      It will remove the main menu, however I only want to remove two sub-menu items contained inside that `edit.php?post_type=question` URL address. For the item I want to remove, the path in the URL bar gives me the following:   `edit-tags.php?taxonomy=faq-topic&post_type=question`   and   `edit-tags.php?taxonomy=faq-tags&post_type=question` I have tried several solutions including `remove_menu_page` and `remove_submenu_page` to no avail. What has failed so far:               remove_submenu_page( 'edit.php?post_type=question', 'edit-tags.php?taxonomy=faq-topic&post_type=question');     remove_menu_page( 'edit-tags.php?taxonomy=faq-tags') ;     remove_menu_page( 'edit-tags.php?taxonomy=faq-tags&post_type=question') ;     remove_submenu_page( 'edit.php?post_type=question', 'edit-tags.php?taxonomy=faq-topic&post_type=question');     remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=faq-topic&post_type=question');     remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=faq-topic');     remove_submenu_page( 'edit.php', 'edit-tags.php');


title: Custom fields with square brackets in the name

text: I have some custom fields which I need to have square brackets inside. This would not be a problem apart from the fact that I need the end user to be able to reselect the custom field on another post but it is not visible. Any custom fields with a name with a square bracket is missing from the drop down list. Is there any one that can help me to show the custom fields in the dropdown with a square bracket in it?


title: How to filter categories of a post

text: Is there any way to filter the categories of a post? I am using `wp_get_post_categories( $post -> ID );` i want to filter this listing i.e. `if(post_name or post_id == "some id or some name") {it should not be displayed}`


title: Multisite Independent User Base

text: I run a multisite blog farms with all blogs having a consistent functionalities (theme and plugins and some basic content), but independent from each other in terms of user database. I would like to prevent user signup at one site being able to sign in through all other sites. Likewise, if a user is deleted from a site, s/he can't access other network sites. I'm actually registering user through a plugin, so I have total control over the registration process. Any input is appreciated :)


title: Static posts page is not working

text:
I've found other questions asking the same thing but I think I followed the method correctly. I created a page called "Splash" (page-splash.php) and another empty page called "Blog" But when I change the settings in "Reading" the main page is working (WP loads page-splash.php correctly) but the the loop in my index.php is NOT returning any posts. ! http://i.imgur.com/ZLVlp.png This is my index.php               <?php get_header(); ?>
          <?php query_posts($query_string . '&cat=-3'); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<?php the_title(); ?>
                <?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>
<?php the_content(); ?>

            <?php endwhile; else: ?>
Sorry, no posts matched your criteria.
      <?php endif; ?>
     <?php get_footer(); ?>      The thing that confuses me if I remove the whole use a static front page feature and just return to the normal settings. The loop in index.php is working... Update: here's the site I'm working on. http://www.christiegrahamphotography.com/2012/wordpress/ Click into blog will return zero posts (I have 3 published posts)


title: Using wp_dropdown_users and selected() function?

text: I have a custom meta box with a dropdown displaying all the WP users via wp_dropdown_users. It saves which WP user is chosen with the post, so that all works. However, is there a way to make it show the selected user in the dropdown when going back to edit, rather than the first in the list? I've used the selected() function for another dropdown but I've created that dynamically. I've tried to implement selected() with wp_dropdown_users, but it hasn't worked so I'm not sure if it's even possible? Thanks!


title: How do I “replace a function via plugins” in WordPress?

text: I'm new to WordPress and am not understanding their docs. What I'd like to do is to replace the `wp_hash_password` (and a few other password related functions) with my own. I've already written the functions and had them tested outside WordPress to ensure functionality. > "wp_hash_password function can be replaced via plugins. If plugins do not > redefine these functions, then this will be used instead." > > According to WordPress docs Unfortunately I can't find any place that tells me HOW to do it. I tried creating a PHP file in the `../wp-content/plugins/myfirstplugin/myplugin.php`. In my `myplugin.php` file I have an "overriding" function:               function wp_hash_password( $password ) {           // my code is here          }      I also tried renaming my php file to functions.php and even used the `add_action` & `add_filter` but again the docs are less than supportive. I have the code I just need to know how to put it in a "plugin", where the plugin goes, and how to activate the plugin (is this done in the wordpress admin's menu?) Cheers!


title: Listing all posts from current category on page

text:
I'm trying to list all posts from a certain category, in a list, on the category page that already lists the posts out in blog form. I'm trying to do it in the header area so that you can get an overall look at the posts on the page. I found this:
     <?php     global $post;     $category = get_the_category($post->ID);     $category = $category[0]->cat_ID;     $myposts = get_posts(array('numberposts' => 5, 'category__in' => array($category), 'post__not_in' => array($post->ID),'post_status'=>'publish'));     foreach($myposts as $post) :     setup_postdata($post);     ?>
     <a href="<?php the_permalink(); ?>">     <?php the_title(); ?>
     <?php endforeach; ?>     <?php wp_reset_query(); ?>
      But it always seems to cut one of the posts out of the list. Is there an easier way to do this, without a plugin? Thanks


title: Add a .last class to the last <li> in each ul.sub-menu

text:
I've seen a lot of code on how to add a `first` and `last` class to a WordPress menu, but in my instance I would like to add a `last` class to the last li in the sub-menu that WP generates. Here's what I would like to achieve in it's simplest form.

Menu item one

Menu item two

Sub menu item one

Sub menu item two

Sub menu item three

Menu item three

      And here is what I currently have, that adds first and last classes to only the parent menu items. Could this be adapted?               function add_first_and_last($items) {         $items[1]->classes[] = 'first';         $items[count($items)]->classes[] = 'last';         return $items;     }          add_filter('wp_nav_menu_objects', 'add_first_and_last');      I would like to stick with php for this and not use either `:last-child` (want it to work in ie7 & 8) or jQuery.


title: Page not found error when adding text `2 = 2 ^ 1` to the page

text: Adding the following text to a page in the Text editor and clicking `Update` results in "Error 404 - Page Not Found":               2 = 2^1      Replacing this text with anything else makes the Update succeed. Any ideas what might be causing the error? **Update:** After some experimentation I've discovered a more general form of input leading to errors:               <number> = <number> ^      with the same number on both sides of the equal sign. For example, `100 = 100 ^` gives an error while `100 = 101 ^` doesn't.


title: How pass a 0 in $atts?

text: I need to pass an attribute (tabindex="0") into my navigation link. I use this filter:               /**      * Add tabindex attribute to menu links      *      * Brings keyboard accessibility for opera browser.      */     add_filter( 'nav_menu_link_attributes', 'atts_menu_tabindex' );     function atts_menu_tabindex( $atts, $item, $args )     {         $atts['tabindex'] = 0;         return $atts;     }      This filter works fine with all values unless with **_0_** (zero). What can i do, to pass the "0"?


title: Multisite install on subdomain w/ subdomains change siteURL

text: I have a multisite installed on a subdomain and I am trying to make the process of duplicating sites more straight forward. Currently when it is duplicated you must delve into the settings to manually change the siteURL for that particular site from `xxx.xxx.example.com` to `xxx.example.com`. Is there a way this can be done hooking into `wpmu_create_blog` at all? If it helps I am currently using NS Cloner Pro to duplicate sites, but I don't think it should matter.


title: How to call one custom field value if another custom field value is equal to today's date

text: I'm building a website for a school division in Canada, they help organize their days by assigning a school day to each day of the week. There are 5 school days, and so they do not always end up on the same day of the week, as on a day off the school day doesn't roll over. I have used a custom post type and entered in custom fields to allow setting a date value, and a School Day Value by the staff of the school, however on the front page I have created a widget that I'd like to run a php string that will find an event with the date value the same as today's date, and then display that day's date or that custom field value in the sidebar for that day. Can anyone think of how to do this? Thanks! EDIT* So from what I can see I think I'd need something like "               $query = new WP_Query( array( 'meta_key' => 'color', 'meta_value' => '**insert something that would show today's date in the  correct format**' ) );      does it seem like I'm headed in the right direction? Sorry guys I know I'm way below the skill set needed for this but I'm not sure how else to learn.


title: How to Delete all Unused photos Function

text: I have the current problem : I run a WordPress website with Woo Commerce and every few days I refresh the product list deleting and importing over 8000 products at a time . Now, every single time I get +/- 3500 products deleted from the database so I have to remove the photos and the thumbnails for each one .. so i have to delete more then 12.000 photos . Using any plugin is not an option, they all freeze / stop working so I need to build my own / function or plugin and I need a starting point . I have a list with the old products and I delete them like this :               foreach($old_product_list as $oldproduct){              $wpdb->show_errors();         $delq = $wpdb->get_results(                          "  DELETE a,b,c                             FROM wp_posts a                             LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )                              LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )                              LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )                              LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )                                                 WHERE a.post_title='".$mysqli->real_escape_string($oldproduct['name'])."' " );        [.....]


title: making a glossary with wordpress

text: I know that there are glossary plugins in the wordpress repository. This plugins normally searches glossary terms in post content and adds a link to it. But i have not found one, that search and replace terms in custom post types. Because of this i am trying to make my own glossary plugin. if you know about a plugin that make this, please tell me. My code search custom post type posts titles in the post content and replace it with a link. The problem is that it make the replace in all the text, including a title atributte of a links, and i dont want to replace it by a link in this cases. what can i do to it doesn`t replace when is link atributte text? This is my code:               function reemplazar($cadena){              //get glossary posts type posts         $args = array(             'showposts'   => -1,             'category_name' => 'glosario',             'post_type' => 'glosario',         );          $posts_array = get_posts( $args );              //Create an array with post title in keys and post link in a value         $reemplaza = array();         foreach ($posts_array as $posts) {             $reemplaza[get_the_title($posts->ID)] = 'ID) . '" title="' . $posts->post_content .'">' . get_the_title($posts->ID) . '';         }              //create an array with array keys and add a regex for search terms that are before a dot, coma o white spaces         $patterns = array_keys($reemplaza);         $pattern_final = array();         foreach ($patterns as $pattern) {             $pattern_final[] = '/(?<=\s|^)' . $pattern . '(?=\s|\.|\,|$)/i';         }              //replace in the post content words that are a glossary term by a link to glossary         $cadena = preg_replace($pattern_final, $reemplaza, $cadena, 1);         return $cadena;     }          //do reemplazar function when post content display     add_filter('the_content', 'reemplazar');


title: One Click demo content installation feature in WordPress theme options panel

text: I've been seeing a feature of one click demo content installation option on some powerful WordPress themes now a days. Mostly on Themeforest themes. I'd like to know if anyone have any idea about the best way to implement this. Or any other resources to do this. Some hints, idea or keyword would be suffice. I'm not asking you to write me the codes or something. I'm wondering if you know the right way to do this. Thanks in advance.


title: How to get the custom header image's alt text?

text: I'm using a custom header in my theme. My aim is to add an `alt` attribute to my custom header `img` element. My `img` element so far looks like this:               <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />      How can I get the alt text of the custom header image?


title: Add id to menu items in wp_nav_menu

text:
I'm using wp_nav_menu in Wordpress to create my navigation The output is similar to this(I have removed href links)

Home

About

Services

Work

Contact

                        I need to style each link separately. How can I add an id to each (li) or (a) in the menu so I can style it.


title: How to create shortcode to show the 2 latest posts

text:
I would like to create a shortcode that displays the last 3 posts to any page.... It should be laid out like this > Title > > Excerpt...Read more I've added this code in function.php               function my_recent_post()      {       global $post;            $html = "";            $my_query = new WP_Query( array(            'post_type' => 'post',            'posts_per_page' => 2       ));            if( $my_query->have_posts() ) : while( $my_query->have_posts() ) : $my_query->the_post();                 $html .= "
" . get_the_title() . "
";            $html .= "
" . get_the_excerpt() . "
";            $html .= "Read more";            endwhile; endif;            return $html;      }      add_shortcode( 'recent', 'my_recent_post' );      and it works, except now my homepage shows the 2 posts as desired in a division, but the problem is below the content, ie, below the division with the shortcode, it shows the entire 2nd article (see image). Any suggestions? ![the problem](http://i.stack.imgur.com/NkxlG.jpg)


title: How do write this type shortcode?

text: How do I write this shortcode or any alternative?               echo do_shortcode ('[gviewer file="$att_url"]');      Any suggestions someone?


title: in_category() works in single.php but not in page.php?

text:
I'm using `in_category(array)` inside The Loop to detect whether a post is categorised into the Discussion category (or has one of a couple of slugs). This works beautifully on `single.php` but doesn't even seem to be evaluated when used inside `page.php`? FWIW, here's my code:               <?php if ( in_category( array( 'Discussions', 'discussion', 'discussion-article' ) )) :?>
This is an article from our Discussions series - read more in the Discussions section.
     <?php endif;?>      On the borked page.php instance, I've also tried               <?php elseif:?>
This post does not meet the category criteria.
     <?php endif;?>      but that doesn't show either leading me to believe the code's not being evaluated. This code snippet was, in both instances, inserted directly before `<?php the_content(''); ?>` (`the_content()` in single.php); it just doesn't eval or show up in page.php. Intentional behaviour or am I doing it wrong?


title: Add ASC / DESC to custom post columns

text: Im using the following code to create custom columns in the backend of the posts menu.               add_filter('manage_edit-post_columns', 'post_edit_columns');         function post_edit_columns( $columns )         {             $columns = array(                 'cb'            => '<input type="checkbox" />',                 'title'         => 'Module Title',                 'categories'    => 'Section',                 'menu_order'    => 'Order',                 'unlock'        => 'Unlock',                 'date'          => 'Date'             );             return $columns;         }      The `title` column outputs an ASC / DESC link. How can i add this ordering link to the other columns?


title: Global variable set in the template's header.php is unable to echo in footer.php

text: E.g. I set this in header.php in my template:               <?php $postidextra = get_the_ID(); ?>      <?php $sidebar_state = get_post_meta($postidextra , 'rw_sidebar_state', true); ?>      And I can echo $sidebar_state in header.php, it's working. However, when I try to echo this variable from footer.php or page.php it's not working and I need to repeat my code to get the post id and post meta etc. which is repeating and a bad practice. **Why it's not available if it is just include?** How to make the variable available in all files across WP template files? **UPDATE:** After suggestion to use global variables I am still unable to `echo $sidebar_state;` in footer.php. My code in header.php looks like this:                <?php global $postidextra; ?>       <?php $postidextra = get_the_ID(); ?>      <?php global $sidebar_state; ?>      <?php $sidebar_state = get_post_meta($postidextra , 'rw_sidebar_state', true); ?>      Footer.php looks like this:               <?php     /**      * The template for displaying the footer.      *      * Contains footer content and the closing of the      * #main and #page div elements.      *      * @package WordPress      * @subpackage Twenty_Twelve      * @since Twenty Twelve 1.0      */     ?>         </div><!-- #main .wrapper -->         <footer id="colophon" role="contentinfo">             <div class="site-info">                 <?php echo $sidebar_state; ?>             </div><!-- .site-info -->         </footer><!-- #colophon -->     </div><!-- #page -->          <?php wp_footer(); ?>     </body>     </html>      `<?php echo $sidebar_state; ?>` is wokring only in header.php . Any idea what should I change in my code?


title: Native "playlist" shortcode random playing... How?

text: I'm using the beautiful shortcode "playlist" in my site but I want the random playing of my audio files. What I use is this: > [playlist tracklist="false" images="false" artists="false" > ids="7691,7690,7688,7687,7686,7685,7684,7683,7682,7681,7680,7679,7678,7677,7676,7674,3978,3647,3408,1395,1217,1216,1214,1213,1211,1210,1209,1208,1207,1206,1181,975,899,668,663,642,641"] How to make random playing, maybe also with dad jQuery?


title: Conditional category & tag statement

text:
I'm just working on a "quick" change to the blog-entry-subtitle of specific posts in a category on my wordpress website. I'm hoping to have "Published in Orchard and Vine Magazine on:" instead of "Posted on:". You'll see that the page I'm trying to customize is here               <?php if ( is_category('Legal Libation Columns') ) : ?>
Published in Orchard and Vine Magazine on: <?php the_time('F j, Y'); ?>
     <?php  else: ?>
Posted on: <?php the_time('F j, Y'); ?>
     <?php endif; ?>      GREAT! I love it. However once you click on one of those posts to read more it converts the blog-entry-subtitle back to the "Posted on:" as now you aren't in the specific category anymore. I would like the "Published in Orchard and Vine Magazine on:" instead of "Posted on:" for all posts with a category and tag of Legal Libation Columns. So then I try this.               <?php if (is_category('Legal Libation Columns') && has_tag('Legal Libation Columns')); ?>
Published in Orchard and Vine Magazine on: <?php the_time('F j, Y'); ?>
     <?php  else: ?>
Posted on: <?php the_time('F j, Y'); ?>
     <?php endif; ?>      However I get a weird white screen of nothing? ![enter image description here](http://i.stack.imgur.com/aT7Aq.png) How do I have it so that any post with the tag Legal Libation Columns always has that specific blog-entry-subtitle without giving me an error?


title: How to add a field to live preview in post editor?

text: WordPress 4.0 allows live previewing of certain shortcodes while editing a post. How can I customise the options that appear when I edit my embedded video? I want to add a custom field below the already existing "title" field. That field shall contain data that is assigned to that specific embedded video. The screenshot should make it clear: ![Add field to embedURL options](http://i.stack.imgur.com/KnqTQ.png) Maybe those pages help you to solve my issue: wp_editor or wp-views. Any help will be appreciated! Best regards, Kevin


title: Drop Up Menu with a twist

text: I am trying to make menu tabs slide up like a bookmark on hover so that the main menu item is still on top and the submenu slides up with it. I am using TwentyTwelve WordPress theme. Is this possible with CSS? Thanks


title: How to select widgets top bottom?

text: i'm add widgets in functions.php:               register_sidebar(array('name'=>'sidebar1'));     register_sidebar(array('name'=>'sidebar2'));      in index.php how to code: set options sidebar1 or sidebar2 to top index. i'm add index.php               <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar1')) : ?><?php endif;?>     <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar2')) : ?><?php endif;?>      but not setlect sidebar2 to top sidebar1 Thanks!


title: Count posts by type including drafts and pending posts

text: I had this function that counts posts number by type (taken from wordpress codex)               function count_user_posts_by_type($userid, $post_type) {         global $wpdb;         $where = get_posts_by_author_sql($post_type, TRUE, $userid);         $count = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} $where" );         return apply_filters('get_usernumposts', $count, $userid);     }      and I changed it in order to display even posts with "draft" and "pending" status.               function count_user_posts_by_type($userid, $post_type) {         global $wpdb;         $where = get_posts_by_author_sql($post_type, TRUE, $userid);         $count = $wpdb->get_var( "SELECT COUNT(*)                                  FROM {$wpdb->posts} $where                                  AND (post_status = 'publish' OR post_status = 'draft' OR post_status = 'pending')");         return apply_filters('get_usernumposts', $count, $userid);     }      but it doesn't work. If I echo the function like this               echo count_user_posts_by_type(wp_get_current_user()->ID, 'percorso');      I can see it counts just published posts. What's wrong with what I wrote? Thanks! EDIT: as suggested, I performed a var_dump for SELECT COUNT etc. here's what I got               string(216)          "SELECT COUNT(*) FROM mi_posts          WHERE post_author = 1          AND post_type = 'percorso'          AND (post_status = 'publish' OR post_status = 'private')          AND (post_status = 'publish' OR post_status = 'draft' OR post_status = 'pending')"


title: Pretty URLs with Categories and Tags

text: How do I create pretty permalinks for a query page that includes results from both categories and tags. For instance, if the category is Country (America) and the tag name is city (New York), can I have a permalink like wordpressblog.com/america/new-york for a page that shows all posts belonging to Amercia category and NY tag? Thanks much!


title: How do I adjust/remove img widths when embedding posts in a narrower external site?

text: I have a blog on a PHP site i.e. http://mywebsite.com/blog/ and want to embed complete posts in a page on http://mywebsite.com/               include('blog/wp-load.php');     $post=get_post($postid);     $content=apply_filters( 'the_content', $post->post_content );     $title=apply_filters( 'the_title', $post->post_title );      My site is responsive and narrower than the Wordpress theme, so some of the wider images and YouTube embeds in the posts are breaking the layout. I could do some regex stuff to find images etc in the content and replace the widths/heights but I wondered if there was a better way to do this? Cheers


title: How to activate the child theme in Wordpress?

text: I create a new style.css and use it in child theme. And I create a new folder in wp-content and name it as themename-child and upload the style.css that I created. Now, I go to wp dashboard -> Appearance -> Themes and I look the child theme that I create. And I found this error:               Broken Themes          The following themes are installed but incomplete. Themes must have a stylesheet and a     template.          Name    Description     Accesspress Lite    The parent theme is missing. Please install the "AccesspressLite" parent theme.      Here's the css child theme format:               /*     Theme Name:   Accesspress Lite     Theme URI:    http://access-keys.com/accesspresslite/     Description:  Accesspress Lite Child Theme     Author:       Yang     Author URI:   http://www.example.com     Template:     accesspress-lite     Version:      2     Tags:         blue, white, light, custom-menu, one-column, two-columns, three-columns,   left-sidebar, right-sidebar, fixed-layout, fluid-layout, custom-background, featured-image-header, sticky-post, theme-options, threaded-comments, featured-images, full-width-template, custom-header, flexible-header, responsive-layout     Text Domain:  accesspress-lite-child     */          @import url("../accesspress-lite/style.css");


title: How do I hide Wordpress users from security scanning?

text: We are about to launch a Wordpress site hosted internally. As a standard practice, our IT security team does their check for any vulnerabilities. And sadly, they are able to retrieve the list of Wordpress users/accounts. Is there a way to hide them? I am envisioning this made involved changes to Wordpress PHP files so I asked here in stackoverflow. Thanks a lot


title: Grab all Custom Posts by multiple taxonomies and terms

text:
I have 4 custom taxonomies with multiple terms for a "Members" page. I have a taxonomy of "location" and "organize" that I'm trying to separate into a list. I need to grab all posts by the "aba-therapists" term in the "organize" taxonomy and separate those by their "locations." If that makes sense to anyone. Something like this: ## ABA Therapist Term of Organize Taxonomy ### Term 1 of Location Taxonomy Post Post Post Post ### Term 2 of Location Taxonomy Post Post Post Post ### Term 3 of Location Taxonomy Post Post Post Post This is the code I have, which just pulls in every post within the "members" CPT and organizes by every term:                   foreach ($taxonomies as $taxonomy){             $terms = get_terms($taxonomy, array('orderby' => 'date', 'order' => 'ASC'));                  if ( !empty( $terms ) && !is_wp_error( $terms ) ){                 foreach ( $terms as $term ) {                     $args = array(                         'post_type'           => $post_type,                         'orderby'             => 'date',                         'order'               => 'ASC',                         'ignore_sticky_posts' => 1,                         'post_status'         => 'publish',                         'posts_per_page'      => - 1,                         'tax_query'           => array(                             array(                                 'taxonomy'    => $taxonomy,                                 'field'       => 'slug',                                 'terms'       => $term->slug                             )                         )                     );                     $my_query = null;                     $my_query = new WP_Query($args);                     if ($my_query->have_posts()) {                         echo '

' . $term->name . '

';                                  while ($my_query->have_posts()) : $my_query->the_post(); ?>                                      <a href="<?php the_permalink(); ?>">                                     <?php if ( has_post_thumbnail() ) : ?>                                         <?php the_post_thumbnail('cac-small'); ?>                                     <?php else : ?>                                         <img src="<?php echo get_template_directory_uri(); ?>/img/profile-placeholder.png" alt="Default Image">                                     <?php endif; ?>

<?php the_title(); ?>

                                                                   <?php                             endwhile;                      } // END if have_posts loop                         echo '

'; // Close 'details', 'wrap', & 'members' DIVs                     wp_reset_query();                  } // END foreach $terms             }         }     ?>      I'm lost on where to start. Anyone have any clues?


title: jQuery undefined function error with WP jQuery, but works with Google CDN

text: I've been reading several articles dissuading WP developers from replacing the enqueued jQuery with the Google CDN version of jQuery. I'm sold. I am now enqueueing the WP jQuery version which uses jQuery.noConflict(). However, I am getting the 'undefined is not a function' error in a home-grown .js file that uses $ selectors. Even when I change the selector to 'jQuery' I still get the error. I made sure that jquery is loaded prior to the .js file. For testing, if I switch out the WP jQuery enqueue with Google CDN's version, I get no errors at all. I want to be able to use WP's jQuery, but I can't seem to get it to work with the home-grown jquery code. Any thoughts on other debugging ideas? EDIT: Here's a slice of the home-grown .js file that is failing:               var brk = {         start: function($){              $("#navigation ul li a").css("color", "#FFF").css("text-decoration", "none");         $("#topButtons a.clearbtn").css("color", "#FFF").css("background", "transparent").css("border", "1px solid #FFF");         }     }          jQuery(document).ready(brk.start($));      The 'undefined is not a function' error is on the first $ line: $("#navigation ul li a")...


title: how to Specifies an author / editor to edit one category only?

text: let me say i have a news website and it have many categories like sports ,politics and art . so i want to specify or select one of my authors "Bob" to be an editor for sports only for example .... how this could be ?? i found a level choice to select for editing over multi user something like :               administrators == administrator roles     editors == editor level .....etc       ...in this link http://codex.wordpress.org/Function_Reference/add_role But i want like this :               Bob == admin of political category posts     Maria == admin of Sports category posts     Dr.Adam == admin of health category posts      i want to select one (admin)user by name or password for every category


title: Theme Check gives: Required: This theme doesn't seem to display tags?

text: I am testing my theme with _Theme Check plugin_ and it shows this message: > Required: This theme doesn't seem to display tags? Picture: ![enter image description here](http://i.stack.imgur.com/NJC9T.png) How can i fix this?


title: Custom registration field to SQL database

text: I have created new columns in a SQL table called `wp_users`. Those fields are "giodo", "handel" and "regulamin". What I want to do is to add '1' to each column when a user registers and selects corresponding checkboxes. I added checkboxes to the form using form_register and then I added those checkboxes to user data with this (here is an example for only one of them):               add_action('user_register', 'myplugin_user_register');     function myplugin_user_register ($user_id) {         if ( isset( $_POST['giodo'] ) )             update_user_meta($user_id, 'giodo', $_POST['giodo']);     }      Can I somehow add their values to the database?


title: How to hook into user registration process Before user registers

text: I need to add a field to the user registration form and then validate it before I add a new user to my WordPress I know how to hook into the registration form via `add_filter('register_form', 'my_function');` But how do I hook into the registration process before the user registers? Hence I do not want `add_action('user_register','my_other_function');`.


title: How to stop form resubmission on page refresh

text:
Hi I have a form that adds attachments to a post, however when the form posts it obviously doesn't show the post with the new attachment echoing "your file has been uploaded". When the user refreshes the page (to try and show their new attachment) the form posts again! Is it possible to either (1) stop the form posting again on refresh, (2) automatically refresh the page to display the post with its new attachment?? (2 is way better)               <?php $post_id = $post->ID;     if ( isset( $_POST['html-upload'] ) && !empty( $_FILES ) ) {     require_once(ABSPATH . 'wp-admin/includes/admin.php');     $id = media_handle_upload('async-upload', $post_id); //post id of Client Files page     unset($_FILES);     if ( is_wp_error($id) ) {         $errors['upload_error'] = $id;         $id = false;     }          if ($errors) {         echo "
There was an error uploading your file.
";     } else {         echo "
Your file has been uploaded.
";     }     }          ?>     <form id="file-form" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
upload     <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload">

<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id ?>" />     <?php wp_nonce_field('client-file-upload'); ?>     <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />

<input type="submit" value="Save all changes" name="save" style="display: none;">
     </form>      Thanks! :)


title: Resort get_categories

text:
I have a get_categories array               $args=array(         'orderby' => 'id',         'order' => 'ASC',         'taxonomy' => 'wpsc-variation',         'hierarchical' => 1,         'hide_empty' => 0     );     $variationCategories=get_categories($args);      I display those categories as a checkbox.               foreach($variationCategories as $category) {              if (in_array($category->term_id, $parentArray)) {             if ($category->parent == 0) {                 echo "

<input type='checkbox' checked name='variationParent[]' autocomplete='off' value='". $category->term_id ."'>" . $category->name . "";             } else {                 echo "

<input type='checkbox' checked name='". $category->parent ."-". $category->term_id ."' autocomplete='off' value='1'>" . $category->name . "

";             }         } else {             if ($category->parent == 0) {                 echo "

<input type='checkbox' name='variationParent[]' autocomplete='off' value='". $category->term_id ."'>" . $category->name . "";             } else {                 echo "

<input type='checkbox' name='". $category->parent ."-". $category->term_id ."' autocomplete='off' value='1'>" . $category->name . "

";             }         }          }      the problem is order, I want to order this by parent value of `$variationCategories[]` This is a dumped version of $VariationCategories it's not problem order it by parent with usort:               function cmp($a, $b) {         return strcmp($a->parent, $b->parent);     }     usort($variationCategories, "cmp");      but that's only works for child categories. but there are also parents which have parent value "0". The order I want is: 0 (parent:0) 1 (parent:3) 2 (parent:3) 3 (parent:3) 4 (parent:0) 5 (parent:4) 6 (parent:4) 7 (parent:4) like this ![screenshot](http://i.stack.imgur.com/6n8C8.png) where color,size and CPU arrays has ->(parent:0) and others are sorted by ID, but when I add new category it appends in the end, because it sorted by id by now Can I resort/recreate such array?


title: Excluding certain post status's from pagination

text: If a user is logged in and browsing through archives, the current pagination function factors in posts that aren't yet published which can result in page numbers leading to 404 pages. How can I get the pagination function to only factor in published posts? This is the pagination function I'm using currently:               // Pagination     function ta_page_navi() {         global $wp_query;         $bignum = 999999999;         if ( $wp_query->max_num_pages <= 1 )             return;         echo '<nav class="pagination">';                  echo paginate_links( array(                 'base'          => str_replace( $bignum, '%#%', esc_url( get_pagenum_link($bignum) ) ),                 'format'        => '',                 'current'       => max( 1, get_query_var('paged') ),                 'total'         => $wp_query->max_num_pages,                 'prev_text'     => '←',                 'next_text'     => '→',                 'type'          => 'list',                 'end_size'      => 3,                 'mid_size'      => 3             ) );              echo '</nav>';     } /* end pagination */


title: Is there some way to put a theme's header.php and footer.php in a subdir

text: and still call them with get_header() / get_footer()? For example {themedir}/templates/headers/header.php of {themedir}/templates/footers/footer.php With templates this is easy, but I can't get it to work with get_header() and get_footer(). Thanks in advance!!


title: New install of wordpress, my url goes to index of/

text: After my Wordpress installation (database hooked up and wp-config done and wp- login created). I just get Index of/ page when I go to my URL. I uploaded all the contents of the Wordpress folder to the document-root of my Apache VirtualHost, after downloading it and unzipping. Im taken to index of/ page for everything unless I specifically navigate to the page.. . I can get to the admin menu/dashboard (all admin stuff I can access). But there is nothing at my home URL. The site is labelleviemodesto.com. If i go there I get the index of/. If I try and go to labelleviemodesto.com/sample-page I get a 404 not found. What did I miss while installing? I made sure index.php is the first to be accessed in apache's dir.conf. I also noticed if I create a new page it cant be accessed either.


title: Inserting code to HTML view from a pop up initiated from visual view

text: I am trying to insert html into the HTML view.What i have done is to have tinymce advanced(a wordpress plugin) button that throws a popup and in it is all the necessary things to insert the html.The tinymce buttons are however only visible on the visual view. Question 1: Is it a plugin or hack that can allow one to parse html inside the visual view Question 2: Is it possible to insert html code to the html view from a popup initiated from the visual view


title: How to configure comments evolved for wordpress for pages?

text: I have installed Comments Evolved for WordPress to enable comments in my sites. there are so many pages and posts in my sites. i have activate this plugin succesfully. this plugin works fine with pages. but in posts whole reply section is not displayed. so is there any configuration for pages? please guide me to overcome this error. Please help


title: How to sort the admin area of a WordPress custom post type by a custom field

text: When editing one of my custom post types I want to be able to list all entries by a custom field instead of the date they are published (which, for a custom post type probably isn't relevant). I got a lead from the comments of a blog post about custom post types and the author said it was possible and that he even made it so you could click on the column names for a custom sort. He mentioned the `posts_orderby` function which I noted in my own comments but now I can find the blog post anymore. Any suggestions? I saw one solution that used               add_action('wp', 'check_page');      And the `check_page` function used `add_filter` to change the query but I'm pretty sure it would only work in the theme files, not in the admin area.


title: Editing default WP Comment Form

text:
I am creating a new WP theme which is built on Bootstrap Framework. For making the comment for responsive certain class to be added to the element for the form. In the comments.php file I used the $fields = array(); and modified the Name, Email Id and Website fields. I now want to modify the Comment label and it associated textarea and also the allowed tag section. Can anyone help me out? Here is what I have written in comments.php:               <?php      //Fields in Comment Form     $fields =  array(              'author' => '
             ' . __( 'Name' ) . ( $req ? '*' : '' ) . '
                 <input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />

',              'email' => '
             ' . __( 'Email' ) . ( $req ? '*' : '' ) . '
                 <input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) .'" size="30"' . $aria_req . ' />

',              'url' => '
             ' . __( 'Website', 'domainreference' ) . ( $req ? '*' : '' ) . '
                 <input id="url" name="url" type="text" value="' . esc_attr(  $commenter['comment_author_url'] ) . '" size="30" />

',          );          $comments_args = array(         'label_submit'=>'Submit Comment',         'title_reply'=>'Leave A Comment',         'fields' =>  $fields,                );          comment_form($comments_args);?>


title: More flexible sidebar and widget management

text: I’d like to have a plugin for a flexible sidebar/widget management. In fact, I want to give a user the possibility to choose which sidebar should be displayed per page/post. I know there are many sidebar plugins out there. Unfortunately, I haven’t found one which cover all my wishes. So I’d like to code this on my own. Which of the following possibilities do you find is the best and most flexible? Or do you have other approaches? ## Posibilities   1. Hardcode the register_sidebar calls in a plugin/functions.php and add a metabox for the `post_edit.php`, `post_new.php` screens.     * Not that flexible. If a user has 100 pages and every page should have a different sidebar, the user has to register additional sidebars manually.   2. Same as Nr.1 but use a generic sidebar template with conditional tags to display the widgets. We could also use the plugin Widget Logic for a more granular filtering in the backend.     * Good for a programmer or experienced WordPress user, but not for a normal user. The conditional tags must be mapped in a friendly manner. Also `is_page(id)` could create problems on multilingual sites, where posts of a different language are stored with another id.   3. A **_flexible-sidebars_** Custom Post Type. Every post in this CPT is used in a generic sidebar-template to display the given content. The sidebar is also selected within a custom metabox. The user can add content to the sidebar with the default WYSIWYG editor which is a big plus.     * Not a „real“ sidebar. Therefore widgets couldn’t longer be added on the widgets-subpage in the admin panel. We have to create an own metabox for widget-assignments.   4. Modify the widgets-subpage in the admin panel to create/register your own sidebars in WordPress. Also create a generic widget with a default WYSIWYG editor. Content with attachments could easily be added to the widget and draged to the new created sidebar. The user could then choose this sidebar with a drop-down field in a custom metabox in the post/page admin screens. To display the sidebar, we need also a generic sidebar-template. ## Conclusion From my point of view, Nr.4 should do the trick. Are there any other possibilities? Or does this already exists in a plugin? Thanks for your reply


title: functions.php conditional tag - only show in single.php?

text: //Geo Map     add_action( 'woo_post_inside_after', 'my_geo_mashup' );     function my_geo_mashup() {         global $post;     if ( in_category('listings') ) {             echo GeoMashup::map();            }     }      Works to embed my map tag only on my single posts categorized as "listings" But, the embedded tag is also showing within the index of posts (thumb, title, meta, excerpt) and I need to remove it from the loop of posts and have it only show on the single.php thoughts?


title: How do I write into a file (css)

text: I'm writing my first wp plugin and I have many problems, most of those I got to solve by just reading the codex, but I don't know how to write into a css file within my plugin's options. Maybe there's a better way of doing it, but what I had in mind was using a text field and saving that into an empty custom.css file that would be packed with the plugin. I don't want having to save css info into the wp_options table. Is there a standardized way of having custom css for your plugins which could be changed by the user without having to open the css file themselves?? Thanks in advance


title: hard code shortcode only on specific category

text: I am looking to embed several shortcodes into my post template, but I want the tags to be conditional to a specific category (and subcats). I've looked through the codex, but I'm unsure where to start.


title: Disable Admin account being emailed for comment notification

text: I am using the code below to send Comment notification and moderation emails to multiple email addresses for a client site. I have a custom admin panel for this particular site. In my admin panel I have a field that holds a comma separated list of emails that should be notified anytime a comment is posted and needs approval or notified. It works great however my client has 1 issue. As my client is also the Admin of the site, they are receiving a comment notification email to the email address that is under there account settings. So in addition to emailing my comma separated list of emails, it also em,ails the Admin account email. I am looking for help on how I can disable it emailing the Admin account and ONLY sending an email to the emails in my custom setting which this code below is doing already. Any ideas on how to do this please?               /**      * Email Multiple people when a Comment is Posted      */     add_action('comment_post', 'wp_notify_allmods');     function wp_notify_allmods($comment_id) {         global $wpdb;              $cn_recipients = get_option('custom_comment_emails');         //$cn_recipients = 'jason.davis@gmail.com,David@email.com,Tracey@custom.com';         //$moderated_only_option = get_option("cn_moderated_only");         //         $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");         $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");         $blogname = get_option('blogname');         $blogurl = get_option('siteurl');         $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);              if (get_option('comment_moderation') == 1) {  //if we need to send comment moderation email             $comments_waiting = $wpdb->get_var("SELECT count(comment_ID) FROM $wpdb->comments WHERE comment_approved = '0'");             $notify_message  = sprintf( __('A new comment on the post #%1$s "%2$s" is waiting for your approval'), $post->ID, $post->post_title ) . "\r\n";             $notify_message .= get_permalink($comment->comment_post_ID) . "\r\n\r\n";             $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";             $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";             //$notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";             $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";             $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";             $notify_message .= sprintf( __('Approve it: %s'),  $blogurl."/wp-admin/comment.php?action=mac&c=$comment_id" ) . "\r\n";             $notify_message .= sprintf( __('Delete it: %s'), $blogurl."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";             $notify_message .= sprintf( __('Spam it: %s'), $blogurl."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";             $notify_message .= sprintf( __('Currently %s comments are waiting for approval. Please visit the moderation panel:'), $comments_waiting ) . "\r\n";             $notify_message .= get_option('siteurl') . "/wp-admin/moderation.php\r\n";             $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), $blogname, $post->post_title );             $notify_message = apply_filters('comment_moderation_text', $notify_message, $comment_id);             $subject = apply_filters('comment_moderation_subject', $subject, $comment_id);             $message_headers = "";                  $cn_recipients_array = explode(",", $cn_recipients);                  foreach ($cn_recipients_array as $email) {                 @wp_mail($email, $subject, $notify_message, $message_headers);             }         } else {  //or just a regular "you've got a new comment" email             if ($moderated_only_option != 1) { //if comments are not modded but update notifications are set to moderated only don't send                 $notify_message  = sprintf( __('New comment on your post #%1$s "%2$s"'), $comment->comment_post_ID, $post->post_title ) . "\r\n";                 $notify_message .= sprintf( __('Author : %1$s (IP: %2$s , %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";                 $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "\r\n";                 $notify_message .= sprintf( __('URL    : %s'), $comment->comment_author_url ) . "\r\n";                 $notify_message .= sprintf( __('Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=%s'), $comment->comment_author_IP ) . "\r\n";                 $notify_message .= __('Comment: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";                 $notify_message .= __('You can see all comments on this post here: ') . "\r\n";                 $subject = sprintf( __('[%1$s] Comment: "%2$s"'), $blogname, $post->post_title );                 $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";                 $notify_message .= sprintf( __('Delete it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&c=$comment_id" ) . "\r\n";                 $notify_message .= sprintf( __('Spam it: %s'), get_option('siteurl')."/wp-admin/comment.php?action=cdc&dt=spam&c=$comment_id" ) . "\r\n";                 $notify_message = apply_filters('comment_notification_text', $notify_message, $comment_id);                 $subject = apply_filters('comment_notification_subject', $subject, $comment_id);                 $message_headers = "MIME-Version: 1.0\n"                     . "$from\n"                     . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";                 $message_headers = apply_filters('comment_notification_headers', $message_headers, $comment_id);                      $cn_recipients_array = explode(",", $cn_recipients);                      foreach ($cn_recipients_array as $email) {                     @wp_mail($email, $subject, $notify_message, $message_headers);                 }             }         }              return true;     }


title: Featured image in admin on custom post type

text: I followed this tutorial to getting featured images to show in the admin menu on posts. I wanted to be able to see what article had a featured image and what it looked like without having to actually edit the article. The article worked, but I noticed that it didn't work on my custom post type. So I went looking for the filter that would make it work and found manage_edit-post_type_columns I have a custom post type for "Events". The slug for this is "events". I figured from the codex that if I did this               add_filter('manage_events_custom_columns', 'ST4_columns_content', 10, 2);      It would work but it has not. I can see the column for the featured image in the admin menu but I do not see the image in the column next to the post.


title: Theme Option is not allowing two advertising for home only and rest of site

text: My Wordpress Theme(Themforest Hottopix) comes with a "theme options" section that allows you to add an ad on the header 970x90 however I was given two ads that are placed on the same spot one is suppose to show on the homepage and the second one is to be showed on the rest of the site. I tried to add this on the special section in the themes option and it does not work it shows both codes plus < ?php } ?> :               <?php if (is_home()) {     ?>     Iframe Advertisement code which is displayed on homepage only     <?php     }     ?>          <?php if (!is_home()) {     ?>     Iframe Advertisement code which is displayed everywhere else <?php     }     ?>      I would appreciate any assistance. Thank you eeb


title: Workflow for working with git and WordPress

text: As my site becomes more important to my business, I want to have better version control so I can look up past changes and backup my code. I keep seeing people talking about having their entire site in git and I want to know how that works. I currently have my custom theme in my git repo. The only person who will edit the theme is me. After committing my edits, I deploy by FTP-ing the new files to my site. How would you have an entire site in git? WordPress, themes, and plugins (I have lots of them!) are updated frequently and would create lots of commits. Do I ignore them? Or do I only commit them when I deploy? How would I keep track of changes to my own theme and custom plugins among all the other commits from updated plugins? I would love for someone to share some insight into this with me. P.S. As you might guess I'm fairly new to git, hence the wrong terminology etc. Appreciate it if you explain it like I'm 5 with your answers :)


title: [SOLVED]Get terms cross-taxonomy query

text:
I'm creating a product list with two custom taxonomies: the producer and the category. I've managed to display all of the producers and make the products display in a collapsible tab accordingly, but I want to exclude from display those producers, who don't have any products in the currently displayed category. The 'display all producers' code looks like this:               $terms = get_terms("producers");     if ( !empty( $terms ) && !is_wp_error( $terms ) ){                         $i=1;                         foreach ( $terms as $term ) {
producer's name, etc.
                         }                     }      How do I exclude producers that don't have any products assigned in the CURRENT category? 'hide_empty' argument doesn't work, as they have products in other categories. Edit: to be more clear, the category itself is shown basing on the current post, '/categories/trucks/' will show only trucks (but still all of producers, even those who do not have any trucks assigned)


title: How can I pass the ID of a post to a page template by clicking a url?

text: I have a post gallery and I'm displaying the thumbnails in example.com/gallery. Now this thumbnails are created via posts and when you click on on eof the thumbnails, it will direct you to single.php template. It goes to display a gallery room which mimics a Gallery Exhibit created with HTML5 and CSS3. Its quite heavy to load and doesn't really have the standard web gallery feel and I want an option for users to click weather to view it in Gallery Room or the standard grid which the native WordPress Gallery has. Now I want, in my example.com/gallery, to have two links. One on the Gallery Room and one on the standard grid. But how can I do this? I have already created a template for the standard gallery but how can I dynamically get the ID of the post whenever the user click on the 1st link in the example.com/gallery page. I have this in my template:               $post_id = 527;     $queried_post = get_post($post_id);      527 being the post ID. But of course this is not dynamic. I want to pass that ID to a url by clicking a link and will be stored to a variable which will be the value of the $post_id. Can anyone help? thanks!


title: Undefined variable error in theme option after updating theme

text: I have built a theme.. Now i have updated the theme and my theme consist of two new fields in the theme option panel               <input id="welcome_post_char" type="text" name="abc_options[welcome_post_char]" value="<?php echo esc_attr($settings['welcome_post_char'],'abc'); ?>">      But when i install this theme with old abc_options in my database table, gives an error > Undefined index: welcome_post_char in D:\wamp\www\wptest2\wp- > content\themes\accesspress-lite\inc\admin-panel\theme-options.php on line > 394 If i do               <input id="welcome_post_char" type="text" name="abc_options[welcome_post_char]" value="<?php if (isset($settings['welcome_post_char'])){echo esc_attr($settings['welcome_post_char'],'abc')}; ?>">      it doesn't give errors.. But i didn't see this approach in other Themes.. So can anyone please suggest me what is the best approach


title: Add custom dynamic string to permalink structure wordpress

text: I am adding dynamic string to permalink but the problem is all the pages which runs from `page.php` goes to **404** whereas the detail page of the post is working fine. ## Code:               add_filter('post_link', 'rating_permalink', 10, 3);     function rating_permalink($permalink, $post, $leavename) {         if (strpos($permalink, '%community%') === FALSE) return $permalink;              global $wpdb;         $Community=$wpdb->get_row(sprintf("SELECT `Community` FROM `tbl_custom` WHERE post_id = %d ",$post->ID));         return str_replace('%community%', $Community->Community, $permalink);     }          global $wp_rewrite;     $wp_rewrite->add_rewrite_tag("%community%", '([^/]+)', "post_type=post&name=");      My custom Permalink structure in `wp-admin`               /%community%/%postname%


title: Removing Fields From the Profile Page of Theme My Login Plugin

text: I would like to remove fields from the profile in Theme My Login. I want to remove everything except email and password field. I am able to hide fields using a little jQuery. But un fortunately I'm not good with it. Can someone help me how to make this? step by step? **Update:**   I found this but i dont know how to use it: > "This may not be the ideal approach, but I was able to hide fields (and > their associated labels and the parent p/div/tr element) using a little > jQuery, if you're familiar with that. Just target the input to hide, climb > up to its parent element, and hide it. This assumes that the element is > nested 3 levels down from the element i actually need to hide.. a in my > case. And i use a wp conditional to run this code only on the 'edit-profile' > page."               <?php     // this code goes in header.php, in the <head> section.     if(is_page('edit-profile') ) { ?>         <script type="text/javascript">             jQuery(document).ready(function() {                 // hide fields (the entire <tr>)                 jQuery('#id-of-field').parent().parent().parent().hide();             });         </script>     <?php }


title: Removing rules from .htaccess

text: I'm writing a small plugin that needs to write to .htaccess a simple non_wp_rule and i am doing it like this:               function ci_flush_rules()     {         global $wp_rewrite;         $wp_rewrite->flush_rules();     }     register_activation_hook(__FILE__, 'ci_flush_rules');               function ci_add_rules()     {         global $wp_rewrite;         $proxy = plugin_dir_path(__FILE__) . 'proxy.php';         $non_wp_rules = array('(.*)\.(jpe?g|gif|png)$' => $proxy);         $wp_rewrite->non_wp_rules = $non_wp_rules + $wp_rewrite->non_wp_rules;     }     add_action('generate_rewrite_rules', 'ci_add_rules');      The rule is written in the .htaccess file as expected. Now i have 2 problems. **Problem 1** When i try to remove this rule during plugin deactivation like this:               function ci_remove_rules()     {         global $wp_rewrite;         $wp_rewrite->non_wp_rules = array();         $wp_rewrite->flush_rules();          }      register_deactivation_hook( __FILE__, 'ci_remove_rules' );      The rule doesn't get removed. If i deactivate the plugin and then visit Settings > Permalinks it removes the rule. **Problem 2** WordPress is installed in a subdirectory `( http://localhost/wordpress )` and when the rule is written in the .htaccess it appears like that:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /wordpress/     RewriteRule ^index\.php$ - [L]     RewriteRule ^(.*)\.(jpe?g|gif|png)$ /wordpress/Applications/MAMP/htdocs/wordpress/wp-content/plugins/myplugin/proxy.php [QSA,L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress/index.php [L]     </IfModule>     # END WordPress      As you can see instead of a path like /Applications/MAMP.... it's /wordpress/Applications/MAMP.... Bare with me as this is the first time dealing with wp_rewrite stuff :)


title: Use image url with add_image_size

text: I am looking for a way to use an image url with the WordPress function `add_image_size`, I have already setup an image size called `'custom-thumb'` For example, instead of...               the_post_thumbnail( 'custom-thumb' );      Which would output the posts thumbnail at the custom size I specified, I want to do something like...               www.mydomain.com/image.jpg('custom-thumb');


title: How can I avoid re-inventing the Custom Fields wheel in my Plugin's Metabox?

text: Here's the scenario: In my plugin, I want to have a metabox show up on the post / page editor. I want the metabox to be -exactly- like WordPress' 'Custom Fields' metabox, ( Add another, delete, update, auto-populated dropdown, Enter new link, AJAX magic, etc ); with a couple minor differences:   * Instead of just 'Name' and 'Value', I want 'Target', 'Name' and 'Value'   * Instead of saving them all as 'public' custom fields that automatically appear inside the WP Custom Fields metabox, I want them all stored as a single multidimensional array inside a 'private', namespaced, field...i.e., `_myplugin_custom_fields = array( 1 => array( 'target' => 'mytarget1', 'name' => 'myname1', 'value' => 'myvalue1' ), 2 => array( 'target' => 'mytarget2', 'name' => 'myname2', 'value' => 'myvalue2' ) )` I've spent all day digging through the tangled web of WP Core, and have not been able to find a straightforward way to pull this off. If I move forward based on my current understanding, I'll end up duplicating hundreds of lines of core code from numerous php and js files. Can anyone here in WordPress Answers-land help point me in the right direction? I have plenty of experience in adding and leveraging metaboxes within themes and plugins, but this one has me totally stumped. Please speak up if I'm being unclear. Thanks in advance to all who reply!


title: Include different loop templates in search query

text: I have differnet Custom Post Types in my blog.   I also have custom templates for each of them like **loop-{$cpt-name}.php**   I would like to include different cpt templates dynamically in search results based on what custom post type is post at the moment in the loop. I am trying to do it like this ( search.php ):               <?php                 while ( have_posts() ) : the_post();                      if ( get_post_type ( $post->ID ) == 'teams' ) {                         get_template_part( 'loop', 'teams' );                     } elseif ( get_post_type ( $post->ID ) == 'players' )  {                         get_template_part( 'loop', 'players' );                     } else {                         get_template_part( 'loop', 'search' );                     }                 endwhile;                 ?>      However, the problem is that when I am trying to do it like so, I have infinitive loop in a query. Because in **search.php** file I check the post type in the **while loop** and include the template where I also have while statement ( I need to have it there ). Example of my CPT template ( beginning ):               <?php      /**      * The loop that displays teams      *      */     if ( have_posts() ) while ( have_posts() ) : the_post();       I came up with the idea to make additional query for each found post in the loop, like so:               while ( have_posts() ) : the_post();          if ( get_post_type ( $post->ID ) == 'teams' ) {                 query_posts('p='.$post->ID);                 get_template_part( 'loop', 'teams' );                 wp_reset_query();      But I suppose that would slow down the search in times. ( have not tested yet)   Any suggestions will be appreciated.


title: How can i show Cubepoints ranks/points in bbpress replies

text: i've been searching for a while now on how to show Cubepoints Points and Ranks in bbPress replies right below the user avatar and name... Found the template file where to show the info, tho not sure this would be the correct one to grab the reply-author info, the "loop-single-reply.php" and just bellow bbp_reply_author_link(); i'm placing the output (correct me if i'm wrong), and i discovered the functions to calculate and display Cubepoints and Ranks (cp_displayPoints($user->ID); & cp_module_ranks_getRank($user->ID)), correct me if i'm wrong again ^^ The question is, since working with bbpress is way more harder then wordpress due to the lack of easy to reach documentation (like wordpress codex), how can I get the reply-author ID and display the Cubepoints and Ranks, am I in the right way? what am I missing? thank you in advance!


title: New WP_Customize API - how does it work under the hood?

text: I noticed that if you make changes trough the new "customize" feature, when you navigate on a different page within the iframe preview document, your changes still apply, even if they are unsaved. It looks like WP is storing the temporary changes somewhere, and it applies them on the site if the site is viewed in "customize" mode. But how does the site know it's in customize mode? Because I don't see any query arguments appended to the links or anything like that.


title: Load plugin scripts and styles only on plugin page

text: Hello wordpress users, I'm stuck with a problem while running 2 self made Wordpress plugins. I'll use the following code :               define('PLUGIN_URL', plugin_dir_url( __FILE__ ));     add_action( 'admin_enqueue_scripts', 'plugin_load_js_and_css' );          function plugin_load_js_and_css() {             wp_register_style( 'plugin.css', PLUGIN_URL . 'plugin.css', array());             wp_enqueue_style( 'plugin.css');                  wp_register_script( 'plugin.js', PLUGIN_URL . 'plugin.js', array('jquery'));             wp_enqueue_script( 'plugin.js' );         }     }      But it's loading this stylesheet everywhere in the admin panel. Now I found this in the codex:               function my_enqueue($hook) {         if( 'edit.php' != $hook )             return;         wp_enqueue_script( 'my_custom_script', plugins_url('/myscript.js', __FILE__) );     }     add_action( 'admin_enqueue_scripts', 'my_enqueue' );      But this code is not working for my.. Does anyone have a another option? Or maybe know why it's not working for me?


title: Importing Tweets with certain hashtags into Wordpress

text: I'm looking for a way to import tweets into Wordpress as posts. In fact, I want to display tweets about a certain topic on a page in Wordpress. So page A would contain tweets about hashtag x, and page B would contain tweets hashtag y. There is at least one plugin that imports tweets (Tweet-Import), but it can only import tweets by a certain user, not by hashtag. Is there any way that this can be done? Cheers!


title: Problem with a query in custom posts

text: I'm making a search form to select available rooms.   I have a custom post for the rooms called "Products" and a post meta value called "availability" (format: Y-m-d).   And I want to find all rooms available from a certain date in my form: MyDate_a.   This is the code I use:               SELECT wposts.*     FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta     WHERE wposts.ID = wpostmeta.post_id     AND wpostmeta.meta_key = 'availability'     AND wpostmeta.meta_value >= $MyDate_a     AND wposts.post_status = 'publish'     AND wposts.post_type = 'products'     ORDER BY wpostmeta.meta_value DESC      But it seems that it select all the rooms, even if `$MyDate_a` is, lets say, 2013-03-30 and availability is 2013-04-01.


title: "Rendering of admin template [path to template] failed"

text: I've got a php script that is called when the user is editing the category. However, although the page renders fine for the most part, at the point where the image upload button should appear, I'm seeing this message: > Rendering of admin template /home/site/public_html/wp- > content/themes/mytheme/folder/subfolfer/admin/file.php failed What are the likely causes for this error in this one site? Other sites are processing this fine? THe site has PHP version 5.2.16 THe site has WP version 3.0.5


title: Add Admin Menu Inside Construct or Init

text:
I thought I was making headway in my WordPress Development education until I ran across the Boilerplate for WordPress plugins and it uses a class object. I'm fine with that and understand those concepts and I am a .Net developer. But, for some reason, I cannot get any callback to function properly. All I want at this point is an admin menu and when you click on that menu item, it display something like "PLEASE HELP ME!!!". Check out what I have below and can anyone please explain what I have wrong?               class school_manager {         function __construct() {             add_action( 'init', array( $this, 'init' ) );         }              public function init(){                 add_action('admin_menu', array(&$this, 'add_admin_menu'));             }              public function add_admin_menu(){             add_menu_page( 'School Manager Settings', 'School Manager', 'administrator', 'school-manager-settings', 'show_admin_settings_page', null );          }              public function show_admin_settings_page(){             echo '
This is a test for the admin settings page.  Please work!
';         }     }      My new menu item does appear (as it did when I was not using a class object in my plugin architecture. But, when I click on the menu item, I get the following error: > Warning: call_user_func_array() [function.call-user-func-array]: First > argument is expected to be a valid callback, > 'school_manager::create_admin_page' was given in H:\root\home\xxxxx\wp- > includes\plugin.php on line 406 I am trying to create a plugin that has not only an admin menu and submenu items, but also want to utilize the Settings API by trying to follow this series. So, this is one of the crucial points to get something as simple as a menu item to function before I can continue.


title: Getting rid of the blog page entirely

text:
My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ http://wordpress.org/extend/plugins/cornerstone/ ] ~ but I can’t figure out the alternative loop code and how I replace the loop in Genesis with a loop that loads post URLs rather than categories. I can see how this Projects template displays posts by category in the loop. // GENESIS LOOP               <?php     /**     *     * Template Name: Projects     * This file handles blog posts with the category Projects within a page.     *     */     remove_action('genesis_loop', 'genesis_do_loop');     add_action('genesis_loop', 'custom_do_cat_loop');     function custom_do_cat_loop() {     global $query_args; // any wp_query() args     $args= array('cat' => '30');     genesis_custom_loop(wp_parse_args($query_args, $args));     }          genesis();      // CORNERSTONE LOOP               <?php if ( cnr_have_children() ) : while ( cnr_have_children() ) : cnr_next_child(); ?>
<?php the_title(); ?>

<?php the_excerpt(); ?>
     <?php endwhile; endif; ?>      The Cornerstone loop displays the title and an excerpt with a link for each post in a section (a page) in Cornerstone. How do I replace the loop in Genesis with a loop that loads post URLs rather than categories? I am a designer, not a developer, so any help you can give me would be much appreciated. Terence.


title: How to sort by custom field value?

text:
I am using these code to sort most Commented, Most viewed Posts               <?php $params = $_GET;     unset($params['orderby']);     unset($params['order']);     unset($params['v_orderby']);     unset($params['v_sortby']);     $url = $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];     $url = strtok($url, '?');     $url =$url.'?'.http_build_query($params);     ?>
     <li <?php if($active == "date"): ?> class="active"<? endif ?>><a href="http://<?php echo        $url ?>">Most Rated
     <li <?php if($active == "comment"): ?> class="active"<? endif ?>><a  href="http://<?php   echo $url ?>&orderby=comment_count&order=desc">Most commented
     <li <?php if($active == "views"): ?> class="active"<? endif ?>><a href="http://<?php echo $url ?>&v_sortby=views&v_orderby=desc">Most viewed

      Now I want to sort Custom Field "Rating" as Most Rated here is the code of custom field.                <?php     //grab the rating value     $rating = get_post_meta($post->ID, 'rating', true);          //prints star image     for ($i=1; $i<=$rating; $i++){         echo '';       }          //prints unstar image     for ($i=$rating; $i<10; $i++){         echo '';     }     ?>      For this I used this code, but it's not working.               <a href="http://<?php echo $url ?>&orderby=rating&order=desc">Most Rated


title: Mass Permalink Changer

text: I recently converted a site from Moveable Type to WordPress and noticed that the permalinks for each post are short, cut off and have underscores in them. What I am looking to do is if there is a script or SQL command I can run to mass change each posts permalink to the default permalink it would have normally generated based on the post title. Thanks in advance!


title: Get Drupal user into WordPress

text: I have a Drupal site, and into it, a WordPress site. I would like to know how to get user info of drupal site in WordPress site ? in fact if your a user of wwww.mydrupalsite.com, how can I pass user info to www.mydrupalinfo.com/wordpress. ? Thank for answer !


title: Getting thumbnails of a custom posts featured images in a page-templates metabox

text: I guess I need to know how to call meta data into metaboxes for beginners. I'm using               $posts = get_posts(array(             'post_type'   => 'slidertype',             'post_status' => 'publish',             'posts_per_page' => -1,             'fields' => 'ids'             )         );         //loop over each post         foreach($posts as $p){             //get the meta you need form each post             $thumb = get_post_meta($p,"_thumbnail_id",true);                  echo $thumb;      To try to get thumbnails of my custom post type 'slidertype' to show up in a page's metabox. Right now it's displaying a number which doesn't make sense to me. No advice is bad advice guys! Thanks.


title: Displaying Latest Posts on a Page

text: I am trying to create a loop to display the title and excerpt of each blog post onto a page that isn't my index page. The in-progress demo site is here: http://thewestharbour.com/mypakage/ On the news page I need to display the latest 3 blog posts. Simply changing the settings won't work and every loop I have tried doesn't work either. I have also tried creating a separate template and assigning it to the news page but had no luck. Thanks, Wade


title: Multiple image uploader under editor?

text: I need a plugin for custom post type. I need something like this: ![Mockup with image uploader under edit screen](http://i.stack.imgur.com/crrY1.jpg) Can anyone suggest a plugin which has this feature, especially image upload and "Add another" button option.


title: Opendir and Wordpress Path

text: I wrote a simple function to get the contents in a folder (called templates) in my wordpress plugin, but am having problems getting the path to work (thus the function always dies). My question is: Is there a wordpress function or something that will give me the path to my plugin as required for the opendir function to work?                function get_templates(){              $path =   '[path to my plugin]/templates';          $dir_handle = @opendir($path) or die("Cannot open the damn file $path");           while ($file = readdir($dir_handle)) {            if(substr($file,-3) == "php" )             continue;            $TheLinkedFile = $path."/".$file;      if(file_exists($TheLinkedFile)) {          echo $TheLinkedFile.'<br>';      } else {     echo "nothing";      }      }          closedir($dir_handle);            }


title: Howto disable comment moderation emails for admins, but not for authors

text: I'm the admin of a WordPress multisite installation, and in most of the blogs I'm the person who created the blog in the first place, and therefore my email is the admin email address. Because of this, I get all the comment moderation emails, which I'm able to filter with some email rules. But I wanted to disable this mails in WordPress itself – with no success. I'm aware of the option in `Settings -> Discussion -> Email me whenever [x] Anyone posts a comment`. So I tried to disable this option, but then the regular authors of posts do not get notified, which is a _no go_. Does anyone have any suggestions? Is it even possible in WordPress to **disable** admin email notifications while still sending notifications to post authors?


title: How do I get my custom query to work with search results after the first page?

text: I am using a custom query in order to ajax load/append additional posts instead of paginating them out like WP defaults. However, when I click the button I've made to load more posts, it loads all posts rather than the ones that match the search result (while the first set matches the search result). How do I maintain this format of loading posts while retaining the search query? I successfully did this for my category pages with something like `query_posts(array('cat' => $category));` but am unsure how to do it for search. Button:               var pager = 1;     var search_load_posts = function(){           $.ajax({               type       : "GET",               data       : {pageNumber: pager, offset: 12},               dataType   : "html",               url        : "http://tay.is/designing/belmontvision/wp-content/themes/yamidoo/search-more-loop.php",               beforeSend : function(){},               success    : function(data){                   var $data = $(data);                   $container.append( $data ) .packery( 'appended', $data );                 heightcalc();                 $container.packery();             }         });     };          $('.search-load-more').click( function() {         search_load_posts();         pager++;     });      Original Loop Query:               <?php if (have_posts()) : get_template_part('loop-search'); ?>      Top Loop Search (loop-search.php):               <?php   $count = 1; while (have_posts()) : the_post();?>      Additional Post Query (search-more-loop.php):               <?php   require_once('../../../wp-load.php');                $page = (isset($_GET['pageNumber'])) ? $_GET['pageNumber'] : 0;             $offset = (isset($_GET['offset'])) ? $_GET['offset'] : 0;                  $args = array ( 'posts_per_page' => 12,);                  $last_twelve = get_posts($args);             $last_twelve_ids = array();             if( $last_twelve ) foreach( $last_twelve as $last_post ) { $last_twelve_ids[] = $last_post->ID; }                  query_posts(array(                   'paged' => $page,                 'post__not_in' => $last_twelve_ids             ));                    while (have_posts()) : the_post(); ?>


title: Custom post type & taxonomy just like WP defaults

text: I've spent days attempting to do a single thing: create a custom post type/taxonomy (cat)/taxonomy(tag) trio that replicates the stock standard WP category/post/tag structure with permalinks of /%category%/%postname%/ for example:               /category-name/ (category page)     /category-name/post-name-1/ (individual post)     /category-name/subcategory-name/ (category page)     /category-name/subcategory-name/post-name-2/  (individual post)     /category-name/subcategory-name/sub-sub-category-name/ (category page)     /category-name/subcategory-name/sub-sub-category-name/post-name-3/  (individual post)      I can get the categories working, but not the individual post pages, or vice versa. I've searched far and wide on this and cannot get all the pieces operative. With slugs, without slugs, with/without re-write plugins, etc. It seems very straight forward to get the category structure working - with or without a slug, but getting the posts to work _and inherit the category URL structure_ seems outright insane! What am I missing? UPDATE #1 7 days later... It seems that the frustration/lack of progress I'm experiencing is common as hell and I still cannot find anyone who has successfully replicated the default WordPress category/post system with permalinks of /%category%/%postname%/. Surely someone out there must know how to make the WordPress "CMS" (yes, in quotes) actually ouptut properly structured URLs that make sense? It would be insane if the _only_ way to do it was via the pages system OR via the default cats & posts!


title: Determine which template-{slug}.php is being loaded

text: I am trying to make a personal plugin that does specific things based on what is loaded. In this example, in my action method I want to perform one function if the currently loading page is using the `template-blog.php` template, if it's a single blog post (loading `single.php` do a second function, anything else do a 3rd function I am not quite sure what method I need to use, and so far Google is not pulling up the right methods. I have been trying get_current_template(), get_template() get_page_template(), but none of them pull the stuff I am looking for above.


title: Custom search for custom post type, custom meta and search fields

text: Id like to build a search form for a specific custom post type (vehicle) and have filters for that custom posts type's custom meta fields (price, age) and custom taxonomies (make). This will totally replace the sites search and be the only search available so I was going to use search.php within my custom template. I've like the search to look something like: **Search our vehicles** **Make** (select box full of all the custom taxonomies - Audi, BMW etc). **Model** (normal input field for people to type whatever in). **Prices over** (select box with prices starting at 1000) **Age** (select box with options such as under 1 year, under 3 years, under 5 years, under 10 years). I'm new to custom fields and dont really know where to start (I've found a few examples on Google but none do exactly what I'm aiming for). I didnt really want to use a plugin either. I'm guessing within search.php I grab the data passed from the form and use it to build $args up to pass to WP_Query? Could someone point me in the right direction please? Thanks in advance


title: Showing certain page without redirection

text: I need to get any url that starts with "booking" to lead to certain post without redirection. That means all of these URL would lead to post Booking, but the URL would stay the way it is:               example.com/booking     example.com/booking/rooms     example.com/booking/rooms/show/kabana-3      This is because in the page template of the post Booking I have a PHP script that needs full URL.


title: Positioning the “Lost your password?” and “← Back to Site”

text: I'd like to customize the log-in page for my WordPress theme and although I can play around with the CSS, I would love to re-position the "Lost your password?" and "← Back to Site" links to be inside of the foreground box, rather than below it / or, in other words...so these links are placed inside of the form-field. How would I be able to achieve this so that I am not modifying any files outside of the _Themes_ directory or would I need to re-create the entire log- in page and link to the new one for this? Thank you.


title: Modify "View" in admin panel for custom taxonomy

text: Fristly, sorry for my bad english.   Secondly, I can't find a solution for my problem since 2 weeks. It's a simple things but I can't find how to do it.   I explain my problem :   I got 2 custom taxonomies call in a function "my_custom_init" :               register_taxonomy( 'directors', 'video', array( 'hierarchical' => true, 'label' => 'Directors', 'query_var' => true, 'rewrite' => true ) );     register_taxonomy( 'clients', 'video', array( 'hierarchical' => true, 'label' => 'Clients', 'query_var' => true, 'rewrite' => true ) );        I would like to edit the link "View" like on the print screen :   http://nsa32.casimages.com/img/2012/10/18/121018025542594841.png I think I have to use the post_row_actions to edit it but I can't get the taxonomy.   If you know how to solve my problem, thanks in advance for your help. **Edit** I made this for my categories "post" and "video" and it works ! But I can't do the same for my custom taxonomies :/   I don't really understand I tried but doesn't work :S               add_filter( 'post_row_actions', 'remove_row_actions', 10, 1);     function remove_row_actions( $actions )     {         if( get_post_type() === 'post' )             unset( $actions['view'] );              if( get_post_type() === 'page' )             unset( $actions['view'] ); //doesn't work ?              if( get_post_type() === 'video' )             unset( $actions['view'] );              // Adding a custom link and passing the post id with it         $permalink = get_permalink();         $permalink = explode(".tv", $permalink);         $actions['customedit'] = "View & Get Url";              return $actions;     }


title: Adding option to Gallery shortcode

text: just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just like the standard 'exclude' option, but still show those images for Administrators. So it would look something like this: `[gallery exclude="1" hide="2,3,4,5,6" link="file"]` So, basically I'm looking for guidance on how to create a function that would add the "hide" function to individual image id's within the gallery shortcode which would work exactly like the exclude, but those images would still show up in the frontend for administrators. Thank you for your time, and expertise.


title: Using wp_mail in functions.php

text: I have set up a simple mailer before I get the full implementation sorted. I've tried a few email addresses but am not receiving them even though it returns 'true'. I'm using wp_ajax as well if that makes a difference. functions.php                        //  Check for email return in share folders         add_action( 'wp_ajax_share_email', 'share_email' );         add_action( 'wp_ajax_nopriv_share_email', 'share_email' );         function share_email(){             $email = $_POST['email'];             // Return a boolean!             $to = $email;             $subject = "Test mail";             $message = "Hello! This is a simple email message.";             $from = "no-reply@website.com";             $headers = "From:" . $from;             if(wp_mail($to,$subject,$message,$headers)) {                 return true;             } else {                 return false;                }         }           Can anyone let me know why this isn't sending? Am I not allowed to use wp_mail and wp_ajax together perhaps? Thanks **EDIT** Jquery part                        $('#share-pop .btn').click(function(){             var email = check.val();             jQuery.ajax({                 type: 'POST',                 url: ajaxurl,                 data: {"action" : "share_email", 'email': email},                 success: function(data){                     if (data) {                         alert('sent');                     } else {                         alert('An error occured');                     }                 }             });         });


title: How to display the current subcategory in product overlay?

text: I want to display the category with the subcategory of the product by mouseover. Here is an example of what I want: https://www.dropbox.com/s/zvddx7nwpyxva0t/example.png. Right now I was able to show the parent category. Here is my code (archive- product.php):                                   <?php                         $parent = is_shop() ? 0 : $cat->term_id;                              $terms = get_terms( 'product_cat', array(                             'parent' => $parent,                              ) );                              ?>      Please help! Thx!