title: Use Single Blog Post as Site Front Page Without Redirect

text: I am attempting to do something similar to the accepted answer on this question Is it possible to use a single custom post as the site front page My problem is that this implementation causes a redirect. So for example if I add the code below to twentyeleven functions.php on a default WordPress install, and then select the `Hello World` post from the `reading->front page` drop down my home url such as `mysite.com` will redirect to `mysite.com/?p=1`. So it is impossible to actually stay on the home page because of this redirect. Is it possible to avoid this redirect? If so, the solution below will be great for showing a post or custom post as the home page.               add_filter( 'get_pages', 'add_pages_to_dropdown', 10, 2 );          function add_pages_to_dropdown( $pages, $r ){         if ( ! isset( $r[ 'name' ] ) )             return $pages;              if ( 'page_on_front' == $r[ 'name' ] ) {             $args = array(                 'post_type' => 'post'             );                  $portfolios = get_posts( $args );             $pages = array_merge( $pages, $portfolios );         }              return $pages;     }


title: Why cant you place the Loop outside of the index.php?

text: This may sound like a stupid / noob question. But I'm curious to wonder as to why you can't insert the wordpress php loop functions outside into say a blog.php file but you can in a index.php file? For instance, when I try running all the loop code in say a blog.php file, and linking the pages up nothing shows. I've tinkered with the reading settings as well just to make sure nothing is off. However, when I move the loop php code into an index.php file the blog page will then display the pages. Am I missing something, or is there a way to insert the loop into a different .php file instead of the index? -Thanks,


title: New user Registration data imported into Page

text: Here's my goal....New users apply to use a site that I'm working on. When I get an application, I talk to them, and afterwards I approve them. From there, the information they supplied online is automatically imported into a page. The page can be edited by the user or any admin. The user can only edit their own page. Here's what I've done so far...I'm using Register Plus Redux to gather all of the additional information from the user that I need while they are registering for the site. This is done through the usual wp- login.php?action=register This works well. The user is 'unverified' when they initially apply online. I get the form, talk to them, and then I can approve them online. Everything works well in this area. From there I don't know how to get all of that information transferred over to the user's page. When I say page, I mean an actual 'Page' not their user account page. If you know of a good way without manually copying and pasting let me know. I'm then using Capability Manager Enhanced to stop the user from deleting or editing other pages. The only thing I also need in this area, is to allow the user to only have 1 page total. I know this is a lot so any help with any part of it would be greatly appreciated! Thanks!


title: add span class inside wp_nav_menu link anchor tag

text:
I found examples adding a class to top level items, so we can display an arrow in menu items with sub-items, but is seems terrible to cope with the already built in WordPress classes, can't display the arrow with current and css hover, it just ruins all states. The current nav menu is like this `<li><a>Text</a></li>` Is there someway to add a `<span class="arrow"></span>` within the parent `<a></a>` tags instead? Example, Add ⇒ `<span class="arrow"></span>` inside ⇒ `<a/></a>` tags Thus ⇒ `<li><a>Text<span class="arrow"></span></a></li>` that is parent. The current code Adds the `<span></span>` tags outside the `<a></a>` tags that is parent               class My_Walker_Nav_Menu extends Walker_Nav_Menu {         function start_lvl(&$output, $depth, $args) {             $indent = str_repeat("\t", $depth);             if('primary' == $args->theme_location && $depth ==0){                 $output .='';             }             $output .= "\n$indent
\n";         }     }      Original question title edited from: " **add span class inside`<a>`**"


What is the condition to check if we are in admin or frontend? I want to add_action not in backend, but only in frontend.


title: Wordpress Plugin Dev: Using array for WP options

text: I am busy dabbling with writing a WP plugin and hitting a bit of a problem. I believe its best practice to store wp options to an array rather than individually which is great no probs. I have two pages. Page one which updates for example:               $xyz_options['api_user'];      $xyz_options['api_key'];      Page two which say has:               $xyz_options['site_bgcolor'];     $xyz_options['site_fontcolor'];      However when updating from either of the pages it empties the other pages settings when using the built in wordpress form building and so forth. I am wondering if I would be better breaking away from the built in methods would be best or is there another way using WP methods that I have missed. A quick example. Say I first set 'api_user' and 'api_key' with 1 and abc123. Then go to style page and update 'site_bgcolor' with #fff and 'site_fontcolor' with #000 it updates the colors but the api_user and api_key values vanish from the $xyz_options array pulled from wp_options. Hope that makes sense. Thanks guys in advance any pointers would be great.


title: Hook or function to upload media via url

text: I am working on image aggregation site. Is there a wordpress hook or function to upload media especially image if a url is provided to it? Rest I can do with wp_handle_upload function. Thanks


title: Allowing Yoast SEO plugin to track me

text: I've recently installed the WordPress SEO plugin by Yoast and it's asking me whether to allow it or not to track my blog? Seems like a stupid question on my part but I'm still new on the blogging arena. What do you guys think? What's the difference if I allow it to track me or not? Is there a mutual benefit for the two of us?


title: BuddyPress - Hook to Update Custom Profile Fields

text: I am working on custom app for a client that requires some extra fields in the user's profile. I have successfully created a registration page that saves the custom fields and now I need to do the same for the "Edit Profile" page. The function that I used to save the custom fields on registration is generic enough that I think I can use it for the update too. I cannot find the right hook to make it work, though. I have tried "profile_update", "edit_user_profile_update", and "personal_options_update" with no luck. Is there something that I am missing here?


title: Delete WordPress plugin Repository

text: I wanted to create a WP plugin. So I requested and my request was approved by WordPress.org But I don't want to develop that plugin anymore. How can I delete the repository forever or request its deletion.


title: WordPress Custom Superfish CSS Problem

text: The problem can be found here: http://themeforward.com/demo2/ Use my menu and navigate to Features > Shortcodes > Typography. Notice how the border ( `ul .sub-menu { border:1px solid #000 }` ) moves the third level menu item (typography) down one pixel. How do I get rid of that one pixel gap so that the third level menu item lines up correctly? Here is my CSS:               /*** DEMO SKIN ***/     .sf-menu {         float:          left;         z-index: 900     }     .sf-menu a, .sf-menu a:visited  { /* visited pseudo selector so IE6 applies text colour*/         color:          #FFF;         padding:        10px;         text-decoration:none     }     .sf-menu li {         margin-right:35px;         z-index: 900     }     .sf-menu li li {         z-index: 900;         background:#FAFAFA     }     .sf-menu li li li {         background:     #FAFAFA;         z-index: 900     }     .sf-menu li:hover, .sf-menu li.sfHover,     .sf-menu li a:focus, .sf-menu li a:hover, .sf-menu li a:active {         outline:        0;         background: #EEE     }     .sf-menu > li:hover, .sf-menu > li.sfHover,     .sf-menu > li a:focus, .sf-menu > li a:hover, .sf-menu > li a:active {         outline:        0;         background: #AF1D21     }          .sf-menu .current-post-ancestor a, .sf-menu .current-menu parent a, .sf-menu .current-page-ancestor a, .sf-menf .current-category-ancestor a, .sf-menu .active_category a, .sf-menu .current-menu-item a { color:#1a1a1a }          ul .sub-menu { border:1px solid #000 }     ul li .sub-menu a { color:#262626!important }     ul li .sub-menu a:hover { background:#EEE!important }


title: Not displaying any articles on a custom made file

text: I have created the file **latest.php** in the public_html so that when I go to **www.domain.com/latest.php** it will show me the latest articles. Sadly, nothing of the posts came up. Later, I will sort them with other ways (mostly based on custom fields). This is my **latest.php** file (I removed any styling for better understanding)               <?php include("wp-load.php"); ?>     <?php get_header(); ?>     <?php wp_head(); ?>          **AND HERE IS WHAT I COPY-PASTED FROM MY INDEX.PHP THAT IS WORKING**          <?php while (have_posts()) : the_post(); ?>              <a title="" href="<?php echo get_permalink(); ?>" ><?php the_title(); ?>          <?php endwhile; // End the loop ?>          <?php posts_nav_link(' · ', 'previous page', 'next page'); ?>      My question is how can I make it possible to show the latest articles with pagination? Should I use an entire different method for my task? If yes, which one? UPDATE header and other functions are working CORRECTLY. It just not shows the posts.


title: How to create a subdomain for mobile?

text: I have a site, I'd like to create a subdomain of it for mobile presentation.   1. Both websites will show the same posts and custom posts. (shared database)   2. Each website will have different pages that will display those posts differently. Because of #2, I can't just use a theme switcher, I really need to design an entirely new website from the ground up for mobile, but using a shared database. How can I achieve this? This seems to me such a basic question, but I can't find answers anywhere. All I get referenced to is Multisite (I'm not trying to create a network)and WP- Touch (might be useful, but I need more than just switching a theme). Anyone know the steps needed? Any tutorials I've not found in my days of scouring the web for answers? As a side note, I've developed the main site with heavy usage of Toolets "Types & Views" and it's awesome. I have an incredibly complex main website. My goal is to create a very customized, stripped down version of that site for mobile. Other thoughts: I don't need to map page-for-page, since the pages on each site will be very different. I'll look to auto-detect for mobile and also allow switching between, but each time it can land on the requisite home pages. I just need to know how to connect 2 domains to 1 database.


title: What's the best way to detect referrer?

text: I've been searching for some WP specific way to detect any referrer. Have an idea? I know how to do that in PHP but I just want to know if there's some WP function to do that? **EDIT:** here is what I 'm trying to test =>               $referer = wp_get_referer();     if (  strpos($referer ,'http://wordpress.org') !== false ) echo 'you come from wordpress.org';


title: How to create different navigation for registered users in WooThemes Canvas?

text:
I'm building a website with wordpress and the Canvas Theme (from WooThemes). I'm using the Top navigation for displaying items when a user is logged in. When the user is not logged in, you can see only 'become a member' and 'login'. When the user logins, he/she sees another navigation with other menu items. I thought of the following solution:   1. register a new navigation.   2. apply a hook which checks if a user is logged in or not   3. According to the result, apply the navigation for registred users, otherwise show other. I put this code in my _functions.php_ :               add_action( 'init', 'register_top_menu_myisa', 10 );          function register_top_menu_myisa() {         $menus = array(                     'top-menu-myisa' => __( 'Top Menu MyISA', 'woothemes' )                 );         register_nav_menus( $menus );     }          add_action( 'woo_top', 'custom_top_navigation', 10 );          function custom_top_navigation() {         if ( function_exists( 'has_nav_menu' ) && has_nav_menu( 'top-menu' ) ) {                  if(is_user_logged_in()) {                 $top_menu = 'top-menu-myisa';             } else {                 $top_menu = 'top-menu';             }              echo '
';         echo '
';         echo '
' . woo_get_menu_name( $top_menu ) . '
';         wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'top-nav', 'menu_class' => 'nav top-navigation fl', 'theme_location' => $top_menu ) );         echo '
';         echo '
';         }     }      The first function registers the new navigation. The second function contains the logic for deciding which top navigation should be displayed. **However: when I look at my site, it displays both menu's (the one for non logged in users and the one for logged in users)** ![Two navigation menu's displayed](http://i.stack.imgur.com/2WPD1.jpg) **How can I modify the code so that it displays one top navigation menu, based on if the user is logged in or not?**


title: How do I turn a post thumbnail into a background image?

text: I believe the answer o this question was posted on this page, but it is still not clear to me. The snippets are scattered all over the discussion and several glitches happen when I implement them.


title: if conditional in sidebar plugin Password content shortcode

text: I have this code [][/] on page and work perfectly! so i want now if i can in sidebar check if the form is properly completed on the page and then will echo some word in sidebar. for example something like this in sidebar:               if (isset($_POST['csp_submit'])) {     if ($_POST['csp_input'] == $password AND $password != '') {     echo 'password is corect and echo some words';     }     else     {     echo 'password is wrong';     }     }     else     {     echo 'you must enter pasword on page';     }      https://wordpress.org/plugins/password-content-shortcode/


title: How to change permalink on post click on post listing page

text: I have a posts listing page, my requirement is that I want to change the url on the click of the post and expand the post to full detail. I am not sure if this can be done without refresh. Any ideas how this can be done?


title: can't make jQuery work (change image on time interval)

text: I don't get it why jQuery function is not working. I read on the interned how to load jQuery in wordpress, but with no success. Can anyone help me? What I did so far: I've put this in header.php inside tags:               <?php wp_enqueue_script("jquery"); ?>          <?php wp_head(); ?>      <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/wp-includes/js/jquery/slideshow1.js"></script>      css styles used for jquery:                #gallery1{      float:right;      width:400px; /* Set your image width */      height:300px; /* Set your image height */      }      #gallery1 img{     position:absolute;     z-index:8;             }        #gallery1 img.active{     z-index:10;       }      #gallery1 img.last-active{      z-index:9;       }      html code: slideshow1.js:               function slideSwitch() {     var $active = $('#gallery1 IMG.active');          if ( $active.length == 0 ) $active = $('#gallery1 IMG:last');          var $next =  $active.next().length ? $active.next()         : $('#gallery1 IMG:first');          $active.addClass('last-active');          $next.css({opacity: 0.0})         .addClass('active')         .animate({opacity: 1.0}, 1000, function() {             $active.removeClass('active last-active');         });      }           $(function() {      setInterval( "slideSwitch()", 5000 );      });      I read that I need to change $ to something else, like 'jQuery'. I tried that, but with no luck too. Can anyone help me?


title: What's the best approach to do this?

text: I want to start a new site where I want the main page to be a static page showing information about myself, a kind of resumee without personal details. Then, there would be a `site.com/blog/` where I occasionally write to demonstrate the skills listed on the static page. Finally, I want all of this to be in English and Spanish. * * * So far, I changed the static front page to "About me" and then I created a new empty page "Blog", and chose it as posts page. When I click on "Blog", I get to the posts page but the URL looks like `/?page_id=11`. I would like it to look as I said before (`/blog/`). About the language, I see there are multiple plugins that translate the content. I'm interested in write it by myself, and the only plugin that seems to allow this is qTranslate, which doesn't work with the latest WP version. The only idea that comes to my mind is to do two separate installations on `site.com/en` and `site.com/es`. What else could I do?


title: Query Custom Post Types by date (custom field) range

text: I've seen similar questions and solutions, but so far I couldn't apply it to my code. The following code (functions.php) works perfectly fine:                  if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'turniere' )     {         $query->set('orderby', 'meta_value_num');           $query->set('meta_key', 'date_start');           $query->set('order', 'ASC');          }        Now I want to add a sort of date range. This is the "best" I've got so far:               if( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'turniere' )     {         $query->set('orderby', 'meta_value_num');           $query->set('meta_key', 'date_start');           $query->set('order', 'ASC');         $query->set('meta_value', '20140520');         $query->set('compare', '>=');         $query->set('type', 'NUMERIC');     }         But it doesn't work, the page just says "no posts available". I've tried different combinations of each parameter (meta_value with or without ', different compare methods and every possible type). 'date_start' is stored as yyyymmdd. I use the plugin "advanced custom fields" to set the date in each post. Any help is much appreciated. :)


title: Excerpt is only getting shown for first post

text:
I'm using the following code in my category.php file. I want it to show my custom post type 'Products' the thumbnail and an excerpt. At the moment it's showing the post title, the thumbnail for all the posts. However it's only showing the excerpt for the first post.               <?php     /*     Template Name: Category     */     ?>     <?php get_header(''); ?>                                 <?php /* Products sidebar */         if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('product_sidebar') ) : ?><?php endif; ?>
     <?php if ( function_exists('yoast_breadcrumb') ) {         yoast_breadcrumb('
','
');     } ?>

            <?php          if (!category_has_children()) {?>     <?php foreach(get_the_category() as $category) {     $cat = $category->cat_ID; }?>     <?php query_posts('post_type=Product&cat=' .$cat .'&order=ASC'); ?>                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?><?php the_post_thumbnail(array(100,100)); ?>                 <?php the_excerpt(); ?>
                         <?php endwhile;?>             <?php endif; ?>      <?php get_template_part('loop', 'index');     } else {?>

     <?php      $cat_id = get_query_var('cat');     $catlist = get_categories('hide_empty=0&child_of=' . $cat_id);     echo "
";     foreach($catlist as $categories_item)     {     echo '
term_id ) . '" title="' . sprintf( __( "View all products in %s" ), $categories_item->name ) . '" ' . '>' . $categories_item->name.'
 ';         echo '
'. $categories_item->description . '
';     }     echo "
";     }     ?>

         <?php get_footer(); ?>      This is in my functions.php as well               //Display product categories     function category_has_children() {     global $wpdb;     $term = get_queried_object();     $category_children_check = $wpdb->get_results(" SELECT * FROM wp_term_taxonomy WHERE parent = '$term->term_id' ");          if ($category_children_check) {               return true;          } else {               return false;          }     }      Does anyone know why? **What i'm trying to achieve:** My main category page on my site is 'Products'. On this page it displays child categories of the parent category. Going on to a child category page will either display more child categories, or if there isn't any, it's displays my custom post types 'Product'. The code i'm using is saying. If the Category has children then display them else display Products. **Update:** I've been experimenting and found something out. Using the following code and a different custom post type 'News', it displays the excerpt for all posts.               <?php query_posts(array('post_type'=>'News')); ?>                 <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_time('j M. Y'); ?><a href="<?php the_permalink(); ?>"><?php the_title(); ?>             <?php the_excerpt();?>
                <?php endwhile;?>             <?php endif; ?>       If i change 'News' to 'Product' the excerpt only displays for the first product created. The only difference i can think of between these two custom post types is 'News' is a post type and 'Product' is a page type. I don't know why this isn't working. Also i haven't written an excerpt for either of them, so the excerpt is automatic from Wordpress.


title: how can I remove the sidebar from my wp homepage

text: What's the best practice when it comes to **removing the sidebar on the wordpress homepage**? I'm using wp Version 3.2.1 and Skeleton Child Theme 1.6


title: How can I redirect foreigners by IP to other URL in WordPress?

text: I want that visitors out of my country would be redirected to www.mysite.com/en. How I can do this in Wordpress?


title: Display attachments by ID in a wp.media frame

text: I'm trying to use the new wp.media uploader frame for an app I'm building. I've read up a lot on other questions, blog posts, etc etc. The code I pasted below is working already quite fine and even does some extra stuff that I left in for reference in case it's useful to anyone. But there is one modification I'd like to bring to it: when the frame is opened, **I want it to filter the "media library" display to only show attachment defined by a list of IDs that I provide.** Here is my current code:               // Uploading files      var file_frame;           $('.upload_attachments_button').on('click', function( event ){          event.preventDefault();          // If the media frame already exists, reopen it.     if ( file_frame ) {       file_frame.open();       return;     }          // Create the media frame.     file_frame = wp.media.frames.file_frame = wp.media({       title: jQuery( this ).data( 'uploader_title' ),       button: { text: jQuery( this ).data( 'uploader_button_text' ) },       library : { type : 'image' },       multiple: true  // Set to true to allow multiple files to be selected     });             // When frame is open, select existing image attachments from custom field     file_frame.on( 'open', function() {          var selection = file_frame.state().get('selection');     var attachment_ids = jQuery('#attachment_ids').val().split(',');          // This is my attempt at showing only attachment with ID 275 --> but doesn't work!     file_frame.state().set( 'library', media.query({ id: 275 }) );          attachment_ids.forEach(function(id) {       attachment = wp.media.attachment(id);       attachment.fetch();       selection.add( attachment ? [ attachment ] : [] );     });      });            // When images are selected, place IDs in hidden custom field and show thumbnails.     file_frame.on( 'select', function() {          var selection = file_frame.state().get('selection');          // Place IDs in custom field     var attachment_ids = selection.map( function( attachment ) {       attachment = attachment.toJSON();       return attachment.id;     }).join();     if( attachment_ids.charAt(0) === ',' ) { attachment_ids = attachment_ids.substring(1); }     $('#attachment_ids').val( attachment_ids );               // Show Thumbs     var attachment_thumbs = selection.map( function( attachment ) {       attachment = attachment.toJSON();       if( attachment.id != '' ) { return '<img src="' + attachment.sizes.thumbnail.url + '" id="id-' + attachment.id + '" />'; }     }).join(' ');     $('#images-feedback').show();     $('#thumbs').html(attachment_thumbs);          });          // Finally, open the modal     file_frame.open();     });                // Place selected thumbnail ID into custom field to save as featured image       $(document).on('click', '#thumbs img', function() {      $('#thumbs img').removeClass('chosen');      var thumb_ID = $(this).attr('id').substring(3);      $('#wpuf_featured_img').val(thumb_ID);      $(this).addClass('chosen');      });      I'm attempting to filter the media library display as seen here, but it gives no results:               file_frame.state().set( 'library', media.query({ id: 275 }) );      Does anyone know how to write the syntax?


title: Permalinks: site.com/post-tite vs site.com/post-id/post-title for SEO and Speed

text: What are the differences, in terms of overall "work" required by the PHP processor to retrieve a page using these two permalinks settings:               /%post_id%/%postname%/      vs               /%postname%/      The second example has been widely adopted and used for the "SEO" benefits of having a clean, keyword friendly URL. The first example, which feeds WordPress the post id, is thought to be more efficient on the PHP processor since it does not have to look up the post-id from the post-title. This should not be an issue on smaller sites, the thinking goes, but on larger sites, it could play a significant role. The first example has been suggested as a happy medium between efficiency and overall site speed and SEO. Is this true?


title: How to show Home Page link in Wordpress Menu and how to add an icon to this?

text: I tried with this code:                 function home_page_menu_args( $args ) {     $args['show_home'] = true;     return $args;     }     add_filter( 'wp_page_menu_args', 'home_page_menu_args' );         but gives me this error: `Error 404 - Not Found`   I would like that when I click on "Home Page" menu appears the recent posts.   And I would like to place an **icon** instead of "Home Page" writing.   Thank you!


title: Targeting specific Page Template for sidebar page

text: Currently, there is a sidebar dedicated to all posts, and one for all pages. What I would like to do is target specific page templates to display sidebars for each template.               if(is_front_page())                 {                   if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Blog Sidebar") ) :                   endif;                      }                 else if(get_post_type($post) == "post" || is_search()  )                 {                   if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Blog Sidebar") ) :                   endif;                      }                 else if((get_post_type($post) != "post" && get_post_type($post) != "page") || get_post_type() == "")                 {                   if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Portfolio Sidebar") ) :                   endif;                      }                 else if(get_post_type($post) == "page" || is_author() || is_404() )                 {                   if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Page Sidebar") ) :                   endif;                      }      So instead of posting "Page Sidebar" for all of the pages. I would like to target, for example, the products.php template so that I can put a specific sidebar for those pages. I have added into functions, additional dynamic_sidebars but I need to find a way to target them on this sidebar.php. IF you need more info please let me know


title: Which jQuery packages are included in Wordpress 3.1.2?

text: I haven't found a document, except this one, that says which jQuery packages are included by wordpress. Thus, I don't know if I should add jQuery to my header.php or not. The link above, doesn't state the version of the libraries included nor the wordpress version that this applies to. Should I load jQuery UI manually?


title: How to use an associative array in post__in with WP_Query?

text:
I have stored user favorite posts in the `user_meta` table of WordPress. The data is stored in a format, for example `a:1:{s:8:"post-134";s:3:"134";s:8:"post-136";s:3:"136";}`. How can I get this in the form of an array like `array( 134, 136 )` so that I can use it in the query below.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $query = new WP_Query( array(          'paged' => $paged,          'post_type' => 'post',          'post__in' => I WANT AN ARRAY HERE      ) );     if ( $query->have_posts() ) :          while ( $query->have_posts() ) : $query->the_post();             get_template_part( 'content', 'fav' )         endwhile;         wp_pagenavi();         wp_reset_postdata(); else :             ?>
You have not faved any post.
<?php     endif;


title: Fatal Errors on pluggable.php

text: I was looking to change the "Wordpress" name in all of my sent mail. In the past I have customized my Wordpress backend to display my desired email. But I have downloaded a new plugin that has altered the email name field. I went to attempt to change it again but this time in the pluggable.php template file. However things did not go as planned now I have a fatal error: Fatal error: Call to undefined function _fill_user() in /home/content/61/7791761/html/Portal/wp-includes/pluggable.php on line 199 I need to fix this seems as though it has something to do with the $wpdb variable               /**      * Retrieve user info by a given field      *      * @since 2.8.0      *      * @param string $field The field to retrieve the user with.  id | slug | email | login      * @param int|string $value A value for $field.  A user ID, slug, email address, or      login name.      * @return bool|object False on failure, User DB row object      */     function get_user_by($field, $value) {     global $wpdb;          switch ($field) {         case 'id':             return get_userdata($value);             break;         case 'slug':             $user_id = wp_cache_get($value, 'userslugs');             $field = 'user_nicename';             break;         case 'email':             $user_id = wp_cache_get($value, 'useremail');             $field = 'user_email';             break;         case 'login':             $value = sanitize_user( $value );             $user_id = wp_cache_get($value, 'userlogins');             $field = 'user_login';             break;         default:             return false;     }           if ( false !== $user_id )         return get_userdata($user_id);           if ( !$user = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->users WHERE $field = %s", $value) ) )         return false;          _fill_user( $user );          return $user;     }     endif;


title: Sorting the portfolio by an ACF?

text: I have an advanced custom field attached to every item in my portfolio (its another date) and I want to sort my portfolio by this field. Is this possible? I was hoping you could just swap the orderby for the custom name (which is date_sold) in:               [portfolio items="40" order="DESC" orderby="date_sold" columns="4" generate_thumbnail="true" show_title="true" show_excerpt="true" show_filters="true" filter_display="text" show_pagination="true" show_item_categories="false" link_behavior="detail_page" show_all_text="Show All" paginate="yes" categories="recent"]      Thanks for any help!


title: What is the right way to make custom main page?

text: I am making a custom theme and I want the main page to be a gallery, not a blog,   is it right to change `index.php` to a gallery page (content wise) or should I use another page?


title: When enqueing a stylesheet, is it possible to remove the type attribute?

text: I'm updating my self-built theme to HTML5, and easily made a number of changes already. My theme's sole stylesheet is added to the page head via `wp_enqueue_style` in the `functions.php` file, as follows:               function gridded_enqueue_styles() {         wp_enqueue_style('style', get_template_directory_uri() . '/style.css', array(), null, 'all');     }     add_action('wp_enqueue_scripts', 'gridded_enqueue_styles');      The resulting markup is:               <link rel='stylesheet' id='style-css'  href='http://grantpalin.com.dev:81/wp-content/themes/gridded/style.css' type='text/css' media='all' />      The stylesheet is loaded, the page renders, all good. However, the HTML5 spec indicates that the `type` attribute is no longer needed for the `link`, `style`, and `script` elements. Looking through the codex reference, I don't see a way to alter or remove the `type` attribute. Can this even be done? The obvious workaround is to hard-code the stylesheet reference in my `header.php`, but that's avoiding the benefit of the enqueue functionality.


title: Child pages on hierarchical Custom Post Types 404s

text: I've been working with Custom Post Types lately and haven't had any major problems. This time I'm trying something new. I want to create a CPT which basically works like Pages, with page hierarchy. The real thing is in Swedish so I'll use "Books" as an example on how I would like it to work. So first I create my new post type:               define('BOOKS_HTTP_PATH', WP_PLUGIN_URL . '/' . str_replace(basename(__FILE__), "", plugin_basename(__FILE__)));     function add_custom_post_type_books() {         register_post_type( 'lpm-books', array(              'labels' => array(                  'name' => 'Books',                 'singular_name' => 'Book',                 'add_new' => 'New book',                 'add_new_item' => 'Add new book',                 'not_found' => 'No books found' ),             'public' => true,              'show_ui' => true,             'show_in_nav_menus' => true,             'menu_icon' => BOOKS_HTTP_PATH . 'images/books-icon.png',             'menu_position' => 20,             'hierarchical' => true,             'rewrite' => array( 'slug' => 'books'),             'capability_type' => 'page',             'supports' => array('title','editor','page-attributes'),             'query_var' => '',             '_builtin' => false,             )          );     }     add_action( 'init', 'add_custom_post_type_books' );      In my case I have a specific name for the CPT, lpm-books (might sound weird in this example but as I said earlier I'm doing this in Swedish but I'd like the post type name in English if possible). I set the rewrite slug to books for my permalinks and I add `'hierarchical' => true` and `'supports' => 'page- attributes'` to make the Attribute meta box available. In Admin->Books the view would be something like this:   * Book 1      * Chapter 1     * Chapter 2   * Book 2      * Chapter 1     * Chapter 2     * ... So, I add a regular page called My books (slug: my-books) to have a "start page" which describes my collection of books. The url is `http://www.example.com/my-books/`. On that page I list all my added books and their chapters. Works perfectly if I click on Book 1 (or Book 2). The url is `http://www.example.com/books/book-1/`. But if I want to view a chapter (url: `http://www.example.com/books/book-1/chapter-1`) I get 404'd. My permalink structure is: `/%category%/%postname%/` I really can't figure out why the custom child pages (posts) 404's. Since my regular start page "My Books" slug doesn't clash with either the CPT name or the rewrite slug I guess I'm all out of thoughts atm. Note: I've also tried to remove `'rewrite' => array( 'slug' => 'books')` but I still get 404 on the "child posts". How do you guys do when creating hierarchical CPTs? Can I make this work or do I need to rethink the structure? Thank you!


title: Validate data on attachment_fields_to_save

text: I'm very glad that there is such a dedicated website for WP. My problem is data validation upon saving attachment fields. I have added many custom fields to attachment/media library dialog, most of them are marked as mandatory. (Ex. `$form_fields["some_custom_field"]["required"] = true;`) But this just adds the class, but no validation or checking is done on WP side, so I want to check them myself with functions attached to `attachment_fields_to_save` filter. I can check and so on, BUT THE QUESTION IS: How to validate these fields, so if validation do not pas - WP returns an error in it's regular style, just like in registration form if you fill bad email. In registration process in `register_post` action you can do this `$errors->add('some_error_code', "<strong>Klaida</strong>: Nenurodėte įmonės kodo");` and it will not save data and return to visitor an error. I want that in saving attachment form :D


title: Hard-coding custom menu elements for menu manager

text: I realize that one can add custom links through the menu manager but is there a way to manually create such components through the functions.php file? More specifically, one example here relates to a situation I currently have where I created a custom post type for "events" meaning all associating posts show up like domain.com/events/events-name-abc/ and where the main events page domain.com/events/ is just defined through a custom post type template. As such, when using the admin menu manager interface there is no way for a user to see this main "events" page as an option to add to his menu. Ideally, I am looking for some example code I can add to my functions.php file which would allow me to define/code in such items manually (with the optional ability to pre-defining custom attributes like a predefined class) and have any of these elements automatically added as options to any of the menu manager meta-boxes or places into a custom meta-box. Any plugins or code anyone is aware of which extend the menu manager to allow for such functionality?


title: Adding all sub-pages to the menu manager

text: Is there some simple way which would allow one to add a page to a menu (through the menu manager interface) and be able to define if the inclusion of this item should automatically add all subpages up to a specific depth? Essentially, the logic I am trying to use here applies to a user adding a new page with content then associating this page as a sub-page of another and by doing so this page automatically shows up on the fronted whenever a specific custom menu is requested where such logic was added. Not sure if the logic of the menu manager allows for such dynamic list capabilities to take place.


title: Add a class to posts in increments of 2

text: Is it possible to add specific classes to posts/pages in a query in increments of 2? For example   * Post 1   * Post 2   * Post 3 (add custom class)   * Post 4 (add custom class)   * Post 5   * Post 6   * Post 7 (add custom class)   * Post 8 (add custom class)   * Post 9 I don't mind using jQuery if needs be.


title: Permalinks so that one custom post type appears to be a child of another, not working

text: Currently I have two post types, "products" and "products-data" they are separate post types; however, for all intents and purposes products-data is a child post of products. The relation is established via a meta element for products-data "parent" that will have a products post's post ID. The "products-data" posts are created only one way --- a user clicks on a product in the products post type and enters data into a popup window. This uses wp_insert_post to create a products-data post and it adds a meta element "parent" with the value of the "products" post's ID. This data is displayed via a modal window if a user clicks on the product type. I am trying to have their permalinks as follows: Permalink schema for a "products" post (for this example this post's ID is 123): http://example.com/products/new-product-1/ Permalink schema for a "products-data" post that has a meta key/value of parent=>123 http://example.com/products/new-product-1/information-product-data/ Here is the code I am using to register the post type and create rewrite rules; however, after adding this code and flushing my rewrite rules (settings>permalink) it works fine for a "products-data" post type BUT when I try to access a "products" post it displays the homepage for the WordPress site (N.B. this is not via redirect, the URL bar displays the "products" URL). I am wondering if the issue is that the two permastructs appear that they can collide with each other, however there will never be an instance of this in practice due to the permastructs schema. Any help would be greatly appreciated on how to resolve this. Code:               add_action ( 'init', 'register_product_post_types' );     add_action ( 'init', 'products_add_rewrite_rules' );     add_filter ( 'post_type_link', 'products_permalinks', 10, 3 );          function register_product_post_types() {             register_post_type( 'products',             array(                     'supports' => array( 'title', 'editor', 'author',"custom-fields", "thumbnail", "excerpt", 'comments' ),                     'labels' => array(                     'name' => __( 'Products' ),                     'singular_name' => __( 'Products' )                 ),             'public' => true,             'has_archive' => false,             'rewrite' => FALSE,             )         );              register_post_type( 'products-data',             array(                     'supports' => array( 'title', 'editor', 'author',"custom-fields" ),                     'labels' => array(                     'name' => __( 'Products-Data' ),                     'singular_name' => __( 'Products-Data' )                 ),             'show_in_menu' =>'edit.php?post_type=products',             'public' => true,             'has_archive' => false,             'rewrite' => FALSE,             )         );     }               function products_add_rewrite_rules() {         global $wp_rewrite;         $wp_rewrite->add_rewrite_tag('%products%', '([^/]+)', 'products=');         $wp_rewrite->add_rewrite_tag('%products-data%', '([^/]+)', 'products-data=');         $wp_rewrite->add_rewrite_tag('%parent%', '([^/]+)', 'parent=');         $wp_rewrite->add_permastruct('products-data', '/products/%parent%/%products-data%', false);          }          function products_permalinks($permalink, $post, $leavename) {         $no_data = 'no-data';         $post_id = $post->ID;         if($post->post_type != 'products-data' || empty($permalink) || in_array($post->post_status, array('draft', 'pending', 'auto-draft')))             return $permalink;         $data = sanitize_title(get_the_title(get_post_meta($post_id, 'parent', true)));         if(!$data) $data = $no_data;         $permalink = str_replace('%parent%', $data, $permalink);         return $permalink;     }


title: Add .html extension to custom post type taxonomies

text: I want to have the `.html` extension in the custom post type taxonomy urls. My custom post type taxonomy it is called "`product_cat`". I will need something like: www.mydomain.com/product-category/product-category-name.html Tried this one, inserting in `functions.php`, without success:               add_action('init', 'add_html_ext_to_custom_post_type_taxonomies');     function add_html_ext_to_custom_post_type_taxonomies() {         add_rewrite_rule('^product_cat/([^/]+)\.html', 'index.php?product_cat=$matches[1]', 'top');     }      **Further tries:** Also I've used the Custom Post Type Permalink plugin and have played around line 559. Replaced the code from line 559 to line 561 with the next one:               $termlink = str_replace( $wp_home, $wp_home, $termlink );     $str = rtrim( preg_replace("/%[a-z_]*%/","",get_option("permalink_structure")) ,'/');//remove with front     return str_replace($str, "", $termlink.'.html' );      This will return the `.html` in the taxonomy view page url, but it gives a 404.


title: Auto Redirect after login

text: In multisite this code redirect users (authors) to /wp-admin/post-new.php after the login ....but also redirects me (super admin) how can I prevent this?               function primary_login_redirect( $redirect_to, $request_redirect_to, $user )     {         if ($user->ID != 0) {             $user_info = get_userdata($user->ID);             if ($user_info->primary_blog) {                 $primary_url = get_blogaddress_by_id($user_info->primary_blog) . 'wp-admin/post-new.php';                 if ($primary_url) {                     wp_redirect($primary_url);                     die();                 }             }         }         return $redirect_to;     }      add_filter('login_redirect','primary_login_redirect', 100, 3);


title: How to Order a list of taxonomies? orderby?

text:
I am using this code to fetch a list of child taxonomies. I want the order displayed to be alphabetical, but it is not! Any help in figuring out how to do it? I guess ordering it before returning it will be most optimal? thanks               <?php     $termID = 4;     $taxonomyName = "location";     $termchildren = get_term_children( $termID, $taxonomyName );          echo '
';     foreach ($termchildren as $child) {     $term = get_term_by( 'id', $child, $taxonomyName );     echo '
name, $taxonomyName ) . '">' .   $term->name . '
';     }     echo '
';     ?>


title: How to setup LDAP authentication with WP multisite

text: I would like to set up my WP multisite install so that it will authenticate with our LDAP server. I had this working using the WPMU LDAP authentication plugin, but it no longer appears to be working with WP 3.9.1 and MySQL 5.3. Other plugins I've tried seem to call for the plugin to be configured on every site, and I would prefer for something to work over the entire network. Can anyone explain how to go about setting up my WP multisite installation running WP 3.9.1 to authenticate over LDAP?


title: CPT, meta-data, url parameter

text: does someone could point me a lecture that could explain me how to create some "filter" passed by pretty link ? Let me explain my self, I have a custom post type called **"spectacle"** and I have a meta_key who contain an array of dates for this spectacle. I know how to extract my date, and filter them if I give explicitly some filter to my display, my problem is not coming from there, what I'm trying to achieve, is to access > http://myurl.com/spectacles (show upcoming spectacles - **already done** ) > http://myurl.com/spectacles/2014 (show all 2014 spectacle) > http://myurl.com/spectacles/2014/01 (show all spectacle from january 2014) > http://myurl.com/spectacles/2014/01/01 (show all spectacle from january 1st > 2014) http://myurl.com/spectacle/name-of-the-spectacle (show this spectacle > - **already done** ) All i need to is a way to enable theses permalink and to extract theses parameters than i'll be able to do what I want, I already have my filtering functions. This is what i've done so far :               // Register Custom Post Type     function build_cpt() {     $labels  = array(         'name'               => _x( 'Programmation', 'Post Type General Name', 'mlog_lang' ),         'singular_name'      => _x( 'Spectacles', 'Post Type Singular Name', 'mlog_lang' ),         'menu_name'          => __( 'Programmation', 'mlog_lang' ),         'all_items'          => __( 'Tous les spectacles', 'mlog_lang' ),         'view_item'          => __( 'Afficher ce spectacle', 'mlog_lang' ),         'add_new_item'       => __( 'Ajouter un spectacle', 'mlog_lang' ),         'add_new'            => __( 'Ajouter un spectacle', 'mlog_lang' ),         'edit_item'          => __( 'Modifier un spectacle', 'mlog_lang' ),         'update_item'        => __( 'Mettre à jour ce spectacle', 'mlog_lang' ),         'search_items'       => __( 'Rechercher un spectacle', 'mlog_lang' ),         'not_found'          => __( 'Aucun spectacle trouvé', 'mlog_lang' ),         'not_found_in_trash' => __( 'Aucun spectacle dans la corbeille', 'mlog_lang' ),     );          add_rewrite_tag( '%event-year%', '(\d{4})' );     //add_rewrite_tag( '%event-month%', '(\d{2})' );     //add_rewrite_tag( '%event-day%', '(\d{2}|\d{1})' );          $rewrite = array(         //'slug'       => 'spectacles/%event-year%/%event-month%/%event-day%/',         'slug'       => 'spectacles/%event-year%/',         'with_front' => true,         'pages'      => true,         'feeds'      => true,     );     $args    = array(         'label'               => __( 'programmation', 'mlog_lang' ),         'description'         => __( 'Liste des spectacles', 'mlog_lang' ),         'labels'              => $labels,         'supports'            => array( 'title', 'editor', 'revisions' ),         'taxonomies'          => array(),         'hierarchical'        => false,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => false,         'show_in_admin_bar'   => false,         'menu_position'       => 4,         'menu_icon'           => 'dashicons-groups',         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'rewrite'             => $rewrite,         'capability_type'     => 'page',     );     register_post_type( 'programmation', $args );      Now I can access : > http://myurl.com/spectacles/2014 but it shows the home page instead of archive-programmation.php And I can't access : > http://myurl.com/spectacles/name-of-the-spectacle


title: Multiple orderby parameters in pre_get_posts() action

text: Referencing @Otto's response to a question I also had about ordering by multiple fields, here is what he said: > Can't do it with a naive WP_Query. Use the posts_orderby filter to add your > own ordering string.               function my_order($orderby) {          global $wpdb;          return "{$wpdb->posts.post_author} ASC, {$wpdb->posts.post_date} DESC";      }      add_filter( 'posts_orderby', 'my_order' );           $blah = new WP_Query(...);           remove_filter( 'posts_orderby', 'my_order' );       > -Otto This appears to be the way it would be done in a new call to WP_Query --> how would I go about this same thing in a `pre_get_posts()` action with two meta fields, with a default sort to?:               function mouldings_sort($query) {         if ($query->is_main_query() && is_tax(array('wood_types','profile_categories','combination_categories'))) {                  $query->set('meta_key', '_mouldings_dimensions_height');             $query->set('order', 'DESC');             $query->set('orderby','meta_value_num');         }          }     add_action('pre_get_posts','mouldings_sort');      I had previously tried simply adding in another meta field like so:               $query->set('meta_key', array('_mouldings_dimensions_height', '_mouldings_dimension_width'));     $query->set('orderby','meta_value_num');      with a default sortback of `title` as so:                $query->set('orderby','meta_value_num title');      but it doesn't look like `meta_key` can accept arrays and my `title` fallback goes back to Otto's original response on the matter. Any help would be a greatly appreciated. Thanks!


title: Adding WordPress colorpicker in widget settings

text: I want to add the WordPress default colorpicker in widget settings form. Here's what I'm trying: In my functions.php, I have this:               function widgets_scripts( $hook ) {         if ( 'widgets.php' != $hook ) {             return;         }         wp_enqueue_style( 'wp-color-picker' );                 wp_enqueue_script( 'wp-color-picker' );      }     add_action( 'admin_enqueue_scripts', 'widgets_scripts' );      In my widget file, I have this:               <script type="text/javascript">         jQuery(document).ready(function($) {             $('#<?php echo $this->get_field_id( 'color' ); ?>').wpColorPicker();         });     </script>     <input id="<?php echo $this->get_field_id( 'color' ); ?>" type="text" name="<?php echo $this->get_field_name( 'color' ); ?>" value="<?php echo esc_attr( $instance['color'] ); ?>" />      Using the above code, I can see the colorpicker "Select color" button, but it does not let me click it initially. It only lets me click after the widget is saved. I'm guessing that it is because of assigning the ID. If I try to use a css class name, it displays the button 2 times (I don't know why, even the class exists only once in a widget). This is what I see if I use class name: ![enter image description here](http://i.stack.imgur.com/GKdJo.png) Also i think class name will cause the problem if same widget is used multiple times. That's why I'm trying to use a dynamic ID for the input field.


title: How to add links under every posts? ( WHILE BUILDING PLUGIN not manually )

text: I want to use, change, add and delete the links that appears with every posts. (e.g. May 21, 2014| 1 Comment) If I'm not wrong these are called template tags. I can play with them manually by getting into the theme codes but is there any built in way of wordpress to handle them or is there a way to handle them while plugin building?


title: jquery code didnt run on my plugin

text: I use this to hook my scripts and styles to my plugin               add_action('admin_init', 'the_box_init' );          // Init plugin options to white list our options     function the_box_init(){         register_setting( 'the_box_options', 'the_box', 'the_box_validate' );         wp_enqueue_style( 'myprefix-style', plugins_url('theboxstyle.css', __FILE__) );         wp_enqueue_script( 'myprefix-script', plugins_url('theboxjs.js', __FILE__) ); //this hook my custom js, preferrably which contents almost my jquery codes.          }      however, the jquery codes doesn't work even in this simple codes (refer below)               $( document ).ready(function() {     alert("asdasd");     });       and only javascript did work.. what does suppose my implementation get wrong that jquery didnt work? im open in any suggestions, recommendations and idea's. Thank you in advance.


title: Disabling auto-resizing of uploaded images

text: Whenever I upload a large image, it gets resized to the width of the post. This will be a negative feature for comic reading sites. I need to display the full width images, which I can resize when I need during upload. If anything that can fix this issue?


title: Login redirect shows white page in firefox

text: I am developing a plugin which allows to link a local wordpress account to a two-factor authentication service. The login and linking flow works perfectly in Chrome and IE, but the redirects result in a white page in Firefox. Strangely, there is no error whatsoever, as all code is executed and a simple F5 refresh of the page shows the correct page. As you can see in the code below, I am only using a wp_redirect() once to trigger the authentication flow, which works and is not the problem. From there on it's Wordpress who handles all redirects and does so nicely in Chrome and IE but fails in Firefox               public function myplugin_callback() {         global $wp_query;              if ($wp_query->get('code')) {             $_SESSION['code'] = $wp_query->get('code');             $_SESSION['state'] = $wp_query->get('state');                  wp_redirect(site_url('wp-login.php', 'login'));             echo 'Please wait, logging in.';             exit;         }     }          public function myplugin_authenticate($user, $username) {         // do the authentication here         if (isset($_SESSION['code'])) {             /* get userdata via OAuth here */                  if (isset($userData['email'])) {                 $userSearch = get_user_by('email', $userData['email']);                      if ($userSearch) { // user exists                     $uuid = get_user_meta($userSearch->ID, 'myplugin_uuid', true);                     if ($uuid == $userData['uuid']) { // user is linked                         $user = new WP_User($userSearch->ID);                     } else { // user is not linked                         $_SESSION['myplugin-data'] = serialize($userData);                         $user = new WP_Error('denied', __('You already have an account with this email on this blog. Please log in to link this account with our service.'));                         remove_action('authenticate', 'wp_authenticate_username_password', 20);                     }                 } else { // user does not exist                     $user = new WP_Error();                 }             }             unset($_SESSION['code']);         } else { // local login             $userSearch = get_user_by('login', $username);                  if ($userSearch) {                 $uuid = get_user_meta($userSearch->ID, 'myplugin_uuid', true);                      if (!isset($_SESSION['myplugin-data']) && !empty($uuid) && !$this->myPluginHelper()->getlocalAuthAllowed()) {                     $user = new WP_Error('denied', __('Local login disabled. Please use myPlugin to log in.'), 'message');                     remove_action('authenticate', 'wp_authenticate_username_password', 20);                 } else {                     add_filter('login_redirect', array($this, 'save_myplugin_uuid'), 10, 3);                 }             }         }         return $user;     }          public function save_myplugin_uuid($redirect_to, $request, $user) {         if (isset($_SESSION['myplugin-data']) && is_a($user, 'WP_User')) {             $userData = unserialize($_SESSION['myplugin-data']);             update_usermeta($user->ID, 'myplugin_uuid', $userData['uuid']);             unset($_SESSION['myplugin-data']);         }         return $redirect_to;     }      I have Googled quite a deal, to no avail. Does anyone have an idea? Thanks Jeroen


title: WP_Query tax_query problem

text: When I call WP_Query with tax query or category__in, I get posts only from first category in array of requested categories.               $query = new WP_Query(         array(             "tax_query" => array(                 array(                     "taxonomy" => "category",                     "field" => "term_id",                     "terms" => array(1, 2, 3)                 )             ),             "posts_per_page" => -1         )     );      Here is sql query from $query->request:               SELECT wp_posts.*     FROM wp_posts     INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)     INNER JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id)     INNER JOIN wp_term_relationships AS tt2 ON (wp_posts.ID = tt2.object_id)     WHERE 1=1       AND (wp_term_relationships.term_taxonomy_id IN (1,                                                       2,                                                       3)            AND tt1.term_taxonomy_id IN (1)            AND tt2.term_taxonomy_id IN (1))       AND wp_posts.post_type = 'post'       AND (wp_posts.post_status = 'publish'            OR wp_posts.post_status = 'future'            OR wp_posts.post_status = 'draft'            OR wp_posts.post_status = 'pending'            OR wp_posts.post_status = 'private')     GROUP BY wp_posts.ID     ORDER BY wp_posts.post_date DESC      Results list only posts in category 1. What is wrong with my query?


title: Let me choose permalinks

text: I need to pick a permalink called 'mysite.com/1418', but wordpress keeps adding '-2' to the permalink. Normally this means i already have a page called the same that is in the trash or something. But that doesn't seem the case here. I tried resetting the permalinks in the settings this also doesn't help. How can i use numbers as page name permalink, without wordpress adding the '-2' to to permalink.


title: AJAX-login over https on a http page, is it possible?

text: I would like to a ajax login-form on every page. Most of the site's pages are served over http. The ajax-login request is over https. Everything works as expected if I am already on https and try to login, but I cannot get it to work if I am on http and want to login via the ajax-https call. The login credentials are verified but the correct cookies are never set. Is this possible to achive this, I have seen non-Wordpress sites do this? I found a simular question with no answer; How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled? I would like to not have a separate login-page at all.


title: Custom taxonomy parent from another taxonomy

text: I've had a look around for this but nothing has came up (perhaps am not searching good enough?) but I'm trying to set a parent on a taxonomy which is loaded from another taxonomy. For example I have Car Makes and Car Models, when adding a new model I would like to select its parent (Car Make) not another parent within itself. Makes cannot have any parents, but can have unlimited children, models cannot have any children and there parent must be a make. Is this possible? Preferably without a plugin.               /* Makes */     $labels = array(     'name' => _x( 'Makes', 'taxonomy general name' ),         'singular_name' => _x( 'Make', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Makes' ),         'all_items' => __( 'All Makes' ),         'parent_item' => __( 'Parent Make' ),         'parent_item_colon' => __( 'Parent Make:' ),         'edit_item' => __( 'Edit Make' ),         'update_item' => __( 'Update Make' ),         'add_new_item' => __( 'Add New Make' ),         'new_item_name' => __( 'New Make' ),     );       register_taxonomy('makes', 'car', array('hierarchical' => false, 'labels' => $labels, 'query_var' => false, 'rewrite' => false, 'with_front' => false));          /* Models */     $labels = array(     'name' => _x( 'Models', 'taxonomy general name' ),         'singular_name' => _x( 'Model', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Models' ),         'all_items' => __( 'All Models' ),         'parent_item' => __( 'Parent Model' ),         'parent_item_colon' => __( 'Parent Model:' ),         'edit_item' => __( 'Edit Model' ),         'update_item' => __( 'Update Model' ),         'add_new_item' => __( 'Add New Model' ),         'new_item_name' => __( 'New Model' )     );     register_taxonomy('models', 'car', array('hierarchical' => true, 'labels' => $labels, 'query_var' => false, 'rewrite' => false, 'with_front' => false));      This question is slightly related: Show WordPress Custom Taxonomy Items Based On a Selected Item From Another Custom Taxonomy however I assume the parent/child elements are from one taxonomy? In my case they need to be two separate taxonomies.


title: Custom Taxonomy Archive URL rewrite

text: I would like to create an archive page with a list of my custom taxonomies that link to a page that shows posts with that taxonomy relationship. I registered my taxonomy like this:               register_taxonomy('my_taxo', array('my_custom_post'), array(                 'hierarchical' => true,                 'label' => 'my taxo'                 'show_ui' => true,                 'query_var' => true,                 'show_in_nav_menus ' => true                 )             );      What is the recommended way to create an archive page that can be visited at a url such as mysite.com/my_taxo or mysite.com/taxonomy/my_taxo. Ideally the template file that will be used would be `taxonomy-{taxonomy}.php`. Does this involve add_rewrite_rule? If so what might that look like?


title: /%post_name%/ or /%postname%/ in Permalinks?

text: In Settings-->Permalinks is there any difference between: checking Custom Structure and using: /%post_name%/ or /%postname%/ Are they both correct? Will they both work? Thank you. -Laxmidi


title: Posts are not showing up on particular category

text: On my website, post are not showing up when I navigate to               http://www.domain.com/category/category-name/      but on wordpress dashboard, I am able to see the actual number of post under that category. It is not getting displayed on website only. Also, when I am logged in to the wordpress dashboard and visit that category page,               http://www.domain.com/category/category-name/      I am not seeing the wp admin bar which used to show on top. but it is showing up on other pages.


title: Adding fields to the "Add New User" screen in the dashboard

text: I'd like to add the field "Company Name" to the add new user page in the admin panel. I've done quite a bit of searching and have been unable to find details on how to do this. I can easily add info to the profile page and registration with..                  function my_custom_userfields( $contactmethods ) {         //Adds customer contact details         $contactmethods['company_name'] = 'Company Name';         return $contactmethods;        }        add_filter('user_contactmethods','my_custom_userfields',10,1);      But no dice on anything else.


title: Making a 1140px wide header logo in the twenty-ten theme?

text:
I've created a child theme that is a wide version of twenty-ten, and it is working for the most part. But I am struggling to make the header logo wider. You can see the work in progress here at http://7d7d.net The CSS that is not working is (it still shows as 980px):               #branding {         margin: 0 auto;         width: 1140px;     }      I can see that the generated html for the logo div is:

      And that header.php defines the logo like so:               <img src="<?php header_image(); ?>"       width="<?php echo HEADER_IMAGE_WIDTH; ?>"       height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />      But I can't see where to set `HEADER_IMAGE_WIDTH` and `HEADER_IMAGE_HEIGHT`. The CSS file is here: http://7d7d.net/wp-content/themes/twenty-ten- wide/style.css


title: Mini-Site Strategy

text: I'm working on a project to allow a number of mini-sites within a WordPress multisite installation. Here's how it's _supposed_ to function: The client has a large number of individual locations, each of which has their own website. All of these websites are sites within a large WordPress network to allow for centralized user and site maintenance. This part is working already. But each location has any number of clients and wants each client to have their own "mini-site" within the network. Essentially a new WordPress site, but housed underneath the location's site, URL, and administrator list. Users of the mini-site should only be able to use that mini-site, not the parent site, and not any other site on the network. As I've been working on this, I've come across two different ways to set this up. Both are somewhat complex: ### Multi-network Installation WordPress allows you to install several standalone networks with one codebase. It's like multisite, but on steroids. My first attempt at solving the above problem was to bury a bunch of multi-network functionality in the system. When you added a new client mini-site, you were actually adding a new site to a network "owned" by the parent site. This half-worked. You could create the sites just fine, but without deeper control over the server (my client asked for a plugin, something they can drop on the server without needing to give me SSH access) it was difficult to get the routing to work in Apache. Some of the new mini-sites would load, others would 404, others would redirect back to the parent site. The other problem was management. Though you could create as many mini-sites as you wanted (and could verify through phpMyAdmin that they existed), I had difficulty reading back out a list of the sites that were available. The other problem was database management. Every time you create a new site, you create 10+ new tables in the database. If the site will only ever have 1 or 2 posts/pages, this is overkill. ### Custom Post Type with Theme Override My new approach is to set up the clients as a custom post type. Then, users of the parent site can write new posts and check a field in a meta box to associate the content with a client (using a post-to-post relationship scheme). When you visit the page for the custom post type, WordPress overrides the display and presents a custom theme (a mod of P2) displaying posts associated with the custom post type. Not as many problems with scalability here, just in content management. I haven't quite figured out a way to allow filtering of content from one client to another (remember, content is associated with a CPT based on a meta field, so unless I build out another post management screen, it's hard to view "all posts for client-x"). My question: Which of these approaches is the best? Is there another approach I should consider that might be easier for the end user to work with?


title: the_posts filter been called multiple time

text: I have create an endpoint so I can do some checkout processing of my cart. Everything is working fine in sense that every thing is hooked up properly. Though I am having issue that to serve the content of my endpoint, I define the_posts filter, where if my "endpoint" is choosen than I check other query_vars and do the processing. It works for me for couple of project. However in this project, I need to mark my cart as paid and remove it from session. So, as usual under my the_posts filter/action function I define a switch and do the processing. But, when said page is called, cart was not getting marked. I debug and found that the_posts action function was called thrice on my page. and the first call did get it marked and clear session, but next call didn't find session value and hence it unmark the cart again. the three call I have on my page are   1. From wordpress URL rewrite module [I am guessing this] that it try to pick content or redirect them? [seems like a main_query as well]   2. I have a custom post type as news that I show in my side header for this I create a new WP_query object, but it still call the_post as it is in header.   3. My page content call where I actually needed it.   4. I have another call that is in footer recent post thing. but it doesn't matter for my purpose. in my the_post method I check for Query_var               global $wp_query, $wpdb, $cardcomm;     if(isset($wp_query->query_vars[cardcomendpoint]) ) { ... }      since all four call set this query var as true I am not sure how can I ensure that it is called for my purpose only. Any idea how to tackle this?


title: List Categories for Custom Post Types - WordPress

text: I'm using custom post types in WordPress 3.0 (now 3.0.1) to setup a custom directory system, but can't seem to find how to list out the categories under the custom taxonomy similar to how you'd use the `wp_list_categories` for normal posts. Anyone know how you'd do this on a page? Thanks! I've seen suggestions for options like the following, but have had no luck when popping them in there:               <?php         //list terms in a given taxonomy using wp_list_categories  (also useful as a widget)         $orderby = 'name';         $show_count = 0; // 1 for yes, 0 for no         $pad_counts = 0; // 1 for yes, 0 for no         $hierarchical = 1; // 1 for yes, 0 for no         $taxonomy = 'genre';         $title = '';              $args = array(             'orderby' => $orderby,             'show_count' => $show_count,             'pad_counts' => $pad_counts,             'hierarchical' => $hierarchical,             'taxonomy' => $taxonomy,             'title_li' => $title         );     ?>     <ul>     <?php wp_list_categories($args); ?>     </ul>


title: Is it possible to send blog posts via email to subscribers?

text: Would like to be able to send the blog post in an email mail to my subscribers, this would be great if it can be achieved through a plugin.


title: how to add a custom form in a page

text: 1. How do I add a custom form to a WordPress page? I do not need contact form I need a custom form that has my own fields. Some fields get data from a database table like cities and country or any other dependable fields.   2. How can I make a form to save data from a user to user meta fields that I created in the dashboard area? I found a plugin that works as form manager, but it's not free. I tried using cform and didnt know how to get access to posted data from the form.


title: Different side menu on each page

text: Does anyone have a solution how to have different side menus on different pages? Do I need to create template for every page? I've registered many nav_menus in functions.php and than used pages ID as a switch/case parameter. It doesn't solve anything if someone gonna create couple new pages and I didn't add ID's to my file... As you can see english is not my first language but I hope it was all understandable.


title: Is it posibble to have alink to display all posts on index.php?

text: I have restricted to display 20 posts on index.php, but also I want to add a link to display all posts without restrictions. Any advices on how to achieve this? Thanks!


title: Styling issue with custom menus and sub menus

text: In a previous question I asked (and later worked out) how to style sub menus, I want to expand on that with another question related to styling sub-menus. I have hit an issue were if the parent is the selected page all child pages pick up the same styling, I believe this is because the `current-menu-item` class gets added to the parent li. If a child element is selected only the child is highlighted (which is correct) Has anyone encountered this before? What is the best way to only have the selected page highlighted and not the child elements of that page? As requested, here is the CSS that is being called to highlight the child menu.               .current-page a, .current-menu-item a {         background-color: #EE8833;     }


title: Styling child custom menu pages

text: I have a custom menu created using Appearance > Menus which contains top level and child pages. I would like to be able to indent my child level pages to give some sort of visual hierarchy to the content. What is the best way to achieve this?


title: Are the Theme frame works or Theme builders slow downs the performance?

text: I depend on theme builders like Suffusion for my Multi-Site Installation. Some WP users say the theme frameworks slow downs the performance and load speed. Is that really affects the performance? A follow up question... is there any chance for performance problem if I enable BuddyPress on same Installation Thanks !


title: Latest Foursquare Checkin function

text: Does anyone know how to display the latest Foursquare checkin for a specific account on a WordPress blog? Ideally I would like to add the function to the theme rather than use a plugin but i'm open to suggestions. Thanks in advance, G


title: How can I hide that I Use Wordpress (with W3 Total Cache)

text: For security reasons I don't want it to be obvious that I use Word Press. I use the W3 Total Cache plugin and minify HTML, CSS and JS. I may also use a CDN. Is it possible to modify the W3 Total Cache plugin so that it can rewrite the Wordpress directories "wp-content", "wp-admin" and "wp-includes" without actually renaming these directories? I'd ideally like to be able to rewrite W3 Total Cache directories such as "w3tc"


title: Custom page sidebar using Template dropdown box

text:
i am wondering how i go about making a Template for some of my pages to use a different sidebar? I have created the widget like this:               register_sidebar(array(         'id' => 'ourPat-sidebar',         'name' => 'ourPat Sidebar',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
'     ));      In side my Functions.php code. Then i go into my Widget panel and its displayed just fine. Then i proceed to add text to it in order to form the sidebar html. ![widget menu](http://i.stack.imgur.com/gq2x0.jpg) However, when i go to my Page menu and create a new page, i do not have the choice to use the custom widget code? ![theme](http://i.stack.imgur.com/ICeCr.jpg) So i must be doing something incorrect since its not in there. To recap, i'm just looking for a way for different pages of mine to use a different sidebar using a custom widget i made.


title: Get a row from a separate table by matching a posts meta_key to a tables ID column

text: I am trying to match a posts meta_key value to a separate tables column ID and call that row/array in the single-listing.php. I have a meta_key value that is called dot_number. The table is called wp_csadata and has a column called dot_number. Lets say the meta_key equals 12. I need to call that wp_csadata table and match the meta_key value of 12 to the column called dot_number, which has the same number, and return values in the row. Thanks.


title: An adiitional function fires on my AJAX submit

text: I am working on a small community style website for my family to use. Mainly it is a small version of a social network so my nieces and nephews can have fun with each other. I have set up "freinding" functionality and it works fine. But when I respond to a friend request an additional ajax function is fired. My AJAX function works and updates the database, but fails to send an email notification whic I think is due to the additional ajax function being fired. After submitted the response (accept or ignore) FireBug shows my AJAX function has been moved temporarily - I see a 302 Moved Temporarily error. The just underneath it an additional GET request fires for the user I am logged in as. The Headers looks something like this in FireBug:               Cache-Control   no-cache, must-revalidate, max-age=0     Connection  Keep-Alive     Content-Type    text/html; charset=UTF-8     Date    Tue, 27 Nov 2012 20:51:46 GMT     Expires Wed, 11 Jan 1984 05:00:00 GMT     Keep-Alive  timeout=10, max=29     Last-Modified   Tue, 27 Nov 2012 20:51:46 GMT     Pragma  no-cache     Server  Apache     Transfer-Encoding   chunked     Vary    Accept-Encoding     X-Pingback  http://obeliskwebdesign.com/sandbox/family-site/xmlrpc.php      I am not sure what this additional function is or why it fires. I have several other AJAX functions in the site which work fine and have no additional functions firing after them so I am at a bit of a loss here. If anyone can shed some light on what may be the cause of this, or if it could be causing my email notification to not fire please let me know. Thanks! \---- EDIT --------------------------------------------------------- My AJAX function:               //ajax for friend response submission     jQuery('.friend-request-response').click(function(event){         event.preventDefault();         var id = $(this).attr('rel');         var form = jQuery( 'form#friend-response-form-'+id ),             friend_request_response_nonce = form.find( 'input[name="friend_request_response_nonce"]' ).val(),             request_id = form.find( 'input[name="request_id"]' ).val(),             userid = form.find( 'input[name="userid"]' ).val(),             friend_id = form.find( 'input[name="friend_id"]' ).val(),             status = form.find( 'input[name="status"]' ).val();              jQuery('div#request-' + id + 'ul').hide('slow');         jQuery.post(             UiAjax.ajaxurl,             {                 action : 'friend_request_response_action',                 friend_request_response_nonce : friend_request_response_nonce,                 //other parameters                 request_id : request_id,                 userid : userid,                 friend_id : friend_id,                 status : status             },             function( response, data ) {                 var new_status = ucFirst( status );                 jQuery('div#request-' + id).html('<p>' + new_status + '</p>').show('slow');             }         );         return false;            });


title: How to merge two Wordpress themes?

text: I have a project in which I want to merge two wp themes, I have two themes in which one has a great interface i want to use this interface and second theme has a good functionality so I want to use that fuctionality with first theme, but I have no idea about this, can it be possible??? if yes how can I achieve this provide some refrence.


title: WP_Query returns random number of posts

text:
There's a file called `inform.php` included in `index.php`, `single.php` and `single-news.php` with the below query in it:               <?php         $arr = array('cat' => '12837', 'posts_per_page' => '22');         $query1 = new WP_Query($arr);         while($query1->have_posts()) : $query1->the_post();     ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail("icon-40", array('class' => 'right icon-40')); ?><?php /*<?php echo text_excerpt(get_the_title(), 67); ?>*/ ?>
     <?php         endwhile;         wp_reset_postdata();     ?>      It returns exact 22 number of posts in `index.php` and `single.php` but in `single-news.php` it returns only **one** post. There is no difference between `single.php` and `singel-news.php` except styling and displaying some custom fields. Also I checked for `wp_reset_postdata();` to be considered after each custom query I wrote, but yet there is that strange result. Single news template will load by this function:               function custom_cat_single_file($single_template) {       global $post;        if ( in_category( 'news' ) && !in_category('mac-game')) {           $single_template = dirname( __FILE__ ) . '/single-news.php';       }       return $single_template;     }     add_filter( "single_template", "custom_cat_single_file" );      **Update #1** Reformatted `var_dump($query1->request);`               string(476) "SELECT SQL_CALC_FOUND_ROWS wp_posts.id      FROM   wp_posts             INNER JOIN wp_term_relationships                     ON ( wp_posts.id = wp_term_relationships.object_id )      WHERE  1 = 1             AND ( wp_term_relationships.term_taxonomy_id IN (12837) )             AND wp_posts.post_type = 'post'             AND ( wp_posts.post_status = 'publish'                    OR wp_posts.post_status = 'private' )             AND wp_posts.post_date >= '2014:03:21 00:00:00'             AND wp_posts.post_date < '2015:03:21 00:00:00'      GROUP  BY wp_posts.id      ORDER  BY wp_posts.post_date DESC      LIMIT  0, 22"      I've a `pre_get_post` hook but I don't think it affects something.               function post_in_page( $query ) {       // not an admin page and is the main query       if (!is_admin() && $query->is_main_query()){         if(is_category()){           $current = get_query_var('cat');           $cat = get_category ($current);           if($cat->slug != 'news')             $query->set('posts_per_page', 25);         }       }     }     add_action( 'pre_get_posts', 'post_in_page');      **Update #2** As @s_ha_dum noticed about dates, I didn't found any hooked function however I didn't go deep in all plugins files. So I ended up with modifying `WHERE` clause of query:               function so__weird()     {       function filter_where( $where = '' ) {         $where = preg_replace("/ AND\s+wp_posts\.post_date.*?wp_posts\.post_date.+[^'].*?'/s", '', $where);         return $where;       }       add_filter( 'posts_where', 'filter_where' );     }      and calling `so__weird()` at the needed place.


title: Why is it defaulting to "uncategorized" even after I select a custom taxonomy

text: I have created a custom taxonomy and configured it to work like a category. The taxonomy shows up fine on the admin, but when I create a post, it is then placed in the default `uncategorized` category. I'm not sure why this is happening. Am I doing something wrong? Any suggestion? My function is:               function register_taxonomy_test() {          $labels = array(          'name' => _x( 'test', 'test' ),         'singular_name' => _x( 'test', 'test' ),         'search_items' => _x( 'Search test', 'test' ),         'popular_items' => _x( 'Popular test', 'test' ),         'all_items' => _x( 'All test', 'test' ),         'parent_item' => _x( 'Parent test', 'test' ),         'parent_item_colon' => _x( 'Parent test:', 'test' ),         'edit_item' => _x( 'Edit test', 'test' ),         'update_item' => _x( 'Update test', 'test' ),         'add_new_item' => _x( 'Add New test', 'test' ),         'new_item_name' => _x( 'New test', 'test' ),         'separate_items_with_commas' => _x( 'Separate test with commas', 'test' ),         'add_or_remove_items' => _x( 'Add or remove test', 'test' ),         'choose_from_most_used' => _x( 'Choose from the most used test', 'test' ),         'menu_name' => _x( 'test', 'test' ),     );          $args = array(          'labels' => $labels,         'public' => true,         'show_in_nav_menus' => true,         'show_ui' => true,         'show_tagcloud' => false,         'show_admin_column' => true,         'hierarchical' => true,              'rewrite' => array(              'slug' => 'little',              'with_front' => true,             'hierarchical' => true         ),         'query_var' => true     );          register_taxonomy( 'test', array('post'), $args );     };      EDIT: @Charles - yes I have added the code below sorry/. forgot to mention it here.               add_action( 'init', 'register_taxonomy_test' );      @OTTO - it shows up in the uncategorized "category" even after I make sure I have checked on a custom taxomony I created EDIT #2 Ok so I decided to go with regular categories and not custom taxonomies. For any one interested why a new post with custom taxomony defaults to un- categorized, is because it is linked to the post type which is "post". So you must also enable a custom post type "register_post_type()" that is linked to your custom taxonomies that will act as categories.


title: Using post_class to style posts indivdually

text: I have a homepage on which I want to display the latest post different from the other posts. I haven't used `post_class` and I am not sure how to. Would I be able to achieve what I want using `post_class`?


title: custom login page redirect to logged in user profile page

text: If I click on **sign in** then it should go to the login page. The issue is that when I put the link then it goes to `redirect_to` home page, but I want to go on user profile page instead. I don't want to use a plugin to redirect to profile page after login. I have code for user profile - `<a href="<?php echo bp_loggedin_user_domain(); ?>/profile/edit/"><span>My Profile</span></a>` And i want to put this link into `<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />` Is this possible? Are there other suggestions?


title: Why is my custom widget breaking another one?

text:
The first plugin is somehow breaking the second one (the content of the second one doesn't show up at all): **plugins/featured-images.php:**               <?php     /* Plugin Name: Featured Jobs     Plugin URI: [Enter your website URL]     Description: [Enter brief description of plugin]     Version: [Enter version number of plugin (probably 1.0)]     Author: [Enter your name]     Author URI: [Enter your website URL]     */     class Featured_Jobs extends WP_Widget {              /**          * Register widget with WordPress.          */         public function __construct() {             parent::__construct(                 'featured_jobs', // Base ID                 'Featured Jobs', // Name                 array( 'description' => __( 'A Foo Widget', 'text_domain' ), ) // Args             );         }              /**          * Front-end display of widget.          *          * @see WP_Widget::widget()          *          * @param array $args     Widget arguments.          * @param array $instance Saved values from database.          */         public function widget( $args, $instance ) {             extract( $args );             $title = apply_filters( 'widget_title', $instance['title'] );                  echo $before_widget;             if ( ! empty( $title ) )                 echo $before_title . $title . $after_title;         ?>
           <?php // Create and run custom loop             $custom_posts = new WP_Query();             $custom_posts->query('post_type=jobs&posts_per_page=8');             while ($custom_posts->have_posts()) : $custom_posts->the_post();           ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
           <?php endwhile; ?>
See All Positions >>

              <?php                  echo $after_widget;         }              /**          * Sanitize widget form values as they are saved.          *          * @see WP_Widget::update()          *          * @param array $new_instance Values just sent to be saved.          * @param array $old_instance Previously saved values from database.          *          * @return array Updated safe values to be saved.          */         public function update( $new_instance, $old_instance ) {             $instance = array();             $instance['title'] = strip_tags( $new_instance['title'] );                  return $instance;         }              /**          * Back-end widget form.          *          * @see WP_Widget::form()          *          * @param array $instance Previously saved values from database.          */         public function form( $instance ) {             if ( isset( $instance[ 'title' ] ) ) {                 $title = $instance[ 'title' ];             }             else {                 $title = __( 'New title', 'text_domain' );             }             ?>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?>              <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
             <?php          }          } // class Foo_Widget          // register Foo_Widget widget     add_action( 'widgets_init', create_function( '', 'register_widget( "featured_jobs" );' ) );      **plugins/theme/theme.php:**               add_action( 'widgets_init', create_function( '', 'register_widget(   "px_reviews_widget" );' ) );               class Px_Reviews_Widget extends WP_Widget {              /**          * Register widget with WordPress.          */         public function __construct() {             parent::__construct(                 'px_reviews_widget', // Base ID                 'Game - Reviews', // Name                 array( 'description' => __( 'Game - Reviews', 'text_domain' ), ) // Args             );         }              /**          * Front-end display of widget.          *          * @see WP_Widget::widget()          *          * @param array $args     Widget arguments.          * @param array $instance Saved values from database.          */         public function widget( $args, $instance ) {                  if ( !is_singular('games')) {                  return;             }                  extract( $args );             $title = 'Reviews';//apply_filters( 'widget_title', $instance['title'] );                  echo $before_widget;             if ( ! empty( $title ) )                 echo $before_title . $title . $after_title;             //echo __( 'Hello, World!', 'text_domain' );                   $templates = array();                  $templates[] = "game-reviews.php";                   // Backward compat code will be removed in a future release         locate_template($templates, true);                        echo $after_widget;         }              /**          * Sanitize widget form values as they are saved.          *          * @see WP_Widget::update()          *          * @param array $new_instance Values just sent to be saved.          * @param array $old_instance Previously saved values from database.          *          * @return array Updated safe values to be saved.          */         public function update( $new_instance, $old_instance ) {             $instance = array();             $instance['title'] = strip_tags( $new_instance['title'] );                  return $instance;         }              /**          * Back-end widget form.          *          * @see WP_Widget::form()          *          * @param array $instance Previously saved values from database.          */         public function form( $instance ) {             /*             if ( isset( $instance[ 'title' ] ) ) {                 $title = $instance[ 'title' ];             }             else {                 $title = __( 'New title', 'text_domain' );             }             */             ?>             This widget only show on Game single page             <?php              /*             ?>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?>              <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
             <?php              */         }          }      What could be the cause?


title: get_the_post_thumbnail wordpress 3.5

text:
For some reason the following isn't loaded anymore in wordpress 3.5. Does anyone know how to fix the `get_the_post_thumbnail()` ? I'm using the follow code:               echo "
";     echo "";     echo "
".get_the_post_thumbnail($post->post_id, 'thumbnail', $attr)."
";     echo "
".$post->post_title."
";     echo "";     echo "
";


title: Post Bulk Update

text: Is there any way to update all the posts at a time through query or through admin panel. For an example i am having an 1000 posts, how to update all the posts at a time. Thanks.


title: Removing translation textdomain

text: I am working on a plugin for myself, so, it's totally useless to load textdomain. But most of codes I copied from others are using the `__(' ','')` I copied the codes from several plugins. So, even if I load textdomain, it's going to be useless as well,posibly slow down the performence. My question is-- What's going to happen when WP read those `__(' ','')` without a textdomain loaded ? Will it become a problem?


title: Woocommerce "out of stock" message

text: By default the "out of stock" message is being output as a `<p>` tag after the product description. How can I change the location where this message is being rendered?


title: Cafe Food Menu upload

text: A funky cafe changes their menu every month, and they're not comfortable with using the default Wordpress editor to make a Wordpress page look the same as their Word doc. Example word doc here. Can you think of a way to get this menu to display nicely as HTML inside their website?