title: Change class name in Wordpress wp_list_page nav

text:
I'm using Wordpress's wp_list_pages to display a nav of pages on the site. Some pages have children so I need a dropdown menu below those links. The html is something like this

Home

Profile

             Products & Services

Buying

Selling

Managing

      I wanted to use bootstrap to create the nav and dropdown menus. Something like - http://www.ttmt.org.uk/nav/ The html for this is something like this.

Home

Profile

             Messages

Inbox

Drafts

Sent Items

      I need to add a 'dropdown' class the li and ul containing the child pages. I also need to add a class and a data-toggle attribute to the 'a' tag. How can I add these clases when I using wp_list_pages and the nav is created dynamically. I'm using this function to add 'dropdown' to li containin the child pages               function add_parent_class( $css_class, $page, $depth, $args ){         if ( ! empty( $args['has_children'] ) )             $css_class[] = 'dropdown';         return $css_class;     }     add_filter( 'page_css_class', 'add_parent_class', 10, 4 );      How could I extened this function add the other classes I need


title: How do I remove the post format meta box?

text: Is it possible to remove the "Post Format" meta box from the edit/new post page? The blog in question has a lot of users that keep messing with that but it only uses the standard format post. I'm kind of new to wordpress so excuse me if this is a really obvious one. Thanks.


title: Accessing Variables Used In a Plugin Using PHPStorm + XDebug

text: I'm currently attempting to use XDebug 2.2.1 and PHPStorm 7.1 to debug my WordPress plugin. So far, I've successfully installed XDebug and breakpoints are working fine. However, I'm unable to access any of the variables being used in the functions in which I'm breaking. For instance, I break in this code:               function generateGoalCard($sub) {             $goalID = $this->CodeLibrary->convertStringToInt($sub->goalID);             $userID = $this->CodeLibrary->convertStringToInt($sub->userID);             print('goalID: '); // BREAK POINT HERE             // Other unimportant code ...     }      Below is a screenshot of the debugging window at the above break point. As you can see, `$goalID` and `$userID` are not accessible. How can I gain access to my plugin's variables? ![enter image description here](http://i.stack.imgur.com/bKq5s.png) Here's the screenshot in DropBox.


title: Get all posts containing a shortcode

text: I'm writing a WP plugin that involves using shortcode. One of the missions is to display all (publish) posts that contain my shortcode regardless of their post type. Is there a built-in function for this? Thanks in advance.


title: tumblr importer error wp 3.4.2

text: i'm trying to import content from tumblr, in wp 3.4.2 i get an error not found i can't get also the tumblr importer page http://wordpress.org/extend/plugins/tumblr-importer/ any idea? Error Data: _Import Tumblr Tumblr replied with an error: Not found. We couldn't find the page you were looking for. Find out why you may have encountered this error. Howdy! This importer allows you to import posts from your Tumblr account into your WordPress site. Firstly, you need to provide your email and password for Tumblr, so that WordPress can access your account. no php errors_ _tools - import - tumblr (An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums.)_


title: How to tell if an option has been created vs an empty option?

text: What is the method to test for the existence of an option in the database? Not the value of the option, just that the option exists.


title: how to insert missing tags into the posts through mySQL?

text: I am looking for a SQL query to insert a tag to multiple posts from a specific category. A pseudo query looks something like this:               INSERT INTO POSTS     VALUES TAG = "tagName"     where Posts in_category("categoryName")      how would such sql look for WP tables?


title: Remove social media sharing buttons on a download page

text: I have a couple of social media sharing plugsin installed, but wonder if there is any way of removing them from one specific page that I have as a download page for a product?


title: Why is the `if else` not working?

text:
I have this on my `header.php`. It checks whether the page is on homepage/frontpage, is on category/children of/has the category of "gamenews", or is on category/children of/has the category of "hobbynews". Basically, if it's on homepage/frontpage, it outputs nothing. On the other hand, if it's on gamenews, it outputs something. If it's on hobbynews, it outputs another thing. You could see in details below. I'm using a custom function there (`is_category_or_sub`).                       <?php if ( is_home() || is_front_page() ) { ?>                  <?php } elseif ( is_category_or_sub('gamenews') || has_category('gamenews') ) { ?>
                 <?php $category = get_category_by_slug( 'gamenews' );                 wp_list_categories(array(                       'child_of' => $category->term_id,                       'title_li' => '',                       'hide_empty' => 0,                       'orderby' => 'count',                       'walker' => new WPSE67791_Walker_Category                    )); ?>
                  <?php } elseif ( is_category_or_sub('hobbynews') || has_category('hobbynews') ) { ?>
                 <?php $category = get_category_by_slug( 'hobbynews' );                 wp_list_categories(array(                       'child_of' => $category->term_id,                       'title_li' => '',                       'hide_empty' => 0,                       'orderby' => 'count',                       'walker' => new WPSE67791_Walker_Category                    )); ?>
             <?php } ?>      Now the first check (is_home/is_frontpage) works just fine. So does the second (the one on "gamenews"). However, the last one ("hobbynews") doesn't work. Each time I visit page which has that requirement (is on category/children of/has the category of "hobbynews"), it displays stuff which is _supposed to be_ on gamenews. The one I want to display on hobbynews does not show up. Why is this happening? I've been trying to re-order, tried to use nested if, etc. But it's still not working and really confusing... * * * **EDIT:** This is my `is_category_or_sub`, located on `functions.php`:               function is_category_or_sub( $cat_slug = get_category_by_slug ) {         foreach (get_the_category() as $cat) {             if ($cat_slug || cat_is_ancestor_of($cat_slug->term_id, $cat)) return true;         }         return false;     }


title: Access to wordpress method inside of classes

text: How could I access an usually word-press method as example $this->get_current_site(); inside of a class?


title: Tabbed content with Pagination

text:
I've stumble across an issue on a site Im building. I have tabbed content each holding a category for price ranges in seprate loops. The tabs work great filtering the categories, however some of the posts now have WP page-navi running the pagination, again works fine. However if I paginate to /page/2 on the first tab the other tabs are then blank/contentless. I can only assume this is a url problem in the pagination so loops are not grabbing the content or I'm not running the loops correctly.
          <?php          $cat_id = get_query_var('cat');          $limit = get_option('posts_per_page');          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          query_posts('showposts=' . $limit = 12 . '&paged=' . $paged .'&cat=' . $cat_id . '');          $wp_query->is_archive = true; $wp_query->is_home = false;          ?>             <?php if (have_posts()) : ?>                         <?php while (have_posts()) : the_post(); ?>

                            <a href="<?php the_permalink() ?>">
<?php the_title(); ?>Read More
                          <?php the_post_thumbnail( 'Full Size' ); ?>
                          <?php echo get_new_excerpt() . '...'; ?>                     <a href="<?php the_permalink(); ?>">more info →
                 <?php endwhile; ?>                 <?php wp_pagenavi(); ?>             <?php endif ?>

          <?php          $cat_id = get_query_var('cat');          $limit = get_option('posts_per_page');          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;          query_posts('showposts=' . $limit = 12 . '&paged=' . $paged .'&cat=-16,-17,' . $cat_id . '');          $wp_query->is_archive = true; $wp_query->is_home = false;          ?>             <?php if (have_posts()) : ?>                         <?php while (have_posts()) : the_post(); ?>

                            <a href="<?php the_permalink() ?>">
<?php the_title(); ?>Read More
                          <?php the_post_thumbnail( 'Full Size' ); ?>
                          <?php echo get_new_excerpt() . '...'; ?>                     <a href="<?php the_permalink(); ?>">more info →
                 <?php endwhile; ?>                  <?php wp_pagenavi(); ?>               <?php endif ?>
      Any information on this is even possible or a kick in the right direction would be greatly appreciated. To see the example of the of page I'm testing


title: Pluck single parent category from get_the_category

text: I am working on a theme that displays a single category for each post. However to eliminate user error, I would like to pluck a single parent category out of a posts categories. Here is my code as of now:                  function thb_DisplaySingleCategory($boxed = true, $id = false) {      $categories = get_the_category();     $_id = (empty($id) ? $categories[0]->cat_ID : $id);     $_name = (empty($id) ? $categories[0]->cat_name : get_cat_name($id));          if ($boxed) {         $thecategory = ''.$_name.'';     } else {         $thecategory = ''.$_name.'';     }               return $thecategory;     }      This gives me a single category, but it can be children.


title: Get the menu name or location of current menu item

text: I am having a hard time trying to get the name of the active menu and, apparently, I cannot find any solutions to this issue. Basically, I have several menus that follow this pattern: **Menu Name**   * Menu Item 1   * Menu Item 2   * ...   * Menu Item n I want to display the menu name of the current page item, but I cannot find any way of doing it. I have tried using get_nav_menu_locations() in conjunction with get_term():               $theme_locations = get_nav_menu_locations();     $menu_obj = get_term($theme_locations["menu_1"], 'nav_menu');     $menu_name = $menu_obj->name;      However, I need to get the location of the current menu dynamically and after searching for answers/solutions and not finding anything concrete, I just assume that there may be at least a database relationship between the current menu item and the menu object to which is assigned; from where I would eventually get the menu location/term ID. Any ideas, please? I have already spent about 2 hours on this. Thank you in advance! PS: I want to output the active menu title without the use of JS


title: getting values from a shortcode with an include

text: I have a checked a few links but nothing seems to for me in getting the attribute value of a shortcode so that I can use it in a condition.               function bf_shortcode_slideshow($atts) {       extract(shortcode_atts(array(         'location' => ''       ), $atts));            ob_start();       if  ( $location = 'home' ) {       classslider = 'homeslider';     }       include(dirname(dirname(__FILE__)) . '/templates/slideshow.php');       return ob_get_clean();     }     add_shortcode('rotator', 'bf_shortcode_slideshow');      In the `slideshow.php` I have a               echo 'classslider=' . $classslider;      My result for `$classslider` is blank ( nothing is displayed ) Is there another way you should compare `$location` to a string value set ?


title: How to add different user account with different signup and login forms in buddypress or wordpress

text: I'm new to wordpress. I built a site in wordpress and i'm stuck in Different user account type in my site. please instruct me how to add different user account with different signup and login forms.. already used buddypress user account type lite but now it changed free version into pro version.. I need help from you.. Advance thank you, Regards, LaxmanveL


title: Hierarchy of Subcategories on Permalink

text: I'm new to Wordpress. My current permalink is set to /%category%/%postname%/ and a "." (dot) in the Category base. My categorys ID are bigger than the subcats IDs. So the URL looks like this: [site-root]/[category]/[postname] And when entering a subcat, it looks like this: [site- root]/[category]/[subcategory]/[postname] The problem is that when I open something like this: www.example.com/food/fruits - I don't get the posts that are related to fruits and instad get a "Not Found" page. They show up only when www.example.com/fruits. I read some tutorials and forum posts that are related, but nothing solved my problem. http://wordpress.org/support/topic/subcategories-not-showing-up-in-uri-with- pretty-permalinks http://wordpress.org/support/topic/how-to-change-category-ids-in- wordpress-27?replies=7 Hierarchy of Subcategories on Permalink (bug?) Please help me to solve this problem I'm stuck with this for too long :( What can be the problem?   * I changed the ID of the main category to a much bigger number than the subcats.    * I wrote what has to be written in Settings=>Permalinks    * I checked that I didn't forget to mark the subcategories under the main category (yeah, sometimes happens when you're stuck on something and it's because something stupid :P).   * I even deleted all the subcats from the menu and added them back again so it will maybe "refresh" something.  Am I missing something?


title: Creating button next to "add media" that allows you to choose a single post

text: I'm looking to create a button next to "add media" ( much like gravity forms "add form) that allows you to choose a custom post and then inserts that post id into a shortcode. I've bene looking at hooking into tinymce for the longest time, but realized that that wasn't the way to go (as those buttons aren't a part of the tinymce editor). anyone have any thoughts?


title: wp_logout_url() - WordPress Failure Notice

text: My `wp_logout_url()` working right from front-end. But when I change the new password from front end, then on change-password page when I click on logout, `wp_logout_url()` giving > You are attempting to log out of Do you really want. Any suggestions?


title: Perform a function when a user clicks register button in wordpress

text: I am kind of new to wordpress coding. I'm trying to edit the wp-login.php file, in which, if a user clicks register button, it registers the user and stores an information on a different table in the database. My code to insert new data into the database is below, how do I add it inside wordpress?               global $wpdb;     $wpdb->insert('wp_classes',     array( 'userlogin' => $user_id, 'classselect' => $_POST['class_select'])     );     $wpdb->show_errors();     $wpdb->print_error();      from what you said, i tried this code below, but no data was inserted into the database and no error               add_action('user_register', 'store_class', 200);               function store_class($user_id)     {     global $wpdb;     $wpdb->insert('wp_classes',     array( 'userlogin' => $user_id, 'classselect' => $_POST['class_select'])     );     $wpdb->show_errors();     $wpdb->print_error();     }


title: Subscribers to posts

text: Consider each post to be topic of conversation, and comments a conversation. For now it is fine. I created a post type called conversation. Now I want to list all the conversations a user is in. How can I extend wordpress for this functionality? In my idea was to create a new table called `wp_posts_users` with `user_id` and `conv_id`. Is there any best practice on this? My final aim is to list on the user page all the conversations he is in.


title: Is It Possible To A Link To The Homepage From The Admin Sidebar?

text: The closest I've managed to get is:               function redirect_to_local_110(){       wp_redirect("/", 302);       exit;     }          function add_home_link() {         add_menu_page( 'Course', 'Course', 'read', 'home', 'redirect_to_local_110', 'dashicons-welcome-learn-more');     }          add_action( 'admin_menu', 'add_home_link', 1001 );      However, even though the function `redirect_to_local_110` is called, the rendered link is `admin.php?page=home`. How can I have a top-level menu item that links to the homepage?


title: How to Check if a Child Category is Being Queried

text: I need to change the number of posts queried for specific categories 'Recipes' or 'Product Reviews'. The below code works great for this, I have it in functions.php:               function change_number_of_posts($query) {         if ($query->is_category && ( $query->is_category('recipes') || $query->is_category('product-reviews') ) )         $query->query_vars['posts_per_page'] = -1; // Show all posts         return $query; // Return our modified query variables     }          add_filter('pre_get_posts', 'change_number_of_posts'); // Hook our custom function onto the request filter      The problem is that the 'Product Reviews' category is a parent category, so the above code does not work when one of its child categories is being queried. I can use the `'cat_is_ancestor_of()'` function in my loop to do what I need to with these subcategories, but I cannot get it to work in functions.php and am thinking it cannot be called from there. I basically want to say "If the category is 'recipes' or 'product-reviews' or a child of 'product-reviews'..." from my functions.php file. I know I can hard code all the subcategories, but I don't want to have to edit the php every time I add a subcategory of Product Reviews. I have spent hours trying to find a solution, any help is greatly appreciated!!


title: disable reply comments on depth equals 2

text: Using budypress and I'm trying to disable comments on comments' comment, meaning depth 2. The structure would go like this. Main Comment. Someone made a comment <\-- Reply is possible Another person made a comment of this reply <\-- No1 can comment this Any ideas? Thanks in advanced.


title: How do you debug plugins?

text: I am pretty new to plugin authoring and was having a hard time debuging. I used lots of echo and it is sloppy and ugly. I am sure there is a better way to do this, maybe an IDE with a debugger that I can run the entire site in including the plugin?


title: Data validation for inline javascript

text: I try to save inline javascript(Google analytics code) in wp-options table. But i can't figure out what validation function i shall use. I have tried esc_js when saving to the database. But i can't figure out what to use when i shall echo it in the head section.


title: Run function from parent on child site

text: I'm running a Multisite WordPress installation and have a couple of child sites. I'm trying to run a script from the main page on one of the child sites. It can be a shortcode `[pro_display_zone id="3"]` or the PHP code `echo pro_display_zone( 3 );` I've got the following but it doesn't output anything:               <?php     function somename()      {         switch_to_blog( 1 );              // Do your stuff         $my_stuff = pro_display_zone( 3 );              // Back to original site         restore_current_blog();              // Return shortcode content         echo $my_stuff;     }     ?>


title: Include "registration.php" for custom registration form?

text: I’m creating a custom registration form for my website. Every tutorial has this call in the form               require_once(ABSPATH . WPINC . '/registration.php');      I’ve read that `registration.php` has been depreciated quite a long time ago. Which file must be called upon, what is the proper way?


title: PHP Call to External Database

text: I am using the Sleek child theme from Studio Press and want to do a PHP call to this external database for it to display just like this link: http://www.escort332.org/tuskegeecadets.php . The Theme page is this full width page: http://escort332.org/wordpress1/tusk...skegee-cadets/. Is there a way to add the PHP code that links to the database in the page itself? I would also need access the database for other pages as well. Is this possible in the Genesis framework or child themes. Any help would be greatly appreciated.


title: Customize The Events Calendar to Include an Option to Expand for More Events Listings

text:
I think The Events Calendar for Wordpress by Modern Tribe does a splendid job and does a lot for to turn a drab calendar into a streamlined and professional looking one. I like the ease of the calendar, that you can show calendars by categories, and have the option to choose between grid and list view. There is one thing that I would like to make the calendar do, have the option to see more events that are posted on days in the month/grid view. Here's an example:               http://austin.culturemap.com/events/?view=month      Notice that for the days where there any many events happening/listed that instead of showing all on the calendar, there's the equivalent of the "show more" "read more" "continue reading" option. I would like to have this option available in The Events Calendar. Some days may hold eight or more events and for a clean looking calendar, you don't want all of the events to show. I know there's a way to limit the number of events to show in grid view, but while those events are hidden after limiting the number, it doesn't show that there are more events happening on that day. From the calendar listed above, there seems to be a function/html code that uses the following as a link:               http://austin.culturemap.com/events/?year=2012&month=9&day=1      When looking at the html in Firefox's Inspect Element, I see this:                +9 more      In the .css, it looks like this:               table#eventCalendarTable td .eventsCalShowMore {     color: #fff;     background-color: #8a7b68;     padding: 2px 8px 2px 4px;     }      but as far as to apply something similar to The Events Calendar, I don't know. I'm surprised to see in such a sophisticated calendar, that this isn't a standard option to have for a less cluttered calendar. I've searched The Events Calendar's site and nothing that would provide for this. Does anyone have any ideas how to implement this? This is the GIRDVIEW.php for the calendar:               <?php     /**      * Grid view template.  This file loads the TEC month view, specifically the       * month view navigation.  The actual rendering if the calendar happens in the       * table.php template.      *      * You can customize this view by putting a replacement file of the same name (gridview.php) in the events/ directory of your theme.      */          // Don't load directly     if ( !defined('ABSPATH') ) { die('-1'); }     $tribe_ecp = TribeEvents::instance();     ?>
                      <title><?php wp_title() ?></title>
                                                               <a href='<?php echo tribe_get_previous_month_link(); ?>'>                         ← <?php echo tribe_get_previous_month_text(); ?>                                                                        <?php tribe_month_year_dropdowns( "tribe-events-" ); ?>                                                   <a href='<?php echo tribe_get_next_month_link(); ?>'>                                        <?php echo tribe_get_next_month_text(); ?> →                                              <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" style='display: none'/>                                                                                <a class='tribe-events-button-off' href='<?php echo tribe_get_listview_link(); ?>'><?php _e('Event List', 'tribe-events-calendar')?>                     <a class='tribe-events-button-on' href='<?php echo tribe_get_gridview_link(); ?>'><?php _e('Calendar', 'tribe-events-calendar')?>
             <?php tribe_calendar_grid(); // See the views/table.php template for customization ?>           <?php if( function_exists( 'tribe_get_ical_link' ) ): ?>              <a title="<?php esc_attr_e('iCal Import', 'tribe-events-calendar') ?>" class="ical" href="<?php echo tribe_get_ical_link(); ?>"><?php _e('iCal Import', 'tribe-events-calendar') ?>           <?php endif; ?>             <?php if (tribe_get_option('donate-link', false) == true) { ?>
<?php echo apply_filters('tribe_promo_banner', sprintf( __('Calendar powered by %sThe Events Calendar%s', 'tribe-events-calendar'), '', '' ) ); ?>
             <?php } ?>
      Should look like the monthly calendar/grid view in Modern Tribe's demo


title: altering search terms

text: How can you filter or alter the search terms that users enter into a search field? Is there a hook available? The idea is to use this function to filter out 2-3 letter "filler" words ("on", "and", "the", etc.)               function prepSearchStr($str){         $str=preg_replace('©[^a-zA-Z0-9]©', ' ', $str);         $str=preg_replace('©(?<=\s|^)(([a-zA-Z]{1,3})|[0-9]{1,2})(?=\s|$)©', ' ', $str); //remove smaller groups of characters         $exploded=explode(' ', $str);         $exploded=array_filter($exploded);         return implode(' ', $exploded);      }


title: Assigning a category to a user role

text: I was looking for a plugin for this, but so far I cant find one that does what I want. I limited the user role capabilities with 'Restrict Capabilities'. But the authors still have to click the category when writing a post. For it to be idiot proof I'd like to have the right category be the default (even if it's the only category they can see). Is there a piece of code I can insert in functions.php to assign each user role to the right category? Appreciate any help I can get! Thanks.


title: Targeting all pages except top level pages

text: I have used `'0' == $post->post_parent` successfully in my templates to target top level pages. However, I cannot seem to target all pages EXCEPT top level pages:                   <?php          if ( '0' !== $post->post_parent ) {              include 'siblings.php';          }          ?>                     Using the code above, the file is still included in top level pages. Note, I can get it working using the code below, but I want to keep it flexible and not have to specify IDs:                   <?php          if ( !is_page( array( 8, 10, 12 )) && (is_tree(8) || is_tree(10) || is_tree(12)) ) {              include 'siblings.php';          }          ?>      Hope someone can help!


title: Add a 'guide' image to custom post type admin page

text: I've created a custom post type and on the admin page for that post type I want an image displayed that can act as a guide for the users uploading images. Is there a function that I can use to insert an image into the admin for just that custom post type. (I have tried to Google this but all the results seem to be related to uploading images).


title: Download statistics for Wordpress site?

text: I have a Wordpress site and would like to track the basic statistics for the site; visitor numbers, visitor numbers for specific pages on the site, download statistics etc. For that purpose, I have installed the "Google Analytics for Wordpress"-plugin (http://wordpress.org/extend/plugins/google- analytics-for-wordpress/), and this now tracks much of the information that I want via Google Analytics. However, the download statistics don't work as I want it to: It only tracks files that have been uploaded via the Wordpress Dashboard and that go into the default upload folders (e.g. .../wp-content/uploads/2013/04). I have my files for download in custom folders (e.g. in .../documents), but these are not tracked by Google Analytics with the above plugin. I have looked into setting this up manually in Google Analytics, but to be honest I don't quite understand how to do this. Alternatively, a Wordpress plugin that tracks the downloads of files from custom folders would work for me. There are a number of plugins for this purpose (e.g. http://wordpress.org/extend/plugins/simple-download-monitor/), but it is not clear to me if they are still maintained and are reliable. So what simple and reliable solution would you recommend for download statistics from custom folders on a Wordpress site? Thanks in advance for any help!


title: Plugin.php: PHP Notice: Undefined offset: 0 in

text: I moved a WordPress site from one domain to another and there were a lot of white spaces that needed to be removed. The only problem that is left are the following errors:   * PHP Notice: Undefined offset: 0 in /home/linguist/public_html/test/wp-includes/plugin.php on line 767    * PHP Notice: Undefined offset: 0 in /home/linguist/public_html/test/wp-includes/plugin.php on line 785 then further PHP Warning: Cannot modify header information - headers already sent by (output started at /home/linguist/public_html/test/wp-includes/plugin.php:767) Its all due to this code which hasn't been changed at all but is creating errors.               if (is_object($function[0]) ) {         // Object Class Calling         if ( function_exists('spl_object_hash') ) {             return spl_object_hash($function[0]) . $function[1];         } else {             $obj_idx = get_class($function[0]).$function[1];             if ( !isset($function[0]->wp_filter_id) ) {                 if ( false === $priority )                     return false;                 $obj_idx .= isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : $filter_id_count;                 $function[0]->wp_filter_id = $filter_id_count;                 ++$filter_id_count;             } else {                 $obj_idx .= $function[0]->wp_filter_id;             }                  return $obj_idx;         }     } else if ( is_string($function[0]) ) {         // Static Calling         return $function[0].$function[1];     }      } Could someone please help me with this?


title: Custom Post Type & Post Meta or Custom Table for Serial Number Delivery Project

text: I've trawled a ton of articles here, on wordpress.org, makeuseof.com, code.tutsplus.com, etc. - all very informative but I'm still not sure whether to use a custom table with my plugin project or not. The plugin is for this project only. No need to package for sale. (I'll share the code on github in case anyone else can use it.) **Scenario** : We're using WordPress with WooCommerce to sell specialist printer's softwares from multiple manufacturers. We have a lot of product variants. Sometimes the software is boxed, but 95% of the time it's downloaded and we want to deliver a serial number/key according to the product variant. The serial is _always_ created by the developer so we can't use systems that generate the numbers for us (which is a real shame - some are great). We'll generate a lot of "sold" serials in the table somewhere that I suspect shouldn't be stored in `wp_posts` or even `wp_postmeta` \- I simply don't know. But, in short, I need to integrate our serial numbers dataset with product variants. [Product variants to serials is a one-to-many relationship.] If I use a custom table it will look like this:               CREATE TABLE `wp_xc_serials` (       `serial_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,       `post_id` bigint(20) unsigned DEFAULT NULL,       `xc_SKU` tinytext NOT NULL,       `sold` tinyint(1) NOT NULL,       `serial` varchar(512) DEFAULT NULL,       `key_description` tinytext,       `key` varchar(1028) DEFAULT NULL,       PRIMARY KEY (`serial_id`),       KEY `post_id` (`post_id`),       KEY `used` (`used`)     ) ENGINE=InnoDB AUTO_INCREMENT=133 DEFAULT CHARSET=utf8;      where `post_id` would link it to the WooCommerce product variant stored in `wp_posts`. So, the question is: **Do I:**   * Go with a separate table for easy import, keeping WP's tables clutter free but tricky integration?   * Go with what's already in WP and risk a bloated `wp_postmeta`, slow queries but a far easier integration? (I like this last idea.)   * Use Custom Posts/Taxonomies with _Pods_ or _Posts 2 Posts_?   * Something else? I'm a newb so may not see the glaringly obvious. I guess **my core question** is, what decision would a really good developer make faced with this requirement? _ps - I've seen one solution that does approximately what we need, but it doesn't work with product variants and the feedback has at times been less than favorable:http://bit.ly/1lHnqqf_


title: Hijacking the URL for filtering

text: Right, here's the deal. I've got a loop of which displays news posts, these posts can belong to special categories (not normal categories) and I want to be able to filter by them. If I wasn't too interested in aesthetics I'd use a link like this:               domain.com/news?filter=cat1      But instead what I want to do is this (» rewritten):               domain.com/news/cat1 » domain.com/news/?filter=cat1      I've modified the `.htaccess` to pass the `cat1` value as a GET variable:               RewriteEngine On     RewriteBase /     RewriteRule ^news/(.*)/$ /news/?filter=$1 [L,QSA]          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      The problem is even though this is now successfully passing the `filter` variable in, WordPress treats the `/cat1/` as a page, it obviously cannot find it and thus throws a 404. Is there a way to allow this particular URL rewriting without WordPress firing a 404? It appears it's taking the URL in the address bar and parsing that, what I really want is for it to parse the rewritten URL. Thanks


title: Add 'has_children' class to parent li when modifying Walker_Nav_Menu

text:
I'm writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be:
         Some item
      I know how to add and remove the classes fine, I just cant find anything to tell me if the current item has children items. Any ideas? Thanks in advance.


title: how build custom json api controller for all registered users

text: i use the json api! from wordpress. And try to build an own json api controller, i want return all registered users with the following controller but thats not give an array with all users, suggestions                 public function get_users_index() {         global $json_api;         $users = $json_api->introspector->get_users();         return array(           'count' => count($users),           'users' => array_values($users)         );       }


title: Attaching global meta to custom fields

text: I post music videos on my site and I add the artist name as a custom field to each post. I want to associate certain meta with that artist name so I dont have to enter it everytime like the artists twitter account and link to Facebook. So my question is how could I enter in their meta data once somewhere and call it to every post automatically where their artist name is entered for a field. Hope I explained that right.


title: Show greetings on first time visitors?

text: This seems pretty straightforward using cookies in straight HTML. In wordpress, how do I do this? AFAIK, wordpress only provides cookies functions for logging/logged in users. How about when I don't want the user to log in to show my greetings?


title: Declare a function before plugin does on the theme functions.php file

text: I'm working with a plugin that declares a function using this format:               if (!function_exists('ABdevDND_get_current_post_type')){         function ABdevDND_get_current_post_type() {            ...         }     }      I'm trying to declare it in my theme's functions.php file, by just using:               function ABdevDND_get_current_post_type() {         ...     }      But my timing is wrong, and I'm getting `Fatal error: Cannot redeclare ABdevDND_get_current_post_type()`. How and where can I declare this function so it's declared before the plugin?


title: Assign a Class to the Current "Tag" for Formatting

text: Essentially what I am hoping to replicate is something like the "current-menu- item" class that is applied to WP Menus. My client is wanting to use Tags as a sub-nav, and I've managed to get the tags for the category output as an unordered list, but now if someone selects the tag "Tag One", I'd like to have that particular tag to highlight as the currently selected Tag. It would be extra super cool if this could also work with the output generated by "the_tags" attached to the post as well. I hope this makes sense, and thanks! Cheers, John


title: Is there a plugin that will completely remove the category system?

text: I have no use in categorizing/tagging my posts with anything, at all, and it doesn't look very good to have every post say "filed under: uncategorized." Is there any plugin to do this, or do I need to do some manual editing?


title: Custom Menus: dynamic highlighting problem with custom home link

text:
I'm currently implementing wp_nav_menu - all has gone well save for dynamic highlighting. The menu code looks like this (when home, which is a custom link, is selected):

Home

Information

Contact

About

      When a page other than home (which is a 'custom link') is selected this is written out:
Information
      As you can see this includes an active style 'current-menu-item' where the custom link only writes 'menu-item-type-custom menu-item-object-custom' So my question is is there any way to add a selected item style for custom links in wp3 menus?


title: How to display post title & excerpt when mouse hovers on an image?

text: I am bit busy with developing one fashion website, currently (http://test- domain.zakirsajib.co.uk/), where I have images come from posts and when mouse will hover on any image, the corresponding post title and post excerpt will de displayed. Couldn't make it happen though :) Any clue will be helpful. Site is developing in wordpress enviornment, so any php and css (though css parts are done, just need bit help from php part)


title: get all posts with certain meta data

text: I'm developing a plugin made on the original calendar. My wordpress is based on real events and I want to keep trace of theme on the calendar. So I added a custom field in the post which is the end of the events (or the last day for subriscribe) with the value of a date of course (like 25/02/2010). Now I want to display on the calendar all the events that ends on the days instead of the posts create in each days.   How to get the meta data value of the post in this query?                // Get days with posts     $dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)         FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'         AND YEAR(post_date) = '$thisyear'         AND post_type = 'post' AND post_status = 'publish'         AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);      It have to select all the post with my custom meta value. Hope I'm not doing this for nothing, I googled and no plugin with this function came out.


title: Best way to show Dynamic Content on a Cached Wordpress Site?

text: I really want to use one of the Cache plugins so that I can serve up more Static pages on my WordPress theme/site. This is obviously the best performance upgrade you can do for a WordPress theme/site. There is a few dynamic elements to my theme that have held me back from making the Leap to Static/cached pages. I will outline these issues below and provide a possible way to solve each issue I have thought of so far. The goal of this post is to either get better ideas/methods to handle the issues I explain or to get some reassurance that I am on the right track at the least. I am a PHP veteran of more then 12-13 years but have only been using WordPress in the past 1-2 years and so far I am really impressed with the capabilities, I am a total WordPress Fanboy now if such a thing exists lol! Ok so the issues I have thought of so far when converting to cached pages... * * * ## Single Posts page   1. **Views Counter Problem** \- I have a function that will fetch a count value for a "View/hit Counter" on the Posts page to give an idea of the Posts Views for a user to see. These are not unique visitors but just a simple hit counter. I have created a separate MySQL table for these values, I am still trying to decide if I should continue with that or switch to use a Meta Field instead. Either way on a page view, the database value is fetched and increased by +1 on each page load. (Admin users views are not added.) The value is then showed on the page in the form of `988 Views` **Views Counter Possible Solution** \- I could make this Value/function be ran using Ajax. Once the new Cached/Static page is loaded, Javascript could then use Ajax to request and update the Views counter for that page. _Does this sound like the best solution for something like this?_   2. **Post Comments Problem** \- Using the default WordPress Comment System, every time a new comment is added to a post, it would require the Cached/Static page for that post to be _re-built_! From what I have seen, there is an option on the Caching plugins I have seen that will let you do just that, you can have it rebuild the page(s) every time a new comment is posted to it. This sounds good on paper but I can imagine it being a nightmare in a high traffic/active site where you might have multiple users commenting on the same article around the same time (all un-tested so I do not know)  **Post Comments Possible Solution** \- So for a solution to the Comments problem, I mentioned a solution above where you can set the Cache plugin to simply rebuild the Cached/Static page upon each new Comment. My concern was I am not really how well this will work in the long run. Now the other possible solution that I see being used more and more is to use a Javascript solution like Disqus Comments or a similar solution. For a long time I really was against this as I wanted all my Comments to not rely on any third-party for my comment system. I am still kind of on the Fence about this issue but have switched to using Disqus comments on my site and so far it's working out fairly good. I am open to other possible solutions though? Or do you think this is really the way to go? ## Site-wide Sidebar   1. **Sidebar Recent Articles Problem** \- I have Tabs in my Sidebar that are shown site-wide across every page on the site...one of the Tabs loads the 10 most recent posts on the blog, since this is shown on every page of the site, once a new article/post is added, it would require that every Cached/Static page on the site be re-built to reflect the addition of new posts in this "Most recent posts list" **Sidebar Recent Articles Possible Solution** \- Again I think I have come up with a good possible solution. I could use Javascript and Ajax to load this content into the Cached/Static pages so they would not ALL have to be re-built so often but could still show the most recent posts. _Does this sound like a good solution? Or more importanctly, can you think of another better or alternative solution to this problem?_ * * * Without getting my hands too dirty yet, this is all the possible problems I can see so far with converting my theme to be Cache/Static Friendly * * * ## UPDATE I just thought of another issue to think about. All Tag/Category as well as user pages will need to be updated every time a post is added that fits into that pages list of posts. I assume this must be a feature of the Caching plugins already I would imagine though


title: WSOD after upgrading to 3.1

text: I installed the new wordpress 3.1, but it gave me some problems and I had restore everything, you'd know it help me? Practically after updating the site was completely white and I could not access the dashboard. I do not know if it's in conflict with some plugin or theme ... but I do not risk coming back to update: ( Can you help me? www.talkischeap.it


title: Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

text: I've found this new plugin http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1 that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav- menu-items from the nav-menu-item array before they are parsed by the walker class, if a user isn't logged in. The plugin uses a specific CSS-class as identifier to decide which items to remove. So I've been wondering if it couldn't be possible to use shortcodes in nav- menu-item descriptions, in order to have an advanced set of conditionals with respect to the display of specific menu items (like display on page x, don't display on page y, or, particularly useful: automatic inclusion of child pages/categories, etc. by inserting them into the nav_menu_item array before the array is parsed by the walker) But adding               add_filter(‘wp_nav_menu_objects’, ‘do_shortcode’);      is causing the page to not load correctly. Not a blank page error, but the page stops rendering right after the nav menu containter div. Is there any way to use native WP shortcode functionality for this purpose? Or would it be necessary to create a custom shortcode parser within the function analysing the nav-item-contents? Thanks for any ideas!


title: How can I custom order the results from wp_list_categories?

text: I am using wp_list_categories to return (you guessed it) a list of categories within a custom taxonomy. The `orderby` parameter accepts sorting by ID, name, slug, count, and term_group. Is there a way that I can custom sort the results? Ideally I could pass an array of category ID's in the desired order, but obviously I'll have to dig a bit deeper to get this sorted.


title: How to make alert for new version on theme options?

text: Let say my theme host on my server. User download my theme and use it. Now I want notify @ alert for new version of my theme. Example to show "New version has been release. Please download at ..." How to do that?


title: Automate Product Import with WooCommerce?

text: I'm going to be using the Product CSV Import suite with WooCommerce to import products from a CSV file, but I'd love to have an automated way to do this via Cron if possible. Has anyone seen examples of this being done, or know of any documentation for doing something like this? Thanks!


title: jQuery UI AutoComplete not working in wordpress?

text: To use jQuery UI AutoComplete, I loaded the following scripts:               wp_enqueue_script('jquery');      wp_enqueue_script('jquery-ui-core');     wp_enqueue_script('jquery-ui-widget');      wp_enqueue_script('jquery-ui-position');          wp_enqueue_style( 'jquery-ui-autocomplete',   $ul .'/css/jquery-ui-1.8.custom.css' );     wp_register_script('jquery-ui-autocomplete', $url .'/js/jquery-ui/jquery.ui.autocomplete.min.js', array( 'jquery-ui-widget', 'jquery-ui-position' ), '1.8.2', true );     wp_enqueue_script( 'jquery-ui-autocomplete', $url .'/js/jquery-ui/jquery.ui.autocomplete.min.js', '1.1', true );      After the above scripts, I loaded my own js which includes the following code:               $(function(){            $("#to").autocomplete({             // code...        });     });      Firebug shows all scripts and style are loaded and gives error message of "$ is not a function". How can I correct this error?


title: Evaluating a external rewrite rule before internal wordpress rewrite rule

text: I am been plucking out my hairs since last few days trying to solve this problem: I want to convert my urls from format               http://example.com/prodsearch/category/tag1-tag2-tag3-tag4      to               http://example.com/prodsearch/index.php?tag=tag1+tag2+tag3+tag4&cat=category      to start with I added following rules to my .htaccess               RewriteRule ^prodsearch/(.*)/(.*)-(.*)$ prodsearch/$1/$2+$3 [L]     RewriteCond %{REQUEST_URI} !^prodsearch/(.*?)/(.*)\-(.*)     RewriteRule ^prodsearch/(.*)/(.*)$ index.php?tag=$2&cat=$1 [R,QSA,L]      Here rule1 recursively replaces all '-' between tags by '+' and rule2 does the actual rewrite once there are no more '-' left between tags (checked by RewriteCond) These rules actually work, but the problem is they redirect (with url change) to new url pattern, I don't want an explicit redirection. On removing 'R' flag from last rule, the whole thing stops working and I start getting 404 page in my wordpress install. Can some one explain why this is happening and how to do this without explicit redirection. Also I tried including these rules into wordpress, hoping when called by wordpress rules may work without redirection. I used following add_rewrite_rule() calls:               add_rewrite_rule('prodsearch/(.*)/(.*)-(.*)$','price-list/$1/$2+$3','top');     add_rewrite_rule('prodsearch/(.*)/(.*)$','index.php?tag=$matches[2]&cat=$matches[1]','top');      Now wordpress detects my first rule as external rule and flushes it to .htaccess file, this screws my execution order, now first rule 2 gets evaluated first(being part of internal wordpress rewrite rule set) and rule 1 gets executed later, hence again 404 page. Is it possible to tell wordpress not to consider my first rule as a external rule and not to flush it to .htaccess, or to evaluate the external rewrite rule before internal wordpress rewrite rules. Finally can anyone help me make this kind of rewrite work? Thanks a lot.


title: How can I check for malware in a Theme?

text: There are so many free, freemium and premium Themes out there. How can I be sure that a Theme I download doesn't have malware in the code? Is there an (relatively) easy way to check for malicious code without going through every line of code?


title: SESSION in WordPress Plugin Development

text: I wondering the session was disable in wordpress. I try to find some information on using session variables in the wordpress. I tried the following method to implement session variables in the wordpress site. I tried this way.               <?php      session_start();          $_SESSION['firstname'] = $_POST['firstname'];          ?>      If i echoing the `$_SESSION['firstname']` is not come's up. So I googled to find the reason why it doesn't support.               function register_session() {         if (!session_id())             session_start();     }          add_action('init', 'register_session');      This above method i tried and implemented but it also doesn't work. Right now i integrating session in plugin so i don't want to edit the core file. Because i doing the custom plugin development. How to enable the session in wordpress plugin. Any Suggestion would be great Thanks.


title: How to get the db table row that has the biggest value in the meta value?

text: E.g. I have a meta field called `car_number`: So, normally I would try something like this to get this value:               $car_value = get_post_meta($post->ID, 'car_number');       But the porblem is that I need to get the row only where the `car_number` is highest e.g. 45. so I need somehow to get the highest value and do something like this:               $post_ID = .. // here I need to get the ID of the post that has the biggest value in the fild car_value          $car_value = get_post_meta($post_ID, 'car_number');       how can I get the post_ID of the post that has the highest value (number) in car_value meta field?


title: Two ".htaccess" Files Located in Different Directories?

text: I found two ".htaccess" files, one is located in '/httpdocs/.htaccess', another one is located in '/httpdocs/wordpress/.htaccess', the content is different, is it normal? The Wordpress was installed on '/wordpress/' dir, then never changed, but when users go to my site, the URL shows "http://www.mydomain.com", no 'wordpress' shown on the URL. Also, from Settings > General: WordPress Address (URL): http://www.mydomain.com/wordpress Site Address (URL): http://www.mydomain.com


title: wp_query within function within wp_query

text: I have a query which looks like this:               $args = arguments for the query     $query = new WP_Query($args);          while ($query->have_posts()): $query->the_post();     $post_id = get_the_ID();     echo my_function($post_id);     endwhile; wp_reset_query(); endif;      Then in `my_function` there's another query with a second function. This second function uses the `post_id` as input:               $args = arguments for the query, using `$post_id` as input     while ($query->have_posts()): $query->the_post();     // Do stuff     endwhile; wp_reset_query(); endif;      The problem is that the output of the first query (which uses `my_function`) isn't correct. The query in `my_function` seems to mess up the loop. As you can see I use `wp_reset_query()` and I've also tried `wp_reset_postdata()`. `my_function` outputs some post information, among which the title. It displays the title of the current page (the page on which the query is) instead of the title of the post queried, so I think I'm missing something regarding resetting the query.


title: Display a portion/ branch of the menu tree using wp_nav_menu()

text: I have a menu defined in WP Admin that looks like this: ![alt text](http://i.stack.imgur.com/XnmMh.png) I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" page, I want a list of the 4 links highlighted in green to appear on the sidebar. I looked at the documentation for wp_nav_menu() and it doesn't appear to have any built-in way to specify a particular node of a given menu to use as the starting point when generating the links. I created a solution for a similar situation which relied on the relationships created by the page parent, but I am looking for one which uses the menu system specifically. Any help would be appreciated.


title: Link Attachment Image to Category

text: How do you link an attachment image to its category?               function wp_attachment_image($size = thumb) {         if($images = get_children(array(             'post_parent'    => get_the_ID(),             'post_type'      => 'attachment',             'numberposts'    => -1, // show all             'post_status'    => null,             'post_mime_type' => 'image',         ))) {             foreach($images as $image) {                 $attimg   = wp_get_attachment_image($image->ID,$size);                 $atturl   = wp_get_attachment_url($image->ID);                 $attlink  = get_attachment_link($image->ID);                 $postlink = get_permalink($image->post_parent);                 $atttitle = apply_filters('the_title',$image->post_title);                      echo ''.$attimg.'';             }         }     }     wp_attachment_image('thumb');


title: Custom post type archive page pagination

text: I have set up an archive page for my custom post type `reference`, where I use a query to get all posts of type `reference`. This works, but when I try to paginate the result, it doesn't work. Right now, it doesn't even print out the pagination links. EDIT: This was earlier used on a regular page, but I changed it to an archive page. That's when the pagination broke. Here is the source code; Custom post type `reference` (plugin)               <?php        /*        comments here removed         */     ?>     <?php          /* Custom post types */     function create_references_post_type() {         $labels = array(             'name'               => __( 'References', 'kasparabi' ),             'singular_name'      => __( 'Reference', 'kasparabi' ),             'add_new'            => __( 'Add New', 'kasparabi' ),             'add_new_item'       => __( 'Add new reference', 'kasparabi' ),             'edit_item'          => __( 'Edit reference', 'kasparabi' ),             'new_item'           => __( 'New reference', 'kasparabi' ),             'all_items'          => __( 'All references', 'kasparabi' ),             'view_item'          => __( 'View reference', 'kasparabi' ),             'search_items'       => __( 'Search references', 'kasparabi' ),             'not_found'          => __( 'No references found', 'kasparabi' ),             'not_found_in_trash' => __( 'No references found in the Trash', 'kasparabi' ),              'parent_item_colon'  => '',             'menu_name'          => __('References', 'kasparabi')         );         $args = array(             'labels'        => $labels,             'description'   => __('All the references', 'kasparabi'),             'public'        => true,             'menu_position' => 5,             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt'),             'has_archive'   => __('references', 'kasparabi')/*,             'rewrite'       => array('slug' => __('references', 'kasparabi'))*/         );         register_post_type( 'reference', $args );        }     add_action('init', 'create_references_post_type');          function add_post_type_to_query( $query ) {         if ( is_home() && $query->is_main_query() )             $query->set( 'post_type', array( 'reference' ) );         return $query;     }     add_action( 'pre_get_posts', 'add_post_type_to_query' );          ?>      The way I query for the posts:               $wp_query = new WP_Query(array(                             'post_type' => 'reference',                              'posts_per_page' => 9,                             'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1                          ));      How I print out the pagination links:               <div class="col-xs-12">         <?php previous_posts_link(__('← newer', 'kasparabi')); ?>              <?php if ($loop->max_num_pages > $paged) :             next_posts_link(__('older →', 'kasparabi'), $posts_per_page);         endif; ?>     </div>      And as a bonus question; is there another way to get the posts than creating a new query every time?


title: How to find if a post with custom_field == X exists?

text: I need to find if a post with a custom field X equal to Y exists in a wordpress installation. Should I do it with a simple sql query or is there something build in that can help me achieve it?


title: Allowing users to add HTML to BP Groups Description how can I error check html of users?

text: I am trying to modify the Group Description field on Buddypress Groups so that they can take HTML but Buddypress has filters to prevent this. I used this; remove_filter( 'bp_get_group_description', 'bp_groups_filter_kses', 1 ); remove_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 ); These are the filters applied: https://buddypress.trac.wordpress.org/browser/tags/1.5.4/bp-groups/bp-groups- filters.php I experimented with removing them and was able to get the form to accept HTML. BUT, the problem is if someone enteres broken html and leaves a closing tag out for example it breaks the page. I put it in protective Tags so the page wont break but the form itself can be broken with bad html being used in the form. So my question is, is there a way to do error checking on the html and prevent open tags and bad code from being submitted? Thanks!


title: Custom field for image, not showing image!

text:
In wordpress 3 you can create your own custom content types (without plugins) natively. I have done this and created a new "add image" field. However, I'm having trouble displaying this image in my page. In the loop I am doing:               <?php echo get_post_meta($post->ID, 'banner_image', true); ?>      But, this just returns '49' (which I assume is the ID of the post). I have tried setting it to false as well, which when using var_dump() reveals an array only with this number in it. Where is the image path? Many thanks for your help. Michael. EDIT: Here's a screenshot of the admin area and the image I need to output in the loop: http://i.imgur.com/hsllK.jpg               <?php              query_posts(array(               'post_status' => 'publish',         'post_type' => 'work',          //'orderby' => 'title',          'order' => 'DESC'              ));              while (have_posts()) : the_post();               ?>              <?php if( get_post_meta($post->ID, 'show_in_home_banner', true) == "yes" ) { ?>

                 <a href="<?php echo get_page_link($post->ID) ?>">                                        <?php echo get_post_meta($post->ID, 'banner_image', true); ?>

<a href="<?php echo get_page_link($post->ID) ?>"><?php echo get_post_meta($post->ID, 'sub_title', true); ?>

<?php echo the_title(); ?>

              <?php } ?>              <?php endwhile; wp_reset_query(); ?>


title: Sort a custom post type array numerically

text: We've set up drop down lists to allow people to filter posts based on custom post types. In order to populate the drop down list I am using:               <?php $terms = get_terms("ratios");     $count = count($terms);     if ( $count > 0 ){      foreach ( $terms as $term ) {          echo "<option value='" . $term->slug . "'>" . $term->name . "</option>";      }     }?>     </select>      The slug and the name are pretty similar, so I don't mind which one we are using. How can I list them as integers? The site is here if you need more of an idea: http://amigaeng.com.au/gearbox- list/


title: How to set search query for joining two tables in sql?

text: What's the wrong with this query?               SELECT l.company_name,DISTINCT c.sub_cat_name FROM tbl_listing l,tbl_sub_category c WHERE l.company_name LIKE '%cy%' and l.city_id='2' and l.area_id=23 ORDER BY l.company_name      I am using auto suggestion search and i want to check two table data with single filed input So how to set search query for two table? When i am enter any word that time company name search and also check enter word related category so please help me...


title: Protect changes made to the theme when updating

text: I customized the wordpress theme I'm using by changing php, css and even a js file. Is there a way to protect these changes, when updating the theme to a new version?


title: What's wrong with my date_query?

text: It's WordPress 3.9 "Smith". I'm trying to implement a new Archive page as per the suggestion of @Milo.               $categories = get_categories( $cat_args ); //it's NOT important for the Q, as it's fetching perfectly          foreach( $categories as $category ) {                                  $args = array(                                 'posts_per_page' => -1,                                 'category__in' => array( $category->term_id ),                                 'ignore_sticky_posts' => 1,                                 'post_status' => 'publish',                                 'date_query' => array(                                                     array(                                                         'after'    => array(                                                             'year'  => 2014,                                                             'month' => 01,                                                             'day'   => 25,                                                         ),                                                         'before'    => array(                                                             'year'  => 2014,                                                             'month' => 01,                                                             'day'   => 25,                                                         ),                                                         'inclusive' => true,                                                     ),                                                 )                             );                                  $posts = get_posts( $args );                             var_dump($posts);     }      I'll make the hard-coded dates into dynamic with Milo's suggestion, but with this hard coding, the `var_dump($posts)` is showing **empty** arrays. I'm following Viper007Bond.com's tutorial on WP `date_query` and I have posts on Jan25 and Jan22. I tried changing the `day` value from 22,24,25 etc, but the results are empty arrays. And of course the code I pasted here is from `archive.php` where my URL is in:               http://localhost/project_name/date/2014/01/25/


title: wp_ajax action is not running

text: I'm writing a plugin. I want to run the method get_my_option when someone pressing a button in the settings page of my wordpress plugin. The ajax call is made but the method never runs. In the page I have the following code:               <div class="wrap">     <input type="button" value="test" onclick="my_js_function();"/>     </div>     <?php     wp_enqueue_script( 'function', plugins_url( '/js/synchandler.js',__FILE__),         array('jquery'));     wp_localize_script( 'function', 'my_ajax_script', array( 'ajaxurl' => admin_url(  'admin-ajax.php' ) ) );               function get_my_option()     {         //do something         die();     }          add_action("wp_ajax_nopriv_get_my_option", "get_my_option");     add_action("wp_ajax_get_my_option", "get_my_option");     ?>      The added synchandler.js file:               function my_js_function()      {         jQuery.ajax({         url: my_ajax_script.ajaxurl,         type: 'POST',         data: ({ action: 'get_my_option', affiliate: 'daisycon' }),         success: function (response) {             console.log("got this: " + response);             }         });     }      There is a response but that's a 0, so the javascript is added nicely but that's about it. I'm getting no errors in my log by running this. AjaxURL is added in the page (seems to be a common mistake).               /* <![CDATA[ */     var my_ajax_script = {"ajaxurl":"http:\/\/mywebsite.net\/wp-admin\/admin-ajax.php"};     /* ]]> */      The button to trigger it all uses `onclick="my_js_function();` on the HTML `button`-tag. As easy as it is, the method `get_my_option` doesn't get triggered by the ajax call. What am I doing wrong here?


title: Comments Confusion

text: Website: [removed] If you goto the above post you will see that there are some comments which when posted appears as admin comments for some reason. If you are having problem finding that specific comment you can also press CTRL+F to find it using the following words Test Comment or Guest which i posted myself for testing purpose to show it here. The problem is that its making guest users comment appear as Admin Comments by putting that ADMIN Image at the right of the comments. and the odd thing is this is only happening if the user replies to an admin comment :o Can someone please help and tell me what could be causing this behavior? i'm pretty new to wordpress theme development :( Thanks in advance.


title: Restrict custom post type to only site administrator role

text: How can I remove this custom post type from being shown in the dashboard for non admin users?               /* Add Websites Custom Post Type */     add_action( 'init', 'create_website_type' );     function create_website_type() {              register_post_type( 'website',             array(                 'labels' => array(                     'name' => __( 'Websites' ),                     'singular_name' => __( 'Website' ),                     'add_new' => __( 'Add New Website' ),                     'add_new_item' => __( 'Add New Website' ),                     'edit' => __( 'Edit Website' ),                                  'edit_item' => __( 'Edit Website' ),                                     'new_item' => __( 'Add New Website' ),                                   'view' => __( 'View Website' ),                              'view_item' => __( 'View Website' ),                                         'search_items' => __( 'Search Websites' ),                       'not_found' => __( 'No Websites Found' ),                     'not_found_in_trash' => __( 'No Websites found in Trash' ),                                                          ),                 'description' => __('Websites to be shown in Resources section.'),                 'public' => true,                 'show_ui' => true,                 'publicly_queryable' => true,                 'exclude_from_search' => false,                 'menu_position' => 20,                 'supports' => array('title', 'editor'),                 'can_export' => true                     )         );          remove_post_type_support('website','editor');      }


title: how can we bring category metabox to Media Library/Upload New Media Page

text: I would like to place the 'categories metabox' found in new post/edit post page in the "upload new media" page. Any clues ?


title: Sort Posts By Category?

text:
Googled this for hours, cannot find a solution. On my theme you have a `Browse` page which pulls all the videos from the Custom Post Type I am working with. If a user makes 30 categories then id like for users to be able to sort the videos using the Category buttons listed at the top. If they click on `Horror` id like to loop to show all `Horror` Videos. How can I sort my videos using Categories within this loop? **BROWSE PAGE** My Category ul li a
         <?           $args = array(                 'orderby' => 'name',                 'parent' => 0           );           $categories = get_categories( $args );           foreach ( $categories as $category ) {             echo '
term_id ) . '">' . $category->name . '
';           }         ?>
     <?          // Our variables         $numPosts = (isset($_GET['numPosts'])) ? $_GET['numPosts'] : 0;         $page = (isset($_GET['pageNumber'])) ? $_GET['pageNumber'] : 0;              query_posts(array(               'posts_per_page' => $numPosts,               'paged'          => $page,               'post_type'      => 'theme_video'         ));              // our loop         if (have_posts()) {               while (have_posts()){                     the_post();                     get_template_part( 'partials/content', 'browse' );               }         }         wp_reset_query();       ?>      I'm a bit lost on how to proceed. Nothing I tried seems to sort the loop, and the methods ive used have been outdated by 1-2 years... Site works well for my first theme, but I do not know how to get this loop to sort by the category you select. Any tips or pointers? Thanks!


title: Customized first post techniques

text:
There doesn't seem to be a standard technique for differentiating first/top posts. After looking around, I found this method:               $current_query = new WP_Query('post_type=current&post_status=publish');           // Pull out top/first post     $first_post = ( $paged == 0 ) ? $posts[0]->ID : '';          while ($current_query->have_posts()) : $current_query->the_post();          if ($first_post == $post->ID) {         echo '
';     } else {         echo '
';     }      This relies on $paged (which seems to be a Wordpress built-in) to add the "top-post-special" class in first post as expected. However, when using the following query_post instead of a new WP_Query instance, it no longer works:               $args=array(               'taxonomy' => 'highlights',                 'term' => 'Featured',               'post_type' => 'highlights',             );          query_posts($args);           $first_post = ( $paged == 0 ) ? $posts[0]->ID : '';                   if ( have_posts()) : while (have_posts()) : the_post();                           if ($first_post == $post->ID) {         echo '
';     } else {         echo '
';     }      I thought the second would be analogous to the first, not sure what I'm doing wrong here. Is there a better or standardized way to target the first post? Seems like this would come up a lot.


title: How to use cache with simplepie

text: According to the docs, if you want to cache results for a fetch of RSS feeds with simplepie, you do this:                add_filter( 'wp_feed_cache_transient_lifetime' , 'return_7200' );      $feed = fetch_feed( $feed_url );      remove_filter( 'wp_feed_cache_transient_lifetime' , 'return_7200' );      My question is if I want to cache the results for several feed urls (by looping through an array), would I really want to add and remove the filter for each pass of the loop (wouldn't that cause separate entries in the cache for each feed) or should I do this:               add_filter( 'wp_feed_cache_transient_lifetime' , 'return_7200' );          for ($i=.......){       $feed = fetch_feed( $feed_url );     }           remove_filter( 'wp_feed_cache_transient_lifetime' , 'return_7200' );      Frankly (and this might be obvious), I'm confused as to how this caching works since all I've seen are examples for a single feed, rather than multiple feeds. Thanks.


title: how to add text to posts from tags

text: How can I add custom generated text to posts using text from tags? Something like: [Post Title] + custom text + tags + custom text .... Or is there a plugin which does this ?


title: Automating a Daily Picture Blog?

text: I was wondering if anyone could give me some suggestions on how best I could streamline the following; I have a WordPress blog (privately hosted) which I update daily (well, I normally schedule a load of updates at once) with pictures which I upload, tag and write a very brief comment on. I was originally considering a folder on the server I could FTP images into and then I would write something that would look there daily and create a post based on the picture, but then I wasn't sure about the meta data that I want along with it. Any help would be greatly appreciated. P.S I would make this a community wiki (as I am not sure there is even one answer let alone one stand out correct answer!) but I don't have enough the right privileges yet!


title: How to load different css file depending on language

text: I am running a multilingual wordpress site - English and Japanese. I am using transposh plugin to make the English text translated to Japanese. And when the user choose Japanese, there will be a words "ja" appended to my url. (This problem should be independant of the Transposh plugin.) For example, www.momorice.com is the english site, while www.momorice.com/ja/ denotes the Japanese page. I would like to load different css files depending on the language that the user choose. The solution that i can think of is to detect the url for the characters "ja", if found, i will then have to point all my css file to japanese css file. Is this a recommended way? If so can someone give me some guideline to do this? I realized I can make use of @font-face unicode-range to specify certain japanese font type for japanese characters. However this is not supported in Firefox browser. So I will not resort to this method.


title: How to use custom post type APIs, but use a different db table

text: We currently have a plugin that creates a new WP table, but it recreates the wheel when it comes to managing/updating data. It would be a good candidate for custom post types, but we don't want to pollute the `wp_posts` table. **Use case:** We're creating a specific job board for a company that lists 100s of jobs, and we want to keep the tables clean for other php scripts outside of WP that will also be accessing the same data. Input and management would be handled by the standard WordPress APIs. **Question:** I want to use WP's custom post type functionality, but use a different db table. Thoughts? Directions? Is it possible to simply tell WordPress to switch tables for a certain query? **Related:** Difficult to read and understand, and not entirely the same: Use Custom Database with Custom Post Type


How can I show my latest tweet in my wordpress blog? in functions.php not use any plugin


title: Can I attach a document (eg: PDF) but have a JPEG as a thumbnail?

text: Is there a built-in feature or plugin that allows you to attach a document to a post or page such that the actual attachment file is one thing (eg a PDF) but the thumbnail images are another (eg a JPEG)? CLARIFICATION: the thumbnail does not need to be automatically generated (it could be a separate upload) The use case here is a document library, where you have a little screenshot of what that document looks like but when you click the attachment, you can download the original document.


title: Load images after page load

text: I just heard somewhere that by using some javascript it is possible to load of a page after the entire page load completes, When I googled, I found LazyLoad, but it seems that latest browsers are not supporting it. My site has some images because of which sites becomes slow, is it possible to load images after the completion of page load?


title: Wordpress file browser

text: I see plugins that somehow hook into the Wordpress file browser (so that users can either upload an image to the image library or choose an image from the image library) but I've been searching through the codex and can't seem to find a simple way to do this. I'd like to add the image browser/file upload to my options page...


title: Permalinks and page store

text: I posted this on stackoverflow and they said i can try here - I have wordpress installed on my website. On that site, under a subfolder i have oscommerce system installed as online commerce store. I activated permalinks on my wordpress, But now everytime i try to reach the store administration i get page not found in the wordpress. If i'll disable the permalink i can gain access again, can you please help? Thanks as always, Danny


title: wp_list_pages isn't creating .children ul in one instance

text:
I'm trying to build a menu on child pages that is structured like this   * Grandparent      * Parent        * Current Page       * child page       * child page     * Item 2     * Item 3     * Item 4 For one set of parent and child pages everything works like it should.

      However, for another set of parents and children the menu output looks like this:

      This is the relevant code where I'm building the menu.               $ancestors = get_post_ancestors( $post->ID );     $ancestor_id = end($ancestors);     $descendants = get_pages(array('child_of' => $ancestor_id));     $incl = "";          foreach ($descendants as $page) {         if (($page->post_parent == $ancestor_id) ||         ($page->post_parent == $post->post_parent) ||         ($page->post_parent == $post->ID))         {             $incl .= $page->ID . ",";         }     }     $children = wp_list_pages("title_li=&include=".$ancestor_id."&echo=0");     $children.= wp_list_pages("title_li=&child_of=".$ancestor_id."&include="         . $incl ."&echo=0");      Is there any reason why the same code would generate a different output even though the parents and children are all set up the similarly?


title: Wordpress upgrade from 2.7 to 3.3 Permalink problem

text: I have upgraded my wordpress from 2.7 to 3.3. Now if I try to change my Permalink /%category%/%postname%/ my home page is loading. However, all my pages are getting 404 page. I dont know how to fix the problem... I got no log.. Then I changed the theme to default theme twenty eleven then also I faced the same issue. Then I installed a new WP 3.3 then installed put my theme alone.. now no menu is displayed.. I dont know what is the problem.. any help is greatly appreciated.. Thanks in advance..


title: Can I customize the To Email address on Contact Form 7?

text: I want the email to be sent to different email addresses based on a drop-down Subject value. Can I do this with Contact Form 7?


title: How to order posts by modified date without using 'query_posts'?

text:
I have an example basic wordpress theme template here for you. First, please take a quick look at it to get an idea.               <?php     get_header(); ?>

                <?php if ( have_posts() ) : ?>                  <?php /* Start the Loop */ ?>             <?php while ( have_posts() ) : the_post(); ?>                    <?php                 /* Include the Post-Format-specific template for the content.                  * If you want to overload this in a child theme then include a file                  * called content-___.php (where ___ is the Post Format name) and that will be used instead.                  */                 get_template_part( 'content', get_post_format() );               ?>                  <?php endwhile; ?>                  <?php reddle_content_nav( 'nav-below' ); ?>                <?php else : ?>

<?php _e( 'Nothing Found', 'reddle' ); ?>

<?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'reddle' ); ?>
                 <?php get_search_form(); ?>

                <?php endif; ?>

          <?php get_sidebar(); ?>     <?php get_footer(); ?>      The simplest way to order posts by the last modified date is by adding this:               <?php query_posts($query_string . '&orderby=modified&order=desc'); ?>      Right above this:               <?php while ( have_posts() ) : the_post(); ?>      But that's not what I want. I am told that it's much better to use `get_posts()` or `WP_Query()` (see), than `query_posts()`. I do not know how to modify the code above as per the suggestions. If would be very helpful if someone can give a pointer as to how I should use `get_posts()` or `WP_Query()` w.r.t the basic template above. Thanks.


title: How do I Make a custom post type get a custom post template in a plugin

text: I am writing a plugin in which I am adding a custom post type(called 'events') using register_post_type. Additionally I want it to use single-event.php instead of the regular single.php. The current structure of the plugin folder is :   * plugin-main-file.php   * single-event.php I know its possible if I place it inside my theme directory, but I want it to be placed inside the plugin and utilize it. How do I do it? Any custom function for that?


title: Is it possible to sync nav menus across multiple wordpress sites?

text: I was asked by a customer about the possibility to put a menu from a WP installation into another WP, whereas are independent installations, each one for its domain. The point is: I developed a website in WP (using Woocommerce) and months after we developed a blog, with another layout structure but keeping the visual ID for the brand. Now, she wants to put the main menu from her main website into the blog, and all the options on that menu needs to be dynamic, so, if she decides to add another category to that menu, it should be shown on the blog too, automatically. Is it possible to do something like that, such as integrate a WP installation with another? Basically I need to put a menu from a WP installation into another, each one on a separated domain. Can someone help me with this big problem?? Thanks at all !


title: "Site Offline" message can't be disabled

text: We installed a plugin to show our site offline for a few days during an update. But after finishing the update we cant remove the "Site offline" message. Finally we uninstalled the plugin, but the frontpage still shows "Site offline". Any suggestions om how to get the site "online" again? ( no, plugin developer does not answer our emails..)


title: Adding Page/Post Attachment Capability to the Media Edit Screen

text: Is there a way to add the page attachment capability to the edit media screen? So if I add/edit a media item, I can also attach/re-attach it to a page.


title: query_posts adding two “post-entry” divs

text:
I'm currently making a worpress theme. In the loop I want to have two "post- entry" divs, one that's small that goes next to my post thumb, and one for without the thumb. I know that I need to do a `<?php` if which I've done, but I seem to have messed up somewhere and I can't see how. I have set my loop in a `query_posts`, but still it's not functioning properly. Here is the code I'm using if it helps make sense:                    <?php query_posts();     if (have_posts()) : while (have_posts()) : the_post(); ?>
     <?php if ( has_post_thumbnail()) { ?>
         <?php the_post_thumbnail(); ?>

          <? } else { ?>
     <?php } ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

<?php the_tags('Tags: ', ', ', '
'); ?> Posted <?php the_time('F jS, Y') ?> <?php _e('in'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?> <?php edit_post_link('Edit', ' | ', ''); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
     <?php the_excerpt(); ?>

     <?php endwhile; ?>          <?php if (function_exists('wp_pagenavi')) { ?><?php wp_pagenavi(); ?>     <?php } else { ?>
<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>
     <?php } ?>          <?php else : ?>
Not Found

Sorry, but nothing matched your search criteria. Please try again with some different keywords.
          <?php endif; wp_reset_query(); ?>           Any suggestions will be greatly appreciated, as I have been stuck on this for a few days now.


title: Adding Read More to Custom excerpts

text: I've added the following code to my functions.php:               function new_excerpt_more($more) {         global $post;         return 'ID) . '">... Read More';     }     add_filter('excerpt_more', 'new_excerpt_more');      This adds a read more link to excerpts that have been automatically generated, i.e. an author hasn't specified anything in the excerpt field when posting an article. So far so good. However I would also like this to appear when something has been specified in this box, currently it only displays in the first instance. Thanks


title: How to create a mini directory in WordPress?

text: I'm looking to create a simple directory, something similar but not so powerful as SOBI2 for Joomla. Is there something like this for Wordpress? I want to store informations like:   * Name   * URL   * Address (country, region)   * Details (text) People should be able to browse or search such a simple directory. Is there something like this available for WordPress?


title: Is there any way to modify images from a theme using the web interface?

text: Is there any way to modify images from a theme using the Wordpress web interface?


title: w3 total cache minification breaks wp_localize_script()

text: I am trying to configure W3 total cache plugin to speed up my site. The minify option is great but I am running into the following issue:   Let's say I have a JavaScript file I am attached `wp_localize script()` to and it's called `'additions.js'`. Because W3TC minifies this JavaScript file and renames it, the `wp_localize_script()` function no longer sees my `'additions.js'` file and the variables inside it don't get shared with it.   Does anyone have a solution for this? Let me know if anything is unclear.


title: How to change or remove .htaccess per plugin?

text: I am looking for a way to edit or reset the `.htaccess` for a wordpress site without access to the filesystem, working only with the wp-admin web interface and/or plugins* (see below for the back story if you're interested or think it's relevant). A quick search on WordPress SE revealed something promising: Plugin to edit htaccess file I tried installing both the plugins suggested there, but neither worked** (see below for explanation of why these plugins didn't work, if you think it's relevant). And searching on google, the only other promising option I could find is a plugin called "WP htaccess Editor", which claims to do exactly what I want -- simply provide a direct textbox editor for the `.htaccess`. But I can't install this plugin. When I try, it fails, saying "Could not create directory. wp-content/upgrade/wp-htaccess-editor.1.1.12/wp-htaccess-editor". Any ideas on how I can change or remove the `.htaccess` with a plugin or some aspect of the wp-admin interface? * * * *Back story: My friend recently discovered that her WordPress site has been compromised, containing malware redirects. She doesn't know where it is hosted or who is hosting it. Apparently someone else set it up for her several years ago, and she's been unable to contact him recently. So I'm stuck working only with the wp-admin web interface. Using a plugin called "BackupBuddy" I managed to download a copy of their site and discovered the source of the malware. The `.htaccess` contains redirects to malware sites. The problem is, I can't for the life of me figure out how to remove these lines. Again, I don't have access to the file system (I wish I did, it would be such a simple fix). * * * **Explanation for why the plug-ins I tried didn't work: Firstly, the wordpress plugin admin interface for the most part doesn't work for me, because almost all pages (including the plugin install pages) redirect because of the malware lines in htaccess. Luckily, the "upload zip file" plugin install method still works, so that's how I installed the plugins. When I tried the first listed plugin ("WP htaccess Control"), it let me go to the plugin settings and fill in all the options and even showed me the resulting output that would supposedly be written to `.htaccess` (and the output looked fine). The problem is, clicking "Save Changes", though reporting success, appeared to do nothing at all to the redirects. Another download via backup buddy confirmed that the `.htaccess` file was not modified. The second plugin ("All-in-one htaccess Plugin") is a Catch-22; before doing anything it requires you to launch a series of tests, but clicking the "Initiate Tests" button on the plugin settings page leads to a page that is redirected to the maleware page by the `.htaccess`. So it's impossible for me to use this plugin.


title: Secure login on wordpress

text: I want to create a login page on wordpress where users type in there username and password and are the redirected to a page that is specified to the user only like for example if u login to facebook or bid or buy. I want to be able to let the users login to a page where they can find files that are only available for the specific user. Almost like E-learning.


title: WP Editor: Keep Bold, Underline, etc. but ignore color

text: Since upgrading to WP 3.9, my clients have been complaining that the new editor keeps _too much_ formatting. They'd like it so when you paste it keeps the formatting of bold, underline, paragraph breaks, etc. but ignores any color formatting. They tell me the old tinymce editor did this. Is there a way to do this? No look searching around the web and here. Thanks.


title: "Loadmore" button is not working in buddypress

text:
"Load-more" button in the activity stream page in buddypress is not working for me. If clicked means , it disappearing suddenly but no more posts are loaded.               <?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
             <?php _e( 'Load More', 'buddypress' ) ?>
     <?php endif; ?>      I want to load activities like Facebook or by means of load more button. So I tried the following code snippet got from buddypress forum                   // Change:
         <?php _e( 'Load More', 'buddypress' ); ?>
       // For this:               <?php if ( ! bp_activity_has_more_items() ) : ?>                        <?php endif; ?>      // 2) Add this at the bottom of that file:

Loading...
                          Does any one got this and get solved? Please , Thanks in advance.
         <?php _e( 'Load More', 'buddypress' ); ?>
      I have added back the following code with all and now it s working when I'm clicking the Load more button but the "Loadmore..." is not showing!


title: I'm looking for a visual composer / builder plugin that supports RTL

text: i'm looking for a plugin that enables building pages in a visual drag & rop interface, these plugins are getting better and gaining popularity - there's several plugins in this category such as wp-bakery's "visual composer" plugin (available on codecanyon) Now, i need this plugin for a hebrew website and "visual composer" does not support that. Does anyone here know of some plugin that DOES support RTL and can be used as a substitute?


title: Post Quote with image on header for news site

text: I'm working on a news website. (wordpress.org) I want to add a quote on the header with an image. Please have a look at this ![image](http://i.stack.imgur.com/CSrBl.jpg) For this I want to add a check box on the post publish section (post.php) like this ![image](http://i.stack.imgur.com/wt4ni.jpg) Please guide me on how to do this, should I use custom field or what? should i try custom metaboxes... or custom post type ?


title: posts stuck as drafts

text: I've recently seen a new bug appear on a site running WP e-commerce. New products (or certain existing products) get stuck as 'drafts'. Once they are marked as draft clicking 'publish' does not do any good, and the only way to make the products publicly accessible is by directly editing the entry in the MySQL database. **UPDATED** Further investigation shows that this is not an wp-ecommerce problem - it affects all posts. Switching to twentyten theme fixes the problem, so clearly the inability to publish must lie somewhere in the custom theme I'm using. Seeing as it's my own theme, I guess I'm to blame ;-) Error reporting throws up a mention of an incorrectly called register_script() function, however I don't think this is what's causing the problem, as it's not in my code.


title: Side effects of disallowing *.php requests in production environment?

text: For security in the production environment a company I work with has removed the whole `wp-admin/` directory, and is about to disallow all `*.php` file calls with a `403 Forbidden` HTTP error. Are there any pitfalls to doing this? (Other than the obvious thing of now allowing administration or other backend functionality). Are there any subsystems on the backend that I should be concerned with not working right if this is in place? (Updates to content are done in a secure area, and the process of pushing to production replicates the database and WP files, except `wp-admin/*` files.). Thanks!


title: When should I be using the Transients API?

text: I've never used the Transients API before and was wondering if anyone has guidance on when to use it. The Codex article implies that as a theme developer I might want to set each new `WP_Query()` as a transient; I assume the same might be said for direct $wpdb queries and `query_posts()`. Is that overkill? And/Or are there other places I should default to using it? I do often use caching plugins on my site (W3 Total Cache usually) and it sounds like using Transients might bump up the plugin's effectiveness but I don't want to go crazy wrapping everything in transients if that's not a best practice.


title: How to get all events from 'All in one Events calender' plugin in JSON format?

text: I am using `All in one Events Calendar` plugin to add the events. It works fine in CMS. I would like to display the events data in mobile version. for this i used `JSON-API` for obtaining web-services in json format. To obtain all events , I dint find any plugin which will full-fill my requirement. so i started writing php code and uploaded the `getevents.php` to `www/.../services/getevents.php` When i execute the file it is redirected to Calendar page in my cms. But i am expecting a json formatted output of all the events. Please suggest a solution...   Thanks


title: Alphabetical search

text: Is is possible to create an alphabetical search like so: A | B | C | D | etc Each letter is a link so when clicked it would show all the posts starting with "A" or "B" etc etc. If so, how could I do it?


title: How to set the cache for the built-in SimplePie feed parser?

text: I'm using the built-in SimplePie, AKA `fetch_feed()`, to retrieve a feed, and I want to be able to adjust the cache time from an admin menu. SimplePie itself is well documented, but not so much the WordPress implementation of it. Any thoughts on the best way to set the cache duration?


title: digital alarm clock widget

text: I am looking for a digtal alarm clock widget since a long time for my wordpress site. It should be configurable in the GUI as well. Also it should have no flash because the ipad and iphone do not support flash.I couldnt find in the widgets and plugins area so i tried the google gadgets, it was having other issues. Can anyone of you help me in this please. Thanks


title: menu_class showing up on DIV instead of UL

text:
I was having an issue where my menu was being created using:               wp_nav_menu(array('theme_location' => 'main_menu', 'menu_class' => 'sf-menu''))      The resulting HTML was like this:

      As you can see, the `$menu_class` argument was being applied to the div instead of the ul. And the ul doesn't even have an id attribute despite using the default `items_wrap`.


title: Duplicate (or more) custom fields on many posts. Is there an easy way to clean them up?

text: I am in the process of cleaning up a site after migrating it from a single install of WP to a multi-site install of WP. I have noticed many, many duplicate custom fields for each post. I assume this is from older versions of plugins that didn't check for the field before adding another. In the migration I am dropping these plugins. Could I just delete these fields in the back-end using SQL or is there a better way?               SELECT *      FROM  `wp_5_postmeta`      WHERE  `meta_key` IN ("podPressPostSpecific", "aktt_tweeted", "podPressMedia")      Only using `DELETE` obviously.