title: wpdb-> not adding prefix to custom table

text: I know it should work with custom table and I think it worked in previous development I believe. But this time I don't know whey it is not getting custom table with `$wpdb->tablename` Code:               global $wpdb;         $items = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->review_media"));      This is not giving any result but when I tried with `$wpdb->prefix than it works               $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM ".$wpdb->prefix."review_media"));      Any idea


title: wp_generate_password sets password but can't login using created password

text: Im creating a simple login/registration page incorporating user moderation and bootstrapping wp for the heavy lifting. I can get the new user added to the db and a password gets created and hashed and all, but when i go to login w/ that account the password won't work. i'm stumped... Anyone see anything i'm missing?               require_once( ABSPATH . WPINC . '/registration.php' );     $user_pass = wp_generate_password();     $userdata = array(       'user_pass' => $user_pass,       'user_login' => esc_attr( $_POST['user_email'] ),       'user_email' => esc_attr( $_POST['user_email'] ),     );          if( !$userdata['user_login'] )       $error .= __('An Email Address is required for registration.', 'frontendprofile');     elseif ( username_exists( $userdata['user_login'] ) )       $error .= __('Sorry, that Email Address is already in use for another account.', 'frontendprofile');     elseif ( !is_email( $userdata['user_email'] ) )       $error .= __('You must enter a valid Email Address.', 'frontendprofile');     elseif ( email_exists( $userdata['user_email'] ) )       $error .= __('Sorry, that Email Address is already for another account.', 'frontendprofile');          else{       $new_user = wp_update_user( $userdata );     }      thanks in advance,


title: How might I setup a development server (local) and a test/production server (remote)

text: I am thinking, how might I setup a development server locally then when done, upload and sync files + data to test/production server? I think options like `siteurl` and `home` in `wp_options` database table will need to be changed, also, in `wp-config.php` some settings like database connection and debug mode will be different too.


title: get_attachment_link() adds a hashtag to URL

text: I'm using the get_attachment_link() function in a site I'm developing and it's returning a really weird result. For some reason it adds #main at the end of every url. http://domain.com/post_title/attachment_title/#main Am I the only one getting this strange result? Any ideas?


title: How to add a Reset to Defaults button with Settings API?

text: **How can I add a reset button when using the Settings API?** I've have something like this that's storing my defaults:               $slider_options = get_option( 'nextslider_options' );           /* Define the array of defaults */      $defaults = array(         'width'             => 0,         'height'            => 0,         'effect'            => 'fade',         'bullets'           => 0,         'arrows'            => 0,         'slidelength'       => 4000,         'animationlength'   => 600     );          $slider_options = wp_parse_args( $slider_options, $defaults );      As a boilerplate I've used the Settings Sandbox.


title: Using a string from a custom field within a link

text: I want to show the image only if there is info in the field. And the link around the image uses the info in the field. The mailto: field is coming up blank. So I'm guessing/hoping I'm doing something wrong with the way I'm printing/calling it. I would greatly appreciate any help.               <?php $email = types_render_field ("email");               if ( $email ) { ?>                <a href="mailto:<?php $email ?>"><img src="<?php bloginfo( 'template_url' ); ?>/images/icon-email.gif" width="24" height="24" />     <?php } ?>      In case it's relevant, I'm using the Types plugin to create my custom fields.


title: Hook after wp_enqueue_scripts

text: I want to perform action when scripts are loaded. I mean when scripts are enqueued i want to take some action. Is there a hook after_wp_enqueue_scripts?


title: custom comment_form fields not displaying

text:
My ideal comment form will have 3 fields- Name, Location, Comment. I'm using the following bits of code- comments.php               <?php comment_form(         array(             'fields' => apply_filters( 'comment_form_default_fields', $fields ),             'comment_notes_after' => ' ',             'title_reply' => 'Please feel free to share your home owning hopes, dreams, or concerns?',             'logged_in_as' => '',         )     ); ?>      functions.php               <?php          function my_fields($fields) {     $fields['Name'] = '
Name
';     $fields['Location'] = '
Location
';     return $fields;     }     add_filter('comment_form_default_fields','my_fields');          ?>      As you can see on the live site, that's not working. Any ideas why/how to remedy?


title: problem including page template

text: I am creating a one page wordpress site. The code I am using does work but for some reason it will not include page templates. It only gets the content from the page editor but will not get the custom html that is inside the page template so I am trying to include the file. I am getting error messages that say include() : "Failed opening"                $template = get_post_meta( get_the_ID(), '_wp_page_template', TRUE );       $file = get_template_directory_uri() . '/' . $template;      include($file);      I am confused here because the path that it is giving me is the correct path for the file. I have 4 templates in my theme and from the code above, One template did get included but the other three have failed.


title: Display post links under month in paginated archive

text: I'd like to create an archive that lists posts under a month header. The months would just be plain text and the post titles, obviously, would link to the posts themselves! So: **October 2013**   * Post title 1   * Post title 2 **September 2013**   * Post title 1   * Post title 2 **August 2013**   * Post title 1   * Post title 2 . . . and, if possible, only show one year per page! So, uhhh, I guess it's paginated too. Is this possible? Probably. I've seen a few threads that deal with similar requests, but nothing quite like this. Or maybe I'm just bad at searching. Can anyone help me out? Thanks!


title: Image media upload problem for images > 800px?

text: I am getting the pink HTTP error message when i try to upload certain images. I narrowed it down to the following, it only seems to happen for images > 800px. But when i refresh the media the particular image is shown and hence uploaded. Is there any image upload setting which sets the max width, height to 800px?? regards


title: Difference between w3total cache disk enhanced and disk basic

text: Regarding the w3total cache working mechanism, I searched the internet but couldnt find any proper information regarding these two. What is the difference between the disk enhanced and disk basic in w3Total cache.And why is disk enhanced preferred over disk basic? What the advantages and disadvantages of using the options disk enhanced and disk cache repectively?


title: Normal pages as children of my Custom Post Type

text: This one is tricky, I've got Custom Post Type called "dictionary", users add "definitions" there which are automagically put into right categories (so for example if user adds "Apple" it's under "A"). The URLs look like this:   * blog/dictionary/ - dictionary welcome page    * blog/dictionary/x/ - listing of definitions starting with "x" letter   * blog/dictionary/x/Xavier - definition of word "Xavier" Now, I want to add normal WordPress pages and somehow display them under:   * blog/dictionary/rules    * blog/dictionary/author etc. I'm creating new pages and setting "Dictionary" page (blog/dictionary) as their parent, so they're where they supposed to be, but display _NOTHING AT ALL_ , no content, nothing. I have absolutely no idea how to resolve it. I can't add them to "dictionary" custom post type as it holds definitions only. Any ideas? I'd rather avoid mod_rewrite (as I want my pages to be children of "dictionary" not hard-linked normal pages). **In short words: I need two types of elements under one Custom Post Type.** **UPDATE** Looks like when my "dictionary" is a a child itself it works, for example:   * blog/dictionary/authors - displays nothing   * blog/page1/dictionary/authors - displays authors page Why is that?


title: Remove post title input from edit page

text: I'd like to remove the post title input on a (cpt) post edit page (backend) based on user's capabilities. I have already found Stack Overflow question dealing the problem. However, the solution in involves editing the WordPress core files. I don't like it that way. Is it possible to achieve the hiding (or removing) with a plugin? Currently I do not know or do not see how the plugin should hook into WordPress.


title: Why does apply_filters behave different inside and outside a loop?

text: **What I want** : the array of posts returned by creating `$query = new WP_Query($args);` **Why** : to return specific content as a sort of API request in json format, ready to display on another site * * * **What I tried first** :               foreach($query->posts as $post) {         $post->post_content = apply_filters('the_content', $post->post_content);     };      This performed the `autop` and `do_shortcode` filters correctly, but no the `oembed` transformation. * * * **What I ended up doing** :               while($query->have_posts()) : $query->the_post();         $query->posts[$query->current_post]->post_content = apply_filters('the_content', get_the_content());     endwhile;      The only difference in output, is that inside the loop it performs the oembed, outside it does not. Where does this difference come from, and is there a better way I should have done this? I checked `global $wp_filters` and `oembed` is definitely listed under `[8]`, so it wasn't a filter loading issue.


title: Site Structure Regarding Custom Post Types and Taxonomies

text: I need assistance with site structure with regard to properly setting up my Custom Post Types and Taxonomies. I am developing a lifestyle site. It will not be a WP multi-site configuration. This site will focus on several cities with several categories/topics and sub cats/topics.   * domain      * City        * City Topic          * City Topic Sub            * City Topic Sub Sub domain_name/city/city_topic/city_topic_sub/city_topic_sub_sub/ As you can imagine there is a lot of “cross pollination” of all of these post. For example a topic or sub topic may be relevant and therefore associated with more than one city eg a specific post on heath topic might appear in all cities. Or a maybe another post might only be associated with just 2 cities. There will also be an “all cities” for readers that do not live within the area of a city that we have. My first question is how is the best way to structure the backend with regard to CPT’s and Taxonomies. I know there are a lot of ways “to skin a cat” but I need to set it up to give me the most flexibility for future expansion and also provide the most flexibility with regard displaying the content within the database in various scenarios. I know I want/need to utilize custom post types to segment all the numerous posts that will be within this site. My current thoughts are to utilize Pippins “Content Post Type” plugin for the creation and management of the CPTs, Taxonomies and Meta Info. I also think that Scribu’s “Posts 2 Posts” plugin would play a part in this based on it’s many-to-many post relationship capabilities, but for the life of me I can’t figure it out. Any advice would be appreciated.


title: All pages lead to home

text: I've recently moved from linux to windows hosting, and now all of my permalinks just redirect to the homepage. I've selected the correct structure in Settings->Permalinks and have the following in my web.config. Hopefully I'm making a daft mistake - any ideas?                   <rewrite>             <rules>                 <!--rule name="Convert to lower case" stopProcessing="true">                   <match url="[A-Z]" ignoreCase="false" />                   <action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent" />                 </rule-->           <rule name="wordpress" patternSyntax="Wildcard">             <match url="*" />             <conditions>               <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />               <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />             </conditions>             <action type="Rewrite" url="index.php" />           </rule>                 <rule name="wordpress alt">                     <match url="^/(.*)$" />                         <conditions>                             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />                         </conditions>                     <action type="Rewrite" url="index.php" />                 </rule>                 <rule name="wordpress2">                     <match url="(?!index\.php|wp-|xmlrpc)(.*)" />                         <conditions>                             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />                             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />                         </conditions>                     <action type="Rewrite" url="index.php/{R:0}" />                 </rule>             </rules>         </rewrite>


title: What are the really difference writing WordPress 3.x widget plugins?

text:
I have read a lot of turorials an even the codex widget API, but can't solve my doubts: What are the really difference writing WorPress 3.x widget plugins? if there exists. this doubt came when trying to create plugin containing an widget I have actived `WP_DEBUG` and saw the notice that `register_sidebar_widget()` is deprecated and I should use `wp_register_sidebar_widget()` instead. So I have changed and now I get: > Notice: Uninitialized string offset: 0 in /.../wp- > content/plugins/raz/index.php on line 54 > > Notice: Uninitialized string offset: 0 in /.../wp- > content/plugins/raz/index.php on line 55 > > Notice: Uninitialized string offset: 0 in /.../wp- > content/plugins/raz/index.php on line 55 Here is the code:               <?php          // widget to show an iframe containing Brazilian CPTEC weather forecast     function previsao_tempo_cptec_widget_display($args) {            // print some HTML for the widget to display here       print $args['before_widget'];       print $args['before_title'] . "Previsão IN TITLE do Tempo - CPTEC" . $args['after_title'];            //  print "content of the widget";       print 'Previsão de Santa Maria/RS oferecido por CPTEC/INPE';       print $args['after_widget'];             }          // Activate the sidebar     wp_register_sidebar_widget(             'TempoCPTEC_1',           'Previsão de Tempo - CPTEC',              'previsao_tempo_cptec_widget_display',           array(             'description' => "Este  widget mostra a previsão de Tempo  pelo CPTEC - INPE/BR"               ),         array(         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
'         )     );               // Loads the widget     add_action('widgets_init','previsao_tempo_cptec_widget_display');     ?>      Other doubt, why this widget is always displayed in the top of my website and in the sidebar widgets also? Thanks for any incoming handy answer.


title: Inserting a shortcode into a genesis menu?

text:
I'm trying to insert a shortcode as the last item in a menu but it results in creating the `<li>` but then throwing the shortcode output elsewhere, outside of the list. It also removes the closing `<li>` for that menu item? In functions.php (as per Jared's answer below)..               <?php         // Add Cart Contents to End of Nav         add_filter('wp_nav_menu_items','my_item', 11, 2);         function my_item($items, $args) {             $items .= '
' . do_shortcode('[shopping_cart empty_msg="You have no items in your basket"]') . '
';             return $items;         }     ?>      The output is:

asdfy

asdf

          You have no items in your basket

asdf

asdf

asdf

asdf

asdf

asdf

asdf

      Edit: Cart66ShortcodeManager.php                 /**        * Short code for displaying shopping cart including the number of items in the cart and links to view cart and checkout        */       public function shoppingCart($attrs) {         $cartPage = get_page_by_path('store/cart');         $checkoutPage = get_page_by_path('store/checkout');         $cart = Cart66Session::get('Cart66Cart');         if(is_object($cart) && $cart->countItems()) {           ?>
             <a id="Cart66scCartLink" href='<?php echo get_permalink($cartPage->ID) ?>'>             <?php echo $cart->countItems(); ?>             <?php echo $cart->countItems() > 1 ? ' items' : ' item' ?>              –                                       <a id="Cart66scViewCart" href='<?php echo get_permalink($cartPage->ID) ?>'>View Cart              |              <a id="Cart66scCheckout" href='<?php echo get_permalink($checkoutPage->ID) ?>'>Check out
           <?php         }         else {           $emptyMessage = isset($attrs['empty_msg']) ? $attrs['empty_msg'] : 'Your cart is empty';             //echo "
$emptyMessage
";             echo "$emptyMessage";         }       }


title: Caching and cookie-based redirects

text: Been banging on this for a while now, and I can't seem to make anything work, so I figured I'd ask here. I'm developing a site that contains age-restricted content. Every page runs a check to see if you've got a pre-defined cookie (and value) set, and if you do, you're sent on your way to the page you've requested. If you don't, we send you to an age check page where you're asked to enter your DOB, etc. If your DOB checks out, we set the aforementioned cookie and send you on your way. If it doesn't, we set it to a fail status and notify you to come back when you're of age, etc... This check is currently running on `template_redirect` All of this works fine, but we need to add some caching to the site. I've been tinkering with W3TotalCache, but I can't seem to tell it to only serve the cached pages to users who have the cookie set to the "age is valid" value. If I enter the cookie name in the Rejected Cookies box, then it doesn't cache ANY page, because every page checks the cookie (again, it's happening on template_redirect). I've also been trying to do the check at the .htaccess level, but that's constantly redirecting people to the age check page, so there's clearly something wrong there (my .htaccess-fu isn't all that). Any recommendations on solutions (either using W3TC or other caching plugins), or other ways to work around this? I don't want to use JS to do the detection and redirect, because that opens up a security issue whereby the page needs to begin loading before we do the check. This needs to happen prior to anything coming back from the server.


title: Is having thousands of unique categories a concern?

text: I'm in the process of creating a lyrics website using WordPress. Each post consists of a song, and I figured for ease to make each category represent the song artist. With this in mind, the site will be host to many many posts and likely thousands of different categories. I've heard rumors that not necessarily the posts but having that many unique categories can affect the speed of the site. Is this true, or should I be using some custom field solution to represent song artists? Thanks!


title: Handling the response sent from a ruby on rails application in wordpress

text: I am using my rails application to send data to a wordpress site. Basically if a user has wrong password, I am going to end the reverse proxy and redirect the user back to the wordpress site but I want to pass data along. In Rails, I use Net::HTTP to send data to another server: http://ruby-doc.org/stdlib-1.9.3/libdoc/net/http/rdoc/Net/HTTP.html Now in WordPress I'm not sure how to receive it. thanks for response


title: Query Users by login, meta & role

text: I'm using pre_user_query to limit the results shown on the users.php page. I am limiting it by role & also by a meta field, so my query **from** like this:               $query->query_from = "          FROM wp_users           INNER JOIN wp_usermeta ON (wp_users.ID = wp_usermeta.user_id)           INNER JOIN wp_usermeta AS mt1 ON (wp_users.ID = mt1.user_id) ";      And my **where** looks like this:               $query->query_where = " WHERE 1=1      AND ( (wp_usermeta.meta_key = 'user-country'                 AND CAST(wp_usermeta.meta_value AS CHAR) IN ($countries_list))     AND (mt1.meta_key = 'wp_capabilities' AND CAST(mt1.meta_value AS CHAR)          LIKE '%\"$role\"%') ) ";      This is working fine, however I would like to be able to search by login or email too. I've tried amending my **where** query to:               $query->query_where = "WHERE 1=1      AND (user_login LIKE 'tom' OR user_email LIKE 'tom')      AND ( (wp_usermeta.meta_key = 'user-country'           AND CAST(wp_usermeta.meta_value AS CHAR) IN ($countries_list))     AND (mt1.meta_key = 'wp_capabilities'           AND CAST(mt1.meta_value AS CHAR) LIKE '%\"$role\"%') ) ";      However that isn't working. I imagine this is something to do with the fact that the wp_users table doesn't have a prefix, but I'm not 100% sure. EDIT: Just to clarify, there is no errors with the code, I'm just not getting the correct results back.


title: Showing Custom Fields on Parent Page

text:
I have lots of subpages each having some custom fields. I am using 2 plugins, eMembers for the membership levels, and Types for my custom fields. I am trying to show the custom field information on the parent page. I have my code working fine. But then I tried to pull in the same data again but only show the ones with a certain checkbox ticked. I have that working as well. But my problem is when I try and run both scripts at the same time. I only get the first script results to show. my code is http://pastebin.com/vgeZwPxM                    <?php if(wp_emember_is_member_logged_in()) { ?>                  <?php if(wp_emember_is_member_logged_in(2)) { ?>
Top 3 In <?php wp_title(''); ?>
         <?php                  // Get the page's children             $top3 = get_pages('child_of='.$post->ID.'&sort_column=menu_order&parent='.$post->ID);                  if (!empty($top3)) { //check if there are any children pages.                  //If there are....                 global $post;                 foreach($top3 as $post) {                          $url = get_permalink($child->ID);                     $title = get_the_title($child->ID);                     $topThreeInArea =  types_render_field("top-3-in-area", array("raw"=>"true","separator"=>";"));                     $address =  types_render_field("address", array("raw"=>"true","separator"=>";"));                           if ( !empty( $topThreeInArea ) ) {                          echo "
";                         echo "
".$title."
";                                  //If Address                              if ( !empty( $address ) ) {                                 echo "
";                                 echo "".$address."
";                             }      echo "".$facilities."
";                             }                              echo "Visit Website    ";                     echo "
";                     }                             }             }               ?>

              <?php } ?>

         <?php              // Get the page's children         $children = get_pages('child_of='.$post->ID.'&sort_column=menu_order&parent='.$post->ID);              if (!empty($children)) { //check if there are any children pages.              //If there are....             global $post;             foreach($children as $post) {                      $url = get_permalink($child->ID);                 $title = get_the_title($child->ID);                 $address =  types_render_field("address", array("raw"=>"true","separator"=>";"));                      echo "
";                     echo "
".$title."
";                     echo "
";                         //If Address                          if ( !empty( $address ) ) {                             echo "
";                             echo "".$address."
";                         }                     echo "
";                     echo "

";                     echo "Visit Website    ";                 echo "
";                  }         }          ?>
     <?php } ?>           Cheers Jord


title: Array in meta key?

text: I have a custom post type called "conference". I want to create a specific meta key for users who have registered for the conference. For example the meta key slug would be `registered_users` which stores an array with all ID's of registered users. Is it possible ? How to create it ? And how to update it when a new user registers? I know how to update a basic meta, but here it's an array... :/


title: Query Multiple Taxominies Across Multiple Post type's

text: i have searched and found some aprroved answers to similer questions   but nothing i could make work or something exactly like my issue... **i have 5 custom post type...**   each one have its own taxmonies and inside all of them i have created   a category called specials... i need to pull all posts marked with this category from all post types... **i have currently stuck starring at this code which doesent work..**               $itemsAmount = of_get_option('sg_specials_amount');          query_posts(array(          'post_type' => array('engagement_ring', 'wedding_ring', 'pendants', 'earrings', 'bracelets'),         'posts_per_page' => $itemsAmount,                                'tax_query' => array(             'relation' => 'AND',             array(                 'taxonomy' => 'wedding_cat',                 'field' => 'slug',                 'terms' => 'specials'             ),             array(                 'taxonomy' => 'engagement_cat',                 'field' => 'slug',                 'terms' => 'specials'             )         ),         'orderby' => 'rand',         'paged' => get_query_var('paged')                            ) );        _(in this example code trying to pull just from two taxomonies but would use five)_ . if relevant then beneath the code i pasted here i have   the loop which can be found here: http://pastebin.com/ds4kFptq Would appreciate your help Sagive.


title: How to Get the title of a custom field?

text: I know how to get the value of a custom field, using code like `get_post_meta($post->ID, 'company', true);`. Is there a way to get the name of the custom field?


title: How can I verify users facebook ID that he provides during signup process

text: In my signup form there is an input field that gets user's facebook ID, I just want to verify if its correct before signing up the user.


title: Page loads all pages of the image gallery with pagination

text: Same as my previous question I have moved to new website. Here there is a page which contains an image gallery with pagination. The text code is like this:               [gallery columns="6" ids="318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,340,341,342"]     <!--nextpage-->     [gallery columns="6" ids="343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366"]      There are about 50 gallery pages in the pagination. It looks like if we load a page, it loads all pages of that gallery page at once (i.e. from 1 to 50). Because loading the page gives me the following error: > Fatal error: Maximum execution time of 120 seconds exceeded in > D:\INETPUB\VHOSTS\mywebsite.com\subdomain\wordpress\wp- > includes\functions.php on line 1362 In the old website it works fine and loads page within 5-10 seconds. But in the new website even after setting 120 second for execution time it gives an error. What can be an issue? How can I solve this? * * * ### Update: Let's don't consider that I have moved the site. What I did is: I created a new page. Added an image gallery. Set pagination. Saved page. Loading the page takes too much time and fails due to maximum execution time. Here problem is not the maximum execution time of 120. The problem is it takes too much time to load instead of 5-10 seconds. FYI(if this may cause this issue): I have installed Jetpack app.


title: Force users to complete their profile after they register? How to

text: I am making a custom (quick) registration page in my wordpress site, to let users to register quickly by just filling username-email and choose their password. I have `tpl-edit-profile.php`, > what i need to achieve is to redirect users after they register to that page > (`tpl-edit-profile.php`) _No activation should be needed for registration._ Then users must fill in and complete all profile data, before they can be redirected to the rest of site. In other terms if they don't complete profile information they can't continue to use the site so all action stick to the `tpl-edit-profile.php`. When they complete profile information they can access and use the whole site. Thank you.


title: Multiple permalink structure for posts

text: I 'd like to have more than one permalink structures for the posts. Let my post URLs would be like that: /program/details/%postname%/ /news/info/%postname%/ Could anyone please suggest if this is possible. Please let me know if there is any plugin for the same purpose. Actually, I am importing the data of a site to WordPress and would like to have same URLs as old website. Thanks,


title: How to override function in functions.php of parent theme?

text: I have created child of theme twentyten. I tried to override function written below                   /**      * Returns a "Continue Reading" link for excerpts      *      * @since Twenty Ten 1.0      * @return string "Continue Reading" link      */     function twentyten_continue_reading_link() {         return ' ' . __( 'Continue reading →', 'twentyten' ) . '';     }          /**      * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link().      *      * To override this in a child theme, remove the filter and add your own      * function tied to the excerpt_more filter hook.      *      * @since Twenty Ten 1.0      * @return string An ellipsis      */     function twentyten_auto_excerpt_more( $more ) {         return ' …' . twentyten_continue_reading_link();     }     add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );      It says to override this in a child theme, remove the filter and add your own function tied to the excerpt_more filter hook. I don't want to make any change in the parent theme folder so created functions.php in child theme folder. I write my function in child file functions.php as below f                function twentyten_continue_reading_link_() {         return ' ' . __( 'READ MORE', 'twentyten' ) . '';     }               function twentyten_auto_excerpt_more_( $more ) {         return ' …' . twentyten_continue_reading_link_();     }     add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more_' );      But I have to comment filter written in the parent to make the new one working. Is it possible to do without modifying in parent file functions.php. Any help will be appreciated. Thanks in advance


title: Wordpress stripping out custom field tags

text:
I am using wordpress get post meta to store the value of a custom field into a variable. In this particular instance, It is actually grabbing the post's parent's custom field due to the `$post->post_parent` Here is the code:               <?php $cast_members = get_post_meta($post->post_parent, 'cast_members', true); ?>
<?php echo $cast_members; ?>
     <?php endif; ?>      The custom field cast_members is a series of cast members, each in its own paragraph. For some reason wordpress is stripping out the paragraph tags and displaying all of the cast members in a continuous string. I need to retain those paragraph tags so each cast member is on its own line. Any idea why `get_post_meta` strips out tags and how to fix it?


title: How do I hardcode a WordPress shortcode into my theme?

text: I am using WooTheme's Canvas theme and would like to "hardcode" in the [post_comments] shortcode into my theme. [post_comments] displays a comment link with comment count (ie Comments 10) in my post. Right now I am inserting the [post_comments] shortcode into my theme's meta "Meta Manager"; however, this is not ideal for me as I have limited control over the placement of where the this shows up in my post. What type of function or such should I be looking for to do this within my .php files? Thank you


title: pre_get_posts conflict with archive posts

text: Currently using bbPress as a forum. But now I have some conflict and archive post page is displaying instead of forum? How should I proceed? Any ideas? **EDIT:** Actually found the causing problem. It is that function that seems is interupting somehow with my forums. The function is for displaying custom post type in author archive page. Still don't have a solution for that problem.               function namespace_add_custom_types( $query ) {       if( is_archive() && empty( $query->query_vars['suppress_filters'] ) ) {         $query->set( 'post_type', array(          'post', 'vehicles'           ));          return $query;        }     }     add_filter( 'pre_get_posts', 'namespace_add_custom_types' );


title: Hierarchical List Pages as a table

text: I need to generate a list of all Wordpress Pages and have them display in a HTML Table, that will be printed for offline use.   * First column is Blank   * Second column will have the Page Creation Date   * Third column will have the last Page Modified Date   * Fourth column will have the Page Title However, the Pages need to be listed by `menu_order` and if a Page is a child of the one above it, that Page Title will need to be intended. Basically, I need something similar to the Wordpress "All Pages" list, but in a simple table format and only the information above. I have searched Google for several hours and have found some code snippets, but nothing has worked. `wp_list_pages` will not allow me to display both Creation and Modified Dates at the same time, nor can I get the formatting I need. `get_pages` is closer, but I don't know how to get the formatting and indentation of sub-pages the way I need. **UPDATE:** I am able to get a Hierarchical List in exactly the order I need to, but still need to figure out how to Indent the Subpages. Within the Page Data of each page, is its original ID as well as the Parent ID. What I need to do now is indent all sub pages, so that it looks like:               ID 1 PARENT-ID 0     ID 2 PARENT-ID 0         ID 3 PARENT-ID 2         ID 4 PARENT-ID 2             ID 5 PARENT-ID 4         ID 6 PARENT-ID 2     ID 7 PARENT-ID 0     ID 8 PARENT-ID 0        ID 9 PARENT-ID 8      Data is being outputted in that exact order. CODE IS FROM Wp get all the sub pages of the parent using wp query - Answer Entitled "Recursively Get All Current Sub-Pages" which will return a multi- dimensional array containing all Post Data I need. I know it is just a matter of comparing the Parent ID of the current record, and if it matches the ID of a page one level above, to then indent it... I just don't know how to do that in a simple function, where the depth of any record can be any number.


title: Create archives by author role

text: I have a site that will have some custom roles (capabilities), and I would like to have archives that list authors based on their role. authors.php list the profile of one author, but there is no template for listing authors, right? Is a custom template the only way to do this? I would rather not have empty pages that just serve as holders for my archives. Thanks


title: Mass post format changer?

text: Hi I am working on a site that has over 1500 posts. Many of those posts are in the gallery post format, but I need to change them to the "Standard" format to work with the clients current theme. Is there any way I can automate this? ![enter image description here](http://i.stack.imgur.com/ZMzFY.jpg)


title: Finding and removing duplicates within WP Arrays

text: I'm looking to see if it's possible to find and remove duplicates from the arrays generated below. I've tried `array_unique` `array_merge` and they haven't worked.               $category = get_the_category();     $tags = wp_get_post_tags($post->ID);      As an example, there is a potential that the word "Apparel" may appear in both Category and Tag for the post. With the "raw" method above, Apparel would appear twice in my output. I'm only looking to include it once. At this point in time, I believe it is ok if both lists are merged and all words are part of 1 output. Example: `%23Apparel %23Auto %23Mens` Then, once the output is generated, I need to add HTML URLEncode %23 to the beginning of each word. Would appreciate your input.


title: Attaching a metabox to a single post

text: I've been using metaboxes for a while now, and enjoyed their flexibility. However, I am now in a situation where I need the metabox to appear only for **a specific single post or page** , and **not** for the whole (custom)-post- type. Is it possible to do so? Your kind assistance would be most welcomed. TIA Matanya


title: Categorize posts on a page o the basis of category of other post on the same page

text: I will explain the problem more clearly. I want to create a page which will show three blocks. At the top: It will show one post . ( An issue of a Magazine. PDF in a post) At the center: It will show all the articles from the magazine. ( Posts from the issue of magazine) At the bottom: It will show other issues of magazines. How to solve this problem? I thought of having one category for each issue of a magazine and the articles belonging to that magazine. Is it feasible?


title: How to show taxonomy meta on frontpage?

text:
For a website I am developing I have come across the following challenge. I have made a custom taxonomy "blog" (associated with both the Post-post_type and the User-object_type). With the taxonomy meta plugin I have added a meta field image. On the taxonomy archive page I output the taxonomy term name, description and this image. On the front_page of this site I want to list all Blogs and I would like to do that in such a way that it again shows that taxonomy meta image. I already have managed to show the blogs with title (link) and description, using the last example on the Codex entry:               /* List all blogs, source example 2: http://codex.wordpress.org/Function_Reference/get_terms#Examples */     $args = array( 'taxonomy' => 'blog', 'orderby' => 'name', 'order' => 'ASC', 'fields' => 'all' );          $terms = get_terms('blog', $args);          $count = count($terms); $i=0;     if ($count > 0) {         foreach ($terms as $term) {                  $i++;                  $term_list .= '

slug . '/" title="' . sprintf(__('View all articles in %s Blog', 'wys'), $term->name) . '">' . $term->name . '

' . $term->description . '
';             if ($count != $i) $term_list .= '
'; else $term_list .= '';         }         echo '
' . $term_list . '
';     }      The code I used to show the image on the blog taxonomy archive comes straight from Rilwis' website (all the way at the bottom):               $queried_object = get_queried_object();     $term_id = $queried_object->term_id;          $meta = get_option('blog_image'); //meta_id         if (empty($meta)) $meta = array();         if (!is_array($meta)) $meta = (array) $meta;             $meta = isset($meta[$term_id]) ? $meta[$term_id] : array(); //term_id             $images = $meta['blogimg']; //field_id                 foreach ($images as $att) {                     // get image's source based on size, can be 'thumbnail', 'medium', 'large', 'full' or registed post thumbnails sizes                     $src = wp_get_attachment_image_src( $att, 'thumbnail' );                     $src = $src[0];                     // show image                     echo '

';                 }          echo '
';              $description = term_description();         if ( $description ) { // Show Blog taxonomy term description             echo $description;         } //endif              $meta = get_option('blog_image'); //meta_id             if (empty($meta)) $meta = array();             if (!is_array($meta)) $meta = (array) $meta;                 $meta = isset($meta[$term_id]) ? $meta[$term_id] : array(); //term_id                 $value = $meta['blog_authors']; //field_id                 echo '
' . __( 'Author(s): ', 'wys' ) . $value . '
'; // if you want to show                            echo '
';      The difficulty to do this on the homepage too is that I seem to have to combine two foreach calls and that is a little bit too complex territory for me. For whomever want to have a visualization, I have made available on my staging server the homepage and one of the blog archives. Any tips and/or nudges in the right direction are appreciated! Thanks


title: Using shortcode to display array in array

text: I am using a widget, U more recent posts. Seems to work with custom taxonomies when you input the correct data into it in a widget form, but the suggested shortcode doesn't work (and I am trying to insert it into a post). He suggests including the following;               tax_query="taxonomy=category&terms=14,17"      so I have tried....               [u_more_recent_posts id="hue-recent-posts" tax_query="taxonomy=destinations&terms=174" post_type="post"]      I am sure, I just need to alter the shortcode slightly for it to work, but have been trying for hours and can't work it out!! Any help would be ENORMOUSLY appreciated!! I think the relevant code in the plugin are;               if( !empty($opts['post_type']) ) {         $query_args['post_type'] = $opts['post_type'];              if( !empty($opts['tax_query']) AND isset($opts['tax_query'][$opts['post_type']]) ) {             $tax_query = $opts['tax_query'][$opts['post_type']];                  if( !empty($tax_query['taxonomy']) AND !empty($tax_query['terms']) ){                 $tax_query['terms'] = explode(',', preg_replace('/\s*/', '', $tax_query['terms']));                 $_tax_query = array(                     'taxonomy' => $tax_query['taxonomy'],                     'terms' => $tax_query['terms'],                     'field' => 'id',                 );                 $operator = '';                 switch($tax_query['operate']){                     case 'include': $operator = 'IN'; break;                     case 'exclude': $operator = 'NOT IN'; break;                     case 'and': $operator = 'AND'; break;                 }                 if( !empty($operator) )                     $_tax_query['operator'] = $operator;                      $query_args['tax_query'] = array($_tax_query);             }         }     }      and this bit.....               if( isset($atts['tax_query']) ){         $opts['tax_query'] = array($opts['post_type'] => wp_parse_args(preg_replace('/&/', '&', $atts['tax_query'])));     }      Thanks very much in advance, I am completely stuck!!


title: Is it possible to define two databases for one installation?

text: Is it possible to define 2 database for one wp installation, I have searched but there are options for one database and 2 installations. I want this because, one of my clients site is hosted on dedicated server, still if a traffic hike happens the database going offline. So if have two database and one installed on another host it'll be possible solution. Any help?


title: Can't retrieve product (post) ID using Shopp e-commerce plugin

text: I'm using the shopp e-commerce plugin. In my template file I need to get the id of the product (post). The online docs for shopp list `shopp('product', 'id')` but irritatingly this prints the id and there appears to be no alternative that simply returns it. Also confusing, when I do `$post->ID` it returns -42... which is weird. Can anyone help me return the post id of individual products inside the shopp loop? Thanks.


title: Wordpress br in content problem

text: I have this irritating problem with a post in Wordpress (see the url below). http://www.bytewire.co.uk/services/website-design-essex/ You'll notice the second lower case bold heading (Why Bytewire for website design essex?) is pushed down from the adjacent picture by a br which Wordpress seems to be silently inserting. I can't seem to work out how to get rid of it or where the hell it's coming from. Anyone solved this problem before?


title: Give extra post-meta to RSS feeds

text: I'm trying to extend an RSS feed to output some post-meta from my website. I have an 'event_date' meta-key and I need to order by this as opposed to the RSS standard publish date, which I know how to do if I could get that information. I'm using the following code, which makes use of the Wordpress action hooks available in the RSS feeds. However, when I use these hooks, the feeds report that there are no items found, while without these the items are found, but of course I cannot order them as I need. Am I doing something wrong in the way that I am outputting to the RSS feed?               /**      * Adds the 'event_date' meta value to a feed      */     add_action('atom_entry', 'add_event_date_to_feed');     add_action('rdf_item', 'add_event_date_to_feed');     add_action('rss_item', 'add_event_date_to_feed');     add_action('rss2_item', 'add_event_date_to_feed');     function add_event_date_to_feed(){              global $post;              $event_date_raw = get_post_meta($post->ID, 'event_date', true);         if($event_date_raw && $event_date_raw !== '') :             $date_object = DateTime::createFromFormat('D, d M Y H:i:s +0000', $event_date_raw);             $event_date = $date->format('U');         else :              $event_date = '';         endif;         printf("\t\t".'<eventDate>%1$s</eventDate>'."\n", $event_date);          }


title: ngnix Url rewrite doesn't work

text: on my server i have installed **magento** ,which is in my root directory. then I created a sub-folder named blog in my site's server. access the blog url is: http://example.com/blog http://example.com/blog/?p=123 when i checked `Post name` item `http://www.example.com/blog/index.php/sample- post/` in the Permalink Settings part. when i access post. it shows not found. when i unenabled the url rewrite. when view all the post is ok.


title: Automatically populate title field

text: I have a WordPress website with Gravity Forms and people can share YouTube videos on it. (The form can be found here: http://shareminecraftvideos.com) Now what I want is to automatically take the video title and use it as the title for the post. I have been searching Google and tried things, but nothing worked so far. Any ideas? Thanks!


title: Add new user and add meta at once

text: I am working on a custom sign up proces where a user first fills in his name and email, then receives an activation e-mail and then the sign up proces continues. The e-mail contains an activation link with a reference. I need to save this reference in my new user so if the user clicks on the link I can retrieve back the user data. But for some reason I cannot add my user meta data by inserting the new user. So first I have my form handling where I get the POST values. And If they are true I start this code:               $ref = md5( get_bloginfo( 'name' ) . $reg_email );     $activation_url = get_bloginfo( 'wpurl' ) . '/search-company?ref=' . $ref;          // Create user     $random_password = wp_generate_password( 12, true, false );     $user_id = username_exists( $email );     $userdata = array(       'user_login'  => $email,       'user_pass'   => $random_password,       'user_email'  => $email,       'first_name'  => $first_name,       'last_name'   => $surname,       'role'            => 'author',     );     wp_insert_user( $userdata );     add_user_meta( $userdata, 'verification_ref', $ref );      And then I send my e-mail by `wp_mail()` with the activation link, this works fine, but I only need to save the verification reference in the user meta of the user.


title: Creating new templates in child themes breaks layout

text: I am learning how to create new templates in WP. I am using a child theme of **Twenty Eleven**. My problem is that whenever I create a new template the **layout breaks**. For debugging I stopped using any customizations and simply copy-pasted-renamed the file `sidebar-page.php` from Twenty Eleven into my child theme's directory. The only adjustment I made to this file is that I edited the `Template Name:` at the start of the file. However what happens is that while selecting the original "Sidebar" template the layout works, when I select my new custom template, the layout breaks. What happens is that the content moves to the center and the sidebar gets positioned below the content, not next to it. Can you tell me why is this happening and what do I need to edit/copy to fix it?


title: in_category() and tax_query with custom post type

text:
I'm using custom post type, that i have named "products" For this post type i have add the custom taxonomies, that have name "products_brand" There are two terms in it now: "natige" and "osakarovka" For my custom post type "products" I have created a custom template, that I called single-products.php It's so conceived, that each taxonomy term ("natige" and "osakarovka") must have different design. I tried to do this with in_category() WP function, but it doesn't work. Please tell me, how can I write my template to do this algorithm: if category is "natige" elseif category is "osakarovka" end Here is my single-products.php code:               <?php get_header(); ?>

     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>               <?php        if ( in_category(array(                          'tax_query' => array(                         'taxonomy' => 'products_brand',                         'field' => 'slug',                         'terms' => 'natige'                     ),                     'post_type' => 'products',                     'posts_per_page' => 1,                 )             )             ) :?>

             <a href="             <?php              if (ICL_LANGUAGE_CODE == 'ru'){                 echo "/ru/produkciya-natizhe";             } elseif (ICL_LANGUAGE_CODE == 'kz'){                   echo "/natizhe-onimi";             }             ?>" class="natiact"><?php _e( 'Продукция «Нәтиже»', 'wpml_theme');?>             <a href="             <?php              if (ICL_LANGUAGE_CODE == 'ru'){                 echo "/ru/produkciya-osakarovka";             } elseif (ICL_LANGUAGE_CODE == 'kz'){                   echo "/osakarovka-onimi";             }             ?>" class="osahover"><?php _e( 'Продукция «Осакаровка»', 'wpml_theme');?>

<?php the_post_thumbnail( 'product-page' ); ?>          <?php     if( get_field('dop_izobrazheniye') ): ?>     <img style="margin-top: 60px;" alt="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>" src="<?php $image = get_field('dop_izobrazheniye'); echo($image['sizes']['product-page']); ?>"/>     <?php endif; ?>

<?php the_title(); ?>
                          <?php if( get_field('product_parameter') ): ?>                              <?php while( has_sub_field('product_parameter') ): ?>                                      <?php if( get_sub_field('pack_volume_fat') ): ?>                                     <?php while( has_sub_field('pack_volume_fat') ): ?>

<?php the_sub_field('pack'); ?>
                                         <?php if (get_sub_field('mass_fat') ): ?>
<?php while( has_sub_field('mass_fat') ): ?>                                                  <?php the_sub_field('mass'); ?>                                             <?php the_sub_field('measure'); ?> —                                              <?php the_sub_field('fatness'); ?>
                                                  <?php endwhile; ?>                                         <?php endif; ?>
                                     <?php endwhile; ?>                                      <?php endif; ?>                              <?php endwhile; ?>                          <?php endif; ?>                      <?php the_content(); ?>
                 <?php wp_reset_query(); ?>

          <?php $orig_post = $post;         global $post;         $tags = wp_get_post_tags($post->ID);         if ($tags) {         $tag_ids = array();         foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;         $args=array(         'tag__in' => $tag_ids,         'post__not_in' => array($post->ID),         'post_type' => 'products',         'posts_per_page'=>6, // Number of related posts that will be shown.         'caller_get_posts'=>1         );         $my_query = new wp_query( $args );         if( $my_query->have_posts() ) {                   echo _e( '
Рекомендуем посмотреть
', 'wpml_theme');          echo '
';         while( $my_query->have_posts() ) {         $my_query->the_post(); ?>
             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" alt="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'product-cat' ); ?><?php the_title(); ?>
         <? }         }         }         $post = $orig_post;         wp_reset_query(); ?>

             <?php $pc = new WP_Query(array(             'order' => 'ASC',              'orderby' => 'title',              'posts_per_page' => '45',              'post_type' => 'products',             'tax_query' => array(                         array(                         'taxonomy' => 'products_brand',                         'field' => 'slug',                         'terms' => 'natige'                     )                 )             ));                  ?>                 <?php while ($pc->have_posts()) : $pc->the_post(); ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
             <?php endwhile; ?>             <?php wp_reset_query() ?>

                                        <?php elseif ( in_category(array(                          'tax_query' => array(                         'taxonomy' => 'products_brand',                         'field' => 'slug',                         'terms' => 'osakarovka'                     ),                     'post_type' => 'products',                     'posts_per_page' => 1,                 )             )             ) :?>

             <a href="             <?php              if (ICL_LANGUAGE_CODE == 'ru'){                 echo "/ru/produkciya-natizhe";             } elseif (ICL_LANGUAGE_CODE == 'kz'){                   echo "/natizhe-onimi";             }             ?>" class="natihover"><?php _e( 'Продукция «Нәтиже»', 'wpml_theme');?>             <a href="             <?php              if (ICL_LANGUAGE_CODE == 'ru'){                 echo "/ru/produkciya-osakarovka";             } elseif (ICL_LANGUAGE_CODE == 'kz'){                   echo "/osakarovka-onimi";             }             ?>" class="osaact"><?php _e( 'Продукция «Осакаровка»', 'wpml_theme');?>

<?php the_post_thumbnail( 'product-page' ); ?>          <?php     if( get_field('dop_izobrazheniye') ): ?>     <img style="margin-top: 60px;" alt="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>" src="<?php $image = get_field('dop_izobrazheniye'); echo($image['sizes']['product-page']); ?>"/>     <?php endif; ?>

<?php the_title(); ?>
                          <?php if( get_field('product_parameter') ): ?>                              <?php while( has_sub_field('product_parameter') ): ?>                                      <?php if( get_sub_field('pack_volume_fat') ): ?>                                     <?php while( has_sub_field('pack_volume_fat') ): ?>

<?php the_sub_field('pack'); ?>
                                         <?php if (get_sub_field('mass_fat') ): ?>
<?php while( has_sub_field('mass_fat') ): ?>                                                  <?php the_sub_field('mass'); ?>                                             <?php the_sub_field('measure'); ?> —                                              <?php the_sub_field('fatness'); ?>
                                                  <?php endwhile; ?>                                         <?php endif; ?>
                                     <?php endwhile; ?>                                      <?php endif; ?>                              <?php endwhile; ?>                          <?php endif; ?>                      <?php the_content(); ?>
                 <?php wp_reset_query(); ?>

          <?php $orig_post = $post;         global $post;         $tags = wp_get_post_tags($post->ID);         if ($tags) {         $tag_ids = array();         foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;         $args=array(         'tag__in' => $tag_ids,         'post__not_in' => array($post->ID),         'post_type' => 'products',         'posts_per_page'=>6, // Number of related posts that will be shown.         'caller_get_posts'=>1         );         $my_query = new wp_query( $args );         if( $my_query->have_posts() ) {                   echo _e( '
Рекомендуем посмотреть
', 'wpml_theme');          echo '
';         while( $my_query->have_posts() ) {         $my_query->the_post(); ?>
             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" alt="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'product-cat' ); ?><?php the_title(); ?>
         <? }         }         }         $post = $orig_post;         wp_reset_query(); ?>

             <?php $pc = new WP_Query(array(             'order' => 'ASC',              'orderby' => 'title',              'posts_per_page' => '45',              'post_type' => 'products',             'tax_query' => array(                         array(                         'taxonomy' => 'products_brand',                         'field' => 'slug',                         'terms' => 'osakarovka'                     )                 )             ));                  ?>                 <?php while ($pc->have_posts()) : $pc->the_post(); ?>
                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
             <?php endwhile; ?>             <?php wp_reset_query() ?>

          <?php endif;  ?>          <?php endwhile; else : ?>     <?php endif; ?>

               <?php get_footer(); ?>      Tell me please what have I to correct. Thanks a lot!


title: Buddypress get member meta info for specific user ID

text: I am trying to create a 'featured member' widget for a Buddypress site, and am using cimy extra fields to add the 'is featured user' checkbox. I have some extra user meta fields that were created within the buddypress profile system, like 'where are you from' which I want to show on the widget. I am able to query the members/users to get the featured user's ID, so could someone instruct on how to use bp_has_members() with a specific user ID to get basic member info like: (gravatar) (member name), from (where member is from), is our featured member this month. (profile page link) Thanks!


title: Most allowed Taxonomies in Appearance->Menus

text: I am managing a large list(300) of "places" taxonomies, and I need to create a menu with those places. the WordPress menu system seems like the way to go but when I save the menu I am getting a PHP timeout error. Why is this taking so long to save the menu? Is there a recommended limit for the amount of terms you should be adding to a menu?


title: How would you create a "weekly" archive?

text: I'm looking to create individual archives for each category of my website, but want to them to break into weeks. Check out the linked image (can't embed images as a new user?): http://i.stack.imgur.com/ynHWb.png I'm finding real difficulties here: 1) Breaking archives out weekly, 2) Adding the Date at the Top 3) Listing each post as a list item with some HTML in it… Any help would be tremendously appreciated!


title: WordPress as a web app - always auto-save post and meta data

text: Is is possible to make WordPress auto-save revisiona more often and have the auto-save version always be the most recent version - Like the way google docs works. This would mean the update button is not necessary. you visit a post or custom post type, make your change, then click to another part of the admin, and your changes are always saved. Saving all the custom fields during auto- save would be essential. (maybe we'll see this in wordpress version 5.0 ;) Here is my problem: i want to insert helpful links in post meta boxes linking to other areas of the admin, but I can't without putting a big warning beside each link telling the user to save first! any suggestions?


title: WP-navi plugin and post sorted alphabetically

text: I've got an issue with using the WP-Navi plugin and posts sorted alphabetically. The first page of posts (5 - set in the plugin settings) appearing properly, but when one navigates to subsequent pages, I lose that sort. In fact, I can't tell how the posts are being sorted - it appears to be random. The plugin's author has a description of this problem, but says that it's fixed in the plugin version that I have and I can't figure out where in the plugin code to verify. Should I abandon the plugin and try to code into the template or functions file? Can anyone help?


title: Custom Post types and their corresponding theme files

text: I have a custom post type called 'business_sold' that is not reading archive- business_sold.php but instead is reading index.php. The custom post type is however, properly reading single-business_sold.php. This is how I registered the custom post type (initially via a plugin through which single-business_sold.php worked) and then I manually added the following code to functions.php:               register_post_type('Business_Sold', array(  'label' => 'Businesses Sold','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => false,'rewrite' => array('slug' => ''),'query_var' => true,'has_archive' => true,'menu_position' => 5,'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),'taxonomies' => array('category','post_tag',),'labels' => array (       'name' => 'Businesses Sold',         'singular_name' => 'Business Sold',         'menu_name' => 'Businesses Sold',         'add_new' => 'Add Business Sold',         'add_new_item' => 'Add New Business Sold',         'edit' => 'Edit',         'edit_item' => 'Edit Business Sold',         'new_item' => 'New Business Sold',         'view' => 'View Business Sold',         'view_item' => 'View Business Sold',         'search_items' => 'Search Businesses Sold',         'not_found' => 'No Businesses Sold Found',         'not_found_in_trash' => 'No Businesses Sold Found in Trash',         'parent' => 'Parent Business Sold',       ),) );      Any ideas on why this is happening?


title: Removing Gravatar.com support for WordPress and Simple Local Avatars

text:
Currently I'm using Simple Local Avatars on several of my blogs allowing people to upload their own custom avatar. As far as I know Simple Local Avatars uses `get_avatar` to check whether a custom avatar is selected, if not defaults to Gravatar.com. Would it be possible to disable the Gravatar.com bit somehow, disabling Gravatar.com completely and returning just some local hosted image if no custom avatar is selected? I hope it would be OK to post this here, but this would be the Simple Local Avatars file               <?php     /*     Plugin Name: Simple Local Avatars     Plugin URI: http://www.get10up.com/plugins/simple-local-avatars-wordpress/     Description: Adds an avatar upload field to user profiles if the current user has media permissions. Generates requested sizes on demand just like Gravatar! Simple and lightweight.     Version: 1.2.3     Author: Jake Goldman (10up), Oomph Inc     Author URI: http://www.get10up.com     */          // add field to user profiles     class simple_local_avatars {         function simple_local_avatars() {             add_filter('get_avatar', array($this, 'get_avatar'), 10, 5);             add_action('admin_init', array($this, 'admin_init'));             add_action('show_user_profile', array($this, 'edit_user_profile'));             add_action('edit_user_profile', array($this, 'edit_user_profile'));             add_action('personal_options_update', array($this, 'edit_user_profile_update'));             add_action('edit_user_profile_update', array($this, 'edit_user_profile_update'));             add_filter('avatar_defaults', array($this, 'avatar_defaults'));         }              function get_avatar($avatar = '', $id_or_email, $size = '96', $default = '', $alt = false) {             if (is_numeric($id_or_email))                 $user_id = (int) $id_or_email;             elseif (is_string($id_or_email)) {                 if ($user = get_user_by_email($id_or_email))                     $user_id = $user->ID;             } elseif (is_object($id_or_email) && !empty($id_or_email->user_id))                 $user_id = (int) $id_or_email->user_id;             if (!empty($user_id))                 $local_avatars = get_user_meta($user_id, 'simple_local_avatar', true);             if (!isset($local_avatars) || empty($local_avatars) || !isset($local_avatars['full'])) {                 if (!empty($avatar)) // if called by filter                     return $avatar;                 remove_filter('get_avatar', 'get_simple_local_avatar');                 $avatar = get_avatar($id_or_email, $size, $default);                 add_filter('get_avatar', 'get_simple_local_avatar', 10, 5);                 return $avatar;             }             if (!is_numeric($size)) // ensure valid size                 $size = '96';             if (empty($alt))                 $alt = get_the_author_meta('display_name', $user_id);             // generate a new size             if (empty($local_avatars[$size])) {                 $upload_path = wp_upload_dir();                 $avatar_full_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $local_avatars['full']);                 $image_sized = image_resize($avatar_full_path, $size, $size, true);                 if (is_wp_error($image_sized)) // deal with original being >= to original image (or lack of sizing ability)                     $local_avatars[$size] = $local_avatars['full'];                 else                     $local_avatars[$size] = str_replace($upload_path['basedir'], $upload_path['baseurl'], $image_sized);                 update_user_meta($user_id, 'simple_local_avatar', $local_avatars);             } elseif (substr($local_avatars[$size], 0, 4) != 'http')                 $local_avatars[$size] = site_url($local_avatars[$size]);             $author_class = is_author($user_id) ? ' current-author' : '';             $avatar = "";             return $avatar;         }              function admin_init() {             load_plugin_textdomain('simple-local-avatars', false, dirname(plugin_basename(__FILE__)) . '/localization/');             register_setting('discussion', 'simple_local_avatars_caps', array($this, 'sanitize_options'));             add_settings_field('simple-local-avatars-caps', __('Local Avatar Permissions', 'simple-local-avatars'), array($this, 'avatar_settings_field'), 'discussion', 'avatars');         }              function sanitize_options($input) {             $new_input['simple_local_avatars_caps'] = empty($input['simple_local_avatars_caps']) ? 0 : 1;             return $new_input;         }              function avatar_settings_field($args) {             $options = get_option('simple_local_avatars_caps');             echo '                                      <input type="checkbox" name="simple_local_avatars_caps" id="simple_local_avatars_caps" value="1" ' . @checked($options['simple_local_avatars_caps'], 1, false) . ' />                     ' . __('Only allow users with file upload capabilities to upload local avatars (Authors and above)', 'simple-local-avatars') . '                              ';         }              function edit_user_profile($profileuser) {             ?>
<?php _e('Avatar', 'simple-local-avatars'); ?>

                     <?php _e('Upload Avatar', 'simple-local-avatars'); ?>	                                              <?php echo get_avatar($profileuser->ID); ?>                     	                                              <?php                         $options = get_option('simple_local_avatars_caps');                         if (empty($options['simple_local_avatars_caps']) || current_user_can('upload_files')) {                             do_action('simple_local_avatar_notices');                             wp_nonce_field('simple_local_avatar_nonce', '_simple_local_avatar_nonce', false);                         ?>                         <input type="file" name="simple-local-avatar" id="simple-local-avatar" />
                         <?php                         if (empty($profileuser->simple_local_avatar))                             echo '' . __('No local avatar is set. Use the upload field to add a local avatar.', 'simple-local-avatars') . '';                         else                             echo '                                 <input type="checkbox" name="simple-local-avatar-erase" value="1" /> ' . __('Delete local avatar', 'simple-local-avatars') . '
                                 ' . __('Replace the local avatar by uploading a new avatar, or erase the local avatar (falling back to a gravatar) by checking the delete option.', 'simple-local-avatars') . '                             ';                         } else {                             if (empty($profileuser->simple_local_avatar))                                 echo '' . __('No local avatar is set. Set up your avatar at Gravatar.com.', 'simple-local-avatars') . '';                             else                                 echo '' . __('You do not have media management permissions. To change your local avatar, contact the blog administrator.', 'simple-local-avatars') . '';                         }                         ?>

                          <?php         }              function edit_user_profile_update($user_id) {             if (!wp_verify_nonce($_POST['_simple_local_avatar_nonce'], 'simple_local_avatar_nonce')) //security                 return;             if (!empty($_FILES['simple-local-avatar']['name'])) {                 $mimes = array(                     'jpg|jpeg|jpe' => 'image/jpeg',                     'gif' => 'image/gif',                     'png' => 'image/png',                     'bmp' => 'image/bmp',                     'tif|tiff' => 'image/tiff'                 );                 $avatar = wp_handle_upload($_FILES['simple-local-avatar'], array('mimes' => $mimes, 'test_form' => false));                 if (empty($avatar['file'])) // handle failures                     {                     switch ($avatar['error']) {                         case 'File type does not meet security guidelines. Try another.':                             add_action('user_profile_update_errors', create_function('$a', '$a->add("avatar_error",__("Please upload a valid image file for the avatar.","simple-local-avatars"));'));                             break;                         default:                             add_action('user_profile_update_errors', create_function('$a', '$a->add("avatar_error","".__("There was an error uploading the avatar:","simple-local-avatars")." ' . esc_attr($avatar['error']) . '");'));                     }                     return;                 }                 $this->avatar_delete($user_id); // delete old images if successful                 update_user_meta($user_id, 'simple_local_avatar', array('full' => $avatar['url'])); // save user information (overwriting old)             } elseif (isset($_POST['simple-local-avatar-erase']) && $_POST['simple-local-avatar-erase'] == 1)                 $this->avatar_delete($user_id);         }              // remove the custom get_avatar hook for the default avatar list output on options-discussion.php         function avatar_defaults($avatar_defaults) {             remove_action('get_avatar', array($this, 'get_avatar'));             return $avatar_defaults;         }              // delete avatars based on user_id         function avatar_delete($user_id) {             $old_avatars = get_user_meta($user_id, 'simple_local_avatar', true);             $upload_path = wp_upload_dir();             if (is_array($old_avatars)) {                 foreach ($old_avatars as $old_avatar) {                     $old_avatar_path = str_replace($upload_path['baseurl'], $upload_path['basedir'], $old_avatar);                     @unlink($old_avatar_path);                 }             }             delete_user_meta($user_id, 'simple_local_avatar');         }     }          $simple_local_avatars = new simple_local_avatars;     if (!function_exists('get_simple_local_avatar')):     /*      * more efficient to call simple local avatar directly in theme and avoid gravatar setup      *       * @param int|string|object $id_or_email A user ID, email address, or comment object      * @param int $size Size of the avatar image      * @param string $default URL to a default image to use if no avatar is available      * @param string $alt Alternate text to use in image tag. Defaults to blank      * @return string  tag for the user's avatar      */         function get_simple_local_avatar($id_or_email, $size = '96', $default = '', $alt = false) {             global $simple_local_avatars;             return $simple_local_avatars->get_avatar('', $id_or_email, $size, $default, $alt);         }     endif;          // on uninstallation, remove the custom field from the users and delete the local avatars     register_uninstall_hook(__FILE__, 'simple_local_avatars_uninstall');          function simple_local_avatars_uninstall() {         $simple_local_avatars = new simple_local_avatars;         $users = get_users_of_blog();         foreach ($users as $user)             $simple_local_avatars->avatar_delete($user->user_id);         delete_option('simple_local_avatars_caps');     }


title: Display featured image as post thumbnail

text: i'm trying to set up a mobile theme for my wordpress site. My desktop version uses themejunkie's weekly theme and my mobile version uses dotmobi theme. the Dotmobi theme pulls out the first image and displays as a thumbnail where as the weekly theme displays the 'featured image' as a thumbnail or a picture that is defined in a custom field value 'thumb' How can I make use of this same logic for dotmobi as well? I tried get_thumbnail() but that doesn't work. Any help on this please. I also tried by putting this code into my functions.php               // Get image attachment (sizes: thumbnail, medium, full)     function get_thumbnail($postid=0, $size='full') {         if ($postid<1)          $postid = get_the_ID();         $thumb_key = get_theme_mod('thumb_key');         if($thumb_key)             $thumb_key = $thumb_key;         else             $thumb_key = 'thumb';         $thumb = get_post_meta($postid, $thumb_key, TRUE); // Declare the custom field for the image         if ($thumb != null or $thumb != '') {             return $thumb;          } elseif ($images = get_children(array(             'post_parent' => $postid,             'post_type' => 'attachment',             'numberposts' => '1',             'post_mime_type' => 'image', ))) {             foreach($images as $image) {                 $thumbnail=wp_get_attachment_image_src($image->ID, $size);                 return $thumbnail[0];              }         } else {             return get_bloginfo ( 'stylesheet_directory' ).'/images/default_thumb.gif';         }          }      and called the same in my index.php through               <?php echo 'ID).'" rel="bookmark">ID, 'full').'&h='.$height.'&w='.$width.'&zc=1" alt="'.get_the_title().'" />' ?>      For some odd reason the thumbnails aren't displaying


title: My pagination.class.php file doesn't work in PHP 5.3.10

text:
I have some php code + a file called pagination.class.php, which my kath.php file incorporates. This pagination code works great on my current server running PHP 5.2.x, but when I moved it over to another server running PHP 5.3.x, it's not working. If someone could give me help, that would be great. Also, if there is other code that I could use instead of what I'm using, that would be great. My kath.php code               <?php     define  ("WP_USE_THEMES", false);     define  ("MAX_PER_PAGE", 3);          require ("wp-load.php");     include ("pagination.class.php");          $query = new WP_Query( array(         'showposts'   => 25,         'post_type'   => 'post',         'numberposts' => -1,     ) );          $posts = $query->get_posts();          $sAllTitles   = array();     $sAllDates    = array();     $sAllContent  = array();     $iCount       = 0;          if ($posts) {         foreach($posts as $post) {             $sAllTitles[$iCount] = $post->post_title;             $sAllDates[$iCount]  = $post->post_date;             $sAllContent[$iCount]= $post->post_content;                  $PostData[] = array(                 'PTitle' => $sAllTitles[$iCount],                 'PDate'  => $sAllDates[$iCount],                 'PCont'  => $sAllContent[$iCount]             );             $iCount++;         }     }     ?>                                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />     <title>BLOG POSTS</title>                              <?php     if (count($PostData)) {         $pagination  = new pagination($PostData, (isset($_GET['page']) ? $_GET['page'] : 1), MAX_PER_PAGE);         $pagination->setShowFirstAndLast(true);              $PostPages = $pagination->getResults();              echo $pageNumbers = '
'.$pagination->getLinks().'
';              if (count($PostPages) != 0) {             print("
");             print ("My Blog Posts");             print("

");                  foreach ($PostPages as $PostArray) {                 print ('
');                 print ('
' . $PostArray['PTitle'] . '
');                      print ('
' . $PostArray['PDate'] . '
');                      print ('
');                 print ($PostArray['PCont']);                 print ('
');                      print ('
');                 print ('
');             }                  print ($pageNumbers);             print ('

');         }     }          wp_reset_postdata();     ?>                     My pagination.class.php file               /**      * Properties array      * @var array         * @access private       */     private $_properties = array();          /**      * Default configurations      * @var array        * @access public       */     public $_defaults = array(       'page' => 1,       'perPage' => 10      );          /**      * Constructor      *       * @param array $array   Array of results to be paginated      * @param int   $curPage The current page interger that should used      * @param int   $perPage The amount of items that should be show per page      * @return void          * @access public        */     public function __construct($array, $curPage = null, $perPage = null)     {       $this->array   = $array;       $this->curPage = ($curPage == null ? $this->defaults['page']    : $curPage);       $this->perPage = ($perPage == null ? $this->defaults['perPage'] : $perPage);     }          /**      * Global setter      *       * Utilises the properties array      *       * @param string $name  The name of the property to set      * @param string $value The value that the property is assigned      * @return void          * @access public        */     public function __set($name, $value)      {        $this->_properties[$name] = $value;     }           /**      * Global getter      *       * Takes a param from the properties array if it exists      *       * @param string $name The name of the property to get      * @return mixed Either the property from the internal      * properties array or false if isn't set      * @access public        */     public function __get($name)     {       if (array_key_exists($name, $this->_properties)) {         return $this->_properties[$name];       }       return false;     }          /**      * Set the show first and last configuration      *       * This will enable the "<< first" and "last >>" style      * links      *       * @param boolean $showFirstAndLast True to show, false to hide.      * @return void          * @access public        */     public function setShowFirstAndLast($showFirstAndLast)     {         $this->_showFirstAndLast = $showFirstAndLast;     }          /**      * Set the main seperator character      *       * By default this will implode an empty string      *       * @param string $mainSeperator The seperator between the page numbers      * @return void          * @access public        */     public function setMainSeperator($mainSeperator)     {       $this->mainSeperator = $mainSeperator;     }          /**      * Get the result portion from the provided array       *       * @return array Reduced array with correct calculated offset       * @access public       */     public function getResults()     {       // Assign the page variable       if (empty($this->curPage) !== false) {         $this->page = $this->curPage; // using the get method       } else {         $this->page = 1; // if we don't have a page number then assume we are on the first page       }            // Take the length of the array       $this->length = count($this->array);            // Get the number of pages       $this->pages = ceil($this->length / $this->perPage);            // Calculate the starting point        $this->start = ceil(($this->page - 1) * $this->perPage);            // return the portion of results       return array_slice($this->array, $this->start, $this->perPage);     }          /**      * Get the html links for the generated page offset      *       * @param array $params A list of parameters (probably get/post) to      * pass around with each request      * @return mixed  Return description (if any) ...      * @access public       */     public function getLinks($params = array())     {       // Initiate the links array       $plinks = array();       $links = array();       $slinks = array();            // Concatenate the get variables to add to the page numbering string       $queryUrl = '';       if (!empty($params) === true) {         unset($params['page']);         $queryUrl = '&'.http_build_query($params);       }            // If we have more then one pages       if (($this->pages) > 1) {         // Assign the 'previous page' link into the array if we are not on the first page         if ($this->page != 1) {           if ($this->_showFirstAndLast) {             $plinks[] = ' «« First  ';           }           $plinks[] = ' page - 1).$queryUrl.'">« Prev ';         }              // Assign all the page numbers & links to the array         for ($j = 1; $j < ($this->pages + 1); $j++) {           if ($this->page == $j) {             $links[] = ' '.$j.' '; // If we are on the same page as the current item           } else {             $links[] = ' '.$j.' '; // add the link to the array           }         }              // Assign the 'next page' if we are not on the last page         if ($this->page < $this->pages) {           $slinks[] = ' page + 1).$queryUrl.'"> Next »  ';           if ($this->_showFirstAndLast) {             $slinks[] = ' pages).$queryUrl.'"> Last »»  ';           }         }              // Push the array into a string using any some glue         return implode(' ', $plinks).implode($this->mainSeperator, $links).implode(' ', $slinks);       }       return;     }      }


title: Integrating a custom post type into a page hierarchy

text: I'm creating a theme with a custom post type for team members, I've also got the following page structure:               about  <-- this is a page     about/team-members  <-- this is a page, lists all the team members     about/team-members/joe-bloggs  <-- this is a custom post type (team member) entry      The third structure here uses the about and team member pages, but goes on to use the custom post type slug to make it look like it's parents are team member and about. I've achieved this by setting the following options on the custom post type:               ...     'rewrite' => array( 'slug' => 'about/team-members', 'with_front' => false)     ...      This works great, however when I get down to the team member post level I no longer get the current-page, current-ancestor classes on the parent pages. I know why this is, because we're not technically on a pagea parent of those pages, however is there a way I can trick/fix/bodge so the pages DO apear as parents? I had achieved this nicely by using pages for team members, however a custom post type was chosen instead for easy of use for the administrator. Thanks guys + girls!


title: Excerpts for Pages

text:
I inserted an excerpt into a Page using the "More" button in WP GUI. I have a custom loop-page.php from which I want to display the excerpt. But it appears to be empty? Is it possible to display excerpts from child pages?               $pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID);     if ( $pageChildren ) {       foreach ( $pageChildren as $pageChild ) {         echo '
And the title is: '. $pageChild->post_title.'
';             print_r($pageChild);             if (!empty($pageChild->post_excerpt)){                 echo '
ID) . '">' . $pageChild->post_excerpt.'
 ';             }             echo '
';       }     }      ![enter image description here](http://i.stack.imgur.com/ZtWrv.png)


title: Theme file for all pages that are a child of a specific page

text: Is it possible within the current theme file naming hierarchy to define a template for for all pages that are a child of a specific page? For example, in this navigation: About Us   * Contact   * Who We Are   * Message Statement Is there any way to just make a theme file named something like: page-about-us-all.php That would automatically be applied to all pages that are children of About Us? **UPDATE** I went with a modified version of what Bainternet had suggested. Here's the descendant function I ended up with:               function is_descendant($ancestor, $tofind = 0) {         global $post;         if ($tofind == 0) $tofind = $post->ID;         $arrpostids = get_post_ancestors($tofind);         $arrpostslugs = array();         foreach($arrpostids as $postid) {             $temppost = get_post($postid);             array_push($arrpostslugs, $temppost->post_name);         }         return (in_array($ancestor, $arrpostids) || in_array($ancestor, $arrpostslugs));     }     // Example use:     is_descendant('about-us');     is_descendant(123);     is_descendant('about-us', 134);      This allows me to verify it's a descendant using either the ID of the parent or the slug. I was concerned that using only the ID might lead to a problem if a parent page had been accidentally trashed there would be no good way to get that to work again without having to edit the Theme files. With the slug at least there's the option of just hopping in and making a new page with the same slug and hierarchy.


title: Installed Wordpress.com Stats with api key and forgot key. How can I register w/ new key?

text: I tried deleting the plugin, reinstalling, and entering a new api key. However, I get this message: > The owner of that API Key (username) is not on the access list for this blog > (blog id). Stats was installed using a different API key. Is there anyway I can install the Wordpress.com Stats plugin with a new api key?


title: Loop the posts between two dates selected using jquery datepicker

text: I went through this link where we can restrict the loop to display the posts only between two dates and it works fine. But if I have a Jquery Datepicker with `from` and `to` date, then how can I pass that selected date inside the where clause? For example,               <?php       function filter_where($where = '') {             $where .= " AND post_date >= 'FromDate' AND post_date <= 'ToDate'";         return $where;       }     add_filter('posts_where', 'filter_where');     query_posts($query_string);     ?>      Where `FromDate` and `ToDate` are the selected values of jquery datepicker.


title: Remove timthumb.php from my custom theme

text: I have used timthumb.php to handle various type of image format in my custom theme, but this is making my site slow and more the number of images per page more it is taking to re size, crop them I am planning to remove timthumb.php file from my theme.Since all my work is at starting phase, so it is not a whole rework for me. What can be the best approach to accomplish this.Is there anything which needs to be taken care while doing this?


title: Is there any other place - besides a theme, a plugin, or a mu-plugin - that an option page might conceivably be used?

text: I'm creating a helper class for simplifying the creation of an option page in admin that could conceivably be used in a theme, a plugin, or a mu-plugin. I'm trying to make the class as easy to instantiate as possible, so I plan on determining programmatically which of those three places the class is being instantiated from. I haven't come across any other ways an option page might be desirable, but I don't want to leave out a scenario that I just haven't encountered or thought of.


title: Category's Description field as editor remove <p> tag

text: I have tried both plugin to make Category's Description field as editor with below plugin. but when i update the text it's remove tag http://wordpress.org/plugins/rich-tax-description-editor/ http://wordpress.org/plugins/categorytinymce/ tried google also but din't help


title: Get Permalink for the top level parent of child pages

text: I've this pages structure:   * TOP PAGE     * SUB PAGE 1        * SUB SUB PAGE 1     * SUB PAGE 2 [etc] Is it possible to display on each sub page a link to come back to the top level page? And how?


title: Single Post in Tab/Slider

text: I have managed to code tab system that fetches different categories and custom taxanomies on a home page and shows relative posts. Now, is it possible that when someone clicks on one of the posts in some specific tab, then the post's content can be shown in the tab itself, instead of taking the user to the single post (single post page)? Here is the screenshot: ![enter image description here](http://i.stack.imgur.com/unK74.png)


title: Is it possible to use WP Query to orderby custom meta value and custom taxonomy?

text: I have a custom post type with a custom taxonomy and I am trying to pull posts with a certain meta value along with a custom taxonomy (tag in my case). Is this possible and if so, how would the query looK? Here is a excerpt of how I am pulling the posts with just meta value and it works fine.               $args = array(     'post_type' => 'box',     'post_status' => 'publish',     'posts_per_page' => -1,     'orderby' => 'meta_value_num',     'meta_key' => 'position',     'taxonomy' => 'box-cat'     );          $boxes = new WP_Query( $args );      So this successfully pulls all the posts that are in "box-cat" category and ordered by the "position" value. But I have also a tags taxonomy that I would like to add into the query as orderby....How can this be done? Thanks!


title: Display featured image on blog page

text: The commented out portion is what I've added to pull the featured image set on the blog page. Without that chunk I'm able to set the image, or pull from the home page's featured image if that page/post doesn't have one. But once I enable the section for 'page_for_posts' everything else goes haywire and it starts outputting an image that isn't set as the feature for anything.               if ( has_post_thumbnail( $post->ID ) ) {         $imageInfo = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );         $imageUrl = $imageInfo[0];     }     //if ( get_option('page_for_posts') ) {     //      $imageInfo = wp_get_attachment_image_src( get_post_thumbnail_id( get_option( 'page_for_posts' ), 'full' ) );      //      $imageUrl = $imageInfo[0];     //}     if ( !has_post_thumbnail( $post->ID ) ) {         $imageInfo = wp_get_attachment_image_src( get_post_thumbnail_id( '46' ), 'full' );         $imageUrl = $imageInfo[0];     }          $cssoutput = ".site-header { background-image: url('" . $imageUrl . "'); } \n";          echo      "<style type=\"text/css\">" . $cssoutput . "</style>";


title: <ul> inside <ol> in editor

text:
I want to add

First list

Second List

Sub Second List

Third List

      This is not possible with editor without manual job. How can we achieve this


title: Category pages vs single post pages

text: For each of a few categories there is a "main" post which should be displayed at the top of the category list page. Should these pages (where both the "main" post and the list of the rest posts for a category are displayed) be category pages or single post pages (with a template)? Also: Should I assign a post corresponding to category or category corresponding to a post?


title: Using jquery-1.7.2.min.js instead of the wordpress jquery

text: I have been trying to deregister the wordpress native jquery and use my version that i have downloaded.At first everything was working fine with the wordpress resident jquery albeit replacing `$` with `jQuery` in my `custom.js` script. I am using media-uploader in my theme and i added the scripts using this code;               function wptuts_options_enqueue_scripts() {         wp_register_script( 'wptuts-upload', get_template_directory_uri() .'/admin/js/mlimage.js', array('jquery','media-upload','thickbox') );                   wp_enqueue_script('jquery');                  wp_enqueue_script('thickbox');             wp_enqueue_style('thickbox');                  wp_enqueue_script('media-upload');             wp_enqueue_script('wptuts-upload');          }     add_action('admin_enqueue_scripts', 'wptuts_options_enqueue_scripts');      I have this code to add my custom jquery               function en_jquery()           {               wp_deregister_script( 'jquery' );                wp_register_script( 'daskustomjquery', get_template_directory_uri() . '/admin/js/jquery-1.7.2.min.js' );                 wp_enqueue_script( 'daskustomjquery' );                  }           add_action( 'admin_enqueue_scripts', 'en_jquery' );      Whenever i try excluding jquery from this line's array,`wp_register_script( 'wptuts-upload', get_template_directory_uri() .'/admin/js/mlimage.js', array('jquery','media-upload','thickbox') );` none of the scripts get loaded.Is it possible to exclude the wordpress jquery and use the `jquery-1.7.2.min` i have downloaded?.


title: Inserting PHP inside do_shortcode

text: I am trying to use an existing shortcode for an accordion element in a custom template for my wordpress site. Basically, I need to insert PHP arrays inside this shortcode, like so:               <php do_shortcode('[vc_accordion]';>          PHP arrays here          <php do_shortcode('[/vc_accordion]';>      Does anyone know if a solution?


title: Need to add rewrite rule that adds in additional information about the post to url

text: A have a post type for `venues` which have the attributes `title`, `state`, and `suburb`. Currently using the default WordPress permalinks I get the following format: `mysite.com/venue/{title}` However, I would like to have the full url be: `mysite.com/venue/{state}/{suburb}/{title}` This information is something that can be retrieved from the database, with permalinks off the url format for this would be: `mysite.com/?venue=title` I believe it's also possible to pull it by ID some how... My question is, how do I create a rewrite rule that pulls this information based on `post_id` or `title` to create a url of this format? Is it even possible?


title: Unattaching unlinked images

text: As I understand default WP behavior: When you upload an image to a post and save it (as a draft or published post), the image becomes "attached" to the post. This can be double checked by going to Media > Library > 'Uploaded To' column. In order to mark an image as unattached to any post, it must be done manually by deleting the post. (Is there another way?) My main question is: Is there a way for me to tell WordPress to mark images as "unattached" if they are not inserted or linked in _any_ existing posts? _edit_ To clarify:   1. We upload 20 (or more) images to a post and insert them. These are all automatically attached by WordPress to the post. We want this to happen, because our theme template pulls all attached images per post.   2. Before the post is published, it's edited and some images are taken out and won't be used again.   3. We're looking for a way to detect which images are not being used* in the post, and automatically unattach them from that post. This is so that we can just head into `Library > Unattached`, select them all and delete them. * I originally used the term 'unlinked' because all the inserted images are `<a href=""><img></a>` so it may help in terms of detecting what are being used because a link to the image is present in the post.


title: How to create a page template that retrieves content from db?

text: I have to create a hundred of content pages that share the same structure. For example:               [Title] - [Subtitle]          [Description]          [Specs]           - [Spec-A]      - [Spec-B]      - [Spec-C]          [Features]           - [Image-A][Feature-A]      - [Image-A][Feature-B]      - [Image-A][Feature-C]      I would like to store this information in some DB tables so that if I need to change the template content positions or style, I can do it once for all pages. But unfortunately I am not very good at PHP, so I don't know where to start. Which features of Wordpress or plugins can I use to reach the result? Thank you in advance