title: why is this content-template not showing any of my blog-entries?

text:
i'm using the blogolife-theme on wordpress 3.6.1 my template looks like this:               <?php     /*     Template Name: Template One     */     ?>          <?php     /**      * A custom template file.      * @package WPLOOK      * @subpackage BlogoLife      * @since BlogoLife 1.0      */     get_header();      $hasSidebar = "";     $sidebar =    get_post_meta($post->ID,'wpl_enable_sidebar',true);     get_template_part('content', 'page' ) ;     //get_template_part('inc', 'indexloop' ) ;     if($sidebar=="false" ) {     echo '

';     } else {          get_sidebar(one);          }     get_footer(); ?>      the content-page.php looks like this:               <?php     /**      * The default template for displaying content      *      * @package wplook      * @subpackage BlogoLife      * @since BlogoLife 1.0      */     ?>

             <?php wplook_doctitle(); ?>             <?php if ( have_posts() ) : ?>             <?php /* Start the Loop */ ?>                 <?php while ( have_posts() ) : the_post(); ?>     <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'wplook' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

             <?php the_content(); ?>             <?php wp_link_pages( array( 'before' => '

' . __( 'Pages:', 'wplook' ) . '', 'after' => '
' ) ); ?>

             <?php if ( the_category ( '', ', ' ) ) { ?>
                     <?php _e('Category:', 'wplook'); ?>                     <?php the_category(', ') ?>

                 <?php } ?>                 <?php if ( get_the_tag_list( '', ', ' ) ) { ?>
                      <?php _e('Tag:', 'wplook'); ?>                     <?php echo get_the_tag_list('',', ',''); ?>

                 <?php } ?>

<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'wplook' ), the_title_attribute( 'echo=0' ) ); ?>" rel="nofollow"><?php wplook_get_date_time();?>
                 <?php if ( comments_open() ) : ?>
<?php comments_popup_link(__('No comments', 'wplook'), __('1 comment', 'wplook'), __('% comments', 'wplook'), 'comments-link', __('Comments off', 'wplook')); ?>
                 <?php endif; ?>
<?php wplook_get_author();?>
                 <?php edit_post_link( __( 'Edit', 'wplook' ), '
', '
' ); ?>

                       <?php comments_template( '', true ); ?>                 <?php endwhile; ?>             <?php endif; ?>

      but nothing is happening. my index.php used               get_template('inc' 'indexloop' ) ;      which showed all entries, but when i use this function on my custom template, also nothing appeares. btw. this is my not modified index.php, the modified works the same, only has some edits:               <?php     /**      * The main template file.      *      * @package WPLOOK      * @subpackage BlogoLife      * @since BlogoLife 1.0     */     get_header();     get_template_part('inc', 'indexloop' ) ;     get_sidebar();     get_footer(); ?>


title: what is __return_false in filters

text: I was thinking of removing/hiding admin-bar from my wordpress (3.1.1) installation. I visited following link: http://codex.wordpress.org/Plugin_API/Filter_Reference/show_admin_bar I was surprised to see only a single line to remove/hide admin-bar               add_filter( 'show_admin_bar', '__return_false' );      My question is what is **__return_false** means? why __ and _?


title: Sidebar does not display on blog page, but fine with static pages

text: Please help as I am loosing my mind with this issue. I built my first really simple wordpress theme. http://www.designstest.co.uk/ For NEWS (blog) page I created a new template page-blog.php (based in index.php that is used by all other pages). The only difference - it has sidebar. It works fine if I apply same template to static page, but it does not display sidebar on NEWS(blog) page. If you see CMR page - it has same template applied as NEWS. I have tried instead of get sidebar just place some simple text and it acts the same - displays text in static pages but not blog. I really don't understand what is going on.


title: WP Simple Fields - Single repeatable field inside repeatable field group

text: I have a field group "teaser". Now my teasers have different types like:   * linked headline + image   * unlinked headline + image   * indidivual html The group itself is repeatable because you can add multiple teasers. Up to now I just had the different fields for all types and you would only fill the fields you needed (e.g.: There is a field "HTML" which is only considered if you chose the type "indidvidual html"). Now I have a new type of teasers where multiple images shall be shown in a row, like in a diashow. My problem is, that therefore you should be able to choose multiple images of any number inside the repeatable field group "teaser". But it seems only field groups can be repeatable and not a single field inside. Also maybe my approach is completely wrong... maybe there is another way how to solve this. I found the alternative plugin "Advanced Custom Fields", which might be able to do this, but unfortunately I cannot change the plugin for this project - it's already launched and I would rather extend the simple fields plugin, than updating the templates, redoing and refilling all fields. So do I really have to extend the simple fields plugin to accomplish this? Also there seems to be no option to make conditional fields for the cms only, like choosing an option (e.g. teaser type) and differ the shown fields in that way - but I am just curious if someone implemented something like that and could share his knowledge.


title: How to create single page site in WordPress

text: I have total 5 pages on my website, I want to display all pages as single page. It is possible? Example: http://yaremchuk.ru


title: How to use my style.css file outside of wordpress subdomain?

text: I am building a wordpress theme from scratch on a subdomain and I want to use the same CSS files across my entire site. My problem is linking my wordpress PHP files (which are on the subdomain) to my CSS files (which are on the main domain). I have tried going into theme.php and changing the ['/style.css'] to an absolute reference such as 'http://diginomics.com/css/style.css' but it doesn't work.               function get_stylesheet_uri() {         $stylesheet_dir_uri = get_stylesheet_directory_uri();         $stylesheet_uri = $stylesheet_dir_uri . '/style.css';      I am assuming my subdomain doesn't have permissions to access my root folder or something is simply wrong with the syntax. I would like to link my wordpress theme to all my CSS files and frameworks and use theme site wide and on all my subdomains. Also, what would the solution be to link my Javascript files site-wide as well?


title: Retrieve Menu name for nav_menu_item

text: Given a `nav_menu_item` object, how would I determine the name of the Menu it is associated with? I have a couple menus defined in my theme, as well as, a `nav_menu_css_class` filter. Inside the filter, I only want to add classes to one of the menus. If I can dynamically pull the menu name using the `$item` variable I can make sure I'm only acting on a specific menu.


title: A real way to override BuddyPress files in a WordPress plugin

text: Is there a working (must be) way to override BuddyPress template files in via a WordPress plugin. I know it can be done using a theme, but is it possible to do it with a plugin? I'm really eager to create something from it, but can't find how to do that :/


title: Using 2 URL's for Wordpress

text: I have a Problem, that my internal company blog should be visible via 2 URL's. One internal and one external. Now I would need to rewrite URL's before content is delivered to the browser. All URL's are in the database and I can't seem to find a place to start rewriting things. Any clue wich hooks might be useful and what can be done to implement this?


title: how to store arrays into a database

text: I'm trying the store multiple rows into a database. The number of fields will change. Below is the way that I use to store just one row.                 <?php            if(isset($_POST['save'])){           $wpdb->insert('wp_table_name',               array(                   'field_a' => $_POST['field_a'],                   'field_b' => $_POST['field_b'],                   'field_c' => $_POST['field_c'],                   'field_d' => $_POST['field_d']                                ),               array(                   '%s',                   '%s',                   '%s',                   '%s'                   )               );       }       ?>            <form>           <input type="text" name="field_a[]"/>           <input type="text" name="field_b[]"/>           <input type="text" name="field_c[]"/>           <input type="text" name="field_d[]"/>                <input type="text" name="field_a[]"/>           <input type="text" name="field_b[]"/>           <input type="text" name="field_c[]"/>           <input type="text" name="field_d[]"/>                <input type="text" name="field_a[]"/>           <input type="text" name="field_b[]"/>           <input type="text" name="field_c[]"/>           <input type="text" name="field_d[]"/>                <button type="submit" name="save">Save</button>       </form>


title: How to upload/update theme from local - bitbucket - shared hosting?

text: I am having tough time to figure out the best most appropriate way to maintain and update my custom theme for wordpress. I have setup local server (wamp) with wordrpess where I mainly develop my theme and push everything to bitbucket. At this point I usually just upload my theme from my local machine to ftp server theme folder - and voilà! However, this seems like an old approach. I see people talk more and more about dynamic update - push theme directly to host (from lets say bitbucket). I tried to search for best approach and a "how-to" tutorial however I failed. My hosting is shared and does have ssh access. How to use all of this - no idea. Maybe someone could direct me to a tutorial?


title: WP_QUERY Get posts by category and similar name (Like)

text:
I have a small problem with wp_query. I want to get the posts filtered by category and with similar project name (like query), so im trying this code:               $args=array(     'post_type' => 'post',     'post_status' => 'publish',     'category_name' => 'projects',     'name__like' => 'Proj');          $my_query = null;     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post();         echo '
'.get_the_title().'
';     endwhile;     }     wp_reset_query();      Actually it displays the projects filtered by category, but the name__like is not working. How can i fix it?? Thank you.


title: insert a taxonomy for a custom post type

text: I have been created a custom post type and create a taxonomy for it, below is the code which i used to create those:               //create custom post type of jobs     add_action( 'init', 'create_jobs' );     function create_jobs() {         register_post_type( 'jobs',             array(             'labels' => array(                 'name' => 'jobs',                 'singular_name' => 'Jobs',                 'add_new' => 'Add New',                 'add_new_item' => 'Add New Jobs',                 'edit' => 'Edit',                 'edit_item' => 'Edit Jobs',                 'new_item' => 'New Jobs',                 'view' => 'View',                 'view_item' => 'View Jobs',                 'search_items' => 'Search Jobs',                 'not_found' => 'No Jobs found',                 'not_found_in_trash' => 'No Jobs found in Trash',                 'parent' => 'Parent Jobs'             ),                  'public' => true,             'menu_position' => 15,             'supports' => array( 'title', 'editor', 'comments', 'thumbnail' ),             'taxonomies' => array( '' ),             'menu_icon' => 'dashicons-visibility',             'has_archive' => true             )         );     }          //create a taxonomy for jobs     add_action( 'init', 'create_jobstax', 0 );     function create_jobstax() {         register_taxonomy(         'jobs_taxonomy_genre',         'jobs',         array(             'labels' => array(                 'name' => 'Create Jobs Genre',                 'add_new_item' => 'Add New jobs genre',                 'new_item_name' => "New jobs genre"             ),                      'show_ui' => true,                 'show_tagcloud' => false,                 'hierarchical' => true                       )         );       }      now what i want is to insert a default taxonomy for that custom post type only, example: i want to insert "latest" and "active" as a default taxonomy for the jobs custom post type, how to achieve that? currently looking for a approach around but seems found nothing to meet my needs. Any ideas, recommendations and suggestions, would love to hear. Very thank you in advance.


title: Website showing random code like texts in a post after pasting from MS Word

text: My website is showing this type of content in a blog. When I click the title of same content, the content is fine there. It shows this type of content in one of the many listed contents. What can be the possible reason?               Normal     0          false     false     false          EN-AU     X-NONE     X-NONE                    DefSemiHidden="false" DefQFormat="false" DefPriority="99"     LatentStyleCount="371">               UnhideWhenUsed="true" QFormat="true" Name="heading 2"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 3"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 4"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 5"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 6"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 7"/>     UnhideWhenUsed="true" QFormat="true" Name="heading 8"/>     UnhideWhenUsed=”true” QFormat=”true” Name=”heading…


title: Where to add the_post_thumbnail( )

text:
I am trying to add the featured image of a post into my category archive pages. My theme already supports post-thumbnail (used for the sliding top menu of the sliding doors theme). from what I gathered I need to modify "the loop" and add `the_post_thumbnail( 'thumbnail' );` somewhere in it. Questions is where? I tried different places and no matter what I do, nothing happens. I tried putting it in the _category.php_ files, same thing. Once I get it to pop up somewhere I should be able to arrange formatting but right now, no matter what I do it's got no effect on the page. edit: I was able to make the thumbnail appear. My problem was that I didn't put it in the right place. Now, formatting is clearly not as easy as I thought: if I put it right after the while (have_posts() .....) it'll show, but it puts it above the post title, details, etc. if I try to put within the existing code, no matter how I do it, the thumbnail won't show. below is what the unmodified code loops like. I'd like to split this in 2, having the thumbnail on the left and the rest on the right.               <?php if ( in_category( _x('gallery', 'gallery category slug', 'slidingdoor') ) ) : ?>         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'slidingdoor' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>

                 <?php slidingdoor_posted_on(); ?>


title: Are term IDs unique even between multiple custom taxonomies

text: I can't find the answer for this question on either Wordpress or here, nor via Google searches, so I'm throwing this out to the community. If you have two taxonomies, and you add 1 term to each taxonomy, will the first term added in taxonomy_1 have a term ID of 1 and the second term added to taxonomy_2 have a term ID of 2?


title: Hide post completely and still reach it via cURL

text: I've been struggling with this for several hours. I want to have a post hidden from every listing, including the posts edit screen, and having it not reachable by browsing to it. I successfully did this with the **pre_get_posts** action hook, but I need to be able to make the post reachable again only when I'm running a specific function, where I use cURL to request the post and do some validations, then I want to hide it again as soon as I'm done with it. The problem I'm having, is that cURL gets a **Not Found** response when my **pre_get_posts** hook is active. I have tried using a *remove_action( 'pre_get_posts', 'my_function' )* statement, but it seems it's not taking it and I can't get to the post. I thought of having the post just be a private post, or password protected, but I really prefer to have this post hidden completely. I also tried the **posts_where** filter, same thing, it works but I can't make cURL get the post correctly. Those are the only two hooks I have found that do what I want, but for some reason I cannot remove them. Can anyone please share some ideas on how to make this work? Or, what am I missing? Thanks! Edit: Ok, here's the code I have for the **pre_get_posts** hook:               function hide_post( $query ) {         $query->query_vars['post__not_in'] = array( $hidden_post_id ) );     }      And this is the code I use to show/hide the post:               remove_action( 'pre_get_posts', 'hide_post' );     $post_permalink = get_permalink( $hidden_post_id );          $ch = curl_init();     curl_setopt( $ch, CURLOPT_URL, $post_permalink );     curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );     curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );     curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, 0 );          $buffer = curl_exec( $ch );     curl_close( $ch );          remove_action( 'pre_get_posts', 'hide_post' );      Worth noting that the part that's not working as I would expect is the remove_action() part, where I should be able to get to my hidden post and after that I will hide it again.


title: Custom Search Page to a different table in the same db

text: I am new to wordpress and php. I want to create a search page. The inputs are: State, GoverningOrg, ProgramType, Orderby. Then press the submit button. So basically what I did was create a new page and then chose the default template. I want to add the inputs pluse the submit button. And then it would return the query below. Please advise Cheers! Sherwin


title: How to paginate get_categories?

text:
I have been working on this code for about a week now. I have tried many things. My recent attempts today resulted in infinite loops that just made the browser keep posting the posts. This is what I get without limiting the posts. ![bad result](http://i.stack.imgur.com/02GTZ.png) This is what I have now and want setting number => 3 in my `get_category` args. ![desired result](http://i.stack.imgur.com/9aP7d.png) This chunk of code below is what needs to be paginated. The allcats variable is passed to the foreach loop and returns the posts needed. The args in the foreach loop gets passed to the query which would handle getting the posts that are listed under the categories of Dinner Menu, Lunch, Pasta. It's the foreach loop that I can't figure out how to re-write into a working query that I can paginate.                //setting the paged variable trying to get pagination      $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;           //the allcats variable gets the child categories of Dinner menu, Lunch, Pasta that are assigned to the parent category of Menu      $allcats = get_categories(array('child_of' => get_query_var('cat'), 'number' =>    3,'order'=> 'asc', 'paged' => $paged));       foreach ($allcats as $cat) :              $args = array(           'category__in' => array($cat->term_id),           'paged' => $paged       );      Now, in the above code, I had hoped that setting the paged variable would work. I experimented by putting in 'paged' => $paged into the args but this does not work. Now I figured that it won't work because the number => 3 that is set above in the $allcats variable is telling WordPress to only return 3 categories. Problem is that I plan on having many more than 3 categories. I only want to display 3 categories on each page. The wine list that you see in the photo above needs to be on page 2. My issue is that I cannot figure out how to get the posts to show on a regular WordPress query so that the paged variable can do it's job. The only way I can get the posts the way I need them is by using the get_categories method with the foreach loop to get the child category. I am using a plugin to get the images that are attached to the child category. Here is the rest of my code:                 query_posts($args);       if (have_posts()) :       echo '
';              //this bit of code gets the images attached to the category using the plugin         $terms = apply_filters( 'taxonomy-images-get-terms', '' );         if ( ! empty( $terms ) ) {         foreach( (array) $terms as $term ) {                 if($term->term_id == $cat->term_id) {                   echo wp_get_attachment_image( $term->image_id, 'menu' );                 }         }         }           //Display the category title of Dinner Menu, Lunch, Pasta      echo '
'.$cat->name.'
';      echo '
';           //Get all the post titles that are posted to the categories of Dinner Menu, Lunch, Pasta        while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
           <?php       endwhile;        echo '

';             ?>            <?php else :        echo 'No post published in:'.$cat->name;                       endif;        wp_reset_query();       endforeach;        ?>
<?php next_posts_link( __( '← Older posts', 'paradiso' ) ); ?>

<?php previous_posts_link( __( 'Newer posts →', 'paradiso' ) ); ?>


title: WordPress Redirect on Name Change

text: I changed the domain name in my WordPress options menu because I was changing the domain name of my site. Now, however, the page never loads. What can cause this and/or how can I revert it back to the previous domain?


title: Filter posts by meta query?

text: I made custom post type and used a meta query … For this link:               wp-admin/edit.php?s&post_status=all&post_type=itinerary&action=-1&m=0&ipt_country=0&ipt_city=0&paged=1&mode=list&action2      … I want this this meta query to apply:               'meta_query' => array(                 array(                     'key' => 'ipt_country',                     'value' => $qv['ipt_country']                 ),                 array(                     'key' => 'ipt_city',                     'value' => $qv['ipt_city']                 )                            ),      How can I do that?


title: Order posts by how many categories it is assigned to in total

text: I'm already doing some custom ordering based on various stored custom fields but this latest one has me stumped. I know I can get the count for how many categories a post is assigned to, but this only helps me re-arrange them as I display the posts - no good for pagination. Ideally something like this would be awesome:               else if($orderItems == 'relevance'){         $wp_query->set('order','DESC');         $wp_query->set('orderby','category_count');     }      Thanks for your time


title: How to avoid website url appending problem in wp site?

text: On localhost when I opens my site (Ex: **http://example.com** ) and when I select any navigation menu then the url of my selected navigation menu appends the previous url. some what like this ( **http://example.com#http://localhost/example.com/?page_id=2** ) but I just want ( **example.com/?page_id=2** ). I damn sure the problem should be in index.php but I am unable to solve it. Anyone can help me to resolve it? Can anyone answer it?


title: WPDB query - decrypting DB data

text: I am trying to grab data from the DB using WPDB but I am stuck on how to decrypt the data e.g. The data is stored as: a:2:{i:0;s:2:"92";i:1;s:2:"71";} I want the 92 & 71 as that's my post IDs, how to I get that part from the DB using WPDB? My code so far is:               $crosssells = $wpdb->get_results(      "SELECT *        FROM $wpdb->postmeta       WHERE _crosssell_ids != ''       "     );      The table is only created when data is in putted in the post so I need to check if the table exists and then grab the post id's


title: How to get main menu only with wp_nav_menu

text: I have created one menu and have some sub-menu but I don't want to display any sub-menu from my template. My Menu code:               <?php wp_nav_menu( array('menu' => 'header-uk', 'menu_id' => 'nav', 'menu_class' => 'sitemap', 'fallback_cb' => false) ); ?>      My Menu Screenshot: ![enter image description here](http://i.stack.imgur.com/9JDFG.png) I want to display only this menu in my template:               Awards     Sagres Town     Getting Here     Sister Hotels     Other     Work for Martinhal     Disclaimer     Site Map


title: Get tags for post_type

text: I have several custom post types that all share the same tags. On the archive for each custom post type I want to display a list of tags used, and the number of posts associated with each. `get_tags()` by default pulls all its information from the entire site content. I can't find any filters for the `get_tags()` function, and I don't want to perform and intensive queries/functions to manually count and restrict.


title: Remove parent page from url

text: I would like to remove the parent page name from the permalink. At the moment, I have site.com/parent-page/child-page.php and I would like to have something like that site.com/child-page.php


title: Should I enable FastCGI on WordPress?

text: I am looking at my server settings and these are as follows: >   * WebDav : active > >   * FastCGI : inactive > >   * SSL support : active > >   * Perl as Apache module : CGI-Programm > >   * PHP module : CGI-Programm > >   * Memory usage : 131072 kB > >   * Process timeout : 60 seconds > >   * Maximum simultaneous processes : 1024 > > Using WP-Supercache (mod-rewrite mode) and have around 6,000 posts. Should I enable FastCGI on my server? Any other settings you recommend changing?


title: Plugin frontend with themes

text: I'm developing a calendar plugin and i need to show my content like a page, how i integrate my plugin file with themes? I created a index.php file in my plugin directory and load the get_header() get_footer() but i dont know if it right.


title: How to avoid foreach error WebDevStudio's WDS_Taxonomy_Radio taxonomy metabox class?

text: What is the correct way to use WebDevStudio's WDS_Taxonomy_Radio taxonomy metabox class? I have included the code in my functions.php file but I'm getting an error that reads: *Invalid argument supplied for foreach() WDS_Taxonomy_Radio.class.php on line 45* so I must be doing something wrong. The instructions on GitHub say to: > Initialize the class (update the taxonomy slug with your own) using the code `$custom_tax_mb = new WDS_Taxonomy_Radio( 'custom-tax-slug' );`. Of course I updated the slug to my taxonomy's. The script otherwise works. Any help is appreciated! Links   1. https://github.com/WebDevStudios/WDS_Taxonomy_Radio   2. http://webdevstudios.com/2013/07/08/replace-wordpress-default-taxonomy-metabox-with-a-radio-select-metabox/


title: Conditional Check in The Loop's Parameters

text: I have several loops each of them built to display a certain category in different style, based on user's input (they're within shortcodes). Now I want to "merge" these (or just 1 of them) loops with the loop to display recent posts, regardless of the category. Currently this is my code (to display post from a certain category):               $args = array(       'category_name' => $category,        'showposts' => $numposts,        'order' => $order     );          $query = new WP_Query( $args );          while ($query->have_posts()) : $query->the_post();     // loop's usual stuff      As I said, they are inside shortcodes, so, $category, $numposts (number of posts) and $order are user's input (shortcode's atts) Anyway, to display the recent posts, all I have to do is take away the category part. However, when I did that from the shortcode's "side" (by not filling the shortcode and not displaying it), the loop is broken. I suppose it is because I have declared "category" within the query parameters. I've tried:               $args = array(        if (!empty($category)) {         'category_name' => $category,       }       'showposts' => $numposts,        'order' => $order     );      but of course, it is throwing an error :P. Well, I guess at least it is better explaining what I am trying to achieve. My question: Is there anyway around this or should I build a new shortcode / loop, specific to just display the recent posts? Thanks in advance. EDIT: Longer code:               function boxed_category($atts, $content) {         extract(shortcode_atts(array(           "category" => '',           "numposts" => '-1',           "order" => 'ASC'         ), $atts));              $output = '';              $args = array(           'category_name' => $category,            'showposts' => $numposts,            'order' => $order         );              $query = new WP_Query( $args );              while ($query->have_posts()) : $query->the_post();      well, not many difference - function name because it is originally made to display a certain category (inside "boxed" - CSS) - I want to turned this shortcode to have a "Recent Posts" option. I'm going to need more atts, but first, need to figure out how to "get rid" of $category from the query should a user chose "Recent Posts" option.


title: Download an image from a webpage to the default uploads folder

text: I am writing a custom theme/site in which I need to download images programatically from certain webpages to the upload folder and then insert them as part of the post. So, I was able to find the image url's programatically, and then I need to save them to the upload folder under w-content, however that folder has specific WordPress folder structure inside it for the saved images. Now my question is, is there a WordPress API or function or method that will allow me to download images from the web and save them to the uploads folder? And if so, what is it. Otherwise, what should I do to save those images? So far, I am doing this               $filetype = wp_check_filetype(basename($image_file_name), null );          $upload_dir = wp_upload_dir();          $attachment = array(         'guid' => $upload_dir['url'] . '/' . basename( $image_file_name ),          'post_mime_type' => $filetype['type'],         'post_title' => preg_replace('/\.[^.]+$/', '', basename($image_file_name)),         'post_content' => '',         'post_status' => 'inherit'     );          $attachment_id = wp_insert_attachment( $attachment, $image_file_name, $post_id );          $attachment_data = wp_generate_attachment_metadata( $attachment_id, $image_file_name );          wp_update_attachment_metadata( $attachment_id,  $attachment_data );     set_post_thumbnail( $post_id, $attachment_id );      But the above code is giving me the following error               imagejpeg(http://wscdn.bbc.co.uk/worldservice/assets/images/2013/07/21/130721173402_egypts_new_foreign_minister_fahmy_304x171_reuters-150x150.jpg): failed to open stream: HTTP wrapper does not support writeable connections in C:\dev\wordpress\pterodactylus\wp-includes\class-wp-image-editor.php on line 334      And after further investigation, it looks like the error is cause by               $attachment_data = wp_generate_attachment_metadata( $attachment_id, $image_file_name );      And after even further investigation, the documentation for `wp_insert_attachment()` states that _`The file MUST be on the uploads directory`_ in regards to the `$image_file_name` So, how do I download an image and save it to my post correctly? Thanks a lot.


title: Easiest Way to Authenticate WP Users Using an External DB?

text: I have been looking for the best/easiest way to share users on a WP blog (in a subfolder) with the MAIN site's user database so that people do not have to register/log in on the WP blog when already registered/logged in on the main site. It seems like this should be a fairly "common" thing, that a blog is a PART of a larger website, rather than a stand-alone website, but apparently not. I have found plenty of info on sharing users between 2+ WP installations, but the main site in my case is NOT another WP site. I had looked at a plugin called "external DB authentication" but it apparently does not work with the more recent versions of WP. In a nutshell, I just want users on my main site to be shared with my WP blog and be able to post without having to register or login again. Any tips/suggestions will be very much appreciated!


title: Disable visual editor on one specific page

text: I would like to remove the visual editor from one specific page because if I edit this one page in Visual mode, it breaks the code. I want to make sure the client doesn't have this option on the particular page. However, I don't want to remove the html editor. This line of code removes the visual editor and the html editor: remove_post_type_support('page', 'editor'); a closer look at remove_post_type_support: http://codex.wordpress.org/Function_Reference/remove_post_type_support But I want to only disable the visual editor. Initial testing, in functions.php for this theme, I have:               function remove_editor_init() {           if ( is_admin() ) {         if (is_page(2548)) {                    remove_post_type_support('page', 'editor');         }      }     }     add_action('init', 'remove_editor_init');      However, the conditional statements is_admin() and is_page() don't seem to working together. Any suggestions?


title: Archive show thumbnail

text: I want to show thumbnails next to my posts in archive page, however it only shows thumbnails if the posts has a featured image. So I want to show thumbnail for the image attached to the post, but I don't know how to. At the moment I am using the following code to show thumbnails if set as featured.               <?php if ( has_post_thumbnail()) : ?>        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >        <?php the_post_thumbnail(thumbnail, array('class' => 'alignleft')); ?>        </a>     <?php endif; ?>      Any suggestions are appreciated


title: Widget which displays thumbnails, but links to urls?

text: I'm working on a wordpress site and need to have a widget on the sidebar which has thumbnails, but links to URLs specified per thumbnail rather than the images. It seems simple, but I can't find any plugin to do it in a way a non- developer can from the admin panel. Currently the NextGEN gallery plugin is being used. Is there any way to configure that, or any similar plugin, in that manner? How hard would it be to build a plugin from scratch to achieve this, and do you think that's necessary?


title: WYSIWYG editor in WP 3.2 plugin

text: I've created my own WP 3.2 plugin. Now I want to put the WYSIWYG editor in it. I've tried the following code:               <?php the_editor(null, 'body', null, false); ?>      Then it's displayed. I don't know why, but the CSS doesn't look as it should look. Am I missing something? Should I include any CSS file?! ![weird tinymce](http://i.stack.imgur.com/o9JIG.png) Please look at the HTML/Visual buttons and the size of the content area.


title: Excerpt formatting for Google News Feed

text: We're currently bringing in a Google RSS News Feed using FeedWordPress and it works great. This issue is that Google uses a defined table structure in their RSS. The excerpt function has no problem stripping all the tags but it leaves the excerpt cluttered with 3 unwanted snippets of text; Image Caption, Article Title and News Source. Here is an example; _msnbc.com1000-year-old hoard of gold coins dug up at Crusades sitemsnbc.comA 1000-year-old hoard of gold coins has been unearthed at a famous Crusader battleground where Christian and Muslim forces once fought for control of the Holy Land, Israeli arch…_ The offending snippets use the "a" and "b" tags. You can view it live at this link; http://www.orrvweb.com/?cat=123 Our site uses the Third-Style theme which is a variant of Twenty-Eleven. We've looked for suitable plugins and tried many of the excellent code samples available of this site thanks to Boutros, Alchymyth and others but we can't get the code to function. The smoothest thing we've found is the Advanced Excerpt plugin. It works flawlessly with our site but lacks the exact functionality. If we could modify it to strip out the tags and text it would be an ideal solution. Any input or ideas would be greatly appreciated.


title: An issue with register_sidebar and the admin interface

text:
Okay, I'm sure there is an simple explanation for this problem... it's just that I can't see it right now. Here is my code adding widget sidebars:               add_action('widgets_init', 'starter_register_sidebars');          function starter_register_sidebars() {          register_sidebar(array(         'id' => 'sidebar',         'name' => __('Sidebar'),         'description' => 'The first (primary) sidebar.',         'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
',         ));          register_sidebar(array(         'name' => __('Main Sidebar'),         'id' => 'sidebar-1',         'before_widget' => '',         'after_widget' => "",         'before_title' => '
',         'after_title' => '
',         ));          }      So when I go the admin widget area it tells me: 'Drag widgets from here to a sidebar on the right to activate them' But there is not sidebar on the right created by the above code... I've looked at a couple of other themes at what they do, and it's not obvious what they are doing differently from me


title: Dynamic settings fields with Settings API

text:
I am at my first Settings API application and I hit a snag. In a submenu page, I need to generate a number of fields (say color picker) for each of the values retrieved from another setting. To be more precise, I created in another menu page a list of category checkboxes:               function bcio_fp_special_cats_display(){     $options = (array)get_option('bcio_options');     $categories = bcio_get_categories();          echo '
';          foreach($categories as $category){         $selected = ( isset( $options['fp_sp_category_'.$category->cat_ID] ) ) ? $options['fp_sp_category_'.$category->cat_ID] : '';                  if($selected){               echo '
<input type="checkbox" value="'.$category->cat_ID.'" name="bcio_options[fp_sp_category_'.$category->cat_ID.']" checked/>'.$category->name.'
';              } else {             echo '
<input type="checkbox" value="'.$category->cat_ID.'" name="bcio_options[fp_sp_category_'.$category->cat_ID.']"/>'.$category->name.'
';                     }                 }          echo '
';}      In my second options page, I use the option values to generate the appropriate fields in another settings section:               function bcio_special_section_settings_display(){     echo "These settings fields are generated based on your selection of Special Front Page Categories";     $options = (array)get_option('bcio_options');     $categories = bcio_get_categories();          foreach($categories as $category){         $selected = ( isset( $options['fp_sp_category_'.$category->cat_ID] ) ) ? $options['fp_sp_category_'.$category->cat_ID] : '';             $cat_id = $category->cat_ID;             if($selected){           add_settings_field(              'bcio_special_cat_'.$category->cat_ID,                               'Special Section:
'.$category->name,                        'bcio_special_section_display("'.$cat_id.'")',                   'business-cover-special-sections',              'bcio_special_sections_options'                          );                   }                }}     //The field itself      function bcio_special_section_display($cat_id){                  $special_options = (array)get_option('bcio_special_options');             $color =  ( isset( $special_options['color'] ) ) ? $special_options['color'] : '';             echo '<input type="text" name="bcio_options[color]" value="' . $color . '" class="bc-color-field" >';            }      This successfully generates the appropriate number of fields, applies the name of the category in the field label, but when I try to use the callback it messes up as the parameter $cat_id I pass in the field callback doesn't quite work as I thought it would. > Warning: call_user_func() expects parameter 1 to be a valid callback, > function 'bcio_special_section_display("12285")' not found or invalid > function name in /nas/wp/www/cluster-2598/businesscover/wp- > admin/includes/template.php on line 1237 I tried poking it in a few ways, but no luck and I really need to figure out a way to store options in association with category IDs without hardcoding the IDs themselves. Getting this to work the right way with the Settings API or some non-plugin solution is paramount. I have a version based on ACF by Elliot Condon but would rather not make the theme dependent on a 3rd party plugin. The settings in these fields would define LESS vars, logos and so on for the site's special sections. Any hints in the right direction would be much appreciated.


title: get_permalink returns default link

text: I hope you can help me. So I'm using `/%postname%/` as permalink structure, and my htaccess looks like this:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /develop/sekai/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /develop/sekai/index.php [L]     </IfModule>          # END WordPress      Hovewer, `get_permalink` function returns me the default permalink structure (`?page_id=x`), while menus are fine with their links. What should I do? Thanks for all!! :D


title: Extract a link in the_content()

text: I'm trying to improve a bookmarks manager/theme I've built (http://bookmarkie.waterstreetgm.org). Right now, each post is simply a link: `<a href="http://tumblr.everlane.com/page/4">Everlane Tumblr</a>.` ie: that one single link is the entire content of `the_content()`. Easy enough and works great. Next, I want to be able to get a screenshot of the site via WordPress.com's mShots. Problem is, I can't seem to extract that link from `the_content()` and feed it into the `<img src="">`. If that wasn't clear, here's what I'm trying to do:               <img src="http://s.wordpress.com/mshots/v1/the-link-extracted-from-the_content()/?w=1024" />      I've tried severalvariations on this:               $content = get_the_content();     $link = preg_match_all('#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', $content, $match);      But I can't achieve the basic task of extracting that link from `the_content()`. At the moment, I simply get a formatted link output. I can't find a way to grab the url instead of grabbing the whole link. Thanks for any suggestions.


title: How to sort post listing on a page using custom field value?

text: I need help in sorting lists of posts inside a static page by a custom field value. I'm currently using the code below but it is not sorting correctly.               <?php                 $postslist = get_posts('numberposts=15&order=DESC&meta_key=sorting&orderby=meta_value_number&tag='. get_post_meta($post->ID, 'Tag', true));                 foreach ($postslist as $post) :                     setup_postdata($post);                 ?>      Any help would be appreciated.


title: wp_update_post is not updating category

text: I am using this custom function to add a publish/unpublish button to the front end of my site for the users:                   if ('draft' == get_post_status ($post_id)) {                 $post = get_post($post_id,ARRAY_A);                 $post['post_status'] ='publish';                 wp_insert_post($post);                 }                       else if ('publish' == get_post_status ($post_id)) {                 $post = get_post($post_id,ARRAY_A);                 $post['post_status'] ='draft';                  wp_update_post($post);                 }      But, for some reason, the category of the post is changing to the parent category of the post instead of sticking with the actual category of the post. For instance, I have 5 categories with 1 parent, like so:               ParentCat      - ChildCat1      - ChildCat2      - ChildCat3      - ChildCat4      - ChildCat5      Each post from the front end is entered into one of the five categories. When I click the "Publish" button that I've created, it changes the category to "ParentCat" instead of keeping it as the child category. Anyone know how I can fix this?


title: How to Expand and Collapse Profile Groups on BuddyPress Profie Page

text: Here is the scenario: I would like the default appearance on a BuddyPress profile page to have the profile fields collapsed and only the profile group names visible and look like: PROFILE GROUP 1 PROFILE GROUP 2 PROFILE GROUP 3 In order to see the profile fields, a user would have to click on a specific profile group. The group would expand revealing the profile fields. If, for example, a user clicked on PROFILE GROUP 2, the page would look like: PROFILE GROUP 1 PROFILE GROUP 2 -Profile Field A -Profile Field B PROFILE GROUP 3 The expanded profile group would collapse if the user clicked it again. Has this been done before? Is there an existing plugin to implement it? What code do I need? Please respond soon.


title: Creating a Custom Post Type for Inserting Preset Content into Post & Pages?

text: In response to Mike Schinkel's comment (see below) on my post about how to pre-populate content (essentially using a content template)... > @Scott B I mean why did you support a file on disk rather than an place in > the admin? For multiple, have you considering created a "Sales Letter" > custom post type? No, but it sounds like a better solution. How would you do it and where would you store the choices for the content? (I assume you might have a few different types of content templates to offer.)


title: Creating a searchable A-Z listing of hundreds of companies/services

text: I am about to create a webbased guide. A guide that will list numerous of companies - their services, contact information and so on. And I need help coding this! I am using Genesis News Child Theme and I want the following (have looked into Custom Post Types UI and taxonomies but need to develop this further!). It is all really quite straight forward - you are looking for a product/serviece, you need to be able to evaluate if you should contact this company, if yes, you want to know who to call, what they are offering you. This is the information that need sto be POSSIBLE but not mandatory necessary to add to each post:   1. Company name (which should be listed as an A-Z list of companies   2. Company logo (I am thinking in the sidebar area but not necessary) linked to URL   3. Company text description   4. Company contact details (here it should be possible to add several contact persons - if there is one KAM for public sector, one for Production industry and so on)   5. TAGS - for what they are offering - these (or made in another way) need to be searchable. Let’s say that a company is looking for providers that sell a certain product/service, in a specific market, for their particular industry. This is key - how to make key word searchable making it possible for users to search for a shortlist of about 10 perfect match companies among maybe houndreds!   6. Customer references (this could simply be links to PDF:s, but need to be shown visibly)   7. A list of features/functions that can be ”marked”/”unmarked” (these are commonly asked for features/functions) to help select a solution best suitable for the company searching for it   8. Recent posts - a company will be able to add an article to the forum, these should be able to track here.   9. A rating system! Functionality/Price/User friendlyness/Service level (in order to be able to rate each company there needs to be a control system - either emailing us, logging in as a member, being forced to add name and contact number (thus making it possible for us to remove false identities) I tried to upload images to help show ideas about what I mean but I didn't make it. I need the perfect code to do this! Who can help me? Thank you!


title: Direct access to site when log in

text: Is possible to have a direct access to the site when log in? I mean, when you log in, you access to the WP editor page. I want that user of my site will directly forwarded to the site.


title: Does the 'cat' argument in query_posts fetch posts from subcategories as well as the given ID?

text: Hello friends I am new to wordpress. I have used query like this query_posts('cat=1,2,3') now If category 1 is parent of 2 and 3. then query_posts('cat=1') and query_posts('cat=1,2,3') will get same posts or not? or how can I manage If I want to include posts form subcategories.


title: Adding dynamic content to end_lvl in Walker Class

text:
I'm trying to add unique content to the end of each dropdown (sub-menu). I've managed to edit the end_lvl function of the walker class to add the div to the end of each sub-menu, but now I'm lost on the next step: creating a conditional statement based on the parent-menu-id to echo different content. Any thoughts/suggestions? This is what I have (and I know its obviously not working because I'm trying to use the item array but with menu-parent-id). Clearly I don't quite understand this.               function start_lvl( &$output, $depth = 0, $args = array() ) {         $indent = str_repeat("\t", $depth);         $output .= "\n$indent
\n
";     }          function end_lvl( &$output, $depth = 0, $item, $args = array() ) {         $indent = str_repeat("\t", $depth);               if($item->menu-item-parent==37) {             $afterMenuContent = "Content";          }         $output .= "$indent
\n
" . $afterMenuContent . "
\n
";          }


title: Using require_once in a Plugin?

text: Whats the difference between these two code snippets, and which one should I use for a WordPress plugin?               require_once(dirname(__FILE__).'/inc/canagan_admin_functions.php');     require_once( '/inc/canagan_admin_functions.php' );      Thanks, Matt


title: draft_to_pending action doesn’t seem to fire

text: I have the action ‘draft_to_pending‘ set to fire on a custom post type. I assume that when the user clicks “Status » Edit” changes it to “Pending” and then clicks “Save Pending”, this action is suppose to fire, but it doesn’t seem to do so. Here is my code:               add_action('draft_to_pending','notify_email_rejected',99);          function notify_email_rejected($post){              $post_id = $post->ID;              $is_rejected = get_post_meta($post_id,'rejected_listing',true);              $owner_id = get_post_meta($post_id,'owner',true);         $owner = get_userdata($owner_id);              $to = $owner->user_email;              $headers = "From: HayForSale <admin@hayforsale.com>\r\n";         $headers .= "MIME-Version: 1.0\r\n";         $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";              $subject = 'Your listing was rejected at HayForSale.com';              $rejection = get_post_meta( $post_id, 'rejection_message', true );              $message = 'some html';              wp_mail($to, $subject, $message, $headers);     }


title: Where is the right place to store custom images?

text: I'm converting my old web project to WP and there are tons of book covers that aren't to be uploaded/managed by WP but by my own functions. Where is the right place to store such a kind of custom content? For sure it has to be a new folder but where? Maybe **wp-content/uploads/cover** or **wp- content/cover** ?


title: Present Color Schemes to Clients

text: i have created a theme that i would want to set as a demo for people to try. I would like to have a menu that has options where one can set a color or option to test it. Therefore, if somebody wants to check the blue scheme, they would click on "Colors->Blue" on the menu and the theme would turn to blue NOT GLOBALLY, but for the specific person, throughout the website. I suppose it's pretty obvious that sessions are needed for this one, as well as some handling of GET parameters with a script that sets the color option of the theme(or any other option). Since i am using the standard Wordpress API to set the theme options, i am wondering whether there is a way to hook an option. That is, instead of saving it to the dabatase, just pass it to the specific session, without having to change the code of my theme to adjust the option selection. Has anybody done it ? Is there anything that can help me with that or i just need to do it from scratch ? Thank you for your time !


title: Need help sorting "My Sites" Alphabetically

text: I have 40+ sites showing up in the "My Sites" page with more planned. Unfortunately WordPress doesn't sort them alphabetically, and that makes it a pain to move from site to site during routine updates and maintenance. I've tried adding               asort($blogs);      to wp-admin/my-sites.php, but that doesn't help either. And regardless, I'd rather do this using a filter in functions.php rather than modifying a core file. Making the issue even more complex is the fact that the list is split into four columns, and while a horizontal alphabetical ordering would be a huge improvement, vertical (by column) would be much, much better. I've been searching for answers for this for a while and coming up empty, so any help would be appreciated. (My PHP is pretty basic, so spelling out the answer would definitely be appreciated.)


title: Plugin Posts 2 Posts : problems with the 'position' field

text: I must be a bit slow, I still have problems with the position field in the Posts-2-Posts plugin. If I set a position to each connection in a given post (say 1, 2 and 3) I don't understand how to display these connections in this order. I thought this would do the job :               $xxx = new WP_Query( array(     'post_type' => 'author',         'p2p_orderby' => 'position',     'connected_order' => 'desc',     'connected_from' => get_the_ID()     ) );          It doesn't. The position field is just not taken into account at all, even if I remove the line « 'p2p_orderby' => 'position' ». What do I do wrong ?


title: Removing the default sidebar from admin panel

text: I would like to remove the default sidebar from my template, it is not needed and I do not want to confuse the user that will be using the admin panel. I have created my own sidebars that are a bit more descriptive to hold content throughout the site.


title: Translating a custom taxonomy

text: How do I go about translating custom taxonomy terms? I am essentially trying to allow authors to see the terms in English and let the subscribers see the terms in Spanish. I am not running a multilingual site in the sense that posts and such are translated, so plugins like qTranslate don't address my need. The closest thing I've seen is an old plugin called ZDMultilang which supports term translation (tags, categories and link categories). I've also found some solutions like this one - Change labels on 'Nickname' and 'Biographical Info' in user-edit.php:               add_filter( 'gettext', 'wpse6096_gettext', 10, 2 );     function wpse6096_gettext( $translation, $original )     {         if ( 'Nickname' == $original ) {             return 'Funny name';         }         if ( 'Biographical Info' == $original ) {             return 'Resume';         }         return $translation;     }      But a) it doesn't seem to be working on my site, and b) I'd need to add a conditional that checks the language the user has selected to view the site in (I suppose `get_bloginfo('language')`).


title: Taxonomy: Why 'with_front' => false DOES NOT WORK?

text: Seriously, why `'with_front' => false` does not work as it should be? It is supposed to remove TAXONOMY BASE NAME and my question is why it does not work? I just dont want the taxonamy base slug appear in my URL and codex says `'with_front' =>` false should help but it does not. Leaving the slug empty like `'slug'=> ''` generates 404 error.               register_taxonomy("tax_categories", array("products"), array(         "hierarchical" => true,         "label" => "Categories",         "singular_label" => "Category",         "show_ui" => true,         'update_count_callback' => '_update_post_term_count',         "rewrite" => array(                  'with_front' => false,                   'hierarchical' => true                   )         ));      This issue supposed to be fixed http://core.trac.wordpress.org/ticket/16807 Please help to understand that. Thank you.


title: Help me to understand wp_header() and wp_footer() functions

text: hi everyone please help me to understand the hook functions `wp_header()` and `wp_footer()` What does it mean hook functions and what to do


title: the_permalink() not working in a root installation

text: I hope someone can help me. I have a root installation of WP, but not as `index.php` (it's actually `news.php`). Consequently `the_permalink()` doesn't work, as the root of the website is a different page. Is there any way I can fix this? Perhaps something in the .htaccess that detects `?` in the URL and redirects to `news.php/?` etc. Thanks for any assistance, I'm a newb at WP!


title: Translate a string to a language with masculin/feminine nouns

text: So in english we don't have gendered nouns. It is always "a table" or "a desk" with no need to worry about it being "une table" or "un tableau" (french). So my question is that when working on the french .mo file, how does one translate a string such as : You can include a %s in a childtheme since the "a" depends on what the %s is?


title: Specific plugin for custom user information access?

text: I've been looking for a while now, but I couldn't find anything near to what I need. Maybe I'm not using the right keywords, that's why I'm asking it here. I need a plugin where the administrator is able to add custom information to users account. So when the specific user logs in he`ll be able to check the information. Let`s say for example, each user has a field called Project Status, the admin may set the value for this field to "Completed", "Incomplete", etc... I hope you guys may help me, and I appreciate any kind of help!!! Thanks


title: Collection of fields in a single post

text: It's possible to create custom post types and custom fields but, is it possible to create custom field collections? That is, groups of different fields as an entity (a dropdown, two images and a textfield)? https://drupal.org/project/field_collection In Drupal there's something like this: https://drupal.org/project/field_collection Screenshot: http://www.commonplaces.com/sites/commonplaces.com/files/images/blog/example- field-collection.png And I was wondering what's the closest thing in WP.


title: WordPress karma theme shortcodes not working

text: I have uploaded karma theme and, but due to some reason, images using timthumb are not displaying. My WordPress url is http://wordpressforpi.com/test/ in this page, second image does not shows up, if we try to see through firebug, image url for second image, it shows > http://wordpressforpi.com/wp- > content/themes/Karma/truethemes_framework/extended/timthumb/timthumb.php?src=http://wordpressforpi.com/wp- > content/uploads/2011/11/google-adwords-e1320816486813.jpg&h=145&w=275 I tried the same process on other server as well as on my local pc, works well. Can you please help me.


title: Show min and max taxonomy values

text: I'm trying to get the min and max values from a taxonomy, but my code is returning all taxonomies:               function get_years ($taxonomies, $args){     $hlterms = get_terms($taxonomies, $args);     foreach($hlterms as $term){         $term_taxonomy = $term->year;         $output .= $term->name;     } return $output;     }     $taxonomies = array ('year');     $args = array ('hide_empty'=>true);     $year = get_years($taxonomies, $args);     echo min(array($year));      What I'm doing wrong? Thanks! Daniel


title: Multisite for main in subdirectory, subdomain and subfolders (EN/ES)

text: I have a domain `<http://my-site.com>` and I want to restructure it, used to have a Drupal for the portal and numerous installations of WordPress in different subdomains. The hosting I have only allows me to access cpanel (limited) and ftp. What I want to do is a single installation of WordPress multisite for the main domain, subdomains and subsites, ie:               <http://my-site.com>       <http://blog1.my-site.com>       <http://blog2.my-site.com>       <http://blog2.my-site.com/blog3> or <http://blog3.blog2.my-site.com>     <http://blog2.my-site.com/blog4> or <http://blog4.blog2.my-site.com>      All these sites should be independent of each other (although they share the themes and plugins) What would be the easiest way to do this?   From what I've been looking on the internet, I found how to make the subdomains, but to make the installation of multisites only gives me the option of subfolders, which does not help. On the other hand, is it possible to do this without installing Wordpress on my root? It's simply for organizing files. That is:               <http://my-site.com> <- Access URL       </www/site/>         <- installation directory (/www is the root)      As it had before, in the root I had a `/www/index.html` what redirected to `/www/site/index.php`. Being this last the Drupal directory. This system doesn't help as it enters an infinite loop of redirects.


title: Organize uploaded media files

text: I have a blog with all media stored in a folder called **upload** (organize media was disabled), I've activate it to organize new uploads by date. **But how can i organize old files?** I want this because i need to migrate the site to a Wordpress MU site, and i need to have files organizated.


title: I need advice on how to structure the categories according to the layout i have

text: I'm seeking advice on how to structure the categories so it fits well my page structure: ![The page structure](http://i.stack.imgur.com/UWbw5.jpg) The main highlight is a single post and the secondary highlight boxes will probably contain a slides showing more than one post each, and the grid at the bottom will have four posts. I don't know how i can categorize that and still mantain a good category structure, or if using taxonomies is a choice or not. Or maybe tags... i'm kinda lost. If it counts, i'm extending the Starkers theme. Thank you. EDIT: For clarity's sake, here's the link to the html version: http://rgbinterativa.com/promundo


title: when does output of get_user_count turns into an array?

text: **question** WHEN does the integer output of get_user_count() turns into an array ? **background** The function get_user_count() in ms-functions.php returns an integer (it calls get_site_option('user_count') The function wp_version_check() in update.php stores this integer in $user_count on line 55 Directly after that on line 73 it calls this integer with $user_count['total_users'] **reason for asking** On my network admin pages I get the error: _`Warning: Illegal string offset 'total_users' in /opt/htdocs/html/wp- includes/update.php on line 75`_ So I need to understand where I need to look (probably something I did somewhere) see also: http://wordpress.org/support/topic/illegal-string-offset- total_users?replies=14#post-2893756


Can NextGEN Gallery be used to display a list of images passed to it? Is there another plugin that can do this? I'm somewhat new to WordPress. I've written some php code to display a set of images in a sidebar. (The set of images is stored in the meta for the single post shown on the page.) When the user clicks on any of the images in the sidebar, can I get NextGEN to display the images starting with the one clicked, just as if the user had clicked on an image in a gallery displayed by using [nggallery id=x]. Thanks. Mojo


title: Why does get_users suddenly return duplicates?

text: I'm having a hard time figuring this one out. I'm running a simple users query :               $args = array(         'role' => 'custom_role',         'orderby' => 'ID',         'order' => 'DESC',         'number' => 3     );     $users = get_users( $args );      And the resulting array has duplicate entries :               Array     (         [0] => stdClass Object             (                 [ID] => 11433                 [user_login] => peterpanpan                 [user_pass] => $P$B1SJOYhvsDRBGLU4hpr4zsdffJdDD.Y0                 [user_nicename] => peterpanpan                 [user_email] => **********@gmail.com                 [user_url] =>                  [user_registered] => 2011-11-29 14:20:46                 [user_activation_key] =>                  [user_status] => 0                 [display_name] => Peter Pan             )              [1] => stdClass Object             (                 [ID] => 11433                 [user_login] => peterpanpan                 [user_pass] => $P$B1SJOYhvsDRBGLU4hpr4zsdffJdDD.Y0                 [user_nicename] => peterpanpan                 [user_email] => **********@gmail.com                 [user_url] =>                  [user_registered] => 2011-11-29 14:20:46                 [user_activation_key] =>                  [user_status] => 0                 [display_name] => Peter Pan             )              [2] => stdClass Object             (                 [ID] => 10663                 [user_login] => dmartin                 [user_pass] => $P$BLFk4yteiCQnVbyXMbMy4jOpBbytw3/                 [user_nicename] => enfont                 [user_email] => **********@yahoo.fr                 [user_url] =>                  [user_registered] => 2011-11-09 14:03:49                 [user_activation_key] =>                  [user_status] => 0                 [display_name] => Deanmartin             )          )      In the example, $users[0] and $users[1] are exactly the same. In the database, there are no duplicates. This started to happen recently, and the only thing that has been added was the W3 Total Cache plugin (but why would it cause such a behavior?). I tried deactivating it, but the duplicates remain. Does anybody have a clue of what may be going on here ?


title: Load posts from external source if not found in database

text: I want to modify WordPress so that it requests content from a function if content is not found in the database. I want to edit the section of the code which requests and returns the post content from the database so that: if it does not find the content in the database, it calls and gets the content from my function, instead of returning null/not found. I am not sure where this section of the code is or how to go about changing it. I can write a set of functions which return the title/body/excerpt/tags/etc... when give the post id not found in the database. Please help me in finding who/where to make this edit.


title: Current class hook on generated list

text:
I want to style a current state with CSS to indicate the page currently being viewed, but List category posts doesn't generate a class hook. All it would need is something similar to the solution posted here. How or where would I modify the plugin or request that the feature to be added? Thanks. UPDATE: I'm using eStore 2.9 with a combination of List-Category-Posts and Dynamic Widgets. They all work as expected, but neither List-Category-Posts nor any similar plugin allows me to list posts in a category AND generate a .current class for me to style with. So I'm left with trying to hack (possibly) the plugin to give me current class hook. And no it's not a homebrewed sidebar. I'd rather the >Menu option in the CP worked its magic. To recap what I want to achieve: the list-category-post plugin generates a list of links for a given category, like so:
Category Name

Apples

Oranges

Pears

      I want a .current class attached to either the li or a tag of the currently viewed page in the said list:
Category Name

Apples

Oranges

Pears


title: which table updated after logout?

text: I am working on wordpress in which on clicking logout button user will be logout using `<?php wp_logout(); ?>` function when I followed some guidelines on wordpress site I came to know that it actually delete all cookies but what about session and in database which table is updated , actually i am using buddypress to see currently active users i got this code for destroying cookies.               function wp_clear_auth_cookie() {         do_action('clear_auth_cookie');              setcookie(AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);         setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, ADMIN_COOKIE_PATH, COOKIE_DOMAIN);         setcookie(AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);         setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN);         setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);         setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);              // Old cookies         setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);         setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);         setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);         setcookie(SECURE_AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);              // Even older cookies         setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);         setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN);         setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);         setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN);     }      please help, thanks


title: Social Sharing / tell a friend plug but specify which URL to share

text: while there are plenty of social sharing / email a friend type of plugins i am looking for one that will let me place it on only 1 page and most importantly allow me to specify which URL (not necessarily the URL of the page the form/buttons are on) I would like to recommend. to explain: the site i am working on is selling an online course. when purchased, the thank you page will have an option to tell your friends about the course. so i don't want to share this "thank you page" i would like the user to share the home/sales page. is there a plugin that does this or do i have to roll my own? and if the latter, where should i start?


title: Can't Install Standard Plugins on a Local MAMP installation

text: I've tried to install two standard plugsins (wp-touch was one). I have a local installation under OS 10.6 and MAMP which otherwise seems to work fine. I select the zip file but get the error message: The uploaded file could not be moved to /Applications/MAMP/htdocs/blog/wp-content/uploads/2012/06. The directory didn't exist, so I created it. I've also changed all the directories to read/write. I still get the same problem. I'm a unix virgin and new to macs, so please be gentle with me.


title: How can I let users open the site for other visitors?

text: I'm a bit new to wordpress and php and I'm trying to create a site where users have the possibility to change the appearance of the index page for other visitors. This could perhaps be done with back-end access to a maintenance plugin but I want it to be more simple than that for the user. Basically just log in and then push a button to open the site. What would be the best way to achieve this? * * * **[Update]** > `#` Plugin name 'Name' => 'Maintenance Mode',   >  `#` Author of the plugin 'Author' => 'Michael Wohrer',   >  `#` Authot URI 'AuthorURI' => 'http://sw-guide.de/',   >  `#` Plugin URI 'PluginURI' => 'http://sw- > guide.de/wordpress/plugins/maintenance-mode/',   >  `#` Support URI: E.g. WP or plugin forum, wordpress.org tags, etc. > 'SupportURI' => 'http://wordpress.org/tags/maintenance-mode',   >  `#` Name of the options for the options database table 'OptionName' => > 'plugin_maintenance-mode',


title: the_tags only showing when logged in?

text: I'm trying to figure out why the_tags(); when used in the loop are only showing when I'm logged in to the site. I've never come across an issue like this before when developing themes. my code is now on pastebin: http://pastebin.com/cSJy5kyH As I said, the tags appear when logged in but only then. Am I missing a permission or some setting that has appeared in WordPress 3.2.1?


title: How to display html in a shortcode

text:
How do you display or process HTML in a wrapped shortcode ? `[myshortcode]<div class="map"></div>[/myshortcode]` my shortcode code is               function myshortcode_sc($atts, $content = null) {     extract( shortcode_atts( array(         'col' => 'left',         ), $atts ) );          $output =  '
' . do_shortcode($content) . '
';            return $output;          }     add_shortcode("myshortcode", "myshortcode_sc");      is there another function at the return to allow for $output to process the HTML and not just display it as text ?


title: Adding code to the function file

text:
I would like to move my large php functions out of the index or template files and into the function.php file. Would it be something like this?               function grab_code(???) {         ??? .= '
some HTML-PHP code I monkeyed together
';           return ????;     }     add_filter('???', 'grab_code');       Then in the template files i would add?               echo grab_code(???);      I found answers here that look close to what I am asking but the seem specific to a function.   Thanks.


title: Post submit using shortcode and init

text: I'm trying to find the best way to return errors to a page once a form submitted by using a shortcode. I'm adding a function to `init` such as -               add_action( 'init', 'contact_form_process_post' );          function contact_form_process_post() {         if( isset( $_POST['unique_hidden_field'] ) ) {             // process $_POST data here                  $errors = new WP_Error();                  if( empty( $_POST['full_name'] ) ) {                 $errors->add( 'invalid', __( 'Full name cannot be empty' ) );             }                  if( count( $errors->get_error_messages() ) == 0 ) {                 wp_redirect( 'some_url ');                 exit();             } else {                 // Return errors here             }         }     }      This works fine if there's no errors (i.e all fields are valid), but if some fields are empty it should return to the form with those errors. If they are valid it re-directs to a confirmation page. The problem is returning the errors from `init` to the content/shortcode. I can do it the following ways -   1. Redirect back to the page setting the errors in the URL (query vars)   2. Globalize a variable for the errors and use this in the shortcode   3. Filter `the_content` and add the errors   4. Store the errors in a session I'd rather the URL stays the same, so option one is out. Option two works but it feels slightly "dirty", along with option 3 which isn't great. Option 4 could work, though WordPress doesn't use sessions. This will be used for along with JS validation (or when JS is disabled). Maybe I'm missing an obvious way to do this? Any suggestions? Thanks!


title: Get first_name on hook user_register

text: I have created a plugin for saving user info. I have used a action hook `user_register`, but I don’t get the values of `first_name` and `last_name`. What wrong in my code?               add_action('user_register','user_sf_lead');     function user_sf_lead($user_id){          $user_info = get_userdata($user_id);            $fields = array (         'Name' => $user_info->ID,         'First_Name__c' => $user_info->first_name,         'Email__c' => $user_info->user_email,         'Last_Name__c' => $user_info->last_name,         'User_Name__c' => $user_info->user_login,       );          ......     }      I tried all possible method used to get user info. The value is always blank.


title: Add images functionality not working as wanted

text:
![structure admin panel](http://i.stack.imgur.com/NPg8t.png) I achieved this structure in wordpress admin panel. I am using wordpress option api to save and retrieve data from option.php . All I want to do is on every click of add more image button one more browse image should appear so that I can upload as many images as I wanted and then all these images path should be stored in array in option.php after clicking save changes. (banner heading is working properly I am able to upload 1 image and retrieve it but I want to do it for multiple images). Any suggestions to make this work here is my code               add_action('admin_menu','register_menu');           function register_menu()      {          add_options_page('slider setting', 'slider settings', 'manage_options', __FILE__, 'build_options_page');      }           function build_options_page()       {?>

My Theme Options

Take control of your theme, by overriding the default settings with your own specific preferences.
                      <form method="post" action="options.php" enctype="multipart/form-data">                        <?php settings_fields('plugin_options'); ?>                        <?php do_settings_sections(__FILE__); ?>
                      <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
</form>
<?php      }      add_action('admin_init', 'register_and_build_fields');      function register_and_build_fields()       {             register_setting('plugin_options', 'plugin_options', 'validate_setting');             add_settings_section('main_section', 'Main Settings', 'section_cb', __FILE__);             add_settings_field('banner_heading', 'Banner Heading:', 'banner_heading_setting', __FILE__, 'main_section');             add_settings_field('logo[]', 'Logo:', 'logo_setting', __FILE__, 'main_section'); // LOGO             add_settings_field('add_image', 'add image :', 'add_images', __FILE__, 'main_section'); // LOGO      }      function validate_setting($plugin_options)       {           $keys = array_keys($_FILES);            $i = 0;             foreach ( $_FILES as $image )             {   // if a files was upload               if ($image['size'])             {     // if it is an image                 if ( preg_match('/(jpg|jpeg|png|gif)$/', $image['type']) )              {                     $override = array('test_form' => false);            // save the file, and store an array, containing its location in $file             $file = wp_handle_upload( $image, $override );            $plugin_options[$keys[$i]] = $file['url'];                 } else {       // Not an image.                        $options = get_option('plugin_options');                        $plugin_options[$keys[$i]] = $options[$logo];       // Die and let the user know that they made a mistake.                              wp_die('No image was uploaded.');     }                   }   // Else, the user didn't upload a file.   // Retain the image that's already on file.                     else {     $options = get_option('plugin_options');                        $plugin_options[$keys[$i]] = $options[$keys[$i]];                      }                       $i++;             }             return $plugin_options;      }      function section_cb()       {           }           // Banner Heading      function banner_heading_setting()       {            $options = get_option('plugin_options');            echo "<input name='plugin_options[banner_heading]' type='text' value='{$options['banner_heading']}' />";      }      global $multi_file_upload;      function add_images()      {          $add_more="add more images";          echo $add_more;      }      function logo_setting()      {          $multi_file_upload.= '<input type="file" name="logo" />';          echo "$multi_file_upload";      }


title: Limit posts displayed to 2 specific posts

text: I'm using the Twenty Twelve theme. I have created a basic page. What I want to do is keep 2 only posts (that I select) on the page at all times. In looking at the code I think this is the section that needs edited:                       <?php /* Start the Loop */ ?>             <?php while ( have_posts() ) : the_post(); ?>                 <?php get_template_part( 'content', get_post_format() ); ?>             <?php endwhile; ?>                  <?php twentytwelve_content_nav( 'nav-below' ); ?>              <?php else : ?>      How can I change this code to limit only 2 posts that I choose?


title: Is there anyway to rewrite woocommerce-template.php?

text: I am trying to do some customizations on the woocommerce-template.php file but I fear it will be overwrite on the next update. I wonder if there is a way to rewrite a function from functions.php with another one loading my custom file. This is the function present within woocommerce:               public function include_template_functions() {         include_once( 'woocommerce-template.php' );     }      I wonder if there is a way to overwrite it or anyother way to do so.


title: Add next and previous post links on pages like category, tags or archive pages

text:
I am trying to find a solution for getting next pages for category or tag page in WordPress, tried with `next_posts_link` and `previous_posts_link` in these pages, but it's not working. Same functions are working on post listing page for me Below is my code
                         <?php next_posts_link( 'Next Entries',3); ?>               <?php previous_posts_link( 'previous Entries'); ?>

                     <?php                       if(have_posts()) :                 $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;                  $args = array( 'post_type' => 'post', 'posts_per_page' => 3, 'paged' => $paged );                  $loop = new WP_Query( $args );                  $i = '1';                       while ( $loop->have_posts() ) : $loop->the_post();  ?>                       <?php if($i=='1' || $i%3 =='1') { echo '
';}  else { echo '
';} ?>
<?php the_time('M');  ?><?php the_time('j'); ?>

 <?php  $url = get_the_post_thumbnail($post_id, 'blog_thumb');                    echo $url; ?>

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

<?php the_excerpt(); ?><a href="<?php the_permalink(); ?>">[...]

                                     <?php $categories = get_the_category();                                      foreach($categories as $category) {                                         echo 'term_id ).'" class="button" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'';                                         }?>

                 <?php                  $i++;                  endwhile;                  else:                     get_template_part( 'content', 'none' );                          endif;                      wp_reset_postdata();           ?>


title: Secure Validation of wp_editor in Theme Options

text: So I just found this great WPSE thread about security for themes/plugins. It answered most of my questions but it was created before the new `wp_editor()` function was built. I have two TinyMCE editors on my Theme Options and I'm wondering whether I need to use `esc_html()` or `esc_textarea()` in a validation callback before saving the theme option. It seems to me that TinyMCE takes care of a lot of that stuff (as well as the Settings API security that's taken care of), but there's still not a lot of documentation out there about `wp_editor()`. Any resources and answers appreciated.


title: Will it break my site if I delete all transient records in wp_options table?

text: My site currently has an outrageous 500k+ transient records in the wp_options table. This causes the table to be crashed frequently and so be my site. I thought transient records will all expired after some time. I'm not sure which plugins are responsible and what went wrong yet. However, I don't want my site to crash frequently like this. The number of records in `wp_options` table has grossly increased to 200k+ a few weeks ago and now 500k+. Should I only delete the `%transient_timeout%` records - 200k+ of them at the moment? Any help would be greatly appreciated. **Updates on 16th July 2012** I actually took risk (I backed up my site first) by deleting all the transient records and my site's database hasnt' crashed ever since :) Thanks again, everyone!


title: Does WP always makes 301 redirection?

text: We rented a SEO specialist for our site, and he says that we have to do some changes in site structure before he starts his work. The first is, that now most pages have 301 redirection. For example:   * `mysite.com/2010/12/02/postname/?p=5500` is redirected to `mysite.com/2010/12/02/postname/`   * some posts are redirected from `mysite.com/2010/12/02/postname/?=12786` to `mysite.com/2010/12/02/another-postname/`   * some posts have redirection from `www.mysite.com/2010/12/02/postname/Mysite/?p=32123` to `www.mysite.com/2010/12/02/another-postname` I would like to know:   1. Why does it happen?   2. Is it a normal WP behavior?   3. How can I change it?   4. Is it really important to avoid this for good SEO?


title: Extend WordPress search to include user search

text: There is many a WordPress plugin out there that enhances WordPress search but I have yet to find a plugin that will add user search. Search Everything used to have the functionality but was removed when WP moved to version 2.8. I suspect this was due to the way WP changed how authors were stored. The reason why I'm after user search is because all users on the WP site are staff members with their own profile. We have an author page that lists all staff by surname that is separated by 20 members per page. If you only know the first name of a member of staff then trying to find that member is very hard. I want to extend WP search so you can simply enter a name and the corresponding member shows up. This site is an intranet so using an external search engine is out of the question. Just want to be clear that I'm wanting to search for users not search for posts by author. How can I get staff member search added?


title: Unix timestamp for post comment

text: Is there any function/code snippet to retrieve the unix time stamp of the comment on a post? The WordPress default function `comment_time();` returns the time of the post in 12hr format (not helpful).


title: Issue with front page navigation after upgrading to 3.4

text: I upgraded to WordPress 3.4 and am having an issues with showing a different amount of post on the first page versus the rest. The first page is still showing 5 posts but when I go to /page/2/ I'm getting a 404 error. I have pagination on the custom post type pages and author pages and it works just fine. This is only happening on the front page with the combination of all post types together. Here is my code that may help:               // For adding custom post types to the feed     if ( ( is_front_page() && false == $query->query_vars['suppress_filters'] ) || is_feed() ){             $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             query_posts( array('post_type'=>array('post', 'gaming', 'entertainment', 'tech', 'breakroom', 'podcasts', 'off-grid'),'paged'=>$paged ) );         }          // different amount of post on front page then other pages                 $temp = $wp_query;                 $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                 $wp_query = null;                 $wp_query = new WP_Query();                 $wp_query->query(array(                   'post_type' => array('post', 'gaming', 'entertainment', 'tech', 'breakroom', 'podcasts', 'off-grid'),                   'post_status' => 'publish',                   'paged' => $paged,                   'posts_per_page' => 10,                   'caller_get_posts'=> 1.                 ));                      $max_first_page = 5;  // Show this many posts on front page                 $args = $wp_query->query;                 $posts_per_page = get_query_var('posts_per_page');                 $posts_to_skip = $posts_per_page - $max_first_page;                 if ($paged == 1) {                    $max_posts = $max_first_page;              $firstPageCheck = "yes";             } else {                    $max_posts = $posts_per_page;                    $args['offset'] = (($paged - 1) * $max_posts)- $posts_to_skip;              $firstPageCheck = "no";                 }                 query_posts($args);                 if ($wp_query->max_num_pages < ceil(($wp_query->found_posts + $posts_to_skip)/$posts_per_page))                   ++$wp_query->max_num_pages;                 $counter = 0;                      if ($firstPageCheck == "yes") {                   // front page here                 } else {                   // all other pages                 }


title: Possible to add another setting to 'Front page displays' setting for Custom Post Type

text: Let me set the scene: I have a CPT that will work on a multi-site installation and some of the sites will be in a different language. For example my CPT is `Case Studies` I would use a URL structure like: `/case-studies/%post_id%/%postname%/` but if the site language is different then `case-studies` is no longer that. In WP settings you can set a page as your posts page. This essentially sets the `front` to your permalink structure. What I want to do is add an extra drop down for my CPT that allows to set the front page for the posts of that CPT. Thus if the language is different then the permalink structure can match that language. ![Add setting here](http://i.stack.imgur.com/csDJb.png) So is it possible to extend the settings using the Settings API in the location shown in the above image? If yes then how would I do that? If no then where would be a suitable place to place my CPT setting? (Bonus points if you can provide some code samples)


title: Formatting of curly brackets array from WP database to get more readable output

text: E.g. when I want to edit something in my WP database, I get a headache, literally. Because I see something like this:                a:92:{s:47:"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$";s:52:"index.php?category_name=$matches[1]&feed=$matches[2]";s:42:"category/(.+?)/(feed|rdf|rss|rss2|atom)/?$";s:52:"index.php?category_name=$matches[1]&feed=$matches[2]";s:35:"category/(.+?)/page/?([0-9]{1,})/?$";s:53:"index.php?category_name=$matches[1]&paged=$matches[2]";s:17:"category/(.+?)/?$";s:35:"index.php?category_name=$matches[1]";s:44:"tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$";s:42:"index.php?ta-9]{1,})/?$";s:50:"index.php?attachment=$matches[1]&cpage=$matches[2]";}      I guess it's some kind of array, but my text editor cannot format that to something like this:               Array     (         [a] => apple         [b] => banana         [c] => Array             (                 [0] => x                 [1] => y                 [2] => z             )     )      how can this be done with the stored data in PW database? Is there some online tool for that or maybe some plugin for Sublime Text 2 or N++?


title: Decontruct serialized data array from wp_options

text: I'm trying to decontruct (and recreate) a serialized option value in wp_options called 'my_options' How would I build the array to recreate this option_value that currently exists for 'my_options'? update_option('my_options', ?) After the update, the wp-options table would hold this value for 'my_options':               a:3:{s:12:"my_widget-1";a:2:{ etc...


title: Client is using Softaculous to upgrade WordPress versions. How do I upgrade from the WordPress dashboard?

text: My client is using Softaculous for software upgrading. I tried upgrading from the WordPress dashboard and it wouldn't let me. Do I have to somehow "uninstall" Softaculous for this to work?


title: How to configure WordPress to handle 75,000 pages?

text: I have a large site that's using WordPress. We have 75,000 pages in the site so far, and it's performing well on the front-end. The issue is that if anyone on our team touches the page editor (wp- admin/edit.php?post_type=page), Apache eats up all the memory on the server. I've tried disabling all plugins, but that didn't work. I also tried debugging on our live server which a 4GB box... it still eats up all the memory and comes to a hault. On this install, we also have 20,000 posts. There's no issue loading those in wp-admin. Maybe we should move all pages to posts - that's going to cause an issue with permalink structure, though. Are there special settings or configurations I'm missing for a large WP site?


title: Filter "Your latest posts"

text: On the Reading Settings page I have clicked **_Your latest posts_** under **_Front page displays_**. I am wondering how I can filter the query that displays these posts before it gets to the loop. I have tried to use the **pre_get_posts** filter but that does not seem to have access to this query. Is there anyway to modify the posts being displayed on the front/home page by editing functions.php and not messing around with template files?


title: Get Page ID from Backend

text: How can i get a page ID from the Admin backend? I'm saving data into a metabox on a 'Page' post type, and I need to return that data on the page in another area. But $post->ID obviously dose not work... What will work? Thanks


title: Non-admin "revisions" to page affecting code on page

text: This is a bit of a strange problem. We have a membership site, and I noticed some of the inline:block images were getting messed up on some of the pages. Upon looking into the problem, I noticed in the revisions section of each page that users were somehow inadvertently revising the pages. The only difference between the original and the new page would be that each inline block tag was removed from divs, messing up our layout. Obviously users are not hacking in and removing tags from our layout, so it must be happening by accident. Any ideas? It seems to be random.


title: Is there a shortcut to change bulk BMP images to JPG images in a site?

text: Images in WordPress posts, as I understand, are uploaded manually. They are uploaded by default to `uploads` folder. A client of mine reported that, in one of his site, he uploaded all the images in BMP format. Now he realized the consequences of his mistake. He wants to make them JPG now. And there are 40-60 images there. With a photo editor I can change the images in uploads folder from BMP to JPG. But the problem is the database. I've seen that in `_postmeta` table images are stored with the **meta_key** `_wp_attached_file` with **meta_value** like `2011/01/canola2.jpg`. And the same image is also in `_posts` table with a detailed path as **guid** , **post_type** `attachment` and **post_mime_type** `image/jpeg`. So may be a similar things happen to the BMP images as well. So, along with the image file format changes in `uploads` folder how can I bulk edit the db to make them available only with a minor change in their format in database? Any SQL query? Or, do I have to do the big change manually, one by one?


title: home.php not loading

text: I have an issue where home.php won't load, so wordpress insists of using index.php to display blog posts. I created home.php by copying the entire content of index.php into home.php. Is there a way to force wordpress to load a specific template or what is the process involved in solving such a situation? (I use the roots.io theme if it makes any difference.)


title: How to change the markup created by menu item only on chosen items?

text: How to add a checkbox to the menu item in WordPress backend that says "Make this a Mega Menu Container"? In my mind it should look something like this (Photoshop draft): ![enter image description here](http://i.stack.imgur.com/V3A2t.png) And when the box is checked instead of adding another standard ul > li DOM element a div container is added instead? I have no idea how to approach this. I was planning to use walker to change the DOM for the menu, but how to "activate" the walker only for some menus - in this case the menus that I choose by that checkbox to be the mega menu?


title: PHP Code to Display Term URL & Name of a Post Under a Custom Post Type

text:
I am featuring a post in my footer(outside the loop) from a custom post type and am using Advanced Custom Fields plugin to do so. This is the code I am using:
Featured Movie
     <?php query_posts(array(     'posts_per_page' => 1,     'post_type' => 'movies',     'orderby' => 'post_date',     'meta_key' => 'featured_movie',     'meta_compare' => '=',     'meta_value' => 1,     'paged' => $paged     )     ); ?>     <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<?php the_post_thumbnail('full-thumbnail');?>

     "<?php the_content(); ?>"
     <?php endwhile; ?>     <?php wp_reset_query(); ?>      While that does exactly what I need it to, I also need some code in there that displays & links to the term(s) that are associated with whatever post being featured at the moment. However the code I have asks me to specify a taxonomy and I dont think that's the way to go as it's too limiting & I want to be able to pull from every post in the `movies` custom post type regardless of what taxonomies and terms they have. The code I have right now is               <?php   // Get terms for post      $terms = get_the_terms( $post->ID , 'genre' );      // Loop over each item since it's an array      if ( $terms != null ){      foreach( $terms as $term ) {     $term_link = get_term_link( $term, 'genre' );      // Print the name method from $term which is an OBJECT     echo '
' . $term->name . '
';      // Get rid of the other data stored in the object, since it's not needed      unset($term);     } } ?>      As you can see I had to specify `genre` as the taxonomy for the sake of having it show up on my site & for the sake of this example but I dont want to specify a taxonomy bc doing so leaves out every other taxonomy I have like `ratings` or `release date`. Sure I could put every single one of my taxonomies into the code to make sure they're all included but there has to be an easier way. Further, how do I make sure that every term associated with the post is displayed.