title: Limit the number of posts a category can have - newest post goes in, oldest one drops out, possible? plugin?

text: I would like to limit the number of posts which can belong to a given category, for example: The "News" category should have no more than ten posts. When the eleventh post is created the oldest post should be dropped from the category without the need to edit the post manually to remove it from the given category. Does it sound possible?


title: All my inserted images gets a link to the full image even if it is already full size image

text: So when I create a new post and I upload an image onto the my server. Normally depending on the size of the image you can select small, medium, large image to place inside the post. On other sites that I have with Wordpress, if I select medium image and insert, Wordpress will place `<a href="...uploads/full-size-img.jpg"><img src="medium.jpg"></a>`. Then if I was to insert a full size image, Wordpress would know that I don't need the `<a href="...upload/full-size-img.jpg"></a>` around the full size image. The problem I have at the moment is that now it always thinks I need an `<a href="upload/full-size-img.jpg"></a>` around all my images even if it is a full sized image already. When I select the none option in the inserting image popup window, the next time I try to insert a medium sized image, it doesn't detect that I would need the `<a href="...uploads/full-size-img.jpg"><img src="medium.jpg"></a>`. I could keep changing the link option in the image inserting window, from "none" when it is full size image to "file URL" to when it's a medium sized image. But with my site I have 26 different writers so I would have to explain to all of them what to do.


title: custom post archive URL is wrong

text: I recently found out that I could use the `with-front=>false` argument in `register_post_type()`. So I went and changed my custom post type slugs and did a `flush_rewrite_rules()`. Now 2 of my custom post types are using the desired URLs and 2 are not. The only difference between the 2 that work and the others, is that they also have custom taxonomies. Here is the code from my `functions.php` file. Any idea what I'm doing wrong?               add_action('init','ASH_addtaxonomies');     add_action('init','ASH_addposttypes');          function ASH_addtaxonomies(){         register_taxonomy('ash_weave_structure', null,                           array('labels'=>array('name'=>'Weave Structures',                                                 'singular_name'=>'Structure'),                                 'public'=>true,                                 'hierarchical'=>true,                                 'rewrite'=>array('slug'=>'samples_weaving/structures', 'with-front'=>false),                                 'query_var'=>true                           )         );         register_taxonomy('ash_weave_technique', null,                         array(  'labels'=>array(    'name'=>'Weaving Techniques',                                                     'singular_name'=>'Technique'),                                 'public'=>true,                                 'hierarchical'=>false,                                 'rewrite'=>array('slug'=>'samples_weaving/techniques', 'with-front'=>false),                                 'query_var'=>true                         )         );           register_taxonomy('ash_equip_cats', 'ash_equipment',                         array(  'labels'=>array(    'name'=>'Equipment Categories',                                                     'singular_name'=>'Equipment Category'),                                 'public'=>true,                                 'hierarchical'=>true,                                 'show_ui'=>true,                                 'show_in_nav_menus'=>true,                                 'rewrite'=>array('slug'=>'equipment/category', 'with_front'=>false),                                 'query_var'=>true                         )         );     }          function ASH_addposttypes(){              //good archive url: http://example.com/samples_weaving/         register_post_type('ash_weaving',                             array(                               'description' => 'Picture, draft and technical details of a weaving sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_weaving', 'with_front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag','ash_weave_structure','ash_weave_technique'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Weaving Samples'),                                                   'singular_name'=>__('Weaving Sample')                                                   )                             )                         );         //bad archive url: http://example.com/archives/samples_spinning/         register_post_type('ash_spinning',                             array(                               'description' => 'Picture and technical details of a spinning sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_spinning', 'with-front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Spinning Samples'),                                                   'singular_name'=>__('Spinning Sample')                                                   )                         )         );              //bad archive url: http://example.com/archives/samples_dyeing/           register_post_type('ash_dyeing',                             array(                               'description' => 'Picture and technical details of a dyeing sample',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'samples_dyeing','with-front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'editor',                                                     'excerpt',                                                     'comments',                                                     'revisions',                                                     'thumbnail',                                                     'author',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Dyeing Samples'),                                                   'singular_name'=>__('Dyeing Sample')                                                   )                             )         );              //good archive url: http://example.com/equipment/     register_post_type('ash_equipment',                             array(                               'description' => 'Weaving and spinning equipment that ASH makes available to members',                               'public' => true,                               'show_ui' => true,                               'show_in_menu' => true,                               'menu_position'=>5,                               'rewrite'=>array('slug'=>'equipment','with_front'=>false),                               'query_var' => true,                               'taxonomies'=>array('post_tag','ash_equip_cats'),                               'has_archive'=>true,                               'supports' => array(  'title',                                                     'excerpt',                                                     'thumbnail',                                                     'page-attributes'),                               'labels' => array ( 'name'=>__('Equipment'),                                                   'singular_name'=>__('Equipment')                                                   )                             )             );     }


title: latest post showing up twice on posts page

text:
Can someone please help me alter my coding to eliminate my problem? I am using this line before the loop:               <?php query_posts('cat=3&showposts='.get_option('posts_per_page')); ?>      for context:               <?php get_header(); ?>

                  <?php query_posts('cat=9&showposts='.get_option('posts_per_page')); ?>                  <?php if (have_posts()) : ?>                      <?php while (have_posts()) : the_post(); ?>                          <div <?php post_class('post') ?> id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                             <?php the_content('Read the rest of this entry »'); ?>

Posted <?php the_time('M j Y') ?>

                           <?php endwhile; ?>

<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>

                  <?php else : ?>
Not Found

Sorry, but you are looking for something that isn't here.
                 <?php get_search_form(); ?>                  <?php endif; ?>

      I believe this is what is causing my latest post to show up twice. Is there supposed to be something else along with this line??


title: WP SQL Categories Export and Import

text: I want to export and export only the Categories and their description using SQL. For now I've managed to retrieve them using this:               SELECT         wp_term_taxonomy.description,         wp_terms.term_id,         wp_terms.name,         wp_terms.slug     FROM wp_term_taxonomy         JOIN wp_terms ON ( wp_term_taxonomy.term_id = wp_terms.term_id )     WHERE wp_term_taxonomy.taxonomy = 'category'      I need some advices on how do to this so I can not screw up the blog. I mention that on the new blog I do not have these categories.


title: wp_options flooded with transient API entires

text: I make heavy use of the WordPress Transient API. Suddenly a few days ago my `wp_options` table began being flooded with transient entries (2GB worth on average). Normally WordPress only writes them to the DB if there is not persistent object caching mechanism. However I use Lite Cache for object caching and that hasn't changed in months. Any ideas on why this would start happening?


title: How can I add user profile fields to my mailpress mailout

text: I want to be able to send emails to my subscribers but reference their name in the email and possibly some other profile fields. Can I do this using mailpress? So for example. I want each email sent out to start with. Hi _Tom_ , rather than Hi, I notice that you can add custom fields but couldn't work out how to relate that to a user profiles field at the time.


title: How do I hook a sidebar via add_action?

text: On one of my templates I have an action hook 'do_xyz' I want to attach a custom sidebar to the action hook do_xyz Here is what I am trying in my theme functions.php file, does not work:               add_action('do_xyz', 'get_sidebar('secondary')' );      What is the proper way of doing this? I know my hooks are setup right because if I attach a custom built function there, then it works. I just can't seem to attach the sidebar the way I am trying to. **EDIT** I have this in my functions file: > function do_xzy() { do_action('do_xyz'); } Then in my template itself I have:               do_action( 'do_xyz' );      I fully understand registering an action hook in my theme, and also adding a place for the action to occur. I even somewhat understand add_action, it is just not liking it when I put the get_sidebar('secondary') in there as my function I want to attach to my action hook. Hope that makes more sense.


title: User meta and author meta

text: Here's what I have so far..               class emailer {     function notifyHeart($post_ID)  {              $interests = get_user_meta( get_current_user_id(), 'interests', TRUE );         $to = the_author_meta( 'user_email', get_current_user_id() );              if(has_tag($interests[0])) {             $email = $to;             mail($email, "An article about Heart",                'A new post has been published about heart.');             return $post_ID;         }     }     }          add_action('publish_post', array('emailer', 'notifyHeart'));      What I need to do now, before actually sending the email, I need something that checks if the user has an $interest and if so, send them an email. Any help with this?


title: Resizing Images to lower Disk Space Using Plugins

text: I'm trying to take existing images and shrink the file size down by resizing to photos to a smaller resolution. I've tried a few methods so far:   1. Simply editing the photo in photoshop and reuploaded, replacing the existing (and larger) file.   2. I tried the Imsanity plugin and set the options to be less than 1024x1024 and then bulk resized the images without failure (but it did not do the trick).   3. I also tried the Regenerate Thumbnails plugin, and ran the rebuild without failure (but it did not resize the photos). Maybe there is a better or a right way to accomplish what I'm doing, but I can't seem to find anything on this issue. I'm running a Multisite install and WP FTP is not enabled and can't be enabled to solve this.


title: Add/remove action on jQuery toggle

text: I have Ajax setup and I'm trying to toggle a function from being loaded into wp_head. It works on the first toggle function, but the second function doesn't register.               function av_maintenance_mode_turn_on() {         if( !wp_verify_nonce( $_GET['nonce'], 'av-maintenance-mode-nonce' ))         die( 'Go away!');         if( add_action( 'get_header', 'av_maintenance_mode_active' ) ) {             echo 'maintenance_mode_on';         }         die();     }     add_action( 'wp_ajax_toggle_av_maintenance_on', 'av_maintenance_mode_turn_on' );      This function works ok. The response is seen.               function av_maintenance_mode_turn_off() {         if( !wp_verify_nonce( $_GET['nonce'], 'av-maintenance-mode-nonce' ))         die( 'Go away!');         if( remove_action( 'get_header', 'av_maintenance_mode_active' ) ) {             echo 'maintenance_mode_off';         }         die();     }     add_action( 'wp_ajax_toggle_av_maintenance_off', 'av_maintenance_mode_turn_off' );      There is no response here. I can echo something before the if statement and the response shows up, so this is likely because `remove_action` is not working. Here is my JavaScript:               jQuery(document).ready( function($) {         var widget_inside = $('#av_maintenance_mode_widget .inside');         var toggle_on = {             action: 'toggle_av_maintenance_on',             nonce: av_maintenance_mode_vars.nonce         };         var toggle_off = {             action: 'toggle_av_maintenance_off',             nonce: av_maintenance_mode_vars.nonce         };         $('#av_maintenance_mode').toggle(              function() {                 $.get( av_maintenance_mode_vars.ajaxurl, toggle_on, function(response) {                     if( response == 'maintenance_mode_on' ) {                         $(widget_inside).addClass('maintenance_mode_on');                     }                 });             },              function() {                 $.get( av_maintenance_mode_vars.ajaxurl, toggle_off, function(response) {                     if( response == 'maintenance_mode_off' ) {                         $(widget_inside).removeClass('maintenance_mode_on');                     }                 });             }         );     });      **EDIT** I tried the same with 'wp_head' as the tag as well as add/remove filter instead of action, but I'm still not removing the function from the header.


title: Show ellipsis (...) only if the number of characters exceeds limit defined in substr

text: I'm limiting the number of characters in the title with `substr`. But even if the title is less than 50 characters, being shown the ellipsis (...). I would not display the ellipsis if the title does not exceed the limit of 50 characters.               $title = substr( $title, 0, 50 ) . "...";      > Title of my post ... (Incorrect: Title less than 50 characters in this case should not display "...") > `Title of my post that exceeds 50 characters ...` (Correct: Title longer than 50 characters are cut and accompanied by "...")


title: Custom search result

text:
I've tried to google it for several time but i couldnt find anything clear. I added a select field in the `searchform.php`, but if the user choose one of the options, i dont know how to show it on the result page. here's my `searchform.php`:               <form id="busca" action="<?php echo home_url(); ?>" class="search" method="get">
Busca

Pesquise as opiniões das pessoas
que fazem Pernambuco

             <input type="text" id="palavraChave" name="s" class="search-input" value="nome ou palavra-chave">             <button class="search-submit" type="submit" role="button"></button>

                     <select name="areaAtuacao" id="areaAtuacao" class="custom">                 <option value="">selecione a área de atuação</option>                 <?php                     $args = array('taxonomy' => 'categoria_entrevistados', 'title_li' => 0);                     $cats = get_categories( $args );                          foreach ($cats as $cat) {                         echo '<option>' . $cat->cat_name . '</option>';                     }                 ?>               </select>

      and here's my results page:               <?php get_header(); ?>

<?php echo sprintf( __( '%s Search Results for ', 'html5blank' ), $wp_query->found_posts ); echo get_search_query(); ?>

             <?php get_template_part('loop'); ?>                  <?php get_template_part('pagination'); ?>

      could someone help me?


title: RSS feed link on archives page not working

text: I am trying to add a RSS link on my website archive-pages, which means, Suppose I am on page `http://mbas.in/location/mba-in-usa/` then on this page, I will be having a **RSS LINK** named link, when I click on this link, it should redirect me to `http://mbas.in/location/mba-in-usa/feed` When anyone navigates through my archive-pages, they will get RSS FEED OF THAT PAGE just by clicking one link, for this I tried the following code `<a href="<?php get_permalink(); ?>/feed">RSS feed of this page</a>` but I am not getting that, instead its giving me `http://mbas.in/feed`


title: 'Organize Series Plugin' as muti author feature

text: Currently with organize series plugin author level user cannot manage their own series. I am trying to add feature to the plugin so that author level user can create & manage their own post and admin and editor can manage all series post. After a little bit searching I have found that that can be done by creating a 'series owner' metadata for series taxonomy and filter by this 'series owner=authorid' to show & manage authors' own post. For adding meta for series taxonomy I have found some tuts and plugin wordpress.org/extend/plugins/taxonomy-metadata/ and shibashake.com/wordpress- theme/add-term-or-taxonomy-meta-data. Now how can I do that? Any help will be appreciated.


title: Displaying content from one WP site on separate WP site

text: I have two totally separate WP websites setup. Different domains, different databases. I manage both of them and they are both hosted on a dedicated server. I am trying to include some basic content that requires just a tad more than an RSS feed. I need to pull data from SITE-1 and display it on SITE-2, using basic WP formatting from a loop. Everywhere I've looked makes it seem impossible. I've tried calling wp-load.php but can't get it to work, and am not sure if it is even the right way to go. I have access to both sites' root servers, and even the server root if necessary. Is there anyway to do this? Thanks!


title: Subscribe to email for security fixes?

text: Is there any email alert list for security fixes? I'd rather not rely on just an RSS feed.


title: Create a new page in WordPress theme

text:
I am creating a functionality in WordPress where I need to create a new php page and have to link it in the menu section of my website. Though I can create a page from the dashboard but due to some reasons that option has been discarded. Aim is to create a new page and link it with my existing site. I have created a page with following entries               <?php get_header(); ?>
             <a href="<?php echo get_option('home'); ?>/">Home » Custom
Custom page

             <?php mycustomFucntion(); ?>

     <?php get_sidebar(); ?>     <?php get_footer(); ?>      I am clueless how I can link it with my existing site so that when some one click on the link on menu user should be redirected to this page.

<a href="<?php echo get_option('home'); ?>/">Home
              <?php wp_list_pages('sort_column=menu_order&title_li='); ?>
<a href="<?php echo get_option('home'); ?>/">CustomPage

      I am just playing around with php and WordPress in J2ee I know I can hit an action class and can return this custom page as new view but not sure how i can do this in WordPress.


title: How to validate inputs with filter in register_setting callback

text: I now have this function that works well :               function wpPartValidate_settings( $input ) {        if ( check_admin_referer( 'wpPart_nonce_field', 'wpPart_nonce_verify_adm' ) ) {              // Create our array for storing the validated options         $output = array();              foreach( $input as $key => $value ) {                // Check to see if the current option has a value. If so, process it.           if( isset( $input[$key] ) ) {                  // Strip all HTML and PHP tags and properly handle quoted strings             $output[$key] = strip_tags( stripslashes( $input[ $key ] ) );                } // end if         } // end foreach       } // end if       // Return the array processing any additional functions filtered by this action       return apply_filters( 'wpPartValidate_settings', $output, $input );     }      I wonder how to implement filters into that function. The goal is to inform the administrator that one input has not been correctly filled (with a correct email, url, numbers, date...)


title: matisse theme show excerpts not whole content

text: I want to only show the excerpts, not the entire content, This question has been asked and answered in respect of the twenty eleven theme. Matisse theme is different. where can i find the files to alter content to excerpts


title: Tips for managing code when developing a parent theme framework

text: I have started work on an open source theme framework that pulls in lots of great code & resources from elsewhere. For example it uses:   * jQuery   * Option Framework Theme   * LESS etc etc. Most of these external projects are hosted on Github or SVN. Rather than continually download and integrate the latest versions of these other libraries into my framework I am looking for a way to automate this process. I would be prepared to change the way I work considerably to accomodate an automated work flow that ensures I am always up to date and not always downloading or duplicating files. Any suggestions are greatly appreciated.


title: Wordpress 3.3 custom post type with /%postname%/ permastruct?

text: There is earlier post with similar title, but it does not look in to the WordPress 3.3, and that is important as 3.3 advertises interestingly: "Use the postname permalink structure without a performance penalty" Problem with Wordpress 3.2 and earlier was that first it looked page names, and then 404. It didn't check the arbitrary post types first. 3.3 on the other hand _must_ look post types, then pages, and finally 404 (as it advertises this feature). This implies that custom post types without slug should be _simple_ , if they didn't hard code `post_type=post` somewhere. I can't find a 3.3 specific solution yet though. **Question** : How can I define permalink struct "/%postname%/" for any given custom post type "xyz"? Thanks.


title: Development of arabic version of wordpress site without using plugin or google translate

text: I got a site which is now in English and the site is just static without any dynamic functionality. So, the client wants to frequently edit the site content by its own and he also told me to change the entire site to the Arabic language so I have decided to convert it to wordpress cms to give him editing flexibility. I have stuck at what should I do to convert the site content into Arabic as far as I know we can implement google translate api or other translation plugins to switch the site language on the go but we all know using such plugins isn't a good choice as sometimes they break words and characters of the language and not work proper as we expect so here I need some appropriate approach to do this task efficiently and effectively. Many thanks.


title: Pass number of images as parameter to NextGen Gallery

text: Hi is there a way to pass through a parameter indicating the number of images (thumbnails) displayed on a page? Thanks


title: Editing Loop So It Targets Specific Tags?

text: Confused on how to achieve this, but what I'm trying to do is load posts with the tag "reviews" in the loop on the homepage. Index.php:               <?php /* Start the Loop */ ?>     <?php while ( have_posts() ) : the_post(); ?>              <?php             get_template_part( 'content-reviews', get_post_format() );         ?>               <?php endwhile; ?>               <?php else : ?>          <?php get_template_part( 'no-results', 'index' ); ?>          <?php endif; ?>


title: Check if on last page of paginated post using wp_link_pages

text: A client of mine reviews products on his site, and wants to display the review criteria and score on the last page of each posts. Typically, there are 3-5 pages per post, and I'm looking for a way to check if we're on the last page. ‹!--nextpage--› is used in the post to divide it into pages, and wp_link_pages on the front-end to display pagination links. I've been able to find ways of checking if we're on page one, or not on page one, or on a specific page. But nothing for checking if we're on the very last page.


title: How to add page content into another page

text: I'll try to explain myself and what I'm trying to gain. I run a DJ business and am trying to get into the Wedding market. One way is to make sure the slug of each page has "wedding-(venue name).html for example. I've got 20 of these pages and they work really well. Problem is that the title H2 header on the page is customised to the venue name (Thinking of getting married at "venue name"?). the rest of the page is the same as the rest. Is there a way of me creating a unique page for the H2 title and then using php to call another single page or post to add underneath? This way I'll only ever need to change one post of page to change all of the pages. Hope I make sense... Cheers, Lee


title: How to Debug: My Plugin Interferes With My Theme

text: I'm learning how to write a plugin. My plugin is a google map that places markers based on the selected criteria. It works fine. The problem is that it interferes with one part of the theme I'm using. The theme is called Superb. The theme has a uBillboard, basically, it's a slider. For some reason, my plugin prevents the uBillboard from appearing-- the first maybe 30 pixels of the image are visible. I'm not sure where to begin in order to debug this. What should I be looking for? What are common reasons for plugins interfering with themes? I can post code, but I don't think that it makes sense to post the whole theme and my plugin. Thank you.


title: Passing form inputs into multi-taxonomy query

text:
I'm in the process of building out a search page to perform a query on a custom post type and its associated meta and taxonomy. Eventually, I would it to query multiple taxonomies as well as compare values to those in the meta (ie - find posts with foo between X and Y). I have a pretty good understanding of the query function, thanks to the posts by Otto and Scribu. The problem is I'm struggling to figure out how to pass the variables in via a form. My first attempt was to try the method recommended in this post, but I'm not returning any results (address bar shows: `http://sitename.com/?brand=22`. Here's my first attempt ("brand" is one of my taxonomy names):               <form action="<?php echo home_url('/'); ?>" method="get">
<?php wp_dropdown_categories('taxonomy=brand&name=brand'); ?>

<input type="submit" value="Search!" />
     </form>      Will a simple HTML form such as this suffice? Or should I be building a function in my functions.php file? My second attempt was to incorporate a function:               <?php     function get_terms_dropdown($taxonomies, $args){         $myterms = get_terms($taxonomies, $args);         $output ='<select multiple="yes" size="3" name="'.$taxonomies.'">';         foreach($myterms as $term){             $root_url = get_bloginfo('url');             $term_taxonomy=$term->taxonomy;             $term_slug=$term->slug;             $term_name =$term->name;             #$link = $root_url.'/'.$term_taxonomy.'/'.$term_slug;             #$link = $term_taxonomy;             $output .="<option value='".$term_name."'>".$term_name."</option>";         }         $output .="</select>";     return $output;     }     $args = array('orderby'=>'count','hide_empty'=>true);     ?>               <form role="search" method="get" id="searchform" action="<?php bloginfo('home'); ?>">     <?php echo get_terms_dropdown(array('brand'), $args); ?>     <input type="submit" id="searchsubmit" value="Search" />     </form>      But again, I'm not able to submit the form/generate results. Am I on the right track here? Any suggestions are appreciated.


title: Conditional Tags and Echo HTML / divs or CSS and Display: none?

text: If I wanted to show a slider on the home page only, is it better or does it make a difference if I:   * use a PHP if/then statement and echo a division and markup, or    * use CSS along with a body class and display none the division? or   * a combination of both What's the best practice?


title: Comments on Author page

text: **Update:** Ok,the DEBUG log says:               PHP Notice:  Undefined offset: 0 in /home/content/00/8437600/html/test/wp-includes/query.php on line 3105          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3939          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3941          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3943          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3944          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3952          PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3967      **NOTE:** At the top of my `author.php` I use the following code in order to get user meta for the page:               <? $curauth = (get_query_var('author_name')) ? get_user_by('slug',             get_query_var('author_name')) :             get_userdata(get_query_var('author'));     ?>      **End of update** **Original Post** First - I am teaching myself how to write php and am also new to this forum. I am trying to follow the instructions from the top answer for this question Author page: Comments and Ratings? to add comments to author.php - without any luck. The following is the steps I have taken:   1. Created a custom post type to hold the comments   2. Created a new post in said post type   3. Created custom field in user meta called -> author_post_id   4. Added newly created post id to user meta for particular user Note: this works because I can add echo statement in the code provided and the above link and it echos the correct post id so I know I did something write (lol)   5. Copy/pasted the code given on the above link (answer #3) into my author.php Nothing is showing up. What am I missing? I even added `wp_reset_query();` after the loop that displays post by the author and it made no difference. Here is my test author page http://test.thesingleparentperspective.com/author/ckmatthews/


title: WordPress TwentyTen Search

text:
Could someone please explain why when I submit an empty search form I get sent to a page with no navigation menu? The navigation menu is there when a search term that has no matches is submitted and the error message is the exact same: "Sorry, but nothing matched your search criteria. Please try again with some different keywords." looking at the seach.php file there's only one else clause that handles the no result found code so why isn't functioning the same? I haven't modified the search from the original theme                   <?php     get_header(); ?>

     <?php if ( have_posts() ) : ?>
<?php printf( __( 'Search Results for: %s', 'twentyten' ), '' . get_search_query() . '' ); ?>
     <?php     /* Run the loop for the search to output the results.     * If you want to overload this in a child theme then include a file     * called loop-search.php and that will be used instead.     */     get_template_part( 'loop', 'search' );     ?>     <?php else : ?>

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

<?php printf( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?>

     <?php endif; ?>

     <?php get_sidebar(); ?>     <?php get_footer(); ?>


title: Custom post type title of each author in his own post

text: I have a seriously problem :( maybe someone can help me The users registered in my wordpress page have one post only, and i created custom_post_type named "ofertas". The users can create one oferta only. With this code show the oferta title on index.php, the problem is show the oferta title in ALL POSTS. I want only show his own oferta title (if they have).               <?php      // First loop     while ( have_posts() ): the_post();      author_id = get_query_var('author');         $ofertas = array();          // Second Loop     $i = 0;     $args = array(         'author' => $author_id,         'post_type' => 'ofertas'     );     $the_query = new WP_Query( $args );     if ($the_query->have_posts()) :          while ($the_query->have_posts()) : $the_query->the_post(); // check if it has offers, if it has, loop over the offers             $ofertas[$i]['title'] = get_the_title(); // or anything you need             $i++;         endwhile; // close the loop     else: // if it has no post         continue; // we don't display the post     endif;          wp_reset_postdata();      ?>     <div class="post">     <?php     the_title(); // or anything you need          foreach ($ofertas as $oferta):         echo $oferta['title']; // we display the title of the offer     endforeach;     ?>     </div>     <?php  endwhile; ?>      I created the custom_post_type with this code               add_action('init', 'crear_tipo_ofertas', 0);          function crear_tipo_ofertas() {     $labels = array(       'name'               => _x( 'Ofertas', 'Post Type General Name', 'text_domain' ),       'singular_name'      => _x( 'Oferta', 'Post Type Singular Name', 'text_domain' ),       'menu_name'          => __( 'Ofertas', 'text_domain' ),       'parent_item_colon'  => __( 'Oferta Padre', 'text_domain' ),       'all_items'          => __( 'Ofertas', 'text_domain' ),       'view_item'          => __( 'Ver Oferta', 'text_domain' ),       'add_new_item'       => __( 'Añadir Oferta Nueva', 'text_domain' ),       'add_new'            => __( 'Añadir', 'text_domain' ),       'edit_item'          => __( 'Editar Oferta', 'text_domain' ),       'update_item'        => __( 'Actualizar', 'text_domain' ),       'search_items'       => __( 'Buscar Ofertas', 'text_domain' ),       'not_found'          => __( 'Ofertas no encontradas', 'text_domain' ),       'not_found_in_trash' => __( 'Ofertas no encontradas en Papelera', 'text_domain' ),       );          $rewrite = array(       'slug'                => 'oferta',       'with_front'          => true,       'pages'               => true,       'feeds'               => true,       );          $args = array(       'label'               => __( 'oferta', 'text_domain' ),       'description'         => __( 'Ofertas Spas y Balnearios', 'text_domain' ),       'labels'              => $labels,       'supports'            => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields'),       'taxonomies'          => array( 'category', 'post_tag' ),       'hierarchical'        => false,       'public'              => true,       'show_ui'             => true,       'show_in_menu'        => true,       'show_in_nav_menus'   => true,       'show_in_admin_bar'   => true,       'menu_position'       => 5,       'menu_icon'           => site_url().'/wp-content/plugins/my_plugin/images/logo.png',       'can_export'          => true,       'has_archive'         => 'ofertas',       'exclude_from_search' => false,       'query_var'           => 'ofertas',       'rewrite'             => $rewrite,       'capability_type'     => 'post',       );          register_post_type('ofertas', $args);     }          add_action('init', 'crear_tipo_ofertas', 0);


title: Is there a Wordpress Event Manager that links with your user database?

text: I'm presently moving my site from a different CMS. Geeklog to Wordpress. They have an event plugin that I used which is very simple. This is it... http://www.portalparts.com/staticpages/index.php?page=glEventMgr&query=event I run comedy open mics and everyone on the website is a comedian. They all have a login. The ones out there for Wordpress are great, but they don't seem to tie in with your user database. On this plugin above for the other CMS they were able to login, click an event and register for it with one more click. I could set a limit on how many could sign up, they could unregister themselves, Email registrants etc... No forms to fill out, nothing but logging in and making a couple clicks. I've been searching through all the WP event plugins and none seem to do this. They all make you fill out fields to register. If anyone knows of a plugin that does what I'm looking for or can help in any way, please let me know! Thanks, B


title: Get post ID from the Create post/page admin interface?

text: I am adding a meta box in the create post/page interface and I want to get the ID of the post being edited/created so I can dynamically display the value of the input field. From the wordpress codex http://codex.wordpress.org/Function_Reference/add_meta_box:               /* Prints the box content */     function myplugin_inner_custom_box() {            // Use nonce for verification       wp_nonce_field( plugin_basename(__FILE__), 'myplugin_noncename' );            // The actual fields for data entry       echo '<label for="myplugin_new_field">' . __("Description for this field", 'myplugin_textdomain' ) . '</label> ';       echo '<input type="text" id= "myplugin_new_field" name="myplugin_new_field" value="whatever" size="25" />';     }      How do I pass the ID to `myplugin_inner_custom_box()`? So I can use the following within it:               // Get the value of the meta key that is associated to the page       $as_meta_value = get_post_meta( $post_id, 'as_link_to_image', true );      and replace the `whatever` value with the value of the meta key in the input field.


title: How to load default scripts included with WordPress correctly?

text: I want to know the correct way to load existing scripts in `wp- includes/js/jquery/` Example I want to load `jQuery UI Tabs` What I have done for now               function sample_exists_code() {        echo '<script type="text/javascript" src="'. CONSTANTS_JS .'/jquery.js"></script>'."\n";         echo '<script type="text/javascript" src="'. CONSTANTS_JS .'/jquery-ui.js"></script>'."\n";      }         add_action('admin_head', 'sample_exists_code');      and this code working fine to load the UI tabs. But when I try use this code and it's not working               function sample_exists_code() {         wp_enqueue_script('jquery');            wp_enqueue_script('jquery-ui-tabs');                 }         add_action('admin_head', 'sample_exists_code');      Let me know the correct way to call the existing scripts. * * * Update :               // load existings js and template css.     function sample_admin_js_head()     {         wp_enqueue_script('jquery-ui-tabs', null, array('jquery-ui-core','jquery'), null, false);         echo '<link rel="stylesheet" type="text/css" href="' . CONSTANTS_STYLES . '/style.css" />' . "\n";     }          // load up the menu page     function sample_add_page()     {         $optionpage = add_theme_page(__('Theme Options'), __('Theme Options'), 'edit_theme_options', 'sample', 'sample_do_template');         add_action( "admin_print_scripts-$optionpage", 'sample_admin_js_head' );     }          add_action('admin_menu', 'sample_add_page');


title: HTML editor accessing quicktag buttons

text: I'm stuck in searching a way to access the quicktag buttons on the html editor with jQuery. I tryed to access the buttons with `.each()` and `.children()` but both won't work.               jQuery( document ).ready( function( $ ) {            $( '#ed_toolbar input.ed_button' ).children().css( 'color', 'red' );            $( '#ed_toolbar input.ed_button' ).each( function() {         $( this ).css( 'color', 'red' );       });               });      I think the buttons are not inserted when the DOM is ready.


title: Ajax URLs without #!, how to prevent falling into single.php on load or reload?

text: I'm trying to make things properly with a single page ajax powered portfolio. I've read that there is no need of `#!` to make it crawlable by google. So I have clean URLs that updates with `.pushState` when I load a post. My problem is that if you hit F5 or load directly an URL, you fall into the single.php. You can try it yourself here: `http://www.youpiemonday.com/` How can I prevent falling into the article page? I thought about redirecting from the single.php to the home and trigger the opening of the post there. But seing the comments, it doesn't seems to be a great idea. Anyway I'm stuck right now... You can see my thought process on StackOverflow here. I'd love to here some feedback from Wordpress specialists... :) * * * **EDIT:** I may have found a simple/quick way to redirect to the homepage if the request is done when on single.php. I simply added this to function.php               add_action('wp', 'RedirecToPost');       function RedirecToPost(){          if($_SERVER['HTTP_X_REQUESTED_WITH']=='' && is_single()){ // if http request AND on single.php                  wp_redirect( home_url() ); // redirect to home                 // THEN check the post requested AND trigger a click on its thumbnail                  }       }      But I'm still at the same point. I need a way to check what was the requested post and trigger a click on its thumbnail. Now I'm really stuck by my scripting knowledge. How can I check the last page url (referer?) and find the href pointing to it in the current page?


title: Disable directory browsing of uploads folder

text: I'm using Wordpress as a CMS for a simple website. I want to prevent users from being able to browse the directories such as the wp-content/uploads folder or any directories of my theme. My host does not allow me to use "Options" or "DirectoryIndex" within a .htaccess file. I have tried putting a .htaccess file in the /uploads/ folder with "IndexIgnore *" in it. However none of my images from the /uploads/ folder will show up on my site with that option. I also tried password protecting the directory with a .htpasswd file but this gives any visitor of my site a popup asking them to enter the credentials. So my question is how do I prevent people from browsing the directories while enabling me to embed files from those directories in my wordpress posts/pages. For example, can I place .htaccess file in the /uploads/ directory and add RewriteRules so WordPress can still show the files on my website?


title: How do you avoid caching during development?

text: Is there a simple way do prevent all caching when testing the appearance of changes to the site? I use WP Super Cache. I can delete its cache using the option provided, delete the cache for my browser, and still some changes to css or widgets do not refresh. I try other work-arounds like switching browsers or computers, but there must be a more stream-lined workflow where I can ensure I'm viewing the changes I made and not some cached earlier format? What's the best solution for this?


title: Plugin to embed local video into Wordpress?

text: What's the best way to achieve this: I have local videos on my server, but if I use the WP add media button I just get a link to a video, rather than it embedded. Are there any good plugins which will let me embed local video? Everything seems to support video sharing from Google, YouTube, Vimeo etc.


title: Using wp_login_form passowrd as undefined

text: Hi I am using the wp_login_form function and when it displays the password field always displays the word undefined. If I remove that when logging in the form works fine. Anyone know why this placeholder value is there no matter what instance I use it in (page, post,theme) Thanks.


title: What would be a proper name for a custom post type created for static content?

text: I recently divided my posts into 3 types: Posts (blog entries) Pages (individual web pages) Static Content (content that goes to specific sections of a Page. For example, the Tagline). I'm not sure if the end user will understand what static content means. I thought about Page Content but I think Blog entries are page content too (the same as Web Content). Any suggestions?


title: Images not rendering

text: I have a baking blog that I run and recently I have changed the url. The problem I have now is when I add images to the posts or libary they are not showing/rendering. The uploading steps go through OK, but the image does not render. Can you assist, I just don't where I have gone wrong.


title: Search result conditonal tag

text: Is there a conditional tag (or a similar concept) that can tell me wether the search returned posts or not?


title: Get Parent Custom Taxonomy Term and Color Div background

text:
I am currently displaying posts from a CPT. Each has a taxonomy term from a parent. I would like to create a function that would color the background of a div of particular parent terms. Here is my set up: Lets call this Cars: > Domestic   >  --Dodge --Ford --Chrysler > > Import   >  --Honda --Toyota --Kia > > European   >  --BMW --Benz The parent is Domestic, Import, European. My posts displays as follows: > Ford   >  Post Title   >  Post Content   > > > Toyota   >  Post Title   >  Post Content   > Etc. My goal is to color the DIV that the child term is held in. For example:
Ford
 (background green)     Post Title
      Post Content

Toyota
 (background red)     Post Title
      Post Content
      I am trying to construct the following:               if (parent_term == 'domestic'){     .car_type{     background-color:green;     }     }          if (parent_term == 'import'){     .car_type{     background-color: red;     }     }      So far I have checked out get_terms. Any help pointing me in the right direction would be amazing. Thank you, I hope this makes sense.


title: Add a meta box to ALL Pages

text: I'd like to add a meta box to all my pages (not posts) but it looks like I am only able to add it for a specific post based on the codex?               add_meta_box( $id, $title, $callback, $page, $context = 'advanced', $priority = 'default', $callback_args = null );


title: Wordpress and isotope filtering

text:
Im trying to use Isotope(http://isotope.metafizzy.co/) to filter my Wordpress posts, http://i44.tinypic.com/fco55k.jpg this is how my site looks like, i would like to filter posts depending on a post category so i need to add a class name to each post and then filter it using isotope
show all

design

typography
      those are the names of my categories, and then i would like to add class name of a post depending on a category he is in.
               <?php               $args = array('orderby' => 'rand' );               $random = new WP_Query($args); ?>               <?php if(have_posts()) : ?><?php while($random->have_posts()) : $random->the_post(); ?>              <a href="<?php the_permalink() ?>"> <div id="img" class="<?php  $category = get_the_category();                      echo $category[0]->cat_name; ?>">                 <?php                      the_post_thumbnail();?>
<?php the_title(); ?>

      and javascript im using


title: How can I add extra attribute in the 'Page Attribute' section in wp-admin for pages?

text: I would like to add a select list in the `Page Attribute` box you see on the right side in the administration interface for pages. Does anyone know if that is possible? Or at least add a custom box below this box?


title: How do I update a specific object in an array, in user meta?

text: I have this array, below, to set custom user meta (`lh_userbadges`) in `user_meta` but I'm not exactly sure how to update just parts of the array later on...               $lh_user_badges = array(         'lh_userbadge_comments25' => '0',         'lh_userbadge_comments50' => '0',         'lh_userbadge_comments75' => '0',         'lh_userbadge_comments100' => '0',         'lh_userbadge_comments150' => '0',         'lh_userbadge_submited' => '0',         //etc.     );     update_user_meta($user_id, 'lh_userbadges', $lh_user_badges);      From what I gathered in other stack overflow questions (How to update serialized data in the user meta data is a good example BUT it just increments, which I don't want. I want to set a specific number just once.), I think it something along these lines but, I'm just not sure....               $meta_value = get_user_meta($user_id, 'lh_userbadges', false);     $meta_value['lh_userbadge_comments25']  //....?      So, for example, I just want to update the object `lh_userbadge_comments25` from `lh_userbadges` from 0 to (lets say) 25, how would I do that? I think I'm on the right track with that 2nd part of code but I do not know... Any ideas? **Also, I'm not sure if this is the best way to do it but I figured this would save database clutter if I did it in this format rather than each type being it's own meta item.**


title: Plugin generated unexpected output - No PHP errors

text:
I'm creating a plugin that creates a custom post type I'm working on. I followed this tutorial. I have just changed it from movie_reviews to staff members. I don't get any syntax errors in PHP and it all looks alright, but when I activate the plugin in WordPress it says it generated 3 characters of unexpected output. I think the problem is the display_staff_member_meta_box function, but there doesn't appear to be any errors in it. Below is the code I'm using.               <?php     /*     Plugin Name: Staff Members     Plugin URI: http://intranet.yourgroupuk.com     Description: Declares a plugin that will create a custom post type displaying staff members     Version: 1.0     Author: Harry Glozier     Author URI: http://intranet.yourgroupuk.com     */          function create_staff_member() {         register_post_type( 'staff_members',             array(                 'labels' => array(                     'name' => 'Staff Members',                     'singular_name' => 'Staff Member',                     'add_new' => 'Add New',                     'add_new_item' => 'Add New Staff Member',                     'edit' => 'Edit',                     'edit_item' => 'Edit Staff Member',                     'new_item' => 'New Staff Member',                     'view' => 'View',                     'view_item' => 'View Staff Member',                     'search_items' => 'Search Staff Members',                     'not_found' => 'Staff Member not found',                     'not_found_in_trash' => 'No Staff Members found in Trash',                     'parent' => 'Parent Staff Member'                 ),                      'public' => true,                 'show_in_menu' => true,                 'menu_position' => 80,                 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ),                 'menu_icon' => plugins_url( 'staff-icon-2.png', __FILE__ ),                 'exclude_from_search' => false,                 'has_archive' => true             )         );     }          function my_admin() {         add_meta_box( 'staff_member_meta_box',             'Staff Member Details',             'display_staff_member_meta_box',             'staff_members', 'normal', 'high'         );     }      ?>          <?php     function display_staff_member_meta_box( $staff_member ) { //Causes error         // Retrieve current Job Title and Company based on staff ID         $job_title = esc_html( get_post_meta( $staff_member->ID, 'job_title', true ) );         $company = esc_html( get_post_meta( $staff_member->ID, 'company', true ) );              $table = <<<TEXT

                 Job Title	                 <input type="text" size="80" name="staff_member_job_title" value="$job_title" />

                 Company	                                      <select style="width: 200px" name="staff_member_company">                         <option value="Your Group">Your Group</option>                         <option value="Your Power">Your Power</option>                         <option value="Your Electrical">Your Electrical</option>                         <option value="Newmills Engineering">Newmills Engineering</option>                     </select>

     TEXT;         echo $table;     } //End of function      ?>          <?php     function add_staff_member_fields( $staff_member_id, $staff_member ) {         // Check post type for staff members         if ( $staff_member->post_type == 'staff_members' ) {             // Store data in post meta table if present in post data             if ( isset( $_POST['staff_member_job_title'] ) && $_POST['staff_member_job_title'] != '' ) {                 update_post_meta( $staff_member_id, 'job_title', $_POST['staff_member_job_title'] );             }             if ( isset( $_POST['staff_member_company'] ) && $_POST['staff_member_company'] != '' ) {                 update_post_meta( $staff_member_id, 'company', $_POST['staff_member_company'] );             }         }     }           /* function include_template_function( $template_path ) {         if ( get_post_type() == 'staff_members' ) {             if ( is_single() ) {                 // checks if the file exists in the theme first,                 // otherwise serve the file from the plugin                 if ( $theme_file = locate_template( array ( 'single-staff_members.php' ) ) ) {                     $template_path = $theme_file;                 } else {                     $template_path = plugin_dir_path( __FILE__ ) . '/single-staff_members.php';                 }             }         }         return $template_path;     } */     ?>          <?php     add_action( 'init', 'create_staff_member' );     add_action( 'admin_init', 'my_admin' );     add_action( 'save_post', 'add_staff_member_fields', 10, 2);     //add_filter( 'template_include', 'include_template_function', 1 );


title: Custom post type with specific category structure

text: I have successfully created a custom post type (aka "Instruction") and two different categories (aka "Program" and "Exercise"). An "Instruction" needs to be filed under an "Exercise" and an Exercise needs to have a "Program" as a parent category. This is how I have registered the taxonomies:                   function create_taxonomy() {             $programLabels = array(                 'name' => _x( 'Programs', 'taxonomy general name' ),                 'singular_name' =>_x( 'Program', 'taxonomy singular name' ),                 'search_items' =>  __( 'Search Programs' ),                 'popular_items' => __( 'Popular Programs' ),                 'all_items' => __( 'All Programs' ),                 'edit_item' => __( 'Edit Program' ),                 'update_item' => __( 'Update Program' ),                 'add_new_item' => __( 'Add New Program' ),                 'new_item_name' => __( 'New Program' ),                 'separate_items_with_commas' => __( 'Separate programs with commas' ),                 'add_or_remove_items' => __( 'Add or remove programs' ),                 'choose_from_most_used' => __( 'Choose from the most used programs' )             );             register_taxonomy(                 'category_program', // The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).                 'cus_instruction',      // post type name                 array(                     'hierarchical'      => false,                     'label'             => __('Program'),                     'labels'            => $programLabels,                     'query_var'         => true,                     'rewrite'           => array(                         'slug'          => 'program',    // This controls the base slug that will display before each term                         'with_front'    => false        // Don't display the category base before                     )                 )             );                  $exerciseLabels = array(                 'name' => _x( 'Exercises', 'taxonomy general name' ),                 'singular_name' =>_x( 'Exercise', 'taxonomy singular name' ),                 'search_items' =>  __( 'Search Exercises' ),                 'popular_items' => __( 'Popular Exercises' ),                 'all_items' => __( 'All Exercises' ),                 'parent_item' =>  __( 'Program' ),                 'parent_item_colon' => ( 'Program:' ),                 'edit_item' => __( 'Edit Exercise' ),                 'update_item' => __( 'Update Exercise' ),                 'add_new_item' => __( 'Add New Exercise' ),                 'new_item_name' => __( 'New Exercise' ),                 'separate_items_with_commas' => __( 'Separate exercises with commas' ),                 'add_or_remove_items' => __( 'Add or remove exercise' ),                 'choose_from_most_used' => __( 'Choose from the most used exercises' ),                 'menu_name' => __( 'Exercises' )             );             register_taxonomy(                 'category_exercise',   // The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).                 'cus_instruction',          // post type name                 array(                     'hierarchical'      => true,                     'label'             => __('Exercise'),                     'labels'            => $exerciseLabels,                     'query_var'         => true,                     'rewrite'           => array(                         'slug'          => 'exercise',    // This controls the base slug that will display before each term                         'with_front'    => false          // Don't display the category base before                     )                 )             );         }         add_action( 'init', 'create_taxonomy', 0);      Conceptually setting the "cus_instruction" as the post type for the category "Program" is not correct but that was the only way I could make Wordpress display it in the admin sidebar. Setting the 'parent_item' in the "Exercise" category doesn't have the effect of binding the category "Program" as a parent though, it only changes the label of the parent category. Is my requirement possible in Wordpress? And if so, how do I set up the category structure?


title: Custom post type permalink uses archive page to display posts

text: I can't figure out why my custom post type page template uses the archive page to display posts. I'm pretty sure I have the right files. These are the important files, regarding this issue, in my root folder: **Root**               mytheme     - archive.php     - home.php     - single.php     - team.php     - single-team.php     - archive-team.php      **Usage**                1. team.php is a custom page template. All team members are shown here.      2. single-team.php displays a single team member.      **My Post Type**                function create_post_type_team() { register_post_type( 'team',        array(            'labels' => array(            'name' => __( 'Team' ),            'singular_name' => __( 'Team' )           ),        'public' => true,        'has_archive' => true,        'supports' => array( 'title', 'editor', 'thumbnail' ),        'taxonomies' => array('post_tag')          )       );     }          add_action( 'init', 'create_post_type_team' );      **My Problem** When I visit mysite/team (team.php), the page is using archive-team.php to display posts. It should use team.php which is assigned to the page as page template via the admin panel. The weird thing is that when I change the page url from /team to /team2, it does use team.php and not archive-team.php. **Notes** Before this problem occurred, mysite/team/member (single-team.php) was not working. I went to my permalink settings - did nothing - and went back. From this point mysite/team/member worked, but team.php started using archive- team.php. If I set has_arhive => false, it falls back to home.php. Any help would be much appreciated!


title: How to use conditional statement with custom field

text:
I think it is a simple thing but I am not good on php so :( can you guys tell me how I can use an if condition with my custom filed. Below is my current code.
<?php echo post_custom('courtesy'); ?>
      I want **courtesy** to show if it has a value. Right now if there is no value then a blank div is shown. I don't want a blank div.


title: Google font doesn't show in theme option

text: I have implemented the following tutorial in my theme's option panel. http://wptheming.com/2012/06/loading-google-fonts-from-theme-options/ Every thing is working fine. But in the themeoption panel the default system fonts are showing in the drop down list.               /**      * Returns an array of system fonts      * Feel free to edit this, update the font fallbacks, etc.      */     function options_typography_get_os_fonts() {         // OS Font Defaults         $os_faces = array(             'Arial, sans-serif' => 'Arial',             '"Avant Garde", sans-serif' => 'Avant Garde',             'Cambria, Georgia, serif' => 'Cambria',             'Copse, sans-serif' => 'Copse',             'Garamond, "Hoefler Text", Times New Roman, Times, serif' => 'Garamond',             'Georgia, serif' => 'Georgia',             '"Helvetica Neue", Helvetica, sans-serif' => 'Helvetica Neue',             'Tahoma, Geneva, sans-serif' => 'Tahoma'         );         return $os_faces;     }          /**      * Returns a select list of Google fonts      * Feel free to edit this, update the fallbacks, etc.      */          function options_typography_get_google_fonts() {         // Google Font Defaults         $google_faces = array(             'Arvo, serif' => 'Arvo',             'Copse, sans-serif' => 'Copse',             'Droid Sans, sans-serif' => 'Droid Sans',             'Droid Serif, serif' => 'Droid Serif',             'Lobster, cursive' => 'Lobster',             'Nobile, sans-serif' => 'Nobile',             'Open Sans, sans-serif' => 'Open Sans',             'Oswald, sans-serif' => 'Oswald',             'Pacifico, cursive' => 'Pacifico',             'Rokkitt, serif' => 'Rokkit',             'PT Sans, sans-serif' => 'PT Sans',             'Quattrocento, serif' => 'Quattrocento',             'Raleway, cursive' => 'Raleway',             'Ubuntu, sans-serif' => 'Ubuntu',             'Yanone Kaffeesatz, sans-serif' => 'Yanone Kaffeesatz'         );         return $google_faces;     }          /**      * Checks font options to see if a Google font is selected.      * If so, options_typography_enqueue_google_font is called to enqueue the font.      * Ensures that each Google font is only enqueued once.      */              function options_typography_google_fonts() {             $all_google_fonts = array_keys( options_typography_get_google_fonts() );             // Define all the options that possibly have a unique Google font             $google_font = woodpecker_get_option('google_font', 'Rokkitt, serif');             $google_mixed = woodpecker_get_option('google_mixed', false);             $google_mixed_2 = woodpecker_get_option('google_mixed_2', 'Arvo, serif');             // Get the font face for each option and put it in an array             $selected_fonts = array(                 $google_font['face'],                 $google_mixed['face'],                 $google_mixed_2['face'] );             // Remove any duplicates in the list             $selected_fonts = array_unique($selected_fonts);             // Check each of the unique fonts against the defined Google fonts             // If it is a Google font, go ahead and call the function to enqueue it             foreach ( $selected_fonts as $font ) {                 if ( in_array( $font, $all_google_fonts ) ) {                     options_typography_enqueue_google_font($font);                 }             }         }          add_action( 'wp_enqueue_scripts', 'options_typography_google_fonts' );     /**      * Enqueues the Google $font that is passed      */     function options_typography_enqueue_google_font($font) {         $font = explode(',', $font);         $font = $font[0];         // Certain Google fonts need slight tweaks in order to load properly         // Like our friend "Raleway"         if ( $font == 'Raleway' )             $font = 'Raleway:100';         $font = str_replace(" ", "+", $font);         wp_enqueue_style( "options_typography_$font", "http://fonts.googleapis.com/css?family=$font", false, null, 'all' );     }          /*      * Outputs the selected option panel styles inline into the <head>      */     function options_typography_styles() {          $output = '';          $input = '';          if ( woodpecker_get_option( 'google_font' ) ) {               $input = woodpecker_get_option( 'google_font' );           $output .= options_typography_font_styles( woodpecker_get_option( 'google_font' ) , '.google-font');          }          if ( $output != '' ) {         $output = "\n<style>\n" . $output . "</style>\n";         echo $output;          }     }     add_action('wp_head', 'options_typography_styles');          // Returns a typography option in a format that can be outputted as inline CSS          function options_typography_font_styles($option, $selectors) {             $output = $selectors . ' {';             $output .= ' color:' . $option['color'] .'; ';             $output .= 'font-family:' . $option['face'] . '; ';             $output .= 'font-weight:' . $option['style'] . '; ';             $output .= 'font-size:' . $option['size'] . '; ';             $output .= '}';             $output .= "\n";             return $output;     }      And in theme-option page added the following code:               //fonts             $options[] = array( 'name' => 'Selected Google Fonts',                 'desc' => 'Fifteen of the top google fonts.',                 'id' => 'google_font',                 'std' => array( 'size' => '36px', 'face' => 'Rokkitt, serif', 'color' => '#00bc96'),                 'type' => 'typography',                 'options' => array(                     'faces' => options_typography_get_google_fonts(),                     'styles' => false )                 );             $options[] = array( 'name' => 'System Fonts and Google Fonts Mixed',                 'desc' => 'Google fonts mixed with system fonts.',                 'id' => 'google_mixed',                 'std' => array( 'size' => '32px', 'face' => 'Georgia, serif', 'color' => '#f15081'),                 'type' => 'typography',                 'options' => array(                     'faces' => $typography_mixed_fonts,                     'styles' => false )                 );             $options[] = array( 'name' => 'System Fonts and Google Fonts Mixed (2)',                 'desc' => 'Google fonts mixed with system fonts.',                 'id' => 'google_mixed_2',                 'std' => array( 'size' => '28px', 'face' => 'Arvo, serif', 'color' => '#ee9f23'),                 'type' => 'typography',                 'options' => array(                     'faces' => $typography_mixed_fonts,                     'styles' => false )                 );      I am not getting the fonts listed in $os_faces array, in the drop down list of theme option panel. But the following defaults fonts are showing. View the image below.![enter image description here](http://i.stack.imgur.com/m9Vk2.png) Please help.


title: Order Terms by Custom Field

text: I have a custom post type that I am trying to order by terms. Each term has a custom field "order" associated with a number. I am trying to order the posts by term, in numerical order based on the custom field. $sections = get_terms('section', 'parent=0&orderby=meta_val_num&meta_key=list_order&order=ASC&hide_empty=1'); This solution does not work. It still prints the terms in alphabetical order.


title: Why can't I display attachment_image_src with Custom Size?

text: I'm trying to display an attachment with a custom size that I created with `add_image_size` called "custom-size-01" What the code returns is the word "Array" I've looked at the wordpress reference and been trying the `wp_get_attachment_image_src` reference and tried the example code it gives but i haven't been able to make it work. I haven't figured out what I'm doing wrong and could use any input to show me where I'm making a mistake.               if($imageid){      echo "<img src=\"";      echo  wp_get_attachment_image_src( $imageid, 'custom-size-01', false);       echo "\" width=\"100%\" >";       }


title: Remove sticky behavior from top navigation on twenty fourteen theme?

text: In wordpress theme twentyfourteen, I am wondering how to remove the sticky behavior of the top navigation with a 100% width header background image like this site? I would love to have a top image with full width and a max-height with the navigation just placed under it, but the navigation sticks to the top of the window in the browser when you scroll down. I ended up using the following .js with twentythirteen child theme               //$(document).ready(function() {     jQuery().ready(function($) {     var stickyNavTop = $('.navbar').offset().top;          var stickyNav = function(){     var scrollTop = $(window).scrollTop();          if (scrollTop > stickyNavTop) {      $('.navbar').addClass('sticky');     } else {     $('.navbar').removeClass('sticky');      }     };          stickyNav();          $(window).scroll(function() {     stickyNav();     });     });      and added                .sticky { position: fixed; z-index: 100; ... }      Thanks to a post found in here. I could have apply the same to the twentyfourteen, but it was tricky and I had no time to waste.


title: Possible to create placeholder images in Wordpress editor that are clickable (should bring up uploader)?

text: Working on a project where I would like to have buttons within the actual visual editor area where the user can click on the placeholder image and it brings up the upload dialog. I've seen that people create their own buttons that adds boxes that the user then should select with their mouse and then click the add media upload. To me that seems like it's bound for a bad user experience. Thus I'm looking to see if someone have seen a plugin that does this. ![http://s-plugins.wordpress.org/visual-editor-custom- buttons/assets/screenshot-4.png?rev=641514](http://i.stack.imgur.com/EmnJd.png) Imaging that you could actually click "insert image here" and have an upload dialog brought up.


title: Why won't this rewrite rule work?

text: Here's the setup. I have a custom post type 'Businesses'. I have a custom taxonomy 'Display Category'. And I have a second custom taxonomy 'Filters' Both taxonomies are set to work with the custom post type. I am trying to get a url structure that looks like this www.domain.com/businesses/display category term/filter term There are only 3 possible choices for the Display Category, those are eat,stay, and play. The Filters then have quite a few choices. so here is the rewrite rule I have so far but it's not working and I'm not sure why.               function test_add_rewrite_rules() {              global $wp_rewrite;              $new_rules = array(             'businesses/(eat|stay|play)/(.+)/?$' => 'index.php?post_type=businesses&display_category=' . $wp_rewrite->preg_index(1) . '&filters=' . $wp_rewrite->preg_index(2),             'businesses/(eat|stay|play)/?$' => 'index.php?post_type=businesses&display_category=' . $wp_rewrite->preg_index(1)              $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;     }          add_action( 'generate_rewrite_rules', 'test_add_rewrite_rules' );      I am using a rewrite rule inspector plugin so I know the rules are being added. But they are not returning the pages I want. I found this article about rewrite rules and it helped me get this far but I am stuck now. Any help would be greatly apprecieated! ## Update Here is the above code but instead using the add_rewrite_rule function. I have hooked in into init for now because the generate_rewrite_rules hook was firing too late for the new rules to be save. I also realized that I will need to get the paged rules to work as well but I'm not sure how to do that.               function test_add_rewrite_rules() {              global $wp_rewrite;              add_rewrite_rule('businesses/(eat|stay|play)/(.+)/?$', 'index.php?post_type=businesses&display_category=$matches[1]&filters=$matches[2]', 'top');         add_rewrite_rule('businesses/(eat|stay|play)/?$', 'index.php?post_type=businesses&display_category=$matches[1]', 'top');          }          add_action( 'init', 'test_add_rewrite_rules' );


title: Sticky Custom Post Types - Query returns nothing if no post marked as sticky

text: I am having an issue with sticky posts and custom post types. I want to display a sticky custom post type, but if there are no sticky posts, I simply want to display the latest post in that custom post type. I have it set up according to the codex here: http://codex.wordpress.org/Sticky_Posts. However, if I make a post sticky, it shows up. If I don't make a post sticky, nothing shows up. Here's my shortcode function: http://pastebin.com/s3jwx3xB I appreciate any help!


title: Select Multiple meta_value from WP DB; Single Query

text: I am trying to retrieve each user's first and last name, phone, email, and address from the usermeta table. I'm having trouble selecting multiple meta_values, each with its own meta_key, using a single sql query. I would like the data returned as First Name, Last Name, Phone, Address, Email First Name, Last Name, Phone, Address, Email First Name, Last Name, Phone, Address, Email First Name, Last Name, Phone, Address, Email I have access to the actual DB via phpMyAdmin, so I would like help with the mySql query.


title: Cannot Redeclare Fatal Error and Pluggable not Working with Child Theme

text: I am trying to make a child theme from the wordpress twentytwelve theme at http://thedragoon.ca and I followed the instructions at: http://www.elegantthemes.com/blog/resources/wordpress-child-theme-tutorial It broke my wordpress installation and no matter what fix I try, I keep getting this:               Fatal error: Cannot redeclare twentytwelve_setup()      (previously declared in /home2/thedrago/public_html/wp-content/themes/dragoon/functions.php:52) in /home2/thedrago/public_html/wp-content/themes/twentytwelve/functions.php on line 77      I have tried downloading a fresh wordpress zip and replacing the wp-includes folder while renaming my old one. I have also changed this part in the functions.php file to include the if(!function_exists).                if(!function_exists('twentytwelve_setup')) :     function twentytwelve_setup() {         /*          * Makes Twenty Twelve available for translation.          *          * Translations can be added to the /languages/ directory.          * If you're building a theme based on Twenty Twelve, use a find and replace          * to change 'twentytwelve' to the name of your theme in all the template files.          */         load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );              // This theme styles the visual editor with editor-style.css to match the theme style.         add_editor_style();              // Adds RSS feed links to <head> for posts and comments.         add_theme_support( 'automatic-feed-links' );              // This theme supports a variety of post formats.         add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );              // This theme uses wp_nav_menu() in one location.         register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );              /*          * This theme supports custom background color and image,          * and here we also set up the default background color.          */         add_theme_support( 'custom-background', array(             'default-color' => 'e6e6e6',         ) );              // This theme uses a custom image size for featured images, displayed on "standard" posts.         add_theme_support( 'post-thumbnails' );         set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop     }     endif;


title: How to remove title from searchs parameters in WordPress?

text: I have a simple question about WordPress theme developpement. I'm trying to check if there is anyway to remove the_title() from parameters into the search engine of WordPress. Here is why : If I search something that is not in a page, post title, il will search into the_content (I supposed) and then shows the list of pages or posts. But if I search something in a title, the loop just show every pages content and it completly skips my search.php template... http://vincent.okidoomedia.com/miller/?s=tes As you can see, there is a list. http://vincent.okidoomedia.com/miller/?s=Sport When I type sport, you can see in the blue bar that it loads all the pages content instead of my list? Any idea how to fix it?


title: Make single widget area top level in 4.0 Customize Panel

text: So I have a widget area that, in v4.0, is burried in a dropdown within the secondary Widgets panel on the Customize panel page. Because it's the only widget area it feels rather silly being burried so deeply, so I'm wondering if there's a way to override the nesting and make that widget area dropdown a top-level section like it was in v3.x? It looks like this was brought up by the Core team here, but didn't gain any traction. Does anyone know how I might be able to do this?


title: Hide page name in wordpress page title

text: In my pages title I got for example "home-my title' and 'Books Archieves- my title', I want to drop those prefixes so I have only on page (home) 'My title' and on archive(category) 'Books- my title'. that's what I got inside the `head`: `<head> <?php wp_head(); ?> </head>`


title: Remove Wordpress.org Meta link

text: In my footer, I have a set of links labeled Meta, it has... Register   Log in   Entries RSS   Comments RSS   Wordpress.org How can I remove just the wordpress.org and and comments rss link from the meta links?


title: How to get the category of the post and link it to the archive (of the category)

text:
I am trying to design a button in the sidebar which is related to the post displayed. The button is basically a "other news in CAT1". i have this piece of code:
     <?php      $category = get_the_category();      if($category[0]){     echo 'term_id ).'">

News su '.$category[0]->cat_name.'

';     }     ?>
      which unfortunately displays the wrong category. Can please anybody tell me how to do it. It shouldn't be that difficult, i just started with wordpress.


title: Register a custom post type as public = false, but have content appear in search engines?

text: I dont want the pages to exist ie. they go to 404 if you attempt to access them but I want the content on to be indexed in a search, google, bing etc the custom-post-type content will be displayed in a front page template, in the style of a 'one page layout'. like this site; http://www.bingu.name/demo/wpmiworks/


title: Custom Post Type with has_archive ignores my custom archive and single template

text: I'm trying to set up a new CPT called news (see code here: http://pastie.org/3148081) and I'm specifying the has_archive parameter. I've set up a new template called archive-news.php and single-news.php but its not being used when I go to /news/ or the permalink on the site. Instead the default archive.php and single.php gets loaded. I've flushed the rewrite rules but still does not work. This is the first time I'm using the has_archive parameter but after lots of searching I still can't see what I doing wrong. Hopefully it's just a stupid mistake somewhere that someone can spot for me.


title: Register User can post video

text: I have a blog. I need to add a functionality. Where Registered user can upload video and Registered user can view all video and Onclick on Particular video That video display and User can comment on video and total view. Is there any plugin that provide this functionality. or Any demo link or code.


title: Plugin recommendation for member management

text: I couldn't find any plugin to do that, so I need a help here. This is what I need. One page will have a small form with 6 fields. One field is to upload photo. Another page will show in a matrix layout (2 columns 5 rows) all the users that were registered from my form. On the backend, I just need to be able to see the registered people and manage them (accept, delete, and so on). Do you know any plugin or tutorial that show me how to achieve that?


title: Sort appearence order in the_content()

text:
I have an About the Author plugin, echoing inside the_content(), and a Facebook Like Button, that I hardcoded in the HTML, after the_content(), here's how it is outputting: ![enter image description here](http://i.stack.imgur.com/JDfg7.png) The Facebook Like button should appear prior than the Author Box Single.php (handcoded by me, probably with some bad practices as I'm noob at PHP):               <?php get_header(); ?>

             <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_title(); ?>

por <?php the_author_link(); ?>

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

<?php the_content(); ?>

                 <?php echo do_shortcode('[fbcomments width="450" count="on" num="10" title="Faça o social :)" countmsg="comments"]'); ?>             <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
<?php endif; ?>

     <?php get_sidebar(); ?>     <?php get_footer(); ?>      I know **why** it is outputting bellow the author box, but I don't know how to **FIX** it. I've tried do_shortcode the Biographia plugin, but then it enters a infinite loop, echoing the post over and over again


title: Wordpress custom post type with folder structure in slug

text: I have setup a custom post type with the slug "interview" and it is working fine. I am trying to change the slug to "magazine/interview" but I keep getting 404 errors when I try to access the posts that are already there. Is there any specific trick to set a slug with "/" characters in it?


title: Custom Fields vs Separate Table

text: I have a client who wants to be able to upload Posts using information stored in a CSV file. I've already got this portion working. Just recently, I changed the CSV File Uploader from pure PHP to an AJAX Uploader in an effort to eliminate server timeouts as well as provide a nice interface to keep track of each new post's progress. ## The Problem: Each custom post contains about 130 Custom Fields total. Each one of my CSV Upload Tests contained roughly 20 new Posts. Even with async left on, it still takes a bit for each new Post to be processed. All of the Custom Fields are broken up into 5 separate Meta Boxes. Originally, I had it set up to store each Meta Box as a JSON Encoded string, and save that as part of the post's metadata. This brought the total number of Custom Fields from 130 to 5, and write time was increased dramatically. The drawback to this, however, is that each individual Custom Field is no longer searchable by Wordpress' standards. ## Proposed Solutions: I can do one of a few things:   1. I can leave it as-is and take the slower write times while retaining both searchable and queryable Metadata, but perhaps run into issues with CSV files that contain a few hundred or - God forbid - a few thousand Posts.   2. I can store each Meta Box as a single Custom Field and modify Wordpress' search functionality to find Metadata via custom SQL, but lose the ability to retrieve Posts via meta_query.   3. I can overhaul the existing structure and write all Custom Post Metadata to a separate table. This means losing the built-in search functionality, as well as the ability to use meta_query. ## The Question: What would be the best approach to handling this? Theoretically, there are going to be hundreds of thousands of these Custom Posts. Giving users the ability to search for these posts both by title, taxonomy, and metadata is required. Personally, I try to avoid writing any new tables to a Wordpress Installation at all costs. But would this be considered a situation that demands it? Or would I lose too much functionality by using my own less-sophisticated queries to fix a problem that might not even necessarily BE a problem? Most of all, is there any other way that I might be missing that can solve this issue? **UPDATE:**   In an effort to clarify what the data entails without violating my NDA, each Custom Post is a Guitar. Each Meta Box signifies a Section of a Guitar (Neck, Body, etc.), with each Custom Field being a fixed piece of information attributed to that particular section (Wood, Manufacturer, etc.).               class Guitar     {         public $ID;         public $Year;         public $Make;         public $Model;              public $Section1;         public $Section2;         public $Section3;         public $Section4;         public $Section5;         public $Section6;         public $Section7;         public $General;              private $_data;         private static $_dataFlags = array('Section1', 'Section2', 'Section3', 'Section4', 'Section5', 'Section6', 'Section7', 'General');         public function __construct($args)         {             $this->ID = $this->_query_existing();             foreach(self::$_dataFlags as $sec)                 $this->$sec = new $sec($args[$sec]);         }     }     abstract class Guitar_Section     {         public function __construct($arr=array())         {                 if(!empty($arr))                 $this->_set_props($arr); //Set Properties         }         public function update_meta($id, $useprops=false)         {             foreach(get_object_vars($this) as $k=>$v)             {                 $this->$k = !$useprops ? $_POST['guitar_'.$this->_get_section_name().'_'.$k] : $v;                 update_post_meta($id, '_guitar_'.$this->_get_section_name().'_'.$k, $this->$k);             }         }     }     class Section1 extends Guitar_Section     {         public $Wood;         public $Attachment;         public $etc;              protected function _get_section_name()         {             return 'Section1';         }     }      This displays how each Class works in tandem with each other. I have it so that each Guitar Section is encapsulated by the Guitar Class, with each section extending the abstract class. Each property is a Custom Field, and is set utilizing the Methods within the Abstract Class, while the Guitar Class essentially queries Wordpress and sets any available ID, Year, Make, and Model. Most of this requires a LOT of string manipulation due to the fact that CSV files are used to set the class and its properties.


title: How to hook into publish_posttype?

text: I'm trying to hook into WordPress publish. The code below is what I'm using, but it doesn't appear to be running. I have it in a plugin file that I deactivate/reactivate each time I make changes (not sure if that's necessary to do that though). Post type is "auction".               add_action( 'publish_auction', 'bvf_set_ceiling_once_on_first_publish' );          function bvf_set_ceiling_once_on_first_publish( $post ) {              $post_id = $post->ID;              if ( !get_post_meta( $post_id, 'ceiling', $single = true ) ) {              $reserve = get_post_meta( $post_id, 'reserve', $single = true );              $ceiling = $reserve * (rand(40,60) / 100);              update_post_meta( $post_id, 'ceiling', $ceiling );              }     }      Now I'm trying the following (01/16/13):               <?php     /**      * @package Bids_Views      * @version 0.0.1      */     /*     Plugin Name: Bids/Views     Description: None     Author: Jerry T.         Version: 0.0.1     */          add_action('publish_post', 'bvf_set_ceiling');     function bvf_set_ceiling( $post_id ) {          $post = get_post($post_id);          $reserve = get_post_meta( $post_id, 'reserve', true );          $ceiling = $reserve * (rand(40,60) / 100);          update_post_meta( $post_id, 'ceiling', $ceiling );          }          ?>


title: Show count of all comments by meta_value from a users posts

text: I'm trying to display the total number of comments for a users posts limited to a comment meta. I've tried using both `get_comments()` and `WP_Comment_Query()` but I get the same result of "1" for the comment count when it should be "3". Now in this example I can remove `'Count' => true` and just loop through the comments and that will return the correct amount of comments in a loop but the count still equals one. They provide an example here on how to get the count but it doesn't work for me. Here's my function.                function get_unseen_comment_count() {         if ( !is_user_logged_in() )             return false;         $user_id = get_current_user_id();         $postids = array();         $posts = get_posts( array(           'numberposts' => -1,           'post_type'       => 'fod_articles',           'author' => $user_id,           'post_status'     => 'publish'         ));              foreach( $posts as $post ) {             $postids[] = $post->ID;         }         $args = array(             'include'      => $postids,             'meta_query' => array(               array(                 'key'   => 'viewed_status',                 'value' => 'unseen'               )             ),                   'count' => true         );         // $comments_query = new WP_Comment_Query;         // $comments = $comments_query->query( $args );         $comments = get_comments($args);         echo '';           echo $comments;         echo '';      }      Now in the codex it doesn't say that `get_comment()` supports meta query but you can see on line 181 here that it does. It doesn't however show support for `include` but it definitely works when I test using a loop of the actual comments. Some further testing when I remove the meta_query I do get the total comment count for all posts by the user so my media query seems to be the problem interfering with the count. I tried also just using `meta_key` and `meta_value` without a meta query but I get the same result..."1".


title: Plugin options table,is the data serialized

text: I am planning on building a plugin and i need to know if the data stored in the options table i will create for the plugin will be serialized or it will be in the ordinary sql format.


title: Get post type on edit page

text: I am writing the backend for my theme and have 4 custom post types. I have registered them all and now I am writing the metaboxes and handlers. My question is in wordpress admin is there a way of determing which custom post type your editing. I.E. lets say I have a custom post type of Testimonials, I click add New and am presented with the various fields etc. Is there a function in wordpress that will tell me what this post type is. Ive tried get_post_type() but it returns nothing. Any help would be appreciated. Steve


title: Configuration Options for embedded YouTube Videos

text: I have some embedded You tube videos on my blog and I have a question about configuration as they are on static pages. Is there code or a WP plugin solution to make an embedded You Tube video to return to the "Play prompt" position when a video ends. Currently when a video ends on my site it promotes other Youtube material. Refreshing (manually)the screens brings it back to "Play prompt" but I would like to do this automatically.


title: Container class not appearing on navigation menu

text:
I want to render a menu with a container like this: `<nav class="nav">` However, the container is just rendering with the default class name applied which I don't want. `<nav class="menu-main-nav-container">` I can't understand where I'm going wrong. Here's my code:               if ( has_nav_menu( 'nav-menu' ) ) {      wp_nav_menu( array(      'theme_location' => 'nav-menu',      'container' => 'nav',      'container-class' => 'nav',      'items_wrap' => '
%3$s
' ) );     }       Anyone able to help?


title: Only list categories that contain posts of a specific custom post type

text: I have three custom post types set up, `articles`, `videos` and `photos`.   I am using standard categories for these post types, and sharing the categories across all post types. I am trying to create a nav menu for each post type, listing the categories, that should follow the following structure:   * Photos     * Cat 1     * Cat 3     * Cat 5   * Videos     * Cat 2     * Cat 3     * Cat 5   * Articles     * Cat 1     * Cat 2     * Cat 4 Categories that do not contain the custom post type should be hidden. `get_categories()` with `hide_empty` set to `1` is obviously close, but it doesn't allow you to specify a post type.


title: Custom post type permalinks breaking due to 3.1 bug fix

text: So I just updated a site to 3.1 that uses several custom post types. When I had made the site I had not noticed at the time the `$post_type` parameter for `register_post_type` has to be in all lowercase letters! ( it was not well written in the codex but now it is **bold** ). http://codex.wordpress.org/Function_Reference/register_post_type#Parameters My custom post types were registered with a capitol letter for instance "Rentals" instead of 'rentals'. This was fixed in 3.1 thus any posts registered with upper case letters were totally broken in the back and front end. I was able to go back into the function and change it to lowercase and then call another function to update the database with the new name before it fires thanks to a post on wordpress.org by dennis_f. Here new function               if(!get_option('custom_type_updated')){     global $wpdb;     $wpdb->query("UPDATE $wpdb->posts SET post_type = 'custom-rental' WHERE post_type = 'Custom-Rental'");     update_option('custom_type_updated','true');     }      and here is the register re-written in lowercase               // Custom page template for rentals      -----------------     function Rental_register_post_type() {         register_post_type( 'custom-rental', array(             'public'        => true,             'can_export'    => true,             'has_archive'   => 'Rentals',             'rewrite'       => true,             'supports' => array(                     ** bunch of supports stuff                 ),             'labels' => array(                 **bunch of labels                 )             )         );     }     add_action( 'init', 'Rental_register_post_type', 0 );      This did fix the major issue of broken custom post types BUT the problem is now using a custom permalink structure breaks the custom post type 'rentals', only the default works. For example www.example.com/?custom-rental=7-bedrooms works fine, but no custom permalink structure works, I have tried each type and cleared the .htaccess and just returns a 404. Any ideas?


title: How do I rewrite attachment urls when permalink structure contains %category%?

text: I'm trying to change the permalinks to my attachments in the same way as this question, and the given solution works great except for one problem: if the permalinks settings on my site contain %category%, the solution doesn't work at all and I get a "This page isn't redirecting properly" error. The only way I can get this solution to work properly is by using the provided "Day and Name", "Month and Name", and "Numeric" permalink settings. What do I add to the solution so that still use %category% in my custom permalink settings?