title: qTranslate - show articles in two languages

text: I would like to show all articles on my page in two languages while the menu and everything is translated in the language choosen.               <?php      $id=5; $post = get_page($id);      $content = qtrans_use('fr', $post->post_content,false);      echo $content;       ?>      This is as far as I got. But I want it to be dynamic with every article. Thanks for your help!


title: Custom Taxonomy in Permalink of Post

text: It is possible to use this as a permalink for a post:               /%category%/%postname%/      But lets say I've created a taxonomy called "artist". I'd like to use this for my posts:               /%artist%/%postname%/      I know that taxonomies allow you to list their terms with this:               /%artist%/%someartist%/      but that is not what I'm looking for. I want to modify POST urls, not taxonomy ones. I'm trying this on my blog and it is not working. Is this something that can be done in Wordpress?


title: Author Profile URL

text: I have 2 user roles. "photographer" and "subscriber" I have set my author.php like this               <?php get_header();          $thisauthor = get_userdata(intval($author));         $author_user = $wp_query->get_queried_object();             ?>          <div id="main">          <?php        if (user_can($author_user, 'photographer')) {            get_template_part( 'author', 'photographer' ); }        else if (user_can($author_user, 'subscriber')) {            get_template_part( 'author', 'subscriber' ); }          ?>        </div><!--/main-->          <?php get_footer(); ?>      This is working great to show different profiles based on the user roles. However id like to change the url based on the roles. Something like http://xxx.xxx/subscriber/username/ http://xxx.xxx/photographer/username/ Any ideas on getting this done?


title: Redirect logged in users if they are on a specific page

text: I'm trying to prevent a user access besides the admin to the registeration page and reset password page if they are already logged in. I have the following:               function redirect_loggedin_users() {     // Maybe use is_user_logged_in() instead?     if (!current_user_can('manage_options') && is_page(array(2090, 2092))) {         wp_redirect(home_url());                 exit();         }     }     add_action('init', 'redirect_loggedin_users');      I tested it and it's not working. Can someone please assist me? Thanks.


title: How properly delete only one site (blog) from the Network in WordPress Multisite (WPMU)

text: I have a Network with ~30 sites. And I need to delete only one of them. Could you please tell me how should I delete properly only one site from the Network WordPress Multisite (WPMU)? Because when I have done it in the admin area side the site was deleted from the admin but the plugins and some other tables for this site are still in database and all files in website directory (`blog.dir/id_of_the_site`) are left too. How properly could I do that? Should I delete manually all tables with site ID (in table name) from database and then delete the website directory with files from `blog.dir` directory? Or should I do something else? Perhaps do you know another way, more safety and properly? P.S. Also I'd like to know if it is possible to restore this site after these manipulations (from the backup) and what is algorithm, because I know that after deletion some data from `wp_blogs` table were deleted too? Thanks.


title: ACF loop and php formatting

text:
The following php will loop through each page and then output **ALL** of the ACF custom fields sequentially. What I need help formatting is a conditional statement that places all `$fields`, except `$field_name` containing 'title', in their own container.               $pages = get_pages( array('sort_column' => 'menu_order'));      foreach ($pages as $page_data) {         $fields = get_fields($page_data);         if( $fields )         {                foreach( $fields as $field_name => $value )           {                 $field = get_field_object($field_name, false, array('load_value' => false));                 // if(strpos($field_name,"title") !== false ){            // /*this field has name containing title*/            // }                 echo '
';            echo $value;            echo '
';                }         }          }      So final HTML should look like:
TITLE

1

2

3

      Thanks for your advice.


title: Change link to permalink inside post content

text: Probably this has been answered before several times.But couldn't find so sorry if it sounds duplicate. I have a post content and in that content I have couple of internal links Now inserting those links via editor I put the id instead of slug name. Is there any way so that when it displays in the site it automatically detects the id and change to permalink. Or I need to copy the permalink and put it in the post? Please suggest.


title: Diffrent search templates for different post types

text: I have a site with diffrent post types. Two of them are the 'post' post type and the other one is 'charity', for both pages I have an index, the normal index.php and a diffrent page template for charity. I used a plugin called taxonomy filters to filter the category and a custom taxonomy on 'charity'. for 'post' I created an other widget that only searches for category's. This works amazing, the only thing is that I get redirected to the search.php template. No problem, I thought, and I made some conditional statements on search, where at diffrent post types diffrent widgets will be shows. so in short it is something like:               <?php if ( 'charity' == get_post_type() ){          //widget1         //html for charity     } else ( 'post' == get_post_type() ){         if ( 'post' == get_post_type() ){              //widget2     }     //html for posts and search     }     ?>      Now the filtering is working amazingly good, when I'm on charity and i select a cat and a term it will direct to search, but keep the same template with te checkboxes still as they where. BUT.. and here comes the real problem.. When I want to search something normally via the searchform, and it belongs to one of the two post types, it will (ofcourse..) take that template, including the filters of that post type. can I prefend that? I want the filters only to show up when redirected from that post type index.. Isn't there something as `if redirected from index.php`? that would be amazing !


title: how to create my own edit.php admin page code or template for my custom post type

text: Most plugins try to hide the components of the edit.php screen on wp admin and replace it with meta boxes to create the needed layout and fields for the custom post type. But this means that there is still unnecessary code on that edit.php page not used and increases the page load. Also, Not everything can be done using meta boxes. Is there is a way where i can create my own edit.php page from scratch for my custom post type? maybe hide the custom post type UI and make a new admin page and use it to insert the custom posts or update it? is this possible on admin pages?


title: Error when setting cookie

text: I get this error when trying to set a cookie on a WP page.               Warning: Cannot modify header information - headers already sent by(...)      Any help here? It worked fine when I did the php outside of wordpress, but when I move it in, it broke. Nothing special about the cookie(very basic). So how do I get the cookie to set?


title: prevent custom widget file names from showing in Appearance > Editor

text: I've setup a few custom widgets for my theme, and when I go into Appearance > Editor, the widget file names are showing up in the list of files that can be edited. How can I prevent these widget file names from showing up in the Editor's list of files? I put them in a subdirectory ("widgets"), but they are still showing up on the list with the main pages.


title: Get categories related to particular category

text:
I have assigned two different main categories to blog and portfolio. the blog will show only categories related to main blog category and portfolio will also do the same. with this code for portfolio               $cat_ids = get_all_category_ids();     foreach($cat_ids as $cat_id) {     $cat_name = get_cat_name($cat_id);         $cat_slug = strtolower($cat_name);         $cat_slug = str_replace(' ', '-', $cat_slug);         if(get_category($cat_id) ) {                  echo '
'.$cat_name.'
';         }     } // foreach       i am getting all categories also blog. i just want to show the categories related to 'portfolio' category on portfolio page.


title: Extending wp.media.model, query media from different blog on network and refresh view

text: I'm trying to extend the new wp.media.model to allow users to be able to choose any blog across the network and pull down the associated media library into the library content view. In the old thickbox we just called `switch_to_blog()` and refreshed the thickbox. I would like to stay within the new backbone.js media-views and media-models (open to other suggestions) but I'm having trouble getting wp.media.query() to return the results from the correct blog. I'm calling switch_to_blog() using the wp.media.ajax method and the correct global variables are being set. The result of the query variable below is an object of attachments for the original blog not the switched to blog. javascript:               /*global blogs */ //Object of network blogs passed via wp_localize_script     (function ($) {         "use strict"; // jshint ;_;              var current = blogs['current_blog'];         var Blogs = blogs['UserBlogs'];              $(function() {             var media = wp.media.editor.add('content');             media.on('open', function() {                 var html = $("<select>", {name:'blog_id', id: 'blog_id'});                 $.each(Blogs, function (index, blog) {                     if( 1 == index ) { return; }                     html.append($("<option>", {value:blog.userblog_id, html:blog.domain}).prop({ selected: blog.userblog_id == current}));                 });             $(".attachment-filters").after(html);                  $("select#blog_id").change(function () {                 var str = "";                 $("select#blog_id option:selected").each(function () {                     str += $(this).val();                     var options = {                         type: 'POST',                         url: ajaxurl,                         data: {                             blog: str                         }                     };                     wp.media.ajax('switch_blog', options );                     var query = wp.media.query();                     console.log(query);                 });             })         });     });     }(jQuery));      PHP:               public static function _switch_blog() {         global $blog_id;         $current = $blog_id;         $blog = isset( $_POST['blog'] ) ? intval( $_POST['blog'] ) : false;         $result = false;         if ( (bool)$blog )             $result = switch_to_blog( (int)$blog );            if ( $result )                echo json_encode( array( 'success' => $result, 'response' => 'Switched from: '.$current. ' to '.$blog_id ) );              exit;     }


title: Retrieve name or slug from get_objects_in_term

text: I have taxonomies set up for users, and on `taxonomy-{term}.php` I have the following code to "loop" them all out, sorted by ID:               $term_id = get_queried_object_id(); // Get taxonomy term ID     $term = get_queried_object(); // Get the term     $argu = array('orderby' => 'name', 'order' => 'ASC', 'fields' => 'all'); // Order     $users = get_objects_in_term( $term_id, $term->taxonomy, $argu );          if ( !empty( $users ) ) { // Don't show if empty ?>          <?php foreach ( $users as $user_id ) if (!user_can( $user_id, 'invisible' )) { // Exclude users with the role invisible ?>          <!-- Thumbnail, title, name etc. here -->      How would I go about sorting them by their last name (which is a custom field)? Ideally I would like to change `'orderby' => 'name'` to something like `'orderby' => 'CUSTOM-FIELD-NAME'`, or if I could utilize `get_objects_in_term()->name;` somehow. Here's a `var_dump($users)` from a term page where I have four users:               array(4) { [0]=> string(2) "12" [1]=> string(2) "19" [2]=> string(2) "20" [3]=> string(2) "21" }      The number inside the quotes is the users' ID. **Edit, completely revised using WP_User_Query**               $args = array(     'fields' => 'all_with_meta',     'role' => 'talare',     'order' => 'DESC',     'meta_query' => array(         array(         'key' => 'last_name', // the meta field (or key) we want to target for sorting         )     ));     //get_users calls WP_User_Query and returns an array of matching users     $users = get_users($args);          //custom function for comparing the data we want to sort by     function cmp($a, $b){         if ($a->last_name == $b->last_name) {             return 0;         }         return ($a->last_name > $b->last_name) ? 1 : -1;     }     //usort sorts our $users array with our function cmp()         usort($users, 'cmp');          //leaving an array of $users sorted by the value of meta 'last_name'     foreach ($users as $user) {         //Thumbnail, title, name etc.     }      I got the sorting-function from here.


title: Programmatically Selecting Theme Based on URL

text: I've inherited a site which has a mobile version. Let's call it qqq.com. It has a Varnish server in front of it to cache the pages. But it seems the Varnish server is also detecting mobile requests, and changing the URL to m.qqq.com. The WP install is then switching to the qqq-mobile theme, instead of the qqq theme. How would you do that? I'm trying to locate the code that does this, so I can do the same thing on my local dev instance. Thanks for your help.


title: Add custom field to all posts in specific category

text: I want to bulk add a custom field (category) with value (photography) to all posts in a specific category (photography, with Category ID 5). I have used the code below to bulk add a custom field to all posts, but how can I narrow this down to a specific category? Anyone? This is the code I used for all posts:               INSERT INTO wp_postmeta (post_id, meta_key, meta_value)     SELECT wp_posts.ID, 'category', 'photography'     FROM wp_posts     WHERE wp_posts.post_status = 'publish'


title: What is the template file for topic layouts in bbPress?

text: The theme I'm using edits the Topic layout in such a way that the role is not being displayed anymore. I'd like to revert those changes in the theme editor, but I can't seem to find the template file for the bbPress topic layout. Could anyone tell me where to find it?


title: Get posts in a subcategory of a chosen parent

text: Taking on legacy data I have the following structure -Top level category (category) -- Sub category (report) --- Post I want to get all posts in a particular top level category. **The problem is all the posts are only assigned to Sub Categories, not their top level categories.** I've tried the following:               function getPostsInCategory($category) {              return get_pages(array(             'post_status'   => 'publish',             'post_type'     => 'post',             'child_of'      => $category, // e.g '3'             'numberposts'   => -1         ));     }      I use `get_pages` instead of `get_posts` because it seems to support heirachy better. How can I get all posts that are in a "report" that is a child of my chosen category?


title: Default Attributes in Shortcode Not Working

text:
I'm learning about shortcodes. My shortcode is working fine. But, I'm not getting the default values for the attributes.               function csf_cap_databaseinfo($atts,$content=null) {         global $wpdb;              shortcode_atts( array('title'=>'My Default', 'year'=>'1900'), $atts);               $greeting = $wpdb->get_results($wpdb->prepare("SELECT * FROM wp_test;"));                $out = '
'.$atts['title'].'

'.$atts['year'].'

                             ID	                             Greeting
';               foreach ($greeting as $greet)             {              $out .= '
'. $greet->id .'	';              $out .= ''. $greet->greeting .'
';             }                $out .= '
';                             return $out;           }      So, if someone types in [db-info] in a post, without any attributes, they aren't getting "My Default" and "1900". If they type in: [db-info title="Hello" year="1973"], it works as expected. What am I doing wrong? Thanks. -Laxmidi


title: Custom Post Type And "fopen"

text: Never posted here but since I can't find a solution on my own, let's abuse your kindness! I'm adding some custom post types through my theme. The first custom type works like a charm, but as soon as I add the second (and third) one, the apache's error log reports a PHP Warning when trying to do a search action (like the one to search a post to attach a media).               fopen(http://localhost/site/wp-cron.php?doing_wp_cron) [function.fopen]: failed to open stream [...] in E:\\www\\site\\wp-includes\\class-http.php on line 876, referer: http://localhost/raw/wp-admin/edit.php      It only happens when I set the 'thumbnail' string into the $args['supports'] array passed to the register_post_type function. Any help would be much appreciated! Regards


title: WordPress Job Interview Preparation

text: I'm interviewing for a job as a WordPress Developer. I've only been working with WP for a year now and feel I have a good overview, as in how to set it up, what functions.php does, where to modify themes, etc.. But the interview I have next week is going to be asking me all about WordPress and Linux with some MySql thrown in. All I know is that they will be giving me a laptop and a test. How do I prepare for such a thing? Should I practice writing a plugin today? I know how to set up a Linux server, but I'm not great with advanced file manipulation or shell scripting. I'm good at setting up, troubleshooting and configuration. And I read the WP Codex a LOT. What would be a good homework assignment to give myself to prepare properly? I've noticed there aren't many resources for studying for a WP-centric interview out there.


title: ACF: post query, hide duplicate values

text:
I'm querying an ACF field, and displaying all the results on the front-end like so—   PHP:
                     <?php                           // args                     $args = array(                         'numberposts' => -1,                         'post_type' => 'wpsc-product'                     );                          // get results                     $the_query = new WP_Query( $args );                          // The Loop                     ?>                     <?php if( $the_query->have_posts() ): ?>
                         <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
                                 <a href="/shop/?view_type=default&product_search=<?php $remove = array(" ", ",", "/", ".", ":", "-", "–", "—", "!", "?", ";");     echo strtolower(str_replace($remove, "+", get_field('products_page_designer_name'))); ?>">                                     <?php the_field('products_page_designer_name'); ?>
                         <?php endwhile; ?>
                     <?php endif; ?>                          <?php wp_reset_query(); ?>
      This works great, the only problem is the values of some of the fields are duplicates of others, e.g. It will output a list like so:                 Value 01     Value 02     Value 02     Value 03     Value 03      etc etc. but I only want to display one instance of each, thus if there's a duplicate value it will be hidden. Is this at all possible? Any suggestions would be greatly appreciated!


title: How to get past purchase details, like cart items?

text: Is it possible to get past purchase items? I have created a custom database table but i forgot to add the number of a spefic purchased items in a field. Is this still possible? i tried               print_r($purchase_log);     print_r($purch_data);      But these just gives cart total and customer data? Any tips, suggestions regards


title: Embed Captivate HTML5 into WP

text: I would like to embed HTML5 interactions I create in Captivate into my WordPress. I don't need the data to report to an LRS; I just need the learner to be able to interact with it. An iframe is not ideal, as we would like to be screen agnostic. I saw a similar question here that did not seem to be resolved. Does anyone have another suggestion?


title: Is it possible to temporarily override the language setting?

text: I have a bilingual site working no problem that tests for cookies before setting WPLANG in wp-config.php, with all the text internationalised etc. My one problem is that notification emails are being sent in the language of the current user, not the language of the recipient. So if user1 comments in English, and user2, who uses the site in Spanish but replies in broken English, the comment notification email that user1 receives will be in Spanish. I have a language preference stored for each user, so I intend to customise how the emails are sent so that it checks for the language of the recipient first. So, to the question. Here is a sample line plucked from wp_notify_postauthor() in pluggable.php which uses gettext calls to construct the email message:               $notify_message  = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n";      I'm hoping to continue with this gettext-based method. But that would mean temporarily switching the locale setting immediately prior to constructing the email message, and then switching it back again immediately afterwards. [edit] _Reading through the core files I think I might better describe this as unloading the text domain prior to sending the emails and reloading afterwards, where required. To optimise I could create a text-domain subset specifically for notification messages to load and unload, rather than the text-domain for the entire site, and, of course, when sending multiple notifications, group the messages to send by language_ [/edit] Is that a) meaningful, b) possible, and c) sensible? Because the alternative is to drop gettext here and have both (and eventually, all) language versions there in the php and build the email string accordingly based on my language test.


title: Need a conditional div in custom Walker function for wp_nav_menu()

text:
I have used wp_nav_menu() for my custom WP sites with Custom Walker Function which is working fine and providing me below output:

HOME

MY Review Post 1

My Test Post

      But Right now i want to add one conditional div `if($thisItem->object == 'category')` class through loop after the ul class="col-sm-12 list-unstyled" inside the div class "yamm-content". So output will be:

HOME

MY Review Post 1

My Test Post

title text come here
                                 learn more

      Please provide some idea how can i get it from my custom Walker function. I just tried to get it through static way but don't know how to place it after ending the `</UL>`. Anybody please help me..                 class custom_menu_walker extends Walker_Nav_Menu {     private $curItem;          function start_lvl(&$output, $depth) {         $thisItem = $this->curItem;               $output .= '

';             $output .= ( $depth == 0 && $thisItem->object == 'category' ) ? '
' : '
';                }           function end_lvl(&$output, $depth) {         $output .= '

';          }          // add main/sub classes to li's and links      function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {          $this->curItem = $item;              $indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent                   // depth dependent classes         $depth_classes = array(             ( $depth == 0 ? 'dropdown' : '' ),             (( $depth == 0 && $item->object == 'category' ) ? 'yamm-first' : ''),             ( $depth % 2 ? 'menu-item-odd' : 'menu-item-even' ),             'menu-item-depth-' . $depth         );         $depth_class_names = esc_attr( implode( ' ', $depth_classes ) );              // passed classes         $classes = empty( $item->classes ) ? array() : (array) $item->classes;         $class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );              // build html              $output .= $indent . '
ID . '" class="' . $depth_class_names . ' ' . $class_names . '">';              // link attributes         $attributes = ' class="menu-link ' . ( $depth == 0 ? 'dropdown-toggle' : '' ) . '"';                   $item_output = sprintf( '%1$s%3$s%4$s%5$s%6$s',             $args->before,             $attributes,             $args->link_before,             apply_filters( 'the_title', $item->title, $item->ID ),             $args->link_after,             $args->after         );                   // build html         $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );     }                    function end_el( &$output, $item, $depth = 0, $args = array(), $current_object_id = 0 ) {         if ( $depth == 0 && $item->object == 'category' ) {                   ?>

title text come here
                                 learn more

                 <?php              }       }     }


title: Admin Panel - Custom Menu Sub-Item LINK

text:
I'm trying to add a custom link under my Post Type in my admin menu, which will link to Pending Posts. This code functions, but it instead makes a page (like I suppose the function should), but I just need a single link and there doens't seem to be a `add_submenu_link` function unfortunately. Is there a way to create a static link but place it in my post type submenu?               /** Add Pending Posts to WP Admin Menu **/     function add_custom_link() {         add_submenu_page('edit.php?post_type=cpt_custom', '', 'Pending Posts', 5, __FILE__, 'sub_page_pending');     }     function sub_page_pending() {       echo '
Pending Posts
';     }     add_action('admin_menu', 'add_custom_link');      I've tried to use a `wp_redirect()` but I get some errors telling me that the headers have already been set.


title: Excluding cateory not working on my site. how to solve this?

text: I am using my own wordpress theme. I am trying to exclude some categories on my `author.php` I am using the following code for that purpose.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $author_id=$post->post_author;     $args = array('author'=> $author_id, 'posts_per_page' => 10, 'paged' => $paged, 'category__not_in' => 16, 19, 1, 20);     query_posts( $args); ?>      I tried `$args = array('author'=> $author_id, 'posts_per_page' => 10, 'paged' => $paged, 'cat' => -16, -19, -1, -20);` also not working. How can I exclude those four categories.


title: Access from template info of another blog (in the same network)

text: In my root blog (1), i have a custom post type that can be linked to an existing blog of my network. It does so by recording in post metas the ID of the blog it is linked to. I use `_blog_id` as a name for this data. In a page of this root blog, i list these custom posts, and i easily retreive the meta i saved:               <?php while ( have_posts() ) : the_post();     $blog_id = get_post_meta(get_the_id(), '_blog_id', true);      Now, i have the ID of the blog i want information from, so i try the following:               switch_to_blog($blog_id);     $blog_url = get_bloginfo('url');     restore_current_blog();      Unfortunately, that doesn't work because `$blog_url` has the URL of the root blog. Worse: `switch_to_blog()` works but not `restore_current_blog()`, because subsequent calls to the LOOP functions now work in the sub-blog. For example, when calling `the_post_thumbnails()`, the image source is referred by "/uploads/sites/2/2014..." while i'm in the root site. **As you could guess, i have two questions:**   1. **How to retreive blog info of another blog in the network, from the template of a blog?**   2. **Why does`switch_to_blog()`, followed by `restore_current_blog()` makes the LOOP functions to behave incorrectly?** Thank you everyone! Have a great weekend!


title: New installation can't be found due to htaccess of the original non-Wordpress site

text: I have a non-Wordpress site , **www.example.com** For canonicalization purposes I have this in .htaccess :               Options +FollowSymLinks     RewriteEngine On     RewriteCond %{HTTP_HOST} !^www\.example\.com$     RewriteRule (.*) http://www.example.com/$1 [R=301,L]         This way all non-www links will be redirected to www version of site. Recently I decided to attach a wordpress blog at **www.example.com/blog** . After the installation is complete, whenever I go to **www.example.com/blog** I get 404 - Page not found error. I tried both auto install with Fantastico and a manual install, with the same result. I found out that when I remove the piece of code above from my .htaccess it fixes the problem, and wordpress installation is accessable and usable. However, I would like to keep the the original htaccess settings, for SEO purposes. I tried to change url version in wordpress General Settings and then restore main site htaccess file - it would still break the wordpress and 404 is back again. I tried to add next code in wp-config.php :               define('WP_HOME','http://www.example.com/blog');     define('WP_SITEURL','http://www.example.com/blog');      It didn't fixed the problem either... I understand it has something to do with htaccess. I also notices that there is no htaccess file in wordpress folder, probably due to the fact that I haven't changed permalinks settings yet. I would appreciate any help on this matter! P.S: I just noticed that **www.example.com/blog/wp-login.php** is visible regardless of htaccess config, however after I log in it brings me to 404 page again :(


title: WP Ecommerce, Gold Cart and pagination

text: This one is driving me mad! Pagination does not work in that it was displaying the same set of products on every page - now after resaving permalinks (twice as recommended) clicking on page 2 results in the message "There are no products in this group." I have done everything advised - resaving permalinks, activating and deactivating WPEC, disabling WP Total Cache etc - nothing works (can't find a lot of help out there including on the WPEC forum) My next shop will be built using a different plugin!) Any help much appreciated.


title: WP_nav_menu fallback not working

text: I just realized the fallback doesn't work for my project when a custom menu doesn't exist. I can't figure out what I am missing. Here is the code that displays the nav menu:               $menu = wp_nav_menu(        array(           'menu_class' => 'reset sf-menu',           'container_id'=>'nav',           'echo'=>0        )     );          $menu = str_replace("\n", "", $menu);     $menu = str_replace("\r", "", $menu);     $menu = str_replace("\t", "", $menu);     echo $menu;      here is the test site: http://brainbuzzmedia.com/themes/amplify/styles/charcoal/


title: Theme Location empty

text: I have a problem. I have a WordPress theme which supports two navigation menus. The primary menu shows all the pages, and the secondary menu displays the categories by default. When I go to Appearance->Menu to change the settings it says "The current theme does not natively support menus, but you can use the “Custom Menu” widget to add any menus you create here to the theme’s sidebar". Could anyone please tell me how to solve this?


title: Multiple while loops not functioning

text:
I have this `while` loop in my product page with Wordpress e-commerce plugin. It is looping through custom post meta.               <?php if (wpsc_have_custom_meta()) : ?>         <?php $count = 2; ?>         <?php while ( wpsc_have_custom_meta() ) : wpsc_the_custom_meta(); ?>         <?php if (stripos(wpsc_custom_meta_name(),'g:') !== FALSE) continue; ?>
             <a href="#tab<?php echo $count; ?>"><?php echo wpsc_custom_meta_name(); ?>
         <?php $count ++; ?>     <?php endwhile; ?>     <?php endif; ?>          I repeat this twice. Once to iterate through tab titles and once through the tab body. But for some reason the second instance of the `while loop` won't work. If I delete the first instance then the second one works as expected but as soon as I have to examples of it then it no longer works. Thanks for the help.


title: Share buttons on article footer

text:
for a website I need to place facebook and twitter share buttons on the footer section of each article on the blog page (where are listed all the articles). I tested many social plugin and was able to have this result only using ShareThis. (I've tested without luck also Sharebar, Sociable and Social likes). Unfortunately Sharethis has a layout bug on my website that cuts off few pixels from the buttons, you can see it on this screenshot: http://postimg.org/image/gdog4h8nz/ I have no clue on how to fix this since I have no control on the nested span tags that build those buttons. Does anyone know a way to fix that border issue, or knows another social plugin that does the same and works better? EDIT: This is the code I see on notepad++:
         <?php          $share = "";         //the_content( __( $articlefooter, 'twentythirteen' ) );         the_content( __( ''.$share.'Continua a leggere »', 'twentythirteen' ) );         ?>
      The code inside the $share variable gets replaced in runtime by ShareThis script, and becomes much bigger with a lot of nested span tags:                                                   0                                                   0          Continua a leggere »           I have found the nested span tag that can be edited to fix the issue, but I have no control over it. I treied to add height to the class stMainservices, like this:               .stMainServices {         height:24px;     }      but from Chrome I see that the style gets overwritten somehow.


title: How to display a static HTML page while setting up a WordPress site?

text: I just installed Wordpress. I have a non Wordpress splash page at [root folder]/index.html. I'd like to keep the splash page up while I work on skinning Wordpress. When I try to access index.php (also in the root folder), it rewrites the url to index.html. I don't see index.html in the url but the splash page is there and I never see Wordpress. I am able to access the Wordpress admin without issue. Anyone know how I can access Wordpress without making it go live?


title: Delete all one-word comments

text: I'm trying to delete all wordpress comments with only one word. I found this mysql query to delete all comments at once, but that's not what I want to achieve:               DELETE FROM wp_comments WHERE comment_approved = '0'


title: Get the children of the parent category

text:
I'm trying to get all the children categories to display in this loop but I'm struggling with the code. This is what I have so far.               <?php $args=array('orderby' => 'name', 'order' => 'ASC');         $categories=get_categories($args);          foreach ($categories as $cat) { ?>
<a href="#" class="customer-acquisitiontop" id="<?php echo $cat->slug; ?>" data-filter=".<?php echo $cat->slug; ?>">
<?= $cat->cat_name; ?>

         <?= $categories=get_categories('parent'); ?> /*This should be the children of the parent category */

     <?php } ?>      Any help would be great


title: Redirect a password protected page?

text: I'm looking for the simplest way to redirect a password protected page, to another page after entering the password. E.g.               <?php if ( is_page('name-of-page') && ! post_password_required() ) {         wp_redirect( home_url() ); exit;      } ?>      Using wp_redirect is triggering a 'headers already sent error'. I've seen some solutions using output buffering to avoid this but, I'm not sure if it is the best solution. Thanks!


title: Widget update function not saving values

text:
Hello WordPress Answers! I'm having trouble with the widget `update` function saving values correctly, but first let me explain the situation. I'm writing a simple news ticker widget plugin, which filters the posts displayed by post type with check boxes in the widget settings form. To generate the check boxes I'm using a `foreach` loop over the available post types. However, the widget update function isn't saving the post type values. I confirmed this by doing a `print_r` in the form function (values exist) and again in the widget function (values do not exist). Here is my code:               class ami_newsticker_widget extends WP_Widget {          // process the widget     function ami_newsticker_widget () {              $widget_ops = array(             'classname' => 'ticketcontainer',             'description' => 'Display a scrolling newsticker'         );         $this->WP_Widget( 'ami_newsticker_widget', 'AMI News Ticker Widget', $widget_ops );     }          // build the widget settings form     function form( $instance ) {         $defaults   = array( 'num_posts' => 5 );         $instance   = wp_parse_args( (array) $instance, $defaults );         $num_posts  = $instance['num_posts'];          foreach ( get_post_types() as $post_type ) {       $instance['post_types'] .= $post_type . ',';     }     $post_types = $instance['post_types'];         //echo '
';     //print_r($instance);         //echo '
';              ?>
Number of posts to show: <input class="widefat" name="<?php echo $this->get_field_name( 'num_posts' ); ?>" type="number" value="<?php echo esc_attr( $num_posts ); ?>" />

Filter by Post Type:
             <?php foreach ( get_post_types() as $post_type ) { ?>
<input name="<?php echo $this->get_field_name( $post_type ); ?>" type="checkbox" <?php checked( $this->get_field_name( $post_type ) ); ?> /><label for="<?php echo $this->get_field_name( $post_type ); ?>" /><?php echo $post_type; ?>
             <?php            } ?>

              <?php     echo '
';     print_r($instance);     echo '
';     }          // save the widget settings     function update( $new_instance, $old_instance ) {         $instance = $old_instance;         $instance['num_posts'] = strip_tags( $new_instance['num_posts'] );     $instance['post_types'] = strip_tags( $new_instance['post_types'] );              return $instance;     }          // display the widget     function widget( $args, $instance ) {             global $wpdb;             extract( $args );            echo '
';       print_r($instance);       echo '
';                  // load the widget settings       //foreach ( $instance['post_types'] as $post_type ) {         //if ( $post_type == 'on' ) {           //$checked .= $instance['post_types'][$post_type] . ' ,';         //}       //}       //echo $checked;                  // get and clean the db data             $num_posts = intval( absint( $instance['num_posts'] ) );             $sql = "SELECT post_title, guid                             FROM {$wpdb->posts}                             WHERE post_status = 'publish'                             ORDER BY post_date DESC                             LIMIT {$num_posts}";                  $results = $wpdb->get_results( $sql );                  // print the widget             echo $before_widget;             echo '
';                  foreach ($results as $result) {                 echo '
guid . '">' . $result->post_title . '
';             }                  echo '
';             echo $after_widget;     }      } It seems like there is something obvious that I'm missing, but I've been banging my head against a wall on this! Any help would be greatly appreciated. Thanks in advance!


title: How to add hook to the_title() and get_the_title()

text: I've having trouble with accented characters now if i do utf8_decode() before echoing the title the problem is solved but instead of changing this all over my theme, can't I do this in one place that upgrade proof? I'm not really familiar with hooks but I think thats they way to do it, havent found out how to do it tho.


title: Limit the word count in the post title

text: Is there a way to limit the word count of the post title? I searched over the internet but found nothing. All I know is, only the content of the post can be limited or excerpted.


title: WordPress creating 404s under blog tags

text: Webmaster Tools is pulling up 404s under by blog tags. I go to a blog tag, scroll all the way down and find an "older posts" button. I click the button and the new page is a 404 because there is not enough content under that specific tag to run into a second page. How do I prevent wordpress from automatically creating these /page/2/ ?


title: fetch_feed: retrieve entries in the appearing order, not chronologically

text:
I'm using WP function fetch_feed to retrieve a feed and display its items.                   <?php         /* include the required file */     include_once(ABSPATH . WPINC . '/feed.php');         /* specify the source feed   */     $rss = fetch_feed('FEED_URL');         /* checks obj. is created    */     if (!is_wp_error( $rss ) ) :         /* specify number of items   */     $maxitems = $rss->get_item_quantity(4);         /* create an array of items  */     $rss_items = $rss->get_items(0, $maxitems);     endif;         ?>
             <?php if ($maxitems == 0) echo '
Content not available.
';         else             // Loop through each feed item and display each item as a hyperlink.             foreach ( $rss_items as $item ) : ?>
                     <a href="<?php echo $item->get_permalink(); ?>" title="<?php echo esc_html( $item->get_title() ); ?>" rel="external"><?php echo esc_html( $item->get_title() ); ?>
                 <?php endforeach; ?>
      If I visit the feed in question with (e.g.) Firefox, I see the entries in the XML appearing order. fetch_feed retrieves the most recent instead (according to their "published" tag). How can I make sure it retrieves items according to their order on the XML feed (not chronologically). Maybe is possible to set the order with this..? **EDIT:** I tried adding $feed->enable_order_by_date(false); but it seems to break the function..


title: Comparing arrays with meta_query in pre_get_posts

text: I'm working on a form for filtering a list of posts using custom fields created with the Advanced Custom Fields plugin. Because of the form, I'm using the `pre_get_posts` action to change the query via GET requests. (following code references are either PHP or dumped from `print_r()`) I set the meta_query like this:               $query->set('meta_query',$filter);      and `$filter` looks like this:               Array     (         [0] => Array             (                 [key] => delivery_method                 [value] => Array                     (                         [0] => Online                         [1] => Scheduled                          )                      [compare] => IN             )     )      The custom field that I am querying is structured like this:               Array (         [delivery_method] => Array (             [0] => Online             [1] => Scheduled         )     )      When I look for posts with `[compare] => IN` (as above), no posts are returned. When I look for posts with `[compare] => NOT IN`, all of the posts are returned. I am trying to return only those posts which have a specific "delivery method". Is there a way to compare the two arrays that I missed? or do I have to somehow explode one of the arrays and compare individual values against an array?


title: Display custom posts in checkbox list

text: I am working in a WordPress backend design and I would like to know if is there any function like wp_categories_checklist but for posts. I have an issue here: http://wordpress.org/support/topic/order-posts-by- custom-post-type-in-dropdown-field?replies=10 in order to find a multiple selection of my dropdown. So if is there any way to put my posts array in a meta box like the custom categories from WordPress that would be great. Thanks


title: 418 header status, I'm a teapot

text: I'm just backing up a clients via ftp site prior to working on it, when suddenly all urls are returning an error page with the header status being `418`. A quick Google finds that this was created for an April Fools joke. Does any body have any idea why I would be getting this error?


title: Using Custom Function With Advanced Custom Fields

text: I've written a custom function which works with the native WordPress custom fields function but I need it to work with the Advanced Custom Fields plugin. I have created the custom field and meta box using the plugin and added the function to my child theme's `functions.php` file. I am using the field name (demo_field) for the meta box in the custom function but the meta box does not hook in to the function.               add_action( 'genesis_after_post_content', 'custom_field_before_content' );     function custom_field_before_content() {       if(is_single() ) {         genesis_custom_field('demo_field');       }     }      What am I doing wrong? Ok i fixed that but it doesn't return the image even though i configured the settings to return value for the image object. It displays the HTML for the image.               add_action( 'genesis_after_post_title', 'custom_field_before_content' );     function custom_field_before_content() {     if(is_single() ) {     the_field('second_image');       }     }      Here's what it displays: 32538, , second feature image, , , /wp-content/uploads/2013/06/second-feature- image.png, 600, 300, Array Here's the final solution i worked out myself which i tested and works with Genesis only. You can change the hook if using another theme with hooks.               add_action( 'genesis_after_post_title', 'custom_field_before_content' );     function custom_field_before_content() {     if(is_single() )      if( get_field('second_image') ):     ?><img src="<?php the_field('second_image'); ?>" alt="" /><?php     endif;      } The code comes from the ACF website.http://www.advancedcustomfields.com/resources/field-types/image/


title: Is it possible to have pagination with an offset loop?

text: I am developing a blog page that requires 3 different post styles (Ie; one full page width with featured image and content, one full page width without featured image and the rest are half page width) so I have been using an offset query. The problem I'm having is that I can't figure out how to force page 2,3, etc. to only use the half page width styles. On top of that I can't get pagination to work anyway Is this even possible?


Here is my wordpress theme to check out(its not completely finished): http://benlevywebdesign.com/wordpress/ This is my first time working with php/wordpress and making themes so keep that in mind. I have an index.php, css, and a 960.css file and don't know about the other files that you can include. In my theme I would like to have different styles for my posts based on the content of each post like for images and video links or audio links. I want to first focus on a photo style where the photo will be big and large and not the size of a thumbnail or regular post image. Once I learn how to have different styles I can add more on my own because that is just the css! * * * Here is my current loop code:

<?php the_time('d'); ?>

<?php the_time('M'); ?>

<?php the_time('Y'); ?>

                 <?php comments_number('No comment', '1 comment', '% comments'); ?>

                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                      <?php the_author_posts_link(); ?>

                     <?php the_post_thumbnail( $size, $attr ); ?>

                 <?php the_content(); ?>

                 <?php the_category(', '); ?>

 <?php wp_list_comments(); ?>

                      <?php endwhile; else: ?>
Hmmm? Can't. Find. Post.
         <?php endif; ?>      * * * Here is an example blog theme that is doing what I want(3rd post from the bottom) http://demo.kreativethemes.com/evolution/ * * * I read about using the `post_class()` function and that I would need to create another php file for the post type, or that I could just code the mark up right into the loop if that's more what I prefer on this question CSS for Custom Post Types (and understood what they are doing but don't know how to actually do it) I think I want to go with putting it right into the loop if that's not too complicated as I said earlier I don't know much about other files you can include.


title: Is there a different way to grab a thumbnail image than this?

text:
I am currently upgrading my WP to 3.2.1 to 3.5.2, and for one section of my posts it seems like the featured image has disappeared. However, I just checked the the wp_posts table in the database through phpmyadmin and looked for one of my posts that had this issue. My `img` tags are being produced dynamically, but the problem is that the `src` is blank. Here's an example of one of the posts: Given this record in my wp_posts table:                   ID     post_author  post_date   post_date_gmt   post_content    post_title  post_excerpt    post_status     comment_status  ping_status     post_password   post_name   to_ping     pinged  post_modified   post_modified_gmt   post_content_filtered   post_parent     guid                                                 menu_order     post_type   post_mime_type  comment_count   cod_current_ahrf          16169  1            2011-06-17  2011-06-17                      Nick-Arias                  inherit         close           close                           Nick-Arias.jpg          0000-00-00 00:00:00     0000-00-00 00:00:00                         3728            /images/ahrf/pioneers/legends_face/Nick-Arias.jpg    0              attachment  image/jpeg      0         category-legends.php:               if(file_exists($_SERVER{'DOCUMENT_ROOT'}.substr($fivesdraft->guid_legend,20)))         {         echo $fivesdraft->ID; // returns 3728         $featured = gangmei_get_the_post_thumbnail_url( $fivesdraft->ID );                   echo '

post_name.'">name.'" />

post_name.'">'.$fivesdraft->name.'

';         }       functions.php:                   function gangmei_get_the_post_thumbnail_url($post_id = NULL) {             global $id;             $post_id = (NULL === $post_id) ? $id : $post_id;             $edmund = get_post_thumbnail_id($post_id);             echo "post_id = $post_id"; // returns 3728             echo "edmund = $edmund"; // returns 16169             $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full'); //the issue arises here. this returns nothing.             $src = $src[0];             return $src;              }      This is what is produced: `<img src="" alt="Nick Arias">`. What's supposed to be produced is this: `<img alt="Nick Arias" src="/images/ahrf/pioneers/legends_face/Nick-Arias.jpg">` The thing is that under the `guid` column in the database you can see the value of that column for that record is `/images/ahrf/pioneers/legends_face/Nick-Arias.jpg`. Is it possible to just grab the `guid` instead of going through all of these functions? Like this: `$featured = $fivesdraft->guid;`?


title: Inserting post_id into guid before wp_insert_post

text: I would like to insert data into the wp_posts table with the inserted post_id in the 'guid' for a record that doesn't already exist. Below is the closest I've gotten but this doesn't work ($postarr['ID'] is equal to 0).               function filter_handler( $data , $postarr )     {     if($data['post_type']=='ai1ec_event'){         $my_post_id = $postarr['ID'];         $data['guid'] = get_option('siteurl') .'/?post_type=ai1ec_event&p='.$my_post_id.'&instance_id=';     }          return $data;     }          add_filter( 'wp_insert_post_data' , 'filter_handler' , '99', 2 );          $mypost = array(       'post_author'     => 1,      'post_content'     => 'Test',       'post_status'      => 'publish',      'post_title'       => $_GET['assignment_name'],      'post_type'        => 'ai1ec_event',      'guid'     => ''     );           $postid = wp_insert_post($mypost);


title: Can't get custom user meta to show in header

text: I have used Pie Register plugin to add a "Phone" field. I tried every method in the book (that google fetched for me, so far) to show it but it shows an empty array although the field is not empty and the wordpress backend shows it. Also, User Meta plugin is able to show the field with its data but I can't get it to show manually in my header file. Any help is appreciated, I spent hours without any luck doing this! Thanks


title: wp_filter_kses allow HTML5 video?

text: Is there a way to allow my users to add HTML5 video tag (without shortcodes) into my textfield/textarea? Allowed anchor styles and bold tags are working, but as soon I add 'video' and 'source' it doesn't work anymore:(   Any help is appreciated. Thx.               function validate_setting($plugin_options){          //This Works         $allowed_html = array(          'a' => array(         'href' => array (),         'title' => array ()),         //This works also         'b' => array(         'style'=> array(),         ),          //This is not working...         'video' = array(         'width' => true,         'height' => true          ),          //This also is not working...         'source' = array(         'src' => true,         'type' => true          ),          );               $plugin_options['text_area']= wp_kses($plugin_options['text_area'],$allowed_html);     return $plugin_options;     }


title: Custom header image, and content, on Posts Page in twentyeleven with Static Front Page

text: I'm new to Wordpress, so sorry if I've missed something obvious. I have a site using (a local child of) the twentyeleven theme. I've found that if I set Featured Images on pages and posts, then that image replaces the header image; which is great. However, if I customise the theme to display a Static Front Page, designate another page (`recent-news`, say) as my Posts page, and set a Featured Image on `recent-news`, then `recent-news` doesn't show that as the custom header image - instead it shows the twentyeleven random images. How can I fix this? Also, I don't know if it's related, but any content I have on the `recent- news` page isn't shown; its only displayed content is the summaries of the Posts.


title: content and excerpt not displaying

text: I am using `get_the_title(453)` and while the title displays, i am unable to display the content and the excerpt for the page with the id of 453. The following is my code                       get_the_title(453);          $content = get_the_content();         echo $content;         the_excerpt();      Is there is something i am missing or doing something wrong?


title: Help writing custom function with rewrite endpoint that generates a page from dynamic content

text: I'm creating a WordPress plugin that will pull content from an API and display it dynamically on a WordPress blog like it's native content. An example of this content would be **company locations**. I already have a short code that pulls the _list_ of locations into the preferred page, but we also want to dynamically generate location detail pages with data from the API. So... `/locations/` is a WordPress page with a `[locations]` short code that pulls the list of locations from the API. DONE & WORKING. We want `/locations/location-detail/123-my-location-name/` (or something really similar) to build a dynamic page using the DEFAULT page template. From the research I've done (and I'm very new to WP plugin development), we could possibly accomplish this by creating a custom endpoint that will send the endpoint "location-detail" with the value "123-my-location-name" to my plugin. I want the plugin to then generate a "fake" page with content from my API and display it to the visitor. I found this code from a blog post, but I can't seem to get it in my plugin which is class-based (OOP).               // added for rewrite URL for front end                 $endpoint = 'wizard';                 add_action('init', 'endpoint');                        add_action( 'template_redirect', 'template_redirect' );                 add_filter( 'the_posts', 'the_posts' );     // added for rewrite URL for front end           function endpoint(){                     $endpoint = 'wizard';                     add_rewrite_endpoint('wizard', EP_ROOT);  // it will create endpoint to access it from frontend     }          function the_posts( $posts ){                     $endpoint = 'wizard';                                $value = get_query_var($endpoint);                          // Check if our endpoint is being used                     if( $value ){                         // Perform the necessary actions                         remove_all_actions('the_content');                         // Create a fake page                         $post = array(                             'ID' => 1,                             'post_author' => 1,                             'post_date' => current_time('mysql'),                             'post_date_gmt' => current_time('mysql', 1),                             'post_content' => $html,                             'post_title' => 'Post Title / Plugin Title',                             'post_status' => 'static',                             'comment_status' => 'closed',                             'ping_status' => 'closed',                             'post_name' => $endpoint . '/' . $value,                             'post_parent' => 0,                             'post_type' => 'page'                         );                         $posts = array( (object) $post );                 }     }          function template_redirect(){     }      I'm hitting a brick wall here, I'm not at all familiar with WordPress plugin development and can't seem to get a proof of concept working. If anyone could get me a simple snippet of code that creates a dynamic page with content from the plugin (even dummy text) I could take it from there and get the rest of the plugin written. Any help, advice, or suggestions would be greatly appreciated!


title: category page for custom post type

text: I know this question has been asked a thousand times, but feel like I've looked at every single article on this issue, and none of them have worked for me. All I want is for there to be a category page for my custom post type, products. So that I can type www.mysite.com/products and see all the products. Or if it's easier make it work like regular posts do www.mysite.com/category/products. Either works for me. I have written the code in functions.php and also used plugins like CPT-onomy and CPT-UI to successfully make the custom post types and taxonomies. But this doesn't create the category page. How is this accomplished? Please include instructions on permalinks if that is relevant to my situation too. Here is the code I placed in functions.php. The second block that deals with taxonomies actually breaks the site. However, using the two plugins mentioned above, I've been able to successfully create taxonomies, but still can't get a category page.               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'product',             array(                 'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Product' )                 ),             'public' => true,             'has_archive' => true,             'exclude_from_search' => false,             'show_ui' => true,             'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),             'taxonomies' => array('category', 'post_tag')             )         );     }               function my_taxonomies_product() {         $args = array();         register_taxonomy( 'product_category', 'product' $args );     }          add_action( 'init', 'my_taxonomies_product', 0 );      updated code               function create_post_type() {         register_post_type( 'product',             array(                 'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Product' )                 ),             'public' => true,             'has_archive' => true,             'exclude_from_search' => true,             'show_ui' => true,             'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),             )         );     }     add_action( 'init', 'create_post_type' );          function my_taxonomies_product() {         $labels = array(             'name'              => _x( 'Product Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Product Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Product Categories' ),             'all_items'         => __( 'All Product Categories' ),             'parent_item'       => __( 'Parent Product Category' ),             'parent_item_colon' => __( 'Parent Product Category:' ),             'edit_item'         => __( 'Edit Product Category' ),              'update_item'       => __( 'Update Product Category' ),             'add_new_item'      => __( 'Add New Product Category' ),             'new_item_name'     => __( 'New Product Category' ),             'menu_name'         => __( 'Product Categories' ),         );         $rewrite = array(             'slug' => 'type',             'with_front' => true,             'hierarchical' => true,         );         $args = array(             'labels' => $labels,             'hierarchical' => true,             'rewrite' => $rewrite,         );         register_taxonomy( 'product_category', 'product', $args );     }     add_action( 'init', 'my_taxonomies_product', 0 );


title: How to get all post titles starting with numbers and symbols?

text:
I want to get all posts which are starting with a number (0-9) or symbols, in a list. I managed to get it work for letters, but this one is harder for me. Can someone help me out please? I tried adding this in my existing code, but it didn't work:               $this_char = strtoupper(mb_substr($post->post_title, 0, 1, 'UTF-8'));     if (strpos('0123456789',$this_char) !== false) $this_char = '0-9';     if ($this_char != $last_char) {      This is my code:               <?php                $first_char = 'A';              $postids=$wpdb->get_col($wpdb->prepare("         SELECT      ID         FROM        $wpdb->posts         WHERE       SUBSTR($wpdb->posts.post_title,1,1) = %s         ORDER BY    $wpdb->posts.post_title",$first_char));              if ($postids) {         $args=array(           'post__in' => $postids,           'post_type' => 'post',           'post_status' => 'publish',           'posts_per_page' => -1,           'caller_get_posts'=> 1,           'orderby'=> 'title',           'order' => 'ASC'         );         $my_query = null;         $my_query = new WP_Query($args);         if( $my_query->have_posts() ) {          echo 'test test '. $first_char;                while ($my_query->have_posts()): $my_query->the_post();           ?>

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

             <?php                endwhile;         }         wp_reset_query();  // Restore global post data stomped by the_post().         }         ?>

      Note: I want all of these symbols and numbers on 1 page.


title: Trigger Submit Event when Widget is added to Sidebar

text: I need to trigger the submit or "Save" button for a widget when the widget is added to a specific sidebar in the backend. The reason for this is I am setting a certain taxonomy for a Dropdown Menu inside each widget. The code for setting the taxonomy works fine as long as after adding a widget you hit the "Save" button or refresh the page after the widget has been added. Here is my code inside jQuery I am using to capture the Ajax event when a widget gets added to a sidebar and to trigger the submit button to force a Save action.               $( document ).ajaxStop( function() {         var $saveBtns = $('#products_sidebar').find('input[submit]').trigger('submit');     } );       I am capturing the Ajax event correctly and able to console out the contents of the sidebar:               console.log("sidebar: " + $('#products_sidebar').html() );      However the submit action is not getting triggered. thanks


title: How do i add custom fields to my themes template file?

text:
I am using 4 custom fields and display the custom fields in my theme page by               $quote_text_1 = get_post_meta($post->ID, 'quote_text_1', true);     $quote_text_1_author = get_post_meta($post->ID, 'quote_text_1_author', true);     echo '
'.$quote_text_1.'
'.$quote_text_1_author .'
';          $quote_text_2 = get_post_meta($post->ID, 'quote_text_2', true);     $quote_text_2_author = get_post_meta($post->ID, 'quote_text_2_author', true);      echo '
'.$quote_text_2.'
'.$quote_text_2_author.'
';      How can I add the custom fields to specific theme template page, so the user knows he/she can use these fields?


title: Simple WP Plugin with plugin settings page

text:
I need to create a plugin with only one select on his settings page and save select value. I have a select with all register menus and I can not to save my select value. What am I doing wrong? What I have tried so far.               if(isset($_POST['av_menu_selector'])) {         $locations = $_POST['av_menu_selector'];         }          function av_register_settings() {         register_setting( 'av_theme_options', 'av_options', 'av_validate_options' );     }     add_action( 'admin_init', 'av_register_settings' );          function av_mobile_menu() {        av_mmenu();     }     add_action('wp_footer', 'av_mobile_menu');               function av_mobile_menu_plugin_settings() {     add_menu_page('AV Mobile Menu', 'AV Mobile', 'administrator', 'av_mobile_menu_settings',     'av_mobile_menu_display_settings');     }     add_action('admin_menu', 'av_mobile_menu_plugin_settings');          function av_mobile_menu_display_settings() {                  $menus = get_registered_nav_menus();              $info = '

Some info here =)

';          $html = '
<form action="options.php" method="post" name="options">'.     wp_nonce_field('update-options') .'
Select Your Menu
';             $html .= '<select name="av_menu_selector" id="av_menu_selector" >';              $locations = array();              foreach ( $menus as $location => $description ) {                         $html .= '<option value="'.$location.'">' . $description . "</option>";             array_push($locations, $location);                 }              print_r($locations);              $html .= '</select>

';             $html .= '<input type="submit" name="Submit" value="Save MENU" /></form>
';              echo $info;         echo $html;          }          function av_mmenu() {         global $location;         $menu_args = array(             'theme_location'  => $location,             'menu_id'           => 'av_mobile_menu_holder'         );              wp_nav_menu( $menu_args );     }


title: Contact form with dynamic recipient

text: I am creating profiles of people where each person is a custompost; I need my customposts have a contact form send mail to different recipient. I have already created a Metabox in which to put the email address (With MetaBox plugin):               ...          array (                 'name' => 'Email',                 'desc' => 'email address',                 'id' => 'people_email',                 'type' => 'text',             ),     ...      without problem I can get the data like this:               $emailPeople = get_post_meta($post->ID, 'people_email', true);     echo $emailPeople;      now I need to send the form to the email you enter in this field. I found this plugin: http://sevenspark.com/goods/contact-form-7-dynamic-text- extension but doesn´t work for me and i would like to know another method. Thanks!


title: Register_post and add_menu & add_submenu conflict?

text: I want use register_post to get wordpress template for create my own post.                $product_label = array(            'name' => __('Products','neocom'),       'singular_name' => __('Product','neocom'),       'add_new' => __('Ajout d\'un nouveau produit','neocom'),       'add_new_item'    => __('Ajout d\'un nouveau produit 2','neocom'),       'new_item'    => __('Ajout d\'un new produit','neocom'),       'edit_item'   => __('Edit produit','neocom'),       'view_item'   => __('View product','neocom'),       'all_items'   => __('Liste des produits','neocom'),       'not_found'   => __('Pas de produits enregistré'),       'menu_name' => __('My product name menu','neocom'),          );               register_post_type('product', array(      'labels' => $product_label,      'singular_label' => __('Product'),      'public' => true,      'show_ui' => true,      'capability_type' => 'post',      'show_menu_ui' => 'neo-product',      'hierarchical' => false,      'supports' => array('title', 'author', 'thumbnail')     ));      I want to do appear List's product and New product and my own admin menu. I have added show_menu_ui => 'neo_product'. The result , i have my product list but haven't new product. I have defined admin_menu like it :               add_action('admin_menu',array($this,'buildMenuAdmin')); // On my constructor      buildMenuAdmin function :                add_menu_page('NeoptinCom','Neo_Com',$capability,'neo-product',array(&$this,'neoproduct_all'));           // Gestion page product & hook pour le css         //Page product ( Liste )         $product_page = add_submenu_page('neo-product', __('All Product','neocom'), __('Products','neocom'),$capability,'neo-product',array(&$this,'neoproduct_all'));         add_action( 'admin_head-'.$product_page, array(&$this,'admin_header') );          // Page Creation/Modification de produit     $product_page_create = add_submenu_page('neo-product', __('Create Product','neocom'), __('Create Product','neocom'),$capability,'neo-product-create',array(&$this,'neoproduct_create'));     add_action( 'admin_head-'.$product_page_create, array(&$this,'admin_header') );     error_log('Page=> '.$product_page_create );     //Page paiement     $paiement_page = add_submenu_page('neo-product', __('Paiement','neocom'), __('Paiement','neocom'),$capability,'neo-paiement',array(&$this,'neopaiement'));     add_action( 'admin_head-'.$paiement_page, array(&$this,'admin_header') );


title: What is a good free subscribe list?

text: I tried 3 different plugins and they ALL didn't work. I would like a plugin that allows me to put a widgit into the sidebar. Configure a redirect page to say thank you and a way to get a list of the emails (preferably with signup date and name. csv is nice) Is that so much to ask for... If it can shoot everyone an email on signup that be nice too


title: how to activate a plugin inside a theme

text: Iam trying to activate a plugin which is inside my theme template directory, ie : i have a folder called plugin inside my current theme, which has some plugins how can i activate those plugins from the current plugins options.


title: Customised plugin failed to install and activate

text: I am trying to customise a plugin to add some functionality that is not part of the original. To do this I have copied all the files into a new folder, and renamed all the function prefixes, changed the header of the main php file. I have tried uploading the files straight to the server for activation but it was not picked up by WP so I zipped all the files to install them "properly" and it came up with the following output: > Unpacking the package… > > Installing the plugin… > > The package could not be installed. No valid plugins were found. > > Plugin install failed. > > _http://www.mydomain.com/wp-admin/update.php?action=upload-plugin_ Thinking that this may be a header problem I double checked my header but it all appeared to be correct, to my eyes at least.               /*     Plugin Name: MC Investment Custom     Plugin URI: http://www.spectra-info.com/wp/plugins (Original)     Description: Customised plugin based on the MC Investment Plugin.     Version: 1.0     Author: Edited by Joshua Ward Original by Spectrain     Author URI: http://www.spectra-info.com (Original)     */      But alas, no success. The .zip file has the plugin file in it's 'root' directory so I am fairly confident that is not the problem. Is there anything wrong with the plugin header that I can't see? I have tried it without the `(Original)` in the URI lines thinking that was what has mucked it but it appears not. EDIT: Please stop replacing Customise with Customize. Everybody who types English who is not American, ie me, spell it the British (read: proper) way.


title: Graphic design changes on Staging before moving to Production?

text: I have a Development, Staging and Production workflow for my WordPress site. I am fairly strict about any structural work to be done on the site being done in Staging first, then migrated to Production. I feel some changes may be better done on Production through the admin interface, such as a simple logo change, and some may be better done on Staging then migrated up to Production, such as a theme alteration. Where do you draw the line? What changes would you allow directly on the Production site and what changes would you say have to be done on Staging before being migrated to Production, for safety's sake?


title: get_the_title outputs title until spacing; it does not get full length of title

text: If I have a post with a spacing in it (like: Hello World), than `get_the_title` shows me only "Hello" as a link and not the whole permalink. I already tried using a `substring` to get it done, but it did not work out for me. Am I missing here something? I just used `get_the_title();` and put it in a variable. Code:               <?php     $titletest = get_the_title();          echo " $titletest ";     ?>


title: Remove short link tag from particular page

text: I want to remove the short link header tag from a specific page. Please suggest me a filter guys. I want to remove the entire               <link rel='shortlink'...       section from a specific page. Adding a filter to the wp_shortlink_wp_head will work fine? I am not sure whether i can add filter to the function just like that... Thank you


title: Creating a Link Directory using WordPress?

text: I would like to create a dmoz like website, using WP. Any suggestions on plugins or site's architecture would be welcomed.


title: Custom image sizes

text: I noticed lots of articles on how to add custom sizes for images (media). But how would I be able to add a custom size such as "width:100% and height:auto" this way it will make sure the images are responsive.


title: JavaScript Files Registered in Parent Theme Won't Load When Calling wp_enqueue_script() in Child Theme?

text: I'm making a framework parent theme and in the parent `functions.php`, I want to register all the possible js files I use frequently and if I want it to load it, in the child `functions.php` I just have to use `wp_enqueue_script()`. But it doesn't work... Any clue why?


title: User gets access denied to css files and js files even though user is logged in

text: We are using wordpress as a intranet, we have the AD Integration plugin. Everything is working fine except for one user. Now there is no difference in settings on his machine or user profile or AD profile to any other user. But for some reason when he logs in he gets access denied to all the CSS files and JS files. I know he has logged in successfully because I use console.log to display the username when logged in as well as other details such as full name and job title. The details are retrieved from the wordpress function for current_user so I know he is logged in. Has anyone else had issues with style sheets etc being denied even though the user is logged in?!


title: WP3.5 Media Uploader - how to make it accept multiple images?

text: I'm wondering how to make WP3.5 media uploader return 2 or more items in `attachement`? It always runs once even if 2 items are selected. The code:               $('.button').on('click', function(){          var send_attachment_backup = wp.media.editor.send.attachment;               wp.media.editor.send.attachment = function(props, attachment){                                                    myFunction(attachment.url);               wp.media.editor.send.attachment = send_attachment_backup;          }          wp.media.editor.open();     });      EDIT: My mistake. I'm doing `wp.media.editor.send.attachment = send_attachment_backup;` and it runs once. So the new questions would be: **how to restore the original function after the latest item in the loop?**


title: Inbuilt style for jquery-ui-datepicker

text: I want to use the datepicker that gets bundled with WordPress on the front end of a website. I enqueued `jquery-ui-datepicker` but the datepicker isn't styled(no js error in console). Is there a corresponding `wp_enqueue_style` for that? I used this code in `functions.php`               function rr_scripts() {       wp_enqueue_script( 'jquery' );       wp_enqueue_script( 'jquery-ui-datepicker', array( 'jquery' ) );            wp_register_style( 'bootstrap_css', get_template_directory_uri() . '/assets/css/bootstrap.min.css' );       wp_enqueue_style( 'bootstrap_css' ); # I'm using Twitter Bootstrap as CSS(if it matters)     }     add_action( 'wp_enqueue_scripts', 'rr_scripts' );


title: How to resolve - IE 6 ignores img "width" properties

text: In this post: http://humus101.com/?p=1734 We've got 4 images set (in the img property) to a width of 246 pixel. In chrome it looks fine. In IE6 it doesn't. Any suggestions on how to solve this?


title: How do I make my blog iPad / iPhone / Android friendly?

text: How do I make sure my blog is iPad / iPhone / Android / touch-device friendly?


title: Permissions to get autoupdate to work

text: I'm at version 3.0 and want to move to 3.0.1 without having to download/unzip/delete/upload but I get this error when trying to update: Could not create directory.: /public/wp- content/upgrade/wordpress-3.tmp/wordpress Is is safe to chmod 777 the upgrade folder?


title: Gravity Forms not loading under https, jQuery is not defined

text: I am using Gravity Forms on my Wordpress site, and so far so good. The problem is I have made the page secure (https/SSL), and this is making the form not to work. It looks like the issue is how the site is trying to load jQuery. There are 23 JS errors on the page, which seem to be due to a failed jQuery load `"Uncaught ReferenceError: jQuery is not defined"`. If I go to the page where the source is trying to pull the jQuery file, you'll see the error:`https://code.jquery.com/jquery-1.7.1.min.js?ver=3.4.2` Screenshot of the error:   ![https jquery error](http://i.stack.imgur.com/IqN2A.png)   _click to enlarge_ And this screenshot is the reference in the page source: ![source page](http://i.stack.imgur.com/jHljo.png) So I have been told I'd want to look into that - that's where the ultimate issue is, but I don't really know what to do next. Is it failing because of Gravity Forms, the HTTPS plugin from Wordpress, my SSL certificate...?


title: Change date number to another language/script?

text: I previously was able to change the numbers of the date and time (into a number and date system of another language, like Khmer) for each post using a script like this in my functions.php:               function KhmerNumDate ($text) {     $text = str_replace('1', '១', $text);     $text = str_replace('2', '២', $text);     $text = str_replace('3', '៣', $text);     $text = str_replace('4', '៤', $text);     $text = str_replace('5', '៥', $text);     $text = str_replace('6', '៦', $text);     $text = str_replace('7', '៧', $text);     $text = str_replace('8', '៨', $text);     $text = str_replace('9', '៩', $text);     $text = str_replace('0', '០', $text);      return $text;     }               add_filter('date', 'KhmerNumDate');     add_filter('the_date', 'KhmerNumDate');     add_filter('the_time', 'KhmerNumDate');      But now it is not working - is my code good? Would the code differ based on which theme I am using (I am currently using a modified child theme of Twenty- Twelve)?


title: How can I create an affiliate program in WordPress?

text: Suggestions for plugins, best practices, etc. welcome.


title: Contact Form on WordPress Sites?

text: How does one go about building a page in wordpress that contains a contact form full of custom fields, boxes, inputs, etc. completely determined by the author of the site. It seems odd that wordpress currently lacks this feature, but knowing the wordpress community, it's unlikely that we must do without.


title: WordPress performance issue. Can I debug it?

text: I have a web site, that while working properly, every day, at 11:00am using a huge amounts of the server resources. The web hosting account contains only the WordPress, and I don't have any other software installed. Also, the hosting account is based on Cloud Linux, that means I can have statistics about my account resource usage. Bellow you can see what is the resource usage of my account:               Your site has been limited within the past 24 hours     CPU resources were limited for your site     You have reached processes number limit 8 times     Your site might hit resource limits soon     Your Physical Memory usage was at 999.7M out of 1000.0M     You had 4000 I/O usage out of 4000 max I/O usage allowed      What I like to ask, is for any script, wordpress plugin or anything else that can help me identify, why I have that issue every day at the same time. Note, already, I have use a plugin to get the WordPress schedule, and the schedule is ok. There is no, any action that run at 11:00 am. Also the server has no any cron job that run at the same time.


title: Production Website Frozen at /wp-admin/upgrade.php

text: My client upgraded the production Wordpress site to 3.5.2 without disabling the active plugins. He called when the site froze at upgrade.php. I opened the database and updated the wp-options table to set db_upgraded to 0. I renamed /wp-content/plugins to disable all plugins, enabled WP_ALLOW_REPAIRS and the repair page reported all OK. I closed the browser, reopened it, cleared the cache and went back to /wp-admin. Without even asking for login information, the page redirects to /wp- admin/upgrade.php. The frontend of the site remains functional. I do not know what else to do. PLEASE HELP!


title: Issue with sidebar widgets not showing when I do custom queries

text: I'm having issues with this. I have 2 while loops, each getting different custom post types. They both work fine, except, my sidebar content i.e. widgets, is not appearing. I think this is because I am not running the default query. My two queries are:               query_posts('post_type=offered');      while (have_posts()) : the_post(); ?>     ....content     endwhile;      and               $wanted_query = new WP_Query('post_type=wanted');     while ($wanted_query->have_posts()) : $wanted_query->the_post();     ....content     endwhile;      However, when I try to combine them as below, I get the sidebar content but no my posts!               global $query_string;     query_posts( $query_string . '&post_type=offered' );


title: How to hide plugin options for editors via functions.php

text: I've read the entry **_Best Collection of Code for your functions.php file_** , it really help me a lot. I only got a question, **is there a way to hide some plugins options (in their respective administrations), just like the way you hide the widgets at the dashboard?**. This because I have to let the editor manage some parts of the plugin, but not all (for example, in a slider, he/she must edit the images to display, but not the dimensions of the slider).


title: How to properly turn off REVISIONS and AUTOSAVE for whole site and optionally for a custom post type only

text: Is there a hook/function combination that can be added to my theme's `functions.php` to properly disable REVISIONS and AUTOSAVE for the entire wordpress installation? What about if just for a certain custom post type? Searching online gives various hacks from deregistering scripts to tampering with core files. What's the acceptable/correct way to do this?


title: WordPress installation does not get completed in WAMP server

text: I have installed WAMP server on Windows 8 and am trying to install WordPress on it, but while installing it, I could not complete it. It's showing me the error like               http://localhost/wordpress/wp-admin/install.php?step=2      After that, the process stops. I referred to the question _Wordpress Installation not getting completed_ , but it could not help me. How can I fix this problem?


title: How to get custom image field of specific post id

text: I have a page where I'm pulling in content from another post, outside of the loop. I've been successfull at getting the content of the specified post, but I cannot get the image from a custom field (advanced custom image field). This is working to get the content from the post who's ID is 299:               $my_id = 299;     $post_id_299 = get_post($my_id);          $content_299 = $post_id_299->post_content;     $content_299 = apply_filters('the_content', $content_299);     $content_299 = str_replace(']]>', ']]>', $content_299);     $content_299_chars = 238;      $modcontent_299 = substr($content_299, 0, $content_299_chars);      `<p><?php echo $modcontent_299; ?></p>` This is what I'm after to get the image from the post who's ID is 299 (if it exists):               $attachment_id = get_field('image', 299);     $size = 'full';     $image = wp_get_attachment_image_src( $attachment_id, $size );           if( get_field('image') ):        echo '<img src="' . $image[0] . '" alt="' . the_title() .'" width="238" height="158" />';     endif;       I'm sure I need to change some of these variables to get the image field from the specific post id, similar to how it's done to get the content, but I'm confused at this point as to how to do that for a custom field...


title: querying user bookmarks from a large number of bookmarks

text: I am trying to access the bookmarks created by a single user. The key is stored in the links table, attribute link_owner. However, get_bookmarks() seems to load the entire table and all I am left with is to parse the table and filter the rows with a matching userid. For my application I expect the number of links to be rather large (more than 10,000). Am I to old school to fear that this usage case will slow down things bigtime? What other ways are there to do this a bit more efficiently? WP_Query seems to apply only to posts. Or should I go and use SQL right away?


title: remove admin bar new post/link/media sub menu

text: I wish to remove the sub menus of post/link/media under the add new menu in the admin bar. I can remove the entire menu but I actually only want to remove the sub menu's               $wp_admin_bar->remove_menu('my-account-with-avatar');


title: How to Sort the Favorite Plugins Screen Alphabetically?

text: When viewing the Favorite Plugins tab, `/wp-admin/plugin- install.php?tab=favorites`, the list comes unordered, is it possible to sort it from A to Z? ![favorite plugins screen](http://i.stack.imgur.com/0DyUr.png)


title: Do not show a custom post if it belongs to a certain custom taxonomy

text: I am trying to block the visualization of a custom post, of type 'product', if it is assigned to certain values of the taxonomy 'product_cat'. Strictly speaking, I would like to block the visualization of a product if it falls under certain categories. I can not make this work, even by hardcoding a forbidden name for a product_cat ('plus' in this example).               function filter($query){        if ($query->is_single && is_main_query()) {             $tax_query = array(                 array(                     'taxonomy' => 'product_cat',                     'field' => 'name',                     'terms' => array('plus'),                     'operator' => 'NOT IN',                 )             );             $query->set( 'tax_query', $tax_query );             return;         }     }     add_filter('pre_get_posts','filter');      If I try to visualize a product falling under the 'plus' category, Wordpress shows it despite this filter. What am I missing here? Cheers! Edit: This code goes in a Wordpress plugin, I forgot to mention this. I am not allowed to touch any template..


title: wordpress page as website

text: I have a website related to information about local info / businesses in certain city and I would to offer business owners in that city a 'one page website'. Their 1 page website is basically using my wordpress page and the address should look like: mycity.com/website/business-name. Any advice on how to automate this process i.e form to get business name, address, header pictures and description. I'm thinking of something like creating facebook page. This way i dont have to deal with all of the repetitive task to create a standard looking page. Let me know also if there's a theme for this kind of function


title: Problem with adding a new post type

text: I want to add a new post type i have a php file (posttype.php) at : wordpress/wp-content/themes/ this is the code :               <?php     // Add new post type for Recipes     add_action('init', 'cooking_recipes_init');     function cooking_recipes_init()      {         $args = array(             'label' => _x('Recipes'),             'singular_label' => _x('Recipe'),             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,              'query_var' => true,             'rewrite' => true,             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => null,             'supports' => array('title','editor','comments')         );          register_post_type('recipes',$args);     }     ?>      i have a problem at the top of the page (but the posttype is created suc) :               Warning: Missing argument 2 for _x(), called in D:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 12 and defined in D:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189          Warning: Missing argument 2 for _x(), called in D:\xampp\htdocs\wordpress\wp-content\themes\posttypes.php on line 14 and defined in D:\xampp\htdocs\wordpress\wp-includes\l10n.php on line 189      Thank you .


title: Recent posts script mess up blog posts

text:
I use this script to display recent posts:
     <?php query_posts('showposts=5'); ?>          <?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?>

<?php the_content_limit(250); ?>
     <?php endwhile;?>
      I put this in the header.php. It does the job, but also all other posts and pages gets messed up. When I try to load any ordinary page (page.php) I get only content from two blog posts and similar problems. It is not the issue with the_content_limit. I also tried excerpt - and its the same. Any ideas how to avoid the problem but still have recent posts?


title: How to add thumbnail images? (Set Featured Image doesn't work)

text: How do I add thumbnail images to the list of blog posts at http://richardclunan.com/blog/ ? When I'm creating or editing a blog post, if I use the Featured Image link at the bottom right in the admin panel, no thumbnail appears by the corresponding blog post excerpt in the list of blog posts. I'm using theme twentyeleven, with some modifications in a childtheme file. ................................. Edit: Here's what I did, and the thumbnails are still not showing: I added an image to use as a thumbnail, using the Media Library. I added a 'Featured Image' in 'Edit Post', and in Edit Post, an image is showing there, so that looks like it should be working. I added the url of the thumbnail in 'Custom Fields' in Edit Post. But on the blog page, there's no thumbnail showing: http://richardclunan.com/blog/ -- the second post down 'Whodunnit...' is the post I added a thumbnail for. (I don't know if the following is relevant, but I have a childtheme of twentyeleven. If I switch back to the twentyeleven theme, the Blog page disappears from the menu on the site, but I can still navigate to http://richardclunan.com/blog/ and still no thumbnail appears on that post.) I've also tried installing the plugin 'Thumbnail for Excerpts' and thumbnails still don't show


title: How do you use a CPT as the default home page?

text: I have a client who's site will be making heavy use of custom post types to configure their site. But I'm between a rock and a hard place for their requested home page. In reality, the home page will be a stack of specific "pages" within WordPress. Basically, there will be pages for: **Intro** , **Blog** , **About Us** , **Portfolio** , and **Contact Us**. They'll all be stacked on top of one another so you can scroll from one page to another. My first instinct was to just use a page (called **Home** ) and embed a shortcode that accepts page slugs and outputs the proper order (i.e. `[pageOrder]intro, blog, about-us, portfolio, contact-us[/pageOrder]`). The page would use a custom page template to lay things out, control the loop, and add navigation to the left side of the page. But that all seems klunky. My _ideal_ solution would be to create a custom post type (called **Stack** ) that allows the end user to position the pages with drag-drop and have the CPT take care of layout and navigation and such. The problem with my ideal solution is settings. WordPress allows you to select a page for the default home page of the site. But it's tied to a post type of **page** , and I'm not sure where to hook in to modify that so that users could also select a **Stack** as the default home page. So, where do I hook in to in order to add a CPT to the dropdown of available pages for the default home page?


title: Allow users to exclude categories? (WP 3.1.2)

text: How do I let users exclude/include specific categories, so that everything (archives, search, etc) is limited to those categories? I've seen admin-side plugins that let _me_ limit what others see, but not ones that let users choose what categories to see. Ideally, this would even work for unregistered users.


title: How to add the same widget twice?

text: I noticed that if you put the same widget in two different widget slots (primary and secondary for instance) only the first one will appear on the page. The second slot will be empty. How to solve that problem and allow my widget (a custom menu) to appear twice on my page ?


title: How can I change the frequency of a scheduled event?

text: I have declared a scheduled event in a plugin like this :               function shedule_email_alerts() {         if ( !wp_next_scheduled( 'send_email_alerts_hook' ) ) {             wp_schedule_event(time(), 'hourly', 'send_email_alerts_hook');         }     }      Then i wanted to change the frequency to 'daily', by doing so, replacing the original function with :               function shedule_email_alerts() {         if ( !wp_next_scheduled( 'send_email_alerts_hook' ) ) {             wp_schedule_event(time(), 'daily', 'send_email_alerts_hook');         }     }      But it seems that my event is still fired every hour. I use the Core control plugin to monitor CRON tasks and it still shows as 'once per hour'


title: Clear cache when a post is submitted

text: I have a question. How can I clear the cache when a post is submitted ? Actually, I need to clear two speficied pages which display these articles ? By default, I have noticed the `index.php` is cleared automatically when a post is submitted. But not `Archive page` or `Category page`... Thanks in advance. EDIT : By the way, how to clear only a specific page with W3 Total Cache ? Example : Clear `/blog.php`


title: Flipping Book PHP Code? Any experience?

text: Hi there guys quick question, using FlippingBook and calling a gallery within a page or post is with something like this: `[book id='1' /]` but I want to call the gallery directly from my code, so is there any php code to achieve this? Thanks guys! Arturo http://wordpress.org/plugins/page-flip-image-gallery/


title: How to remove custom background?

text: I'm using WordPress 3.5.1 and twentyten. I want to remove the support for custom background. I found this text: http://codex.wordpress.org/Function_Reference/remove_custom_background but i'm a newbie in php, so I dont know what to do whit the information. I guess I should use this code `<?php remove_custom_background() ?>` but what to do with it? where should I put it? Thanks! /Frida