title: Why is the Settings API is not saving my array of options

text:
I am writing a set of classes to easily create options pages accessible via submenus of the standard WordPress menus and a way to easily create options for said menus. The way I am wiring it is via a settings class which you pass settings to and I intend to have it work along with a submenu class to create the menu, settings page and store the options neatly in a single option. The option is getting created in the database -- but nothing is being stored in the option. Can anyone lead me in the right direction? Here is my code: ## Settings Class               class settings_page {         public function __construct($args){             foreach($args['sections'] as $section){                 $section_name = $section['section_name'];                 $section_id = $section['section_id'];                 if( false == get_option( $section_id ) ) {                          add_option( $section_id );                   }                  $options = get_option($section_id);                 $section_text = $section['section_text'];                 $page = $section['page'];                 add_settings_section($section_id, $section_name, function(){return $section_text;}, $page);                 foreach($section['items'] as $item) {                     $type = $item['type'];                     $id = $item['id'];                     $description = $item['description'];                     $title = $item['title'];                     $choices = $item['choices'];                     if ($description) $title = $title . '
' . $description . '';                     switch($type){                         case "checkbox":                             add_settings_field($id, $title,                                      function ($section) use ($options) {                                         $id = $section[0];                                         $html = '<input type="checkbox" id="' . $id . '" name="' . $id . '" value="1" ' . checked(1, $options[$id], false) . '/>';                                           echo $html;                                       },                             $page, $section_id, array($id));                         break;                         case "text":                             add_settings_field($id, $title,                                      function ($section) use ($options) {                                         $id = $section[0];                                         unset($html);                                         $html .= '<input type="text" id="' . $id . '" name="' . $id . '" value="' . $options[$id] . '" />';                                           echo $html;                                       },                             $page, $section_id, array($id));                         break;                         case "textarea":                             add_settings_field($id, $title,                                      function ($section) use ($options) {                                         $id = $section[0];                                         unset($html);                                         $html .= '<textarea class="large-text" cols="50" rows="10" type="text" id="' . $id . '" name="' . $id . '">' . $options[$id] . '</textarea>';                                           echo $html;                                       },                             $page, $section_id, array($id));                         break;                         case "pulldown":                             add_settings_field($id, $title,                                      function ($section) use ($options) {                                         $id = $section[0];                                         $choices = $section[1];                                         $value = $options[$id];                                         unset($html);                                         $html = '<select id="' . $id . '" name="' . $id . '">';                                         $html .= '<option value=""> - Select - </option>';                                         foreach($choices as $key=>$val){                                             $selected = '';                                             if ($value== $key) $selected = ' selected="selected" ';                                             $html .= '<option value="' . $key . '"' . $selected . '>'.$val.'</option>';                                         }                                         $html .= '</select>';                                              echo $html;                                       },                             $page, $section_id, array($id, $choices));                         break;                                       }                      }                 register_setting($page, $section_id);             }                  new submenu(array(                 "parent" => $args['parent'],                 "title"=>$args['title'],                 "text"=>$args['text'],                 "capability"=>$args['capability'],                 "slug"=>$args['slug']                  ));              }     }      ## Submenu Class               <?php          class submenu {              function __construct($args=""){                 $parent = strtolower($args['parent']);                 $title = $args['title'];                 $text = $args['text'];                 $capability = $args['capability'];                 $slug = $args['slug'];                      switch($parent){                     case 'dashboard':                          $name = "index.php";                         break;                     case 'posts':                         $name = 'edit.php';                         break;                     case 'media':                         $name='upload.php';                         break;                     case 'links':                         $name='link-manager.php';                         break;                     case 'pages':                         $name='edit.php?post_type=page';                         break;                     case 'comments':                         $name='edit-comments.php';                         break;                     case 'appearance':                         $name='themes.php';                         break;                     case 'plugins':                         $name='plugins.php';                         break;                       case 'users':                         $name='users.php';                         break;                       case 'tools':                         $name='tools.php';                         break;                       case 'settings':                         $name='options-general.php';                         break;                       default:                         $name='options-general.php';                         break;                   }                 add_action('admin_menu', function() use ($name, $title, $text, $capability, $slug) {                              add_submenu_page(                               $name,                                               $title,                                       $text,                                               $capability,                                         $slug, function() use  ($name, $title, $text, $capability, $slug) {                            ?>

<?php echo $title; ?>
                                       <form method="post" action="options.php">                                           <?php settings_fields( $slug ); ?>                                           <?php do_settings_sections( $slug );?>                                             <?php submit_button(); ?>                                       </form>
                                 <?php                             }                              );                     }                 );                            }         }      ## Here is where I am actually calling the classes/methods               add_action('admin_menu',          function() {             $options['parent'] = "settings";             $options['title'] = "My Settings";             $options['text'] = "My Settings";             $options['capability'] = "manage_options";             $options['slug'] = "my_settings";                  $settings['section_name'] = "General Section";             $settings['section_id'] = "general_section";             $settings['section_text'] = "This be General Section Test";             $settings['page'] = "my_settings";             $settings['items'] = array(                 array(                     'type' => 'checkbox',                     'id' => 'show_header',                     'title' => 'The title, to show header',                     'description' => 'show the header now please',                     ),                 array(                     'type' => 'textarea',                     'id' => 'show_footer',                     'title' => 'The title, to show footer',                     'description' => 'show the footer now please',                     ),                   array(                     'type' => 'text',                     'id' => 'text_item',                     'title' => 'Enter anything here',                     'description' => '',                     ),                           array(                     'type' => 'pulldown',                     'id' => 'which_one',                     'title'=>'Who\'s on First?',                     'description'=>'',                     'choices'=>array(                             '1'=>'Who',                             '2'=>'What',                             '3'=>'Why',                         )                     ),                 );             $settings2['section_name'] = "Second Section";             $settings2['section_id'] = "second_section";             $settings2['section_text'] = "More Settings";             $settings2['page'] = "my_settings";             $settings2['items'] = array(                 array(                     'type' => 'checkbox',                     'id' => 'show_header_2',                     'description' => 'Show Second Header',                     'title' => 'Show the Second Header?',                     ),                 array(                     'type' => 'textarea',                     'id' => 'show_footer_2',                     'description' => 'Tell me a story',                     'title' => 'It can be about anything!',                     ),                   );                  $options['sections'][] = $settings;             $options['sections'][] = $settings2;             new settings_page($options);         }, 1);      What works: It works if I change **$options[$id]** to **get_option($id)** but this saves each individual setting to its own individual setting in the database which is wildly inefficient. I've error_logged $page, $section_id right before the register_setting call and everything is as it should be which leaves me baffled. What doesn't work: saving these settings to a serialized array :) I'm happy to provide anything else that can help you help me. Thanks.


title: Echo Parent of Current Pages

text:
I'm using the above code to display sub-pages of the parent (even when the user is on that page). However, this code does not display the parent itself. I tried adding `$subpages = wp_list_pages('title_li=&include='.$id.'&depth=1&echo=0');` but to no avail.               <?php if ( // Maybe you want different conditionals?             (is_page() && ! is_front_page())             || is_category()         ) {             $id = get_the_ID();             $ancestors = get_ancestors($id, 'page');             if (! empty($ancestors)) $id = $ancestors[count($ancestors)-1];             $subpages = wp_list_pages('title_li=&child_of='.$id.'&depth=1&echo=0');             if ('' !== $subpages) {                 echo '
'.PHP_EOL                     .$subpages                     .'
'.PHP_EOL;             } } ?>          <?php $categories = get_the_category();     $catli = '';     if (!empty($categories)) { foreach($categories as $category){         $parent = $category->parent;         if($category->parent != 0){           $catli .= wp_list_categories("child_of=$parent&title_li&echo=0");         }       }       if (!empty($catli)) {         echo '
'.$catli.'
';       } } ?>


title: How to dynamically change spots of text in custom page?

text: When I create a page I'm suppose to describe the content on the editor of Wordpress. When it's a simple text with some images its ok. **But the problem is:** My custom layout has a lot of _deep HTML_ and I want to allow the client to change the dynamic text parts easily, and avoid him from having HTML parts inside the rich text editor. E.g. ![enter image description here](http://i.stack.imgur.com/yu2KK.png) Wordpress has some built-in feature to accomplish that or some plugin maybe? An similar idea is this plugin that I've found, but not for pages specifically: http://wordpress.org/extend/plugins/text-replace


title: Insert menus in the database

text: I want to create a large menu structure, and the admin pages time out, so I cannot insert them via the admin screens. How can I insert the menu entries directly in the database? Thank you


title: Send email for confirmation during user registration

text: I am very new to WP.How does a confirmation mail is sent during user registration.Is there any services being worked out here. is this a free service using php for any plugin.


title: Post type archive page not working

text: I registered a custom post type using Custom Post Type UI, and created an archive page and named it archive-recipe.php, 'recipe' is my custom post type name. But its not working, instead its using the default `archive.php`. I set the `has-archive` to `true` but still not working. How to fix that? Here's the code:               register_post_type(         'recipe', array(     'label' => 'Recipe',         'description' => 'This is a Recipe Custom Post Type',         'public' => true,         'show_ui' => true,         'show_in_menu' => true,         'capability_type' => 'post',         'hierarchical' => true,         'rewrite' => array('slug' => ''),         'query_var' => true,         'has_archive' => true,         'exclude_from_search' => false,         'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes',),         'labels' => array (               'name' => 'Recipe',               'singular_name' => 'Recipe',               'menu_name' => 'Recipe',               'add_new' => 'Add Recipe',               'add_new_item' => 'Add New Recipe',               'edit' => 'Edit',               'edit_item' => 'Edit Recipe',               'new_item' => 'New Recipe',               'view' => 'View Recipe',               'view_item' => 'View Recipe',               'search_items' => 'Search Recipe',               'not_found' => 'No Recipe Found',               'not_found_in_trash' => 'No Recipe Found in Trash',               'parent' => 'Parent Recipe',         ),         )     );


title: Update functions.php from Wordpress dashboard

text: I'm sure this isn't possible but I thought I would ask. In my functions.php file I have a wp_mail function that sends an email to moderators when posts are made. This email is sent to number of different address - these addresses might change. I thought it would easier to set these email addresses in the WP Dashboard something like on custom page and then have functions.php update with the new emails. Is this possible?


title: Need help with restricted page for users

text: I have 3 pages and i want one of the three to be restricted for normal users. I want there to be members, who only can view the page after they have been approved by the admin. To view the page i want them to 1. Register 2. get approved by the admin 3. able to view the page. Is there a plugin for this? or any solution of any kind? Thanks in advance.


title: Things to take care when moving from hosted wordpress to self-hosting

text: I have a hosted free wordpress blog. Now I am thinking to move that blog to self-hosting. What I already have /know/tried: 1: I have a domain name purchased from a companyA. 2: I have hosting accounts Linux as well as ASP.NET with the same companyA. 3: From the cPanel of companyA I can go and install wordpress. I tried that for test and it was pretty fast process. 4: I read that I can simply go to my current blog and Export everything and Import it to my self-hosted website. I have currently 30 posts. The Wordpress Stats shows from 200 to 500 views/day. I don't even know if that's a bad or good number. My questions/concerns: 1: Should I host on my Linux hosting account or Windows Hosting Account? Is there any pro/cons one over other? 2: Should I be concerned about page rankings /SE etc. when transferring the blog. (newbie to this and I want to learn that, one of the reason I am moving to self-hosting...learn) 3: I read this article and so I understand step 1-2. What I don't understand is, with Domain Mapping service, how long do I need to pay for it? Like a year or foreever? EDIT: I think now they have a Site Redirect upgrad option. So is that what I should be doing now? Any other suggestions welcome.


title: Basic File/Post restriction plugin

text: I am looking for a plugin that allows me to restrict access for a individual post/page to a specific role or individual. It also needs to restrict files attached to that post. I have tried several but none seem to have this complete combination or just dont work. What is the best plugin to achieve this or will I have to roll my own? I have tried:   * Role Scoper    * Members    * User Access Manager


title: Problems with the_time,the_date, get_the_time

text:
I have som problems with the date functions in wordpress. I am trying to get different format on the post date on some pages and i have been trying "the_date()","the_time()" and "echo get_the_date()". They all behave in the same way. They output the correct date format when i just type for example the_time(). The output is the format i had setup in wordpress settings, as expected. The problems is that when i try to format the output by ex: the_time('d') the output is "d" or echo get_the_time('F j, Y'); the output is "'F j, Y'". I forgot to mention that the code is inside "the loop" This is my page.php               <?php get_header();?>     <?php get_sidebar('subnav');?>
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_title();?>
     <?php the_content();?>     Publicerades den <?php echo get_the_date('d');?>          <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
     <?php endif; ?>
     <?php get_footer();?>          I cannot understand what the problem is, please help!:)


title: Exclude a category of posts in author template

text:
I'm using the following author archive code:               <?php     /**     * The template for displaying Author Archive pages.     *     * @package Cryout Creations     * @subpackage Parabola     * @since Parabola 1.0     */          get_header(); ?>              <section id="container" class="<?php echo parabola_get_layout_class(); ?>">
             <?php cryout_before_content_hook(); ?>                  <?php if ( have_posts() ) : ?>                      <?php                     /* Queue the first post, that way we know                      * what author we're dealing with (if that is the case).                      *                      * We reset this later so we can run the loop                      * properly with a call to rewind_posts().                      */                     the_post();                 ?>
<?php printf( __( 'Author Archives: %s', 'parabola' ), '' . get_the_author() . '' ); ?>
                                       <?php                     /* Since we called the_post() above, we need to                      * rewind the loop back to the beginning that way                      * we can run the loop properly, in full.                      */                     rewind_posts();                      // If a user has filled out their description, show a bio on their entries.                 if ( get_the_author_meta( 'description' ) ) : ?>

                         <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'parabola_author_bio_avatar_size', 60 ) ); ?>

<?php printf( __( 'About %s', 'parabola' ), get_the_author() ); ?>
                         <?php the_author_meta( 'description' ); ?>

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

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

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'parabola' ); ?>
                         <?php get_search_form(); ?>

                  <?php endif; ?>                  <?php cryout_after_content_hook(); ?>
         <?php parabola_get_sidebar(); ?>
               <?php get_footer(); ?>      I need to exclude a category from the author page. However I can't get this to work. If added               query_posts (query_posts( 'cat=-x' ); where x is category to skip),       instead of looping through posts I always see one single/same post which is not of selected category. Any suggestions, why this might not work?


title: Wp_list_pages not showing children with custom page template

text: I seem to be having problems when using custom page templates using `wp_list_pages`.   These pages are always displayed at the bottom of the website in a menu. The problem is, that they should have a collapsible menu with the children in them, but the children are not showing. These children do not have the same template type as the parents, which is the cause of my problem, I guess. Below you can find how I call `wp_list_pages`. It does fetch and display the parents correctly, but not the children.               $brands = wp_list_pages(array('title_li' => '',         'post_type' => 'page',         'meta_value' => 'brands.php',         'lang' => $GLOBALS["pll_language"],         'showposts' => 20));      Any thoughts on how I can resolve this? **EDIT** This is an example of the structure of the pages.   * Nike      * Shoes        * Shoe 1       * Shoe 2       * Shoe 3     * Shirts     * Sunglasses   * Brand 2   * Brand 3   * etc... until brand 9 But shoe 1 could be removed at any time and shoe 4 can be added at any time. Since I don't want to update the menu all the time, I only want to have to add "Nike", "Brand 2" to the menu and all the other pages would have to load automatically. Any ideas?


title: 404 not found error on pagination

text:
Normal post (not custom post type), I did everything I should do, but 404 not found error in pagination. Here is my code               $category_id = get_query_var('cat'); //Using this to get category ID to meet some special requirements             $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                  $args = array(                 'posts_per_page' => 4,                 'numberposts'    => 50,                 'paged' => $paged,                 'cat' => $category_id             );                  query_posts($args);             if ( have_posts() ) : while ( have_posts() ) : the_post();              $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );             ?>

<img src="<?php echo get_stylesheet_directory_uri(); ?>/timthumb.php?src=<?php echo $image[0]; ?>&w=224&h=224&zc=1" />

<?php  $category = get_the_category(); echo $category[0]->cat_name; ?> : <?php the_title(); ?>

<?php the_date(); ?>

<?php the_excerpt(); ?>

<a href="<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/readmore.png" />

             <?php endwhile;              wp_reset_postdata();             else: ?>
<?php _e('No posts found'); ?>
              <?php endif; ?>

<?php next_posts_link('next »') ?>

<?php previous_posts_link('« previous') ?>

      I need your suggestion.


title: Use stylesheet from a different location

text: I haven't done wordpress development in quite some time so it looks like some things have changed (naturally). I'm using codekit to compile my themes sass files and minify my scripts as well. It requires that all files have a specific output path, in other words I can't specify that the style.scss file should compile to a style.css file in the root directory. It has to go into a folder of some sort relative to the root folder, like a /css folder. So in googling around trying to see if there was a way to tell wordpress to look into the /css folder and look for a file called site.css I found this code I can add to my functions.php file...               add_filter('stylesheet_uri','wpi_stylesheet_uri',10,2);          /**      * wpi_stylesheet_uri      * overwrite default theme stylesheet uri      * filter stylesheet_uri      * @see get_stylesheet_uri()      */     function wpi_stylesheet_uri($stylesheet_uri, $stylesheet_dir_uri){              return $stylesheet_dir_uri.'/css/site.css';     }      Now if I'm not mistaken it looks like I have to call that function? But when I try to call it, say in my header.php I get an error. To summarize I am looking for the preferred way to change where wordpress looks for my themes stylesheet.


title: How to make a drop down menu with categories

text: I'm building a website in which there is a navigation menu with various links; in this menu there is the link to the blog section. My goal is to create a drop down menu that appears when the cursor is passed over the blog link; this link has to show the list of the categories. A few days ago I found this useful tutorial: But it creates another link called "Categories" in which appears the categories drop down menu; therefore how can I adapt that code in my case?


title: Using Advanced Custom Fields with Wordpress and Lightbox

text:
I am using the ACF Plugin. I want to have a field where I can upload an image, and the result will display the full image in the Lightbox and then then full image will be resized into a thumbnail from that field (like a normal Lightbox). So far I have the script here, and this is where I am at:
     <a href="<?php echo the_field('image_gallery'); ?>" rel="lightbox" title="<?php the_title(); ?>">          <?php     $main_car_pic = addslashes(the_repeater_field('image_gallery'));     $reg_ext = "#.jpg#i";     $thumb_ext = "-150x150.jpg";     $car_thumb = preg_replace($reg_ext, $thumb_ext, $main_car_pic);          echo $car_thumb     ?>      The ACF Repeater field isn't working properly and I cannot work why, does anybody have any experience with ACF and resizing images for thumbnails.. Hope what code I have done helps and I'll be really appreciate it, if nto comment and I can supply anything that might help.


title: Is there a way to include some external script to some or all pages in a wordpress site?

text: My current requirement is to stick a countdown timer on the top of every page or on the side of all pages. But since i get too many requests like this, i was looking for a technique with which i can include some external javascript or jquery plugin or maybe some HTML code forced upon a particular location on some/all pages. Has anybody ever done this?? For my requirements, i have found some plugins for countdown timers but they would only create a sidebar or a post. What i had in mind that i would create a div with an iframe inside pointing to countdown page and will stick this div on the top of the page through CSS. But i wanna know if there is any standard way of doing such things.


title: Shortcode for Admin Theme Option?

text: I am trying to create a shortcode for 2 of my theme option. Basically I want to grabe my theme options to my shortcode so that I can display them anywhere on my posts something like this:               [ads_1] [ads_2]      However when I tried to get the options on my shortcode it wont work at all and its giving me an error > Parse error: syntax error, unexpected 'theme_settings' (T_STRING) in > C:\xampp\htdocs\themewp\wp-content\themes\bots_final\shortcodes.php on line > 86 Here's my snippet for my shortcode where in I am trying to grab my theme option data:               add_shortcode('ads_1', function($atts){         return '         <div>             <?php $options = get_option( 'theme_settings' ); ?>             <?php echo $options['banner1']; ?>         </div>';          });      I am trying to grab the options from my Theme options page. Check my theme options code:               <div>     <?php $options = get_option( 'theme_settings' ); ?>     <?php echo $options['banner1']; ?>     </div>      Any idea what's the problem why I can't grab it?


title: Editor stripping out data attribute when saving

text: I am on the Text version of the page editor on the backend and whenever I try to use something like `<div data-100="1500"></div>` and click the update button the data section is stripped out an it returns `<div></div>`. I searched around for a bit and all I could find was reference to the Raw HTML plugin but honestly I dont want to be committed to a plugin. Is there anyway to remove this functionality to allow me to use some data attributes? Thanks in advance


title: mysql query paging

text: Hi I have made an sql query that gets several posts according the parameters that i've selected. I'm showing these posts but the inner paging within wordpress doesnt do anything. It shows me that there are more pages but when i select the page number it shows me the same results as before. That makes sense because it probably runs the sql query again. I'm using WordPress and BuddyPress. How can i page between these query results? UPDATE: here is the code im using               $sql = "SELECT post_title, post_date, post_excerpt, guid, ID FROM wp_posts,wp_term_taxonomy, wp_terms, wp_term_relationships WHERE (post_status = 'publish' or post_status = 'inherit') and wp_term_taxonomy.term_taxonomy_id = ".$cat." and wp_posts.ID = wp_term_relationships.object_id and wp_terms.term_id = wp_term_taxonomy.term_taxonomy_id and wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id and wp_term_taxonomy.taxonomy = 'category' ORDER by post_date DESC";     $matching_posts = $wpdb->get_results($sql,OBJECT);     <?php if ( have_posts() ) : ?>            <?php foreach ($matching_posts as $post): ?>       <?php setup_postdata($post);      then im showing the info i want like title.


title: How to pass data from page to widget functions?

text: I need help,need to pass data from page,to widget function,I need to pass author id to widget,any idea? Tnx


title: How can I set a draft page as parent without publishing?

text: Anyone know a way round this? http://wordpress.org/support/topic/set-draft-page-as-parent I can't risk publishing as a public-facing system updates periodically from the same install.


title: My wordpress multisite homepage redirects to signup page

text: So I just setup my website `fightify.com` and as you will see, visitors are automatically redirected to a signup page, which shouldnt be happening. This only occurs if the domain is typed without the www. prefix. `www.fightify.com` yields no errors. I have a feeling that it has something to do with the .htaccess file, but I'm no coder, and have no idea how to fix it. Has anybody seen this happen before?


title: How to support custom templates on a custom post type?

text: I'm stucked at some point developing my theme. I created a custom posts types to support an image gallery. So far, it's working great (have a look on 'galeria' on psaikali.com). I registered this custom post type (register_post_type( 'artwork', $args )) and activated the 'page attributes' function, to define a different template for my posts ('supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'custom-fields' )). But it just shows the 'order' of the page, not the 'template selection' part. Does anyone knows what's wrong ? I did create the template file called single- artwork.php ... Screenshot of the page attributes page I see : http://img213.imageshack.us/img213/5348/notemplate.jpg Thanks for the help !


title: Wordpress Query Posts From Category Post on Static Page

text:
So I'm trying to query some posts from 1 category only and it does seem to be working. I tried get_post() also but no luck and after awhile I just caved and used query_posts (which is apparently bad practice). Here's my code:

                     <?php query_posts('slug=cat1'); ?>                     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                                 <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">                                     <?php the_title(); ?>
                              <?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>

                                 <?php the_content(); ?>

                     <?php endwhile; else: ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
                     <?php endif; ?>

      The second `endif;` is from above I have a test against the page slug. But from my understanding the query_posts should populate $post with all the posts from that category but I'm still getting posts from uncatagorized and another category so it's not filtering at all... Suggestions? **Edit1** I tried using `cat=0` and `cat=1` also `cat=2` but the only one that actually filters is the `cat=1` which filters to uncategorized. All the others show all posts. Not sure why... **Edit2** `query_posts( array ( 'category_name' => 'Category1', 'posts_per_page' => -1 ) );` returned with the "else" statement saying there was no posts and nothing fit my criteria. I pulled that straight from the codex?


title: Conditional custom menu?

text:
I'm trying to create a custom menu that displays a `<li></li>` when a user is logged in, and not display it when they're not. I have this so far, but it's not working. Does anyone know how to do this properly?               add_filter('wp_nav_menu_items','custom_nav_items',1,2);     function custom_nav_items($menu, $args) {     global $bp;     $args = (array)$args;     if ( $args['theme_location'] != 'primary' )         return $menu;     $customNav = '
loggedin_user->domain .'">'. $bp->loggedin_user->fullname .'

loggedin_user->domain .'">View Profile

loggedin_user->domain .'profile/edit/">Edit Profile

loggedin_user->domain .'settings/">Edit Settings
'     if ( is_user_logged_in() ) {         '
Logout
' }     '

';     return $menu.$customNav;     }


title: update_user_meta: How many is too many?

text: I am working on a community portal that may in future cater to extremely large user base. All users have about 50 settings that needs to be stored to the user meta. These settings would be frequently accessed and overwritten with new values when the user saves changes to their profile. This would lead to extremely large number of calls to update_user_meta courtesy: large user base and large number of settings per user. Would these high number of calls to update_user_meta cause any performance degradation? An alternative that I see, would be to write the user settings to an array and subsequently store the array to user meta using a single call to update_user_meta. Which of the two appears to be a better solution? Regards John


title: Link from tags to tag pages displaying all posts with that tag

text: `<a href="<?php echo get_tag_link($tag->id); ?>"><?php echo $tag->name; ?></a>` I was using this to try to list the first tag for a post, and make it so that when you click on that tag you go to a page which lists all of the posts with that tag. Instead, when you click the link it just refreshes the page. I tried going directly to one of our tag pages and it exists but it's totally empty. How do I get each tag to link to it's tag page and how do I populate tag pages with posts?


title: Only allow one login session to be active at a time

text: Is there any way to restrict accounts to login only once at the same time? Ex. Mike bought a subscription from my website and also lent it to his friend John. What I want to achieve is preventing Mike login if John is already logged in and the opposite. Is this possible?


title: pageYOffset problems in WordPress? Works on code playground, not on dev site

text: I am hoping someone will have some insight into my jQuery conundrum. I'm trying to implement a fairly simple script to add/remove a class to my navbar. I've mocked up a codepen here: http://codepen.io/anon/pen/Inmpb On scrolldown, a class is added to the navbar, so that I can target it. It works as expected on codepen, but I cannnot get it to work on my dev site. For the codepen, I simply copied and pasted the entirety of my html and css and then added my script and, there, it worked as expected. I have tried wrapping the script in the document ready function for wordpress: jQuery(document).ready(function($) { // function here }); I have tried adding the script directly to the footer. I have tried to enqueue it via functions.php. It simply doesn't work on my site. I just changed to twenty-fourteen and deactivated all plugins. Still no luck. However, I did try an even more simple script: http://pastebin.com/XJh2Bbvm and that did work, the class was added. I have no idea what I could be missing.


title: Strip hashtag off permalink with php

text: I use the_permalink() to pass the current page to the facebook like button. But when one goes directly to a comment link with a hashtag, such as example.com/post#comment1, it's considered a separate link and FB likes are counted separately. How can I have the_permalink() point to just example.com/post and strip the #comment1?


title: How to get blog-id of an MU site from functions.php

text: How can one determine, from functions.php, the blog-id of the site (or alternately, the path to the media directory)?


title: How to test for MU via functions.php?

text: What is the call to determine, from a theme's functions.php whether the site is an MU site or not? Updated with answer:               $dir =       is_multisite() ? 'wp-content/blogs.dir/'.$current_site->blog_id.'/files/'       : 'wp-content/uploads/';


title: new page sidebar-template by default

text: Using twenty-eleven theme, need to change default template for new page from standard to sidebar. anyone?


title: Plugin to Link Posts by Title

text: I'm looking for a plugin that will allow me to link to posts by title. That is, when I click the link icon in the editor (or some other icon), instead of entering a URL, I get a drop-down of posts to link. I select one, press okay, and tada! Link is done. I also expect that the link looks at the ID; so if I change the target page's title, post-slug, or any other features that may be in the permalink, the link is "smart enough" to still link the correct page. Does anything like this exist out there? I couldn't find anything.


title: Is it possible to know which category page the post was linked from?

text: For example, I have a post that's filed under category 1 and category 2. When someone clicks on it from category 2, I want to know the slug for category 2. If it links from the category 1 page, I want to know the category 1 slug. Is this even possible?


title: Can't get pagination to work for sticky posts only

text: I don't get my pagination to work. I need to filter my posts on sticky posts and display only two per page. Tried almost everything but can't get it to work. It is totally ignoring my posts_per_page setting. Anyone got a suggestion?               <?php query_posts(array('posts_per_page' =>2, 'paged' => get_query_var('page'), 'post__in'=>get_option('sticky_posts'))); ?>              <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                          <?php the_content(''); ?>          <?php endwhile; ?>          <?php else : ?>          <?php endif; ?>              <?php next_posts_link('« Older Entries'); ?>         <?php previous_posts_link('Newer Entries »'); ?>


title: Automatically add paragraphs in long string

text: I have posts ported from VBulletin. I had to stripp all VBulletin tags so now I have long strings of text with no line breaks or any **br** or **p** tags. How can I add a **br br** instead of each 7-th dot for example? I would also prefer a conditional depending on the date created, because the new posts will be ok :)


title: Transfer Wordpress to new Host, Images missing

text: So I'm helping my wife move her site. I'm moving her from Bluehost to Digital Ocean, she's on WordPress currently and I exported the DB, grabbed all the files, and uploaded everything. Everything seems fine, but the images aren't showing up. The images are on the new server, the `wp-contents/uploads` directory has the right permissions, but when you go into the Media Library...you don't see any images. Now apparently the WordPress export only exports posts, not images. I'm moving a site, I'd like everything. So I manually added an image back into the `wp_posts` table and you can see it in the media library...but you can't preview the image. So, how does WordPress want you to move images from one install to another?


title: Remove child category from URL

text: I am moving a custom website with a WP blog to WP in one install The old URL was: domain.co.uk/blog/post-name The New URL is currently (while using a Category URL rewrite of /%category%/%postname%/ ) domain.co.uk/blog/category/post-name Is there a way to remove the child category from the URL so it will be the same as the the old URL (so I don't need to 301 redirect all the old url's) The client still wants the posts to be categorised hence the need for the custom permalink


title: How to correctly add Javascript in functions.php

text: I would like to remove some ugly looking arrows that are standard on cart buttons in WooCommerce. To achieve this, I found a tip of adding the following code, which should remove the arrows when the document has loaded. I assume I am going to put it in my functions.php? How exactly would I do that?               $(document).ready(function() {         $(".woocommerce-cart").html(function(i, val) {         return val.replace(" →", "");         });         $(".woocommerce-cart").html(function(i, val) {         return val.replace("← ", "");         });     });      **EDIT** Okay. I've tried this approach: Made a file named 'removeArrows.js' and placed it in my plugin folder. This has the same content as the original code, except jQuery instead $. Then I added the following to functions.php:               function wpb_adding_scripts() {           wp_register_script('my_amazing_script', plugins_url('removeArrows.js', FILE), array('jquery'),'1.1', true);          wp_enqueue_script('my_amazing_script');      }           add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );       I can't figure out how to make the code display properly. This did not work. Any suggestions to make this work? jQuery Snippet Source


title: Remove the height limit on wordpress 3.4.2

text: I have problems when insert images on my pages. I have a image of 1113 × 731 and I upload it to my wordpress, when I go to Add Object popup, the Full size of the image mode is of: 950 x 342. When I upload a larger sized image this always limit the height to 342, Why? I tried deleting the width/height html attribute from the image, but the URL image looks like this "http://mywordpress.net/wp- content/uploads/2014/06/image-950x342.jpg" This always modify the height to 342, but I cant find these option on any place. ![example image](http://i.stack.imgur.com/CpRVF.jpg) Thanks for the help. Title edited. Sorry Wordpress 3.4.2 This a example code when I insert a image in one of my pages:                     How you can see, the image used in the src is a little version that create wordpress, i want this use the real size url: http://todogangas.net/wp- content/uploads/2014/06/MOVIL.jpg


title: Why might conditionals not work on a page?

text: <?php          if (is_single()) {         echo '1';          } elseif ( is_page() ) {         echo '2';          } else {        echo '3';     }          ?>      I put this snippet at the top of index.php, which is what I'm using to govern the layout of my blog post feeds. I then created a new page, set template to default, and left it blank. It shows all of my posts. But the snippet above echoes a 3. It's using index.php as the template, but it's a page. Why isn't it echoing 2? **UPDATE** Since the blog feed page was set in Settings > Reading, I had to use the conditional `is_home();`. Apologies for all of the confusion.


title: Why does including a file in theme's functions.php not work?

text: For example, if I write some code (e.d. add a custom post type or something) in my theme's functions.php, it works fine. If I move it to a new file, then `include()` the file in my theme's functions.php file, it no longer works (but debug code using `error_log()` still works. e.g. Here's functions.php:               <?php     // ###### functions.php ######     error_log("fu_debug: Including the post type.");          add_action('init', 'fu_create_project_post_type');     function fu_create_project_post_type() {         error_log("fu_debug: create project post type");              register_post_type( 'fu_project',             array(                 'labels' => array(                     'name' => __( 'Projects' ),                     'singular_name' => __( 'Project' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'projects'),             )         );     }     ?>      That works fine. Now, if I change functions.php to this:               <?php     // ###### functions.php ######     include "newfile.php";     ?>      and put the code inside newfile.php like this:               <?php     // ###### newfile.php ######     error_log("fu_debug: Including the post type.");          add_action('init', 'fu_create_project_post_type');     function fu_create_project_post_type() {         error_log("fu_debug: create project post type");              register_post_type( 'fu_project',             array(                 'labels' => array(                     'name' => __( 'Projects' ),                     'singular_name' => __( 'Project' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'projects'),             )         );     }     ?>      the code no longer works, but the error_log() message still shows up in the logs. Why does the error message still work, but the wordpress code not?


title: Refine user taxonomy query based on role

text:
I have a bunch of custom user taxonomies which I use to group users by, and then show these users on the front end with the following code (from taxonomy-{term}.php) > >     <?php // Get each user from taxonomy >                 $term_id = get_queried_object_id(); // Get Term ID >                 $term = get_queried_object(); // Get term >                 $users = get_objects_in_term( $term_id, $term->taxonomy ); >                 if ( !empty( $users ) && (/* Condition based on role here > */) ) { >                 ?> >                     <?php foreach ( $users as $user_id ) { ?> >
 >                             <?php /* Image */ echo get_avatar( > get_the_author_meta( 'user_email', $user_id ), '204' ); ?> >
<?php /* Name */ the_author_meta( > 'first_name', $user_id ); ?> <?php the_author_meta( 'last_name', $user_id ); > ?>
 >
<?php /* Short Bio */ the_author_meta( > 'short_bio', $user_id ); ?>
 >
 >                     <?php } ?> >                 <?php } ?> >   The code is working just fine, but I would like to refine the results based on what role the users have. I have a role called "invisible" which lets the user access their profile but they won't be visible on the site until i change the role to one that is visible. Ideally I would like to use something like `if (!user_has_role('invisible'))` I've tried different solutions but I just can't seem to get it right.


title: Why is my pagination showing up?

text: I have the following code, Assume this code spits back one post. the page displaying that post will also display pagination. Why? It shouldn't. This code only queries for posts that belong to the post type of post.                   protected function _general_wordpress_loop(){             query_posts("post_type=post");             if($this->_wp_query->have_posts()){                 while($this->_wp_query->have_posts()){                     $this->_wp_query->the_post();                          if(isset($this->_options['post_before'])){                         echo $this->_options['post_before'];                     }                             $this->_components->thumbnail($this->_options);                          $this->_components->title($this->_options);                          the_excerpt();                          if(isset($this->_options['post_after'])){                         echo $this->_options['post_after'];                     }                 }                      if(isset($this->_options['navigation_wrap'])){                     $this->_components->loop_navigation($this->_options['navigation_wrap']);                 }else{                     $this->_components->loop_navigation();                 }                  }else{                 $this->_components->error_page($this->_options);             }         }      A quick run down, we query the post type of post, state if we have more posts, while we have more posts display the post, after the while, display the pagination (if there is a wrap (divs) wrap the nav, else display as normal). If there are no posts, display a custom error page. Pretty basic and simple stuff. How ever I am getting pagination for things like, the category test has one post and I can see pagination. is there a way to say "if you have more then one post display this?" I know `if(have_posts()){}` will do what ever assuming it has more then 0 posts which means pagination will be displayed by that logic.


title: Passing a varible from jQuery to PHP

text:
I have a a bunch of li's that are a blog but i want to show them enlarged in a colorbox. Therefore I need to know which li I clicked so I can get that ID and use that in my query to get all the date for that post. Now I thought that the best way is to retrieve the blog id with jQuery and then use that to add to my query in the footer.                   <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
              //My colorbox inline frame         <?php query_posts( 'p="the_ID_of_clicked_li' ); ?>          etc etc      I think this can be done with AJAX but is there a more simple method and give me a clean URL? I haven't AJAX in projects before, so I am a beginner with that. Any thoughts would be appreciated


title: Why tags are displayed bellow the content and not inside

text: I am developing a theme for myself and I was wondering why wordpress tags are allways displayed bellow the_content. I know that this can be done via shortcode, but I would like to know if this is for seo purposes, or there is any technical reason? I´am asking because I didn´t find any information on the web... My code: in functions.php (found in here)               function tags_in_post($atts) {    // [tags] outputs post's tags in a span     global $post;     $tags = '';     ob_start();     the_tags( '', ', ', '' );     $tags = ob_get_contents();     ob_end_clean();     return $tags;     }     add_shortcode ('tags', 'tags_in_post');      Than this shorttag [tags] must be used inside the wordpress editor. Thanks


title: meta_value_num sort glitch

text: i have a custom query, and I have a meta key that contains a sequence number: 1.1, 1.2, 2.1, 2.2... 11.1, etc the problem occurs when the numerical sequence gets in to double digits, ie. 5.11, 5.12, 5.21 these appear as such 5.1, 5.11, 5.12, 5.2, 5.21 etc instead of 5.1, 5.2, 5.3... 5.11, 5.12 etc how can I make them sort properly!?               $loop = new WP_Query(array(         'factsheet_category' => $term->slug,         'orderby' => 'meta_value_num',          'meta_key' => 'factsheet_id',          'order' => 'ASC'     ));


title: add_user_meta() vs update_user_meta()

text: I'm looking at the docs for `add_user_meta()` vs `update_user_meta()`. If the current meta_key does not exist for a user, will `update_user_meta()` automatically add the meta_key for that user or do you have to define the meta_key with `add_user_meta()` first?


title: setup_postdata doesn`t seem ot be working

text:
I'm having issues with `setup_postdata()`. From my understanding, if I want to use functions such as `the_permalink()` or `the_title()`, I must use `setup_postdata()`. Right now, `the_permalink()` or `the_title()` is returning nothing (blank). I've also tried `echo get_the_title()` to see what happens but even that yields the same result. Here is the code the relates to the problem:                 $posts = get_posts($args);       foreach($posts as $post) {         setup_postdata($post);       ?>
         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
           <?php if(has_post_thumbnail(get_the_ID())): ?>             <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), array(650,200)); ?>             <div style="background: url('<?php echo $image[0]; ?>') center center no-repeat;">
           <?php endif; ?>

             <?php $cat = get_the_category(get_the_ID()); ?>             <?php echo $cat[0]->cat_name; ?>             <?php the_title(); ?>             <?php the_excerpt(); ?>

       <? }       wp_reset_postdata();      So basically, this code is within a function that is a callback function for an AJAX request. The function grabs the next set of posts to simulate someone clicking the next page button. After `get_posts()` the `$posts` variable gets populated by the proper posts so it is getting something. Right now, it responds with just the tags with no data in them. Thanks.


title: Using "media_handle_sideload" to upload images programmatically does not upload image to Media Library

text:
I am using this code to try to upload images located in my server to Media Library of my wordpress installation.               <?php          include("../../../wp-blog-header.php");         include("../../../wp-admin/includes/file.php");         include("../../../wp-admin/includes/media.php");              $id = 0;         $image = $_SERVER['DOCUMENT_ROOT'] . "/image01.jpg";         $array = array( //array to mimic $_FILES                 'name' => basename($image), //isolates and outputs the file name from its absolute path                 'type' => 'image/jpeg', //yes, thats sloppy, see my text further down on this topic                 'tmp_name' => $image, //this field passes the actual path to the image                 'error' => 0, //normally, this is used to store an error, should the upload fail. but since this isnt actually an instance of $_FILES we can default it to zero here                 'size' => filesize($image) //returns image filesize in bytes             );              media_handle_sideload($array, $id); //the actual image processing, that is, move to upload directory, generate thumbnails and image sizes and writing into the database happens here     ?>      I can see that this code takes my image called "image01.jpg" located in that path and then it put the image to /wp-contents/uploads/. However when I go to the admin panel in wordpress to see the image in the Media Library I cannot see the image. Also there is not any row in the wp_posts of this image. **UPDATE:** I used this time this code:               $result = media_handle_sideload($array, $id);     echo "Finish media handle sideload
";          if ( ! is_wp_error( $result ) ) {         echo "Result
";         print_r($result);     } else {         echo "Error
";         print_r($results);     }     echo "Finish script
";      Nothing is shown is the execution. I can't see the msg "Finish media handle sideload". However the file is moved from path specified in "$image" to "wp- content/uploads". Note that the files is moved, not copied, so if I execute the script without copy again the image to the source (path of $image), I can see some warnings about filesize function likes this: > Warning: filesize(): stat failed for > C:/Users/dlopez/Documents/Development/web-folders/image01.jpg in > C:\Users\dlopez\Documents\Development\web-folders\wp_test\wp- > content\plugins\pods-csv-importer\upload.php on line 16


title: How can I implement Search feature for Membership site?

text: I have a membership site where I am using Wishlist membership plugin. There are few Courses for which the user signed up and after signing up, they can get access to different modules and their corresponding lessons. All these lessons have multiple videos, files and pdfs attached to them via custom meta boxes( values are getting stored as serialized array in wp_postmeta table ). Moreover, each user can add his/her notes for each specific lessons( values are getting stored in a custom notes table ). Now, I have to add Search feature on my site which should search for the following things:   1. Post Content   2. Post Comments   3. Custom Meta boxes which consists of different video links, excel file links and pdfs links.   4. Notes which user adds   5. Spoken words in Videos I have tried implementing Relevanssi Pro Search plugin for this since it searches values for custom meta fields as well. But, the result is not satisfactory at all. Can anyone please suggest some good search plugin for this or do I need to go for some custom search solution for this?


title: How to know if it's a child taxonomy?

text: I'm in need to know if the current taxonomy is child or parent. How can i achieve this? I need it for the condition in if statement. I need to know               if(this is child taxonomy){          }      Anybody knows how?


title: Media Library not showing images properly

text: I'm trying to upload an image, but keep getting an error. Check the attacted image. ![Screenshot](http://i.stack.imgur.com/5YdHF.jpg)


title: Displaying custom post types with taxonomy

text:
I want to build a page with the members of a team. Because I have too many members, I want to group them by department. Therefore, I created a custom post type **TEAM** with **taxonomy by department** I use the following code to display the team members. I created a new page template.                <?php      $team_posts = get_posts( array(         'post_type' => 'team',         'posts_per_page' => -1, // Unlimited posts         'orderby' => 'title', // Order alphabetically by name     ) );              foreach ( $team_posts as $post ):          setup_postdata($post);              $thumb_src = null;         if ( has_post_thumbnail($post->ID) ) {             $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'team-thumb' );             $thumb_src = $src[0];         }         ?>

                 <?php if ( $thumb_src ): ?>                 <img src="<?php echo $thumb_src; ?>" alt="<?php the_title(); ?>, <?php the_field('team_position'); ?>" class="img-circle">                 <?php endif; ?>

<?php the_title(); ?>

<?php the_field('team_position'); ?>
                 <?php the_field('team_phone'); ?>
                 <?php the_field('mobile_phone'); ?>
                      <a href="<?php the_field('team_email'); ?>"><?php the_field('team_email'); ?>
                 <?php the_content(); ?>

         <?php endforeach; ?>      This is all working well, but as you can see this code displays all the team members no matter in which department they are. Can somebody help me with this matter? I want to have the different departments with the team members on 1 page template. Which functions do I have to use.


title: Load page HTML content through AJAX

text: I'm currently building a single page style site that loads all content through AJAX, but will degrade back to a standard page load if javascript isn't present. I have done AJAX loading in the past through wordpress so know my way around it. However I haven't loaded in the contents of an entire page before. What I'm wanting to do is:   1. Hijack clicks to internal URLs and AJAX load the content of their urls into a main content div.    2. I'll wrap the header/footer/sidebars in my post/page template files in a function to check if the load request was made by ajax. If it was it will not echo those in the file.  To do this I need to know how to get the html content of a url in my functions.php. After hours of searching I can't find anything that will let me do it. All the things I've relate to echoing out small portions of the content and not then entire page HTML. It would be great if someone could point me in the right direction! Cheers


title: Is it wise to delete post revisions and autosaves from database?

text: I'm just wondering is it wise to delete all post revisions and autosaves from database every once in a while?   I mean they take a lot of database space and apparently have no use after the post has been published.


title: Page for custom taxonomy

text: I'm a newbie in WordPress and I've just created a new custom-taxonomy called categories under a custom post type called arts. Is there a way I can create a custom page to display the 'categories's custom type? Such that a user can navigate to arts/categories and see all the terms under the categories taxonomy.


title: How to allow only Admins or Logged In Users to post links in comments?

text: I know how to disable HTML in comments, but I'd like the ability to only have Admins be able to post links, or only Logged In users if need be, to have the ability to post links. Is this possible? I am currently using this plugin. I wrote the author of the plugin and he had this to say: "The problem with the function is that it applies to all comments by using a filter. I'm not sure if it's possible to add a condition to it. Instead, you'd have to create a new function: http://www.pastebin.com/q68qkKFX Then, when you echo out your comment, you'd have to do something like this:               echo remove_comment_links($commentID, $commentTEXT);       But with the right variables ($commentID and $commentTEXT doesn't exist). " I used:               <?php $comment_text = get_comment_text();           $comment_id = get_comment_id();           echo remove_comment_links($comment_id, $comment_text); ?>      But it strips out all HTML from all users, instead.


title: WP_Error message

text: `PHP Notice: Object of class WP_Error could not be converted to int in /var/www/vhosts/hayhauler.co/httpdocs/wp-includes/functions.php on line 2568, referer: http://hayhauler.co/` I'm not even sure where to start with this or the right question to ask. I know that it is preventing me from posting some information into a database using this:               $wpdb->query($wpdb->prepare(       "         INSERT INTO $wpdb->quotes         (user_ID,origin,destination,broker_ID,quote_ID,estimatedship)         VALUES (%d,%s,%s,%d,%s,%s)       ",       $user_id,       $origin,       $destination,       $brokerID,       $brokerID.'-'.genRandomString(),       $estimatedship     ));      And this error follows it: `mysql_real_escape_string() expects parameter 1 to be string, object given in /var/www/vhosts/hayhauler.co/httpdocs/wp-includes/wp-db.php on line 789, referer: http://hayhauler.co/` Any help or direction would be greatly appreciated.


title: How can I query posts with newly uploaded images?

text: I have a custom post type for events. A couple of days after each event photos are sometimes uploaded and attached to the event they were taken at. I want to highlight these image gallerys somewhere on my site, displaying them under a headline "Recently Changed Image Galleries". How can I query posts of type 'event' that have 3 or more image attachments, and order the result by the upload or publish time of the newest attachment?


title: Ignores post_type when no results

text:
I have a custom searchbox that only searches a particular custom post type. On the results page I have modified seacrh.php to display the results slightly differently. Mainly the title is different.               <?php              if ( 'wpdmpro' == get_post_type() ) : ?>
Documents Search
                          <?php              else : ?>
Search
             <?php endif ?>      This works when there are some rsults, but fails on no results and displays the default title? Why is the confitional failing. the url of the results page shows that the post type is still relevant?               http://siteurl.com/?s=searchterm&post_type=wpdmpro      Any idea?


title: Images uploaded using media uploader are appearing upside down

text: A client of mine has come to me with an issue I've never seen before. Some of the images he's uploaded via the media uploader are appearing upside down or sideways. I'm assuming it's because they were taken on a phone and Wordpress is preserving the direction in which they were shot? Is there a fix for this?


title: How to use shortcodes on a widget sidebar when doing an ajax call?

text: I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing:               add_action( 'init', function() {        ps_register_shortcode_ajax( 'ps_get_slider', '8' );      } );          function ps_register_shortcode_ajax( $callable, $action ) {     if(isset($_POST['href'])) {           $pageId = preg_match( '/^http:\/\/.+\/\?page_id=\d+$/', $_POST['href'] ) ? substr( strrchr( $_POST['href'], '=' ), 1 ) : '8' ;                if ( empty( $pageId ) || $pageId != $action )             return;                call_user_func( $callable );     }     }          function ps_get_slider() {         //require_once('../wp-load.php'); Nothing changes         if ( dynamic_sidebar('Slider') ) : else : endif;         //echo do_shortcode( '[promoslider post_type="news" height="300px" width="70%" numberposts="5" start_on="first" display_title="fancy" display_excerpt="excerpt"  pause_on_hover="pause"]' );  Same output than above         die();      }       but I'm just getting the literal output: `[promoslider post_type="news" height="300px" width="70%" numberposts="5" start_on="first" display_title="fancy" display_excerpt="excerpt" pause_on_hover="pause"]`. Any idea of how could achieve it? _As a note, I first tried just adding`if ( dynamic_sidebar('Slider') ) : else : endif;` into the ajax template, but didn't work._


title: Parent and child custom post types without options on parent

text: This might sound an odd one but wondering if the following scenario is possible at all within WP. Would like for example a parent custom post type of : Product Type 1 Underneath it I only want options to have 2 custom post type children within it: News, Reviews (which could be expanded going forward) Product types could then be expanded as well but they are separated by their CPTs in WP. Wouldnt want any other post options for the parent only for the children so no add post under Product Type 1 only under News and Reviews. The CPTs would auto create a permalink structure for /product-type-1/news/ ..reviews/ Is this possible or am I thinking about this all wrong? Its to go into an existing site which is mainly powered by another CMS. It has sections already for say domain.com/product-type-1/ with other areas powered by the main CMS. Was hoping to them piggy back in for domain.com/product-type-1/news/ and ..reviews/ which htaccess will handle sending to WP instead. Thanks for any help in advance.


title: What's an efficient way to change the post status of many posts at once?

text: I'm looking for an efficient way to change the post status on many posts at once. I have a custom post type that I'm using as a means to store content that must be approved by a moderator before being published. I'm trying to give the moderator the ability to "approve all" or "reject all" on a fairly large number of posts (100-200 would be common). The best solution I've come up with is to make an ajax call that sends a list of post id's to the server, which loops through them calling the below function:               wp_update_post(array('ID'=> $post_id, 'post_status' => 'publish' ))      This results in a query to the DB for each post, however, and it's much slower than I'd like. Ideally, I'd be able to make a query that changes the post status to 'publish' on all of the post ID's in the list at once, but I can't find any means to do this.


title: Chopping up a large ajax request of around 200 posts

text:
I've put myself into an uneasy situation, where I have roughly 200 posts I need to load in with jQuery `.load()`. Nothing shows up until the whole `.load()` has executed, of course. Takes roughly 3 to 4 seconds. What would be the best way to chop up the big load query to smaller junks, like 50 posts per query. So that the user would see something at least, most of the posts are under the fold anyway. It can't be a lazy load or infinite scroll, cause there's an Isotope filter at the top and all post eventually have to be in the DOM to be sortable. EDIT: The code that handles the ajax load:               // Get time for measuring the load duration     $then = $.now();          var init2 = function() {         // Du stuff while the ajax load     },     // Do stuff after ajax load     ajaxLoad2 = function(html) {         window.$body.addClass('ajax-load-done');         // Init lazy load on images with Unveil         $('img')             .on("unveiled", function() {                 this.style.opacity = 1;                 $('body, html').scroll();             })             .unveil({                 threshold: 600,                 debounce: 30,             });         // Run title function         titler(html);         init2();         // Measure the time it took to run the ajax request         $now = $.now();         var totalTime = ($now - window.$then) / 1000 % 60;         console.log('all models loaded in ' + totalTime + ' seconds');     };     init2();          // This is the ajax request function     var loadModels = function() {         // Get the site domain         var href = window.location.origin + '/model',             // This is the load container             $underlayer = $('#underlayer');         // Load animation spinner         $underlayer.html("
Loading

Loading models, wait for it...
");         // The actual load         $underlayer.load(href + ' #content>*', ajaxLoad2);     }     var $overlayer2 = $('#overlayer');     // Check from the body class that it is s post type model and single and execute the load     if (window.$body.hasClass('root-single-model') && $overlayer2.offsetParent !== null ) {         loadModels();     }      And heres an illustration what I'm trying to achieve: ![enter image description here](http://i.stack.imgur.com/EblZD.png) The problem is that the 2) ajax load take about too long, about 3 seconds if cached and even up 8 sec if not.


title: Wooslider custom css

text: I recently purchased Wooslider plugin and would like to add custom css to override the Woothemes slider defaults. However if I add custom css to the theme css file it gets overridden by the wooslider css since that css comes after my theme css in the head of the document. Is there a way around this? some method or Wordpress script that forces my theme css to appear after the wooslider css perhaps, that would be a more elegant solution than putting css style tags into the head of the document? I was curious as to how other people deal with this issue?


title: Front-end login: Redirect user to the post they had created

text:
Is is possible to redirect a user on front end login to a post that they have created? I have the form below on the front end which works great to log people in but doesn't quite achieve what I want. I've created a front end registration process, that creates a new user and a post and fills in certain details into that post. On completion of that process they are sent to the post they just created, which then allows them to front end edit all the details. That works perfectly for first time registrants but I can't quite achieve what I want with people that have already registered and want to login. When they fill in their details on the form below, I want it to redirect to the post they created when they registered, is this possible? The users can only ever create **ONE** post... which is acting as a profile. So I want them to be able to log in and get redirected to their profile. If it helps, the username is the same as the post title (the username is the persons company name, which is also the name of the post).                           <?php if (!(current_user_can('level_0'))){ ?>                        <form action="<?php echo get_option('home'); ?>/wp-login.php" method="post" id="login-form">
Please login.
                                                      <input type="text" placeholder="Username" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" />                                                                                <input type="password" placeholder="Password" name="pwd" id="pwd" />
                             <input style="width:14%!IMPORTANT;" name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me
                                   <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
                             <a style="font-size:14px!IMPORTANT;" href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password
                                                         <input style="margin-left:80px;float:left;" type="submit" name="submit" value="LOGIN" class="login-button" />                                                    </form>

                 <?php } else { ?>
                         You are currently logged in, would you like to <a href="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>">logout?
                 <?php } ?>        I'm guessing the following... I need to do something with the username (entered in the form above) then match that with the author of any posts, if that matches then send them to that page... all before the submission of the form above. This needs to be done before the hidden field, so it can enter the username field into the hidden input value.


title: How to not show tags if the post doesn't have any?

text:
I currently have the following trying to avoid showing tags (the icon in this case) when there aren't any, but the icon continues to show up. Any thoughts?               <?php if ( is_singular() && function_exists('the_tags') ) : ?>
<?php the_tags('', ', ', ' '); ?>
     <?php endif; ?>


title: In a loop, do not display content that does not have a thumbnail

text: In a multisite installation, I have a loop set up on my main blog that displays all posts from sub blogs, along with a thumbnail image. The image is important and without one will break the grid. Is there a way to reject posts that do not have a featured image? Thanks.


title: Display sub menus as separate lists

text:
I need to change the way of rendering menu in WordPress - I guess I should write my own walker class but I'm not sure how to bite it. What I'd like to achieve is to render each level of menu as separate div. So we have pretty standard wp menu:

         Contact

             Blog

Blog

Home

Home

Sample Page

      What I'd like to achieve is this:

Contact

Blog

Home

Blog

Home

Sample Page

      Is it possible to achieve with custom Walker_Nav_Menu class? I'd really appreciate any ideas. Thanks


title: How to check if a slug exists?

text: I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks


title: Displaying the 'time ago' for recent activity within a post/custom post type?

text: How to get the 'freshness' of a post? (when it was last updated or commented and by who?) > e.g. 48 days / admin (avatar).


title: Wordpress CodeHighlighter

text: I've noticed on a couple of websites that the code highlighter can have some options like print / copy to clipboard, ... I've installed CodeHighlighter as a Wordpress plugin in my website but can't find a way to get those options. Any help would be grateful. Thank you


title: Can serialized arrays in DB be matched against serialized arrays with meta_query?

text: Say I have an array of checkbox choices associated with a post (a custom field) stored in the database in serialized form. On my site, I present users with the same checkboxes and let them make their choices to "filter" out posts according to their choices. If as little as one of their choices matches a posts choices, that post should be displayed.               $args['meta_query'] = array(       array(         'key' => 'choices',         'value' => $_POST['choices'],         'compare' => 'IN',     ));      As the data in the DB is in serialized form, I hoped that the WP_Query was smart enough to understand that it needed to unserialize the serialized data in the DB before attempting to match. This was not the case, and I am considering submitting this to the WP Trac and see if it can be added as a feature in future releases. My question is whether I have any options here, other than to store my data in another way (which at the moment seems difficult as I am using the plugin _Advanced Custom Fields_ to store it). I looked through meta_query with meta values as serialize arrays, and the answers there pointed me towards storing my data in another way. I hope I can avoid that.


title: Conditional Statement - check if post has an attachment image

text: I'm working on a conditional statement (in a loop) that looks for a featured image then grabs a default image if there is none, which I have figured out. But, I also wanted a way to pull the first image (or any image) attachment before going the route of the default image. Having trouble finding the right way to check for an attachment image, then display it. I have added a specific thumbnail size, "featured-thumbs" in the functions.php file of my theme. It would be great if I could utilize this when displaying the attachment image. Here's what I have so far:               <?php $count=0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                                  <div class="span-9 subfeature append-bottom <?php if(++$count%2==0) echo 'last'?>">                                                                   <?php $thumb = get_the_post_thumbnail(); //Hack for Sitewide Tags Thumbnail process: assigns variable for use in conditional statement below ?>                        <?php if (has_post_thumbnail()) {                        the_post_thumbnail('thumbnail');                        } else                        if ( $thumb ) { //if not checks to see if there's a Sitewide Tags created thumbnail and uses that if there is                       the_post_thumbnail();                        } else {                                             echo '';                   }                             ?>                   Thanks very much.


title: wpdb->insert: do I need to prepare against SQL injection?

text: Do I need to use wpdb prepare before wpdb->insert? If I am inserting values into a wordpress table using wpdb->insert, do I need to "clean" my data before inserting it or does this method (wpdb->insert) do that for me?


title: how do I group content in magazine-style 'issues'?

text: I am building a website for a magazine. It won't carry the whole content of the mag, just a teaser article or two from each issue. I need to have a page for each issue that features these articles, something like:               http://www.magazine.com/issue/20/      I'd make a template for 'issue' pages that spits out all the associated articles. But wouldn't this mean the client would have to create a blank page for each new issue, and assign the template? That seems eminently breakable. If it could be done dynamically that would be preferable. An alternative would be putting each page in a numbered category and using the standard archive output for that category, but I'd rather use categories for their intended purpose. Is there a standard way of doing it?


title: How do I export the headlines of all the blog posts in a single category?

text: I need a list of all the blog post I wrote on a topic. (Basically a list of headlines that are marked with a certain category.) One of my readers once created a list like this and emailed it to me, but I never asked him how he did it and can't find his email.


title: Taxonomy.php Not Showing Posts

text:
I have the following code in my Functions.php file to create a custom taxonomy and post type. And I have created a series of posts within this post type and attached tags to them.               add_action( 'init', 'create_my_post_types' );          function create_my_post_types() {          register_post_type('portfolio', array(         'label' => __('Portfolio'),         'singular_label' => __('Portfolio'),         'public' => false,         'show_ui' => true,         '_builtin' => false,         '_edit_link' => 'post.php?post=%d',         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array('slug' => 'work', 'with_front' => false),         'query_var' => 'portfolio',         'supports' => array('title', 'thumbnail'),         'menu_position' => 5     ));          }          add_action( 'init', 'create_pc_db_taxonomies', 0 );          function create_pc_db_taxonomies() {         register_taxonomy(             'portfolio_tag',             'portfolio',             array(                 'hierarchical' => true,                 'label' => 'Portfolio Tags',                 'rewrite' => array('slug' => '', 'with_front' => false)             )         );     }      I have created a custom loop on my home page and successfully shown my posts from this type which shows they work, however when viewing the taxonomy archive I just get the message that no posts could be found... It is finding the correct template to use just not seeing posts attached to that taxonomy. Here is the code for the Taxonomy.php               <?php if (have_posts()) : ?>
                         <?php while (have_posts()) : the_post(); ?>
                          <?php if ( has_post_thumbnail() ) { ?>                              <a class="fancybox" title="<?php the_title(); ?>" rel="bookmark" href="<?php                         $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );                         foreach ( $attachments as $attachment_id => $attachment ) {                             echo wp_get_attachment_url( $attachment_id, 'medium' );                         } ?>">                             <?php the_post_thumbnail(); ?>                                                   <?php } else { ?>                              <a class="fancybox" title="<?php the_title(); ?>" rel="bookmark" href="http://dummyimage.com/640x480/333/fff&text=x">                             <img src="http://dummyimage.com/300x300/333/fff&text=x" alt="<?php the_title(); ?>" />                                                   <?php } ?>
                  <?php endwhile; ?>
                  <?php else : ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
                  <?php endif; ?>      **Any ideas why this is not working? Thanks**


title: Display a paragraph in the index page that won't be displayed in the single post

text: Can i make it possible for an excerpt to be displayed in the index page but that part of the excerpt will not be displayed in the single post anymore?


title: How do I apply a class to custom menu items based on user roles

text: I have a members section on my site and they see specific custom menu items. I'm seeking a way to simply apply a star to the `<li>` based on it's permission level and what the user's role is. Something to the effect of.               if( current_user_can('integrator') || current_user_can('distributor')) :      This is what I have so far and it applies a class to every menu item if the user's role is (whatever). I essentially need to apply the class if another class is present and the user's role is (whatever)...               add_filter('nav_menu_css_class' , 'my_nav_special_class' , 10 , 2);     function my_nav_special_class($classes, $item){             if (current_user_can('integrator') || current_user_can('distributor')){                 $classes[] = 'PARTNER_STAR';             }         return $classes;     }      Courtesy Bainternet from this post Any ideas would be appreciated **Update:** I also want to note that I'm using "Role Scoper" to handle permissions. They do have a template function `is_restricted_rs()` but I'm honestly unsure how to use it currently.


title: why is unregister_setting() undefined?

text: trying to call               unregister_setting('general','users_can_register');      so as to removed the option for allowing or dissallowing user registration (it is required in the theme, so it is set programatically) but it is returning `Call to undefined function unregister_setting()...`


title: Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term

text: Say, for example, I have the following custom taxonomy:               Term 1        Term 1.1        Term 1.2           Term 1.2.1           Term 1.2.2        Term 1.3     Term 2        Term 2.1      How can I get the children terms of Term 1, not including grandchildren? That is, I want my results to include only Term 1.1, Term 1.2, and Term 1.3. Thanks.


title: Populate WYSIWYG field with ACF choice

text: So, I have a custom post type that uses a flexible content field containing a post object field and a wysiwyg field. The post object is to choose a post from a selected post type. After you choose that post from the drop down, I would like to populate the content of that post in to my blank wysiwyg field. Hoping someone has any ideas, been at this for hours with no solution. Thanks! Edit: After some searching I found this. Works great for populating the default Wordpress WYSIWYG field.               add_filter( 'default_content', 'my_editor_content', 10, 2 );          function my_editor_content( $content, $post ) {              switch( $post->post_type ) {             case 'proposal':                 $content = 'Testing my custom function';             break;         }              return $content;     }      I found this link: http://www.advancedcustomfields.com/resources/filters/acf- fields-post_object-result/ but not sure how to incorporate that with my snippet. ![enter image description here](http://i.stack.imgur.com/UHAgN.png)


title: Loading a post's content, into a div outside the loop, when it's title is selected in a list

text:
I am building a site in wordpress where at a certain part there is a container that has a list of post items (see it as a menu/sidebar), and an empty space where I will load content. When you click on one of the titles from the list of posts, the content of that clicked title is supposed to load into the empty div. Clicking another title from the list of titles should of course replace the previous content. So it looks like this, basically:

          <?php            $my_query = new WP_Query('showposts=10&cat=4');            while ($my_query -> have_posts()) :                 $my_query->the_post();                $category = get_the_category();           ?>

                <? the_title(); ?>

               <?php             endwhile; wp_reset_query();           ?>

         <? the_content(); ?>

      So, I already looked up something for ajax but I don't have any experience with that. What would be the best way too do this?


title: How to have Tiled Galleries like in WordPress.com?

text: In a WordPress.com hosted blog, you have the posibility to create picture galleries with a different style than usual: tiles, squared tiles or circles. What plugin are they using to achieve this? I haven't found that feature in a stand-alone WordPress installation.


title: Best place to store company address

text: Ok I'm creating a site for a company, this company will have multiple users. In the footer I am trying to include the company name, phone and address but not as a widget. I need to store the information in a place where all users can edit it. In the past I've stored this kind of information in a users profile but that is only good on a single user blog. Where can I store this information where I can easily pick it up in the theme and all users can see/edit it.


title: Wordpress plugin search does not work and updates are not shown, VPS install

text: I have configured a VPS running CentOS 6.3 and Plesk 11. The install of a blank version of Wordpress works well. However, I have problems with updating Wordpress and searching for plugins. The two problems:   * When trying to search a new plugin from within the Wordpress backend I get an 'Unknown error'. I have found a lot of references with people having this problem, however it is usually solved by the webhost as this is a server configuration issue. Since I am now my own webhost with the VPS, I would like to know how to solve this myself and improve my server configuration. I did not find anywhere online how to do this in practice.   * A (most likely) related problem is that Wordpress does not show any new updates. The current version of my blank install is 3.4.2 but once logging in, Wordpress does not indicate that I should update to version 3.5. Also after performing an update check, Wordpress does not find the new version. Updating everything manually (via FTP) works well of course. But I would like the update process from within wordpress to work. Anyone any ideas how to improve my PHP or other configurations to solve these update problems? Any help appreciated!


title: Shortcode to insert <!--nextpage-->

text: Since wordpress does not have a menu icon (aka "user friendly) way to add the command to a post or page, I'm trying to create a shortcode to do it. However, as logic would have it, its not that easy. Doing this with a shortcode merely inserts into the markup, which is post process, not pre- process as wordpress does it substitution in pre-process. Can anyone shed light on how this can be done?


title: Create a link which allows visitors to disable a plugin?

text: Is it possible to create a link that allows site visitors to disable a plugin? I'm using a plugin called "any mobile theme" which automatically detects if the visitor is on a mobile device and automatically switches to a mobile- friendly version of the themes. This works very well, but I would like to give them option to view the full (desktop) version if they prefer. Is it possible to create a frontend link to disable a plugin (the mobile theme switcher) to achieve this? Thanks


title: Post2Post refusing to show linked posts

text:
I'm trying to construct a catalog page, made out of `product`s and `product- category`s. I have set up both post types, and set up a connection between them in `functions.php` (Using the **Posts2Posts plugin**. The problem I'm having, is that in my `catalog-page.php`, I can't see the connected pages (I can see the Categories using the first loop, but not the connected Products). # Code: ## functions.php (Relevant)               /* ======================        Custom Page Types        ====================== */          add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'product-category',                             array(                                  'labels' => array(                                      'name' => __( 'קטגוריות' ),                                      'singular_name' => __( 'קטגוריה' ),                                      'add_new' => __('קטגוריה חדשה'),                                  ),                                  'public' => true,                                  'has_archive' => true,                                  'hierarchical' => true,                                  'supports' => array(                                      'title',                                      'editor',                                      'thumbnail',                                           'page-attributes'                                  )                                  )         );         register_post_type( 'product',                             array(                                  'labels' => array(                                      'name' => __( 'מוצרים' ),                                      'singular_name' => __( 'מוצר' ),                                      'add_new_item' => __('מוצר חדש'),                                      'new_item' => __('מוצר חדש'),                                      'parent' => __('קטגוריה'),                                  ),                                  'public' => true,                                  'has_archive' => true,                                  'hierarchical' => true,                                  'supports' => array(                                      'title',                                      'editor',                                      'thumbnail',                                           'page-attributes'                                  )                             )              );          }          /*      * Posts2Posts plugin      */     function my_connection_types() {         p2p_register_connection_type( array(                                            'name' => 'products_to_categories',                                            'from' => 'product',                                            'to' => 'product-category'                                       ) );     }     add_action( 'p2p_init', 'my_connection_types' );      ## catalog-page.php (Relevant)               <?php if (have_posts()) {     while (have_posts()) : the_post(); ?>
             <?php             $category_arguments = array(                 "post_type" => "product-category",             );             $category_query     = new WP_Query($category_arguments);             while ($category_query->have_posts()) {                 $category_query->next_post();                 echo "
{$category_query->post->post_title}
";                 $products_arguments = array(                     "connected_type"      => "products_to_categories",                     "connected_items"     => $category_query->post->ID,                     "connected_direction" => "from",                     "nopaging"            => true,                 );                 $products_query     = new WP_Query($products_arguments);                 var_dump($products_query->have_posts(), $category_query->post->ID);                 while ($products_query->have_posts()) {                     $products_query->next_post();                     echo "
{$products_query->post->post_title}
";                     var_dump($products_query->post);                 }                      var_dump($category_query->post);             }      ## This outputs: ### משקפי שמש               boolean false //have_posts() on products     int 81        //Post ID (correct)     object(WP_Post)[1992] //The category post       public 'ID' => int 81       public 'post_author' => string '1' (length=1)       public 'post_date' => string '2012-12-16 23:47:02' (length=19)       public 'post_date_gmt' => string '2012-12-16 21:47:02' (length=19)       public 'post_content' => string 'קטגוריה של משקפי שמש' (length=37)       public 'post_title' => string 'משקפי שמש' (length=17)       public 'post_excerpt' => string '' (length=0)       public 'post_status' => string 'publish' (length=7)       public 'comment_status' => string 'closed' (length=6)       public 'ping_status' => string 'closed' (length=6)       public 'post_password' => string '' (length=0)       public 'post_name' => string '%d7%9e%d7%a9%d7%a7%d7%a4%d7%99-%d7%a9%d7%9e%d7%a9' (length=49)       public 'to_ping' => string '' (length=0)       public 'pinged' => string '' (length=0)       public 'post_modified' => string '2012-12-16 23:47:02' (length=19)       public 'post_modified_gmt' => string '2012-12-16 21:47:02' (length=19)       public 'post_content_filtered' => string '' (length=0)       public 'post_parent' => int 0       public 'guid' => string 'http://localhost/geva/?post_type=product-category&p=81' (length=59)       public 'menu_order' => int 0       public 'post_type' => string 'product-category' (length=16)       public 'post_mime_type' => string '' (length=0)       public 'comment_count' => string '0' (length=1)       public 'filter' => string 'raw' (length=3)


title: Updating themes customized by users

text: Can I safely update a theme if a user has _only_ modified it through THEMES > CUSTOMIZED? I know that a user has to clone and create a child theme if they want to edit the php/css/javascript files directly. But, if the only modifications were through the THEMES > CUSTOMIZED, would there changes remain in place after a theme update? ![enter image description here](http://i.stack.imgur.com/WMHp2.png)


title: Removing featured image from gallery?

text: I'm having trouble removing the featured image from gallery. ![enter image description here](http://i.stack.imgur.com/7ZgSs.png) I removed all kinds of stuff from those 2 files, but seems like I need to add something, not take away. Here are the pastebin's of 2 files: http://pastebin.com/sBaVzk8y http://pastebin.com/Ae8TkbAP