title: Can I add a blog subfolder to my website and use a different theme

text: I asked this question over at WebMasters, and was directed to this stack exchange, I might add I had no idea this even existed! I was wondering if I am able to create a new subfolder named blog on my site, and use a different theme on the blog than my site.


title: Screenshot are not showing up on plugin page

text: I know its quite common now, But I cant find out where I am doing wrong. I have screenshot placed at the right place (both trunk and tag/1.0 ) and used the same tag i.e 1.0 in readmen.txt but still they are not showing up on plugin's screenshots tab. Read me file http://plugins.svn.wordpress.org/nextgen-3d-flux-slider- template/tags/1.0/readme.txt Plugin page. http://wordpress.org/extend/plugins/nextgen-3d-flux-slider- template/screenshots Can anyone notice a problem somewhere?


title: WordPress Backup

text: I'm learning how to backup right now and I'd like some validation. From what I understood, to fully backup my Wordpress I need two things. One backup for my database and another for theme files. The database contains all my blog posts and uploads. Theme files include plugins and theme settings. Which means if I update my plugins or restore those files my configurations will stay. So yeah, my question is simply: is this correct?


title: remove other tabs in new wordpress media gallery

text: I recently updated my WordPress site into the latest WordPress version, and i added a code to my `functions.php` that would add a capability to subscriber to upload using WordPress media upload. I successfully remove the media library tabs on the later version of WordPress but when I updated the version it seems like the code does not work anymore. Any ideas how to fix this? This is the previous code which I googled before:               function remove_medialibrary_tab($tabs){       if ( !current_user_can( 'administrator' ) || !current_user_can( 'editor' ) || !current_user_can( 'contibutor' ) || !current_user_can( 'author' ) ) {         unset($tabs['library']);         return $tabs;       } else {         return $tabs;       }     }     add_filter('media_upload_tabs','remove_medialibrary_tab');          if ( !current_user_can('upload_files') ){         add_action('init', 'allow_user_to_upload');     }          function allow_user_to_upload() {         $subscriber = get_role('subscriber');         $subscriber->add_cap('upload_files');     }


title: Does page.php need the loop?

text: Simple question. Does page.php need the loop? The Loop 'loops' through several pages/posts/content. However the page.php template only has 1 page. There's nothing to loop through. I noticed that simple functions such as the_title() and the_content() work outside the loop inside page.php. So... Does page.php need the loop? If so, why?


title: order by meta_value serialized array

text: Hi I'm trying to pull posts using the wp query. Just one problem--I am trying to sort the posts alphabetically by a certain meta_value. Thing is that this meta_value is a serialized array. Is there an easy way to do this without having to unserialize it? Thanks!               a:1:{i:0;a:1:{s:7:"people";s:16:"Tanya Garca";}}      Btw, I cannot change the way the meta_value is being saved because I am using this plugin which automatically saves it serialized.


title: include w_thumbnail_src in function?

text: I got a function that automatically creates a custom field in the post. I have this located in my functions.php. `Image` is the name of the custom field and `HERE` is the value. How can I put the function `w_thumbnail_src` as the variable?               add_action('wp_insert_post', 'mk_set_default_custom_fields');         function mk_set_default_custom_fields($post_id)              {             if ( $_GET['post_type'] != 'post' ) {                 add_post_meta($post_id, 'Image','HERE', true);             }             return true;         }      And let me add that `w_thumbnail_src` is a function in the same file that looks like this               function w_thumbnail_src() {         if (has_post_thumbnail()) {             $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'emphasis');            echo $thumb[0]; // thumbnail url         }     }      EDIT : Here is the final code that adds the thumbnail url to a custom field named Image.               function w_thumbnail_src() {         if (has_post_thumbnail()) {             $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'emphasis');             return $thumb[0]; // thumbnail url         } else {             return '';  // or a default thumbnail url         }     }               add_action('publish_page', 'add_custom_field_automatically', 'w_thumbnail_src');     add_action('publish_post', 'add_custom_field_automatically');     function add_custom_field_automatically($post_id) {     global $wpdb;     if(!wp_is_post_revision($post_id)) {     add_post_meta($post_id, 'Image', w_thumbnail_src(), true);     }     }


title: How to get popular post from across a network?

text: I have a multisite network on WP 3.3.1. I now need to get all popular posts from across this network (preferably based on the amount of views). Is this possible, and how do I do that?


title: Moving online website to MAMP or dumb idea?

text: I was thinking of doing some major design (incl child theme and plugin stuff) on an existing site which is rather large. I'm thinking it would be good to do my trial and errors offline and having a MAC thought that it would be good to do this with MAMP. For those from WordCamp, I'm a designer with developer aspirations having only minimal programing experience but want to learn and try some of the cool stuff I learned from WC ATL. Is this a good idea? If so, how do I get my DB files into MAMP? TIA for your time and help. Cindy


title: Insert custom ID into wp_get_attachment_link

text: I'm working on this function of WordPress.               function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) {         $id = intval( $id );         $_post = get_post( $id );              if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )             return __( 'Missing Attachment' );              if ( $permalink )             $url = get_attachment_link( $_post->ID );              $post_title = esc_attr( $_post->post_title );              if ( $text )             $link_text = $text;         elseif ( $size && 'none' != $size )             $link_text = wp_get_attachment_image( $id, $size, $icon );         else             $link_text = '';              if ( trim( $link_text ) == '' )             $link_text = $_post->post_title;              return apply_filters( 'wp_get_attachment_link', "$link_text", $id, $size, $permalink, $icon, $text );     }      And I want to modify this line:               return apply_filters( 'wp_get_attachment_link', "$link_text", $id, $size, $permalink, $icon, $text );      I want that link can output like this:               $link_text      Because, default it print out like this:                     I want it print out like this:                     My wished attachment ID could be the same with 'post-title-example'. I have tried many ways and searched Google a lot. But it doesn't work. Can you help me? Thank you.


title: How to control WordPress Search Behavior?

text: I'm developing a website using WordPress and I need to make a totally customized theme. Everything seem to work well until I found something wrong at search result which doesn't match with customer requirements. I have no experience with PHP and WordPress. So let me ask two questions.   1. How can I validate the WordPress Search Box when **users do not enter any words and make search**? I don't want any searching process at above case.   2. How can I **exclude Home Page from any search results**? Thanks in advance!


title: Action hook 'wp' firing twice... why?

text: I noticed that when I hook into 'wp' it seems to be firing twice -- for example               add_action('wp', 'just_testing');     function just_testing(){         global $post;         error_log($post->ID);     }      returns into my error_log the following two entries:               [01-Feb-2013 13:06:58 UTC] 1120     [01-Feb-2013 13:06:58 UTC]       I searched google and stackexchange and the thread "What would cause the 'wp' action to fire twice per page (but only once per post) in Firefox only?" does not apply because I am getting the two firings in all browsers. Thanks for any help!


title: Roll my own theme or customize an existing one

text: I just want to know whether I should roll my own theme from scratch or I should customize an existing one like twenty twelve. Reason I ask is I wanted to know whether there are any best practises I may be missing if may be missing from these themes ir I roll my own. Also I find that there is a lot of bloat even for a theme as simple as twenty twelve and hence ind myself removing a lot of it as I'm building my theme. The site I am currently building is www.laminsanneh.com Thanks in nadvance


title: Is it possible to get all term items from a custom taxonomy regardless of post attachment status?

text: Essentially, I build web sites with galleries, for photographers. Up until now, gallery images have all been attached to posts and I've just pulled from the category taxonomy. This is messy if it's also to be used as a regular blog. So I've been poking around and I discovered things like if an attachment item isn't assigned to a post, it has a `parent_post ID` of **0**. If I could, how would I go about simply getting all items with a term in my custom taxonomy, ignoring their `parent_post IDs`? I'm getting the feeling Wordpress just isn't quite there yet, for what I would like to do...


title: Add separator to admin submenu

text: I would like to add a **separator** to the **admin submenu** section, **NOT in the top level section**. ![enter image description here](http://i.stack.imgur.com/0OL8S.jpg) I'm thinking of using javascript and styling to do the job, but I was wondering if there's a more straightforward method such as that when adding a separator to the top level menu section. I'm still experimenting on this. I will provide my method once I get it working. [UPDATED]


title: Wordpress Super Admin

text: I'm trying to block any admin of a Wordpress install from being able to modify certain pages, the sort of stuff detailed here: http://wackao.com/be-a- wordpress-super-administrator/ . Is this even possible? Thank you. I would like to do this by modifying the core word press files.


title: What does multi-site WordPress application mean?

text: I have a WordPress application. I have been added as administrator in that blog application. I haven't access on the application server. After login to admin section, I am not able to see any post or page? But, on the homepage ( **blogs.xyz.com** ), I can see that there are multiple links like   * blogs.xyz.com/hospitality    * blogs.xyz.com/healthcare   * blogs.xyz.com/insurance I am very new in WordPress and don't know about this behavior of WordPress.   * How can I get access on all these sites?   * Has Multiple been installed for all these sites or a single WordPress is enough for this?   * Why should we do this?


title: How to search my posts based on tags or keywords?

text: I am developing one wp site, in which I have to insert some tags and keywords and tags to my posts. I want those posts get filtered based on the keywords, for e.g. when I click on the link [Fresher Jobs], it should give me the posts that contain [Fresher Jobs] as a keyword.


title: Adding Action Hooks In Parent Theme For Easier Child Theme Customization

text: I was wondering why isn't anyone (haven't be able to find one with it) adding custom hooks an the beginning and at the end of the theme's `function.php` for theme development. The reason I'm asking this is while making a child theme, I had to overwrite some default setups like image sizes set in the parent theme's main `function.php` (no `!function_exists` to overwrite on). So anything I write in my child's `function.php`will be overwritten. Aside from of course adding the `function_exists` wrapper, the solution I had in mind was just adding a `do_action()` at the beginning and at the end of the function.php. But is this a bad practice? If so, why? I am unable to find any answers or anyone asking this anywhere.


title: Learning rewrite rules and custom permalinks. Paging not working

text: I am just starting to learn rewrite rules and custom wordpress permalinks. I have made a custom endpoint called autor with the following code:               function my_query_vars($vars) {       $vars[] = "autor";       return $vars;     }     add_filter('query_vars', 'my_query_vars');     function my_rewrite_endpoint(){       // Use EP_PERMALINK | EP_PAGES for pages and posts both       add_rewrite_endpoint( 'autor', EP_PERMALINK | EP_PAGES );          global $wp_rewrite;     }     add_filter('init','my_rewrite_endpoint');      I am using this custom page for displaying some information about the author in a custom page template a made. So now, I am trying to accomplish the following: ## First, Everything works for the first page; however, when I go to the second page, I get an error: `Notice: Trying to get property of non-object in --source-- on line 16` On that line I have:               $user_id = get_user_by('login',get_query_var('autor'));     $user_id = $user_id->ID;      This is how my first and second page links look like: `http://mysite.com/custom_page/autor/author_login` -WORKS `http://mysite.com/custom_page/autor/author_login/page/2` -BROKEN   * **custom_page** is a page for displaying info about the author   * **autor** is a custom endpoint   * **author_login** is the nickname for the user: ## Second, How can I use the default author tag used by wordpress? So my custom permalink looks like this: `http://mysite.com/custom_page/author/author_login` `http://mysite.com/custom_page/author/author_login/page/2` ## And third, How can I change that permalink structure to the following: (while using the default author tag) `http://mysite.com/author/author_login/custom_page` `http://mysite.com/author/author_login/custom_page/page/2` Or better yet like this: `http://mysite.com/author_login/custom_page` `http://mysite.com/author_login/custom_page/page/2` I hope I am making myself clear enough, if not, let me know and I will try to elaborate some more my question.


title: Custom post type support for get_users('orderby=post_count');

text:
The default WordPress function `get_users('orderby=post_count');` only orders users with the count of the _posts_ they've made. Any idea how to modify this to support custom post types as well? **UPDATE:** I only want to query posts of type "company-item". Currently, this snippet is in my functions.php:                function user_query_count_post_type($args) {        $args->query_from = str_replace("post_type = post AND", "post_type IN ('company-item') AND ", $args->query_from);       }      And this is in my page template:
       <?php       add_action('pre_user_query','user_query_count_post_type');       $showrooms = get_users('orderby=post_count&role=company&order=desc');       remove_action('pre_user_query','user_query_count_post_type');            foreach ($showrooms as $showroom) : ?>
             <a href="<?php echo get_author_posts_url( $showroom->id ); ?>" ><img src="<?php echo $showroom->company_logo; ?>" title="<?php echo $showroom->company_name; ?>" />
            <?php endforeach; ?>


title: TGM-Plugin-Activation does not work

text: When I try to install **a lot of** plugins using TGM-Plugin-Activation I got an ocurrent error: > An error occurred while installing : Download failed. A valid URL was not > provided.. and in the end > All installations have been completed. > > All plugins installed and activated successfully Despite these messages, none of the plugins is installed.


title: Add an attribute to attachments

text: Currently attachments have   * title   * caption   * alt text   * description I would like to add another attribute to that list (e.g source). How can I do this ?


title: Why is group ownership with rwx permissions not enough?

text: Running PHP 5.4 and Apache2 on Debian 7, with apache configured to use user `www-data`. I'm trying to figure out why Wordpress cannot modify files in its directory when it has group ownership with full permissions, and seems to only work if it has user ownership. Allow me to illustrate : * * * # Case 1   * Set User to `root` and Group to `www-data`: `chown -R root:www-data /var/www/site-dir/wordpress-dir/`   * Set Permissions to read, write and execute for both user and group. `chmod -R u=rwx,g=rwx /var/www/site-dir/wordpress-dir/`   * Current `ls -l` output of the Wordpress directory: `drwxrwsr-x 5 root www-data 4096 Jul 11 15:20`   * **Outcome** : When trying to delete a plugin, Wordpress claims it does not have access: ![enter image description here](http://i.stack.imgur.com/Jl9Rt.png) # Case 2   * Permissions are identical to 1, but user is set to `www-data`:  `chown -R www-data:www-data /var/www/site-dir/wordpress-dir/`   * **Outcome** : Wordpress is now able to delete the plugin: ![enter image description here](http://i.stack.imgur.com/i1WWg.png) * * * # Question I'm trying to understand what's going on here. Why does the user _have_ to be `www-data`, even when using `www-data` as group it has full permissions? With my (limited) understanding of linux permissions I would assume that, since the apache process running Wordpress is using the `www-data` user, it would have complete access to do whatever it needs to in case 1, because the group is recursively set as `www-data`, and group permissions are recursively set to read, write and execute. Why does the user need to be `www-data` for this to work?


title: How can I input a single right-to-left paragraph (Hebrew) into an English page/post?

text: I have an English blog. In one of the pages I want to include a Hebrew paragraph between two English paragraphs (I expect the English text to be left-aligned and the Hebrew text to be right-aligned). I can get the Hebrew text to be right aligned, but not in a right-to-left way (e.g. the period at the end of the sentence appears to it's right instead of its left). I tried pasting formatted text from Microsoft Word, but it doesn't work (the pasted text changes from right-to-left as it was in Word to the screwed-up form I get on WordPress if I type it myself). I do not want the admin interface to change, I do not want my entire blog to change to right-to-left. Only a paragraph. How can I achieve that? The site is http://roee.co


title: How do I tell what plugins are used on my multisite install?

text: I have a bunch of plugins I have installed but never use, others I am not sure if they are used or not. Is there a way to tell what plugins are not active on any site?


title: Displaying URL Based on User Input from a Form W/in a Dashboard Widget

text: First question and first commercial plugin. Woohoo! I'm trying to create a dashboard widget that leverages user input and a predefined URL structure to create an outbound link that sends the user to his/her desired destination. This is basically a hack created so that users on a blogging network can query another Wordpress site that holds all the content from the bloggers in that network. So if the user enters "pretty cats" and click on the search button, a link appears taking the user to the search page for the aggregating website i.e. http://wordpressag.com/?s=pretty+cats So far I have the dashboard widget being created and displaying a text field and "search" button, but I'm stumped on the other functions I need to create a link based on the user input. The variable for the user input is $wpag_search, so the desired URL structure would be something akin to http://wordpressag.com?s=($wpag_search) , only with the user input instead of the variable. Here's what I have, any suggestions?               // Function for displaying text input fields and search button           function wpag_search_forms() {         ?>         <input id="search_terms" type="text" size="50" name="wpag_search" value="<?php echo esc_attr($wpag_search);?>" />         <input id="search_button" type="button" value="Search WPAG" class="button-secondary"/>         <?php     }           //Other function for utilizing user input     //Has to follow http://wordpressag.com/?s=(user input) structure          // Create the function use in the action hook          function wpag_plugin_init () {         wp_add_dashboard_widget('example_dashboard_widget', 'Search The WP Ag Network', 'wpag_search_forms');        }           // Hook into the 'wp_dashboard_setup' action to register our other functions          add_action('wp_dashboard_setup', 'wpag_plugin_init' );          ?>


title: Get shortcode name from within it's callback function?

text: > **Possible Duplicate:**   >  current_shortcode() - detect currently used shortcode I'm dynamically generating shortcodes with my plugin like this:               foreach ($options['grids'] as $grid) {         add_shortcode($grid['shortcode'], array($this, 'print_shortcode'));     }      But the problem is, in the callback function I need to print different content, based on the shortcode's name. My question is - how would I get the shortcode's name from within print_shortcode() ? Thank you!


title: Is it safe to use PUT and DELETE requests

text: I am building my new shiny plugin and since I've read about REST etc.I wanted to do things right and implement PUT and DELETE requests, and not just use POST and GET like I did until now. But now I am wondering is it safe to use those. And by safe, I mean, are those requests supported by all servers in general. I don't want to implement everything now only to figure out later that just because of my wish to follow semantics my product is unusable for half of my customers. Thank you


title: How To Remove The "+ Add New Category" Link From A Category Metabox

text: Inside of a Wordpress category metabox or any custom taxonomy box for that matter there is a link with the text "+ Add New Category" is there a way this link can be removed preferably without resorting to JS or CSS hacks to hide it? A way to hide it using some kind of filter or action hook would be best. If no action hook or filter method exists to remove it, I would be open to JS and CSS solutions as a last resort. The reason I am doing this is because I have a Wordpress installation integrated with Magento and I am creating and populating a custom taxonomy called "brands" with a list of brands from the Magento database so a post can be assigned to a brand. Obviously this means I don't want users to be able to add in their own terms and only be able to choose the brands added in dynamically to keep it in-sync with Magento. Thank you.


title: Add_image_size not cropping

text: I want to make a crop on the images of my blog page that have more than 443px adjust it to 645x443 size, exactly. I used this code:               add_theme_support ('post-thumbnails');     add_image_size ('blog-page', 645, 445, true);      However, the image is resized instead of making the crop. Exemples: Original image: http://img843.imageshack.us/img843/6444/56004879.jpg How is: http://imageshack.us/scaled/landing/809/53926495.png How i want: http://imageshack.us/scaled/landing/823/32122755.png How do I do this?


title: Recent post on single page from specyfic category

text: i have problem. I use this code before comment form.               <?php          global $post;          $args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => 1 );          $myposts = get_posts( $args );          foreach ( $myposts as $post ) : setup_postdata( $post ); ?>                  <?php the_permalink(); ?><?php the_title(); ?>          <?php endforeach; ?>      I have in `single.php`: 1 -- post content 2 -- recent post 3 -- form comment But when i comment something my comment is not on post but was added to last **recent post**. How can i do this? I tried to use this:               <?php     $args = array(         'posts_per_page'   => 1,         'category__not_in' => array( 23, 24 )     );          $recent_posts = get_posts( $args );          foreach ( $recent_posts as $recent ) {         echo 'Latest Post';     }     ?>


title: Super slow admin panel

text: My admin panel in wordpress is super slow. I disabled all the plugins, I changed the theme to "Twenty Eleven" and I updated Wordpress. Still, the admin panel is very slow. I have 2008 posts and 6 pages. My front end though is not slow, even though I disabled cache. Does anybody have an idea of what can I do about that?! Thank you very much!


title: Genesis page template with Powerpress

text: I want to create a template that will display podcasts in a archive page with the powerpress player and links. Powerpess talks about this on this page http://help.blubrry.com/blubrry- powerpress/customizing-with-your-wordpress-theme/ and I have looked at the various pages taht talk about building a genesis template. When it comes down to it, though, I don't know enough php to get this working (after trying many times) Can someone show me how to incorporate the powerpress player and links into the template?


title: Overwrite textdomain of plugins by default - Lost Translation

text: Wordpress is awesome, but there is something that is driving me crazy. Whenever a plugin or a theme is updated, all files are deleted and replaced. So if I have custom code or a translation in one plugin, it will get lost! I've seen some solutions suggesting to change the textdomain of the plugin to load language files from wp-content/languages, but if I write a custom function to load the *.po and *.mo from wp-content, directly in the plugin code, it will get overwritten too. So I was wondering how I can update my plugins, without losing the translation or the custom code. I ended up with WPML strings that do the job, by saving translation in DB, ( I'm not sure if is the way) but WPML is a very heavy plugin, and I will have to install it in all sites, which makes it difficult to maintain. Is there any function to overwrite all textdomains of a plugin, so I can have all of the translations in wp-content/languages, without changing plugin code?


title: Passing query variables to a custom page template

text: On my website I have a custom post type called 'theme'. I wanted the homepage to display an archive of themes. For this the only approach that I could think of was to create a page template with a custom wp_query and loop in it. Here's the code:               <?php global $wp_query; $wp_query = new WP_Query( array('post_type' => 'theme','post_status' => 'publish', 'paged' => get_query_var('page') ) ); ?>             <?php if ( $wp_query->have_posts() ) : ?>                 <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>                              <?php get_template_part( 'content', 'theme-widget' ); ?>                 <?php endwhile; ?>                 <?php wptrc_paging_nav(); ?>             <?php else : ?>                 <?php get_template_part( 'no-results', 'index' ); ?>             <?php endif; ?>      I have a page created with this template as my homepage. I also wanted my users to be able to change the order of items with query variables so I used this code:               function wptrc_filter_query( $query ) {         if( is_main_query() && (get_query_var('post_type') == 'theme' || is_tax('theme_cat')) && !is_admin() ) {             $order = get_query_var('theme_order');             $query->set('order', $order);         }     }     add_action('pre_get_posts', 'wptrc_filter_query', 9999);          function wptrc_query_vars( $query_vars ) {         $query_vars[] = 'theme_order';         $query_vars[] = 'theme_orderby';         return $query_vars;     }     add_filter( 'query_vars', 'wptrc_query_vars' );      **The problem:** Whenever I try passing the query variables to my homepage like this: http://mydomain.com/?theme_order=ASC my blog page shows up instead of the theme archive. For some reason when I use the query variables WordPress loads up the index.php file instead of the page template I created. This is not limited to custom query variables. order and orderby also give the same result. Any help would be appreciated. Thanks in advance.


title: Dropdown list of taxonomies won't display selected

text: I used the answer in this question to show a dropdown list of my taxonomies and it works great. But when I save the post/update and the page refreshes/loads the taxonomy I selected reverts back to the last taxonomy on the list. I checked the database and it does save the chosen taxonomy correctly so it's obviously how I echo the data right? How can I fix this so that it stays on the selected taxonomy?               $term = isset( $values['meta-box-events_select'] ) ? esc_attr( $values['meta-box-events_select'][0] ) : '';      THIS IS THE CODE I USED TO SHOW THE DROPDOWN                       <?php $tax = get_object_taxonomies('activities');             $taxterms = get_terms( $tax, 'orderby=count&offset=1&hide_empty=0&fields=all' );         ?>         <select name='meta-box-events_select' id='meta-box-events_select'>             <option value='' <?php if (!count( $names )) echo "selected";?>>Select Term</option>             <?php              foreach ( $taxterms as $term ) {                  echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>',"\n";              } ?>         </select>


title: User access control in sidebar archive and categorires

text: Could someone please help me solve my problem which is: I want content restrictions based on user roles and a sidebar category based on user roles. I have three type of user roles: Beginner, Intermediate and Advanced. Beginner Role: can read only self blog Intermediate Role: can read self and beginner blog Advanced Role: full read access to all levels of the blog The same case is with sidebar archives and categories if user is logged in. With beginner role (like demo/demo), user could only view beginner member area and limited sidebar categories and archives. case 2: if user is logged in with intermediate role (inter/inter), user could view intermediate area and would be able to see beginner, self category and archives. case 3: advanaced user login with (adv/adv) could view advanced member area and would be able to see all level categories. please help me


title: New categories are now going to 404s

text: I have a WPMU site with hundreds of blogs on it. We are on 3.4.2 and this is the first time I'm seeing this issue within a few of my sites. Basically, what happens is that I'll create a new category and then when I click on it from the sidebar where all the categories appear, it 404's. Also, this happens when I add a new article to the new category. This is happening on a few of my sites now. What's interesting to note is I cannot reproduce the issue on test even though test is more of less a direct clone of my live envrionment. The only difference between live and test is that I use a domain mapping plugin on live. Also, I have 6 memcached nodes/servers (AWS) whereas my test area only has one. My live area has 5 app servers and my test area has one. We have the multi-DB plugin installed in both environments. Aside from those differences, the plugins are exactly the same as is the code base. The issue happens: \--> Regardless of category slug \--> Regardless of # posts assigned to the category \--> Only on newly created categories (we noticed it about a month ago and it's still happening -- and seems to be spreading across our network) \--> On the front end -- you can browse categories just fine on the back end. \--> Regardless of how many times I flush the rewrite rules by changing permalink settings \--> On any permalink setting other than default. If I go to default permalink structure, it works fine. \--> Only on categories -- tags work fine.


title: List Child Pages of Parent Parent Page (Child pages from Grand Parent)

text: OK I'm doing a a menu (sidebar menu) that will display this all child pages of parent page (currently open)   Parent   |-Child 1   |-Child 2   | _Child 3      but in same time when someone is in bolded page (child) will see the same thing   Parent   |-Child 1   __ _|-Child 1   _ _| **-Child 2**   _ _|- Child 3   |-Child 2   |-Child 3      currently I use next code which do first job well but not the second one with child of child I tried several things but nothing worked                <?php if ( is_page() ) {      if($post->post_parent)     $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0&sort_column=post_date&sort_order=DESC'); else     $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&sort_column=post_date&sort_order=DESC');     if ($children) { ?> .......      Thanks in advance * * * ## Edit As Simon answered it worked but not for all cases and I edited so now final code is:               <?php if ( is_page() ) {         $stats = count($post->ancestors);     if($post->post_parent){        if($stats == 2){         $children = wp_list_pages('title_li=&child_of='.get_post( $post->post_parent )->post_parent.'&echo=0&sort_column=post_date&sort_order=DESC&depth=1');        }else{         $children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0&sort_column=post_date&sort_order=DESC&depth=1');       }}     else{       $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&sort_column=post_date&sort_order=DESC&depth=1');     }     if ($children) { ?> ....      That's in case if somebody else need this stuff, Cheers and thanks for fast help


title: Using get_template_part to retrieve a template file based on current post type

text:
I'm trying to use get_template_part to retrieve a template file based on the current post type (slug) the user is in. The template file just includes an image that is used specific to specific post types.               <?php get_template_part('parts/get_post_type( $post )') ?>
<?php $post_type = get_post_type_object( get_post_type($post) ); echo $post_type->labels->singular_name ; ?>
      The above doesn't blow up the page, but nothing seems to get output. Not sure what I'm doing wrong here.


title: allow only lowercase user registrations

text: I'm trying to get allow only lowercase usernames are valid usernames in my wordpress blog. I managed to write a function but it does not seem to work.               add_filter('validate_username' , 'simple_user', 1, 2);         function simple_user($valid, $username ) {                 if (preg_match("/[a-z0-9]+/", $username)) {                     // there are spaces                     return $valid=false;                 }             return $valid;         }      Any ideas with getting this to work ? i tried this but it never worked. I will be very appreciative if someone could help me with this one. Thank you


title: How to disable saving/changing update date for certain admin users?

text: I have an admin user who is only for correcting the spelling errors and grammar stuff, however, when he corrects some post that is several hours or days old and just changes "People are gready" to "People are greedy" in the title or makes some other changes in the content, the update date is changed and I don't want that to happen. Is there any build-in WP function that I can use that for some users e.g. for user with ID 14 and 19. Any idea how to do that?


title: Does WordPress Change the .htaccess File When Updating?

text: I've just implemented a new WP website, replacing an older hardcoded HTML site. I will be adding 301 redirects in the `.htaccess` file to point the old URIs to the new WP Permalinks. My questions is, as WP generates the `.htaccess` file initially (at least on my install it did) will WP overrite the `.htaccess` file when I update WP in the future? Further to the above, is there any time, including the update as mentioned above, that WP may overwrite this file and if so is there a way to prevent that? I've searched high and low and can't seem to find a straight answer. Any help would be appreciated. Thanks!


title: Template for slug

text: I am using the "Edit Author Slug" plugin to provide public profile pages on my site using the following structure: **mysite.com/users/username**. Now, I want to show a list of all users on **mysite.com/users/**. But this returns a 404 because the "users" path is only a slug created by the plugin. Does WP provide the possibility to create slug templates (just like tag templates)? Or is there another way to accomplish this? Thanks for your help :-)


title: js and images files are not recognized - beginner

text: it might be the simplest question but i can't find why my javascript files and images are not recognized by wordpress : i put all my JS files and images in my theme's folder, so i created a folder "word" inside "theme", with all the content and then i added my files. But the website doesn't recognize the path to the javascript or the images. Could you please tell me what i'm doing wrong? i used it like that in the header page : > < script src="jquery.js" type="text/javascript"> Thanks ;)


title: Tag selector like stackexchange?

text: I'm creating my own form based on this and I'd like to have a tag selector which is similar to the one on StackExchange. I can roll my own but I was wondering if something similar already exists. Thanks!


title: Displaying Facebook comments count with <fb:comments-count> tag

text: On the Facebook Developer page they say the comments counts can be displayed using               <fb:comments-count href=http://example.com/></fb:comments-count> awesome comments      I added this to my loop then:               <fb:comments-count href=<?php the_permalink();?>></fb:comments-count>      to display the comments count per each post. Nothing is displayed even though I do have comments...any suggestion? Thank you Edit: placing the code in single.php, it shows the number 0 despite I have many comments....


title: Preview Post/Custom Post types in Archive

text: I have a few custom post types on my website. One of these is a front page slider. I add some text, images, links and as soon as I publish the CPT appears as a slide and I'm a happy camper. The problem is when I need to preview the slide before it is live. I can preview that specific CPT post via the post preview button, but obviously I see the actual slide and not how the slide looks in that slider or gallery or archive. I'm looking for a solution to preview the Drafts in an archive. Any help will be much appreciated.


title: Facebook Like needs confirmation?

text: I use a Facebook Like plugin on my WordPress blog, but it is really weird. I need to press a confirm link, even if the user clicked the like button. But most users won't click twice. Is this something that is caused by the plugin I use or by Facebook?


How are rewrite rules applied in WordPress? I don't see any rules in the .htaccess file... For example, if I set the address URL to www.example.com, then calls to example.com will 301 redirect to www.example.com, but I don't see any rule for that in the .htaccess:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress


title: I cant access custom taxonomy page listing

text: I had a issue with a custom taxonomy and a custom post type using the same url. my url i am using for my post type is /news and then i have a taxonomy which i need to have /news/cars I followed this post to get my urls to work but now i cant access the actual taxonomy listing pages as i get a 404. Mixing custom post type and taxonomy rewrite structures? this is my code i am using to do this functionality:                   function register_custom_post_types() {         $args = array(             'labels' => array(                 'name' => __( 'News' ),                 'singular_name' => __( 'News' )             ),             'menu_position' => 5,             'public' => true,         'query_var' => 'news',             'has_archive' => 'news',             'hierarchical' => true,             'taxonomies' => array('news_categories'),         'publicly_queryable' => true,             'capability_type' => 'post',             'rewrite' => array('with_front' => false, 'slug' => 'news/%news_categories%'),             'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'page-attributes')         );         register_post_type( 'news', $args);          }     add_action( 'init', 'register_custom_post_types' );          add_action( 'init', 'create_my_taxonomies', 0 );              function create_my_taxonomies() {             register_taxonomy(                 'news_categories',                 'news',                 array(                     'labels' => array(                         'name' => 'News Categories',                         'add_new_item' => 'Add New Category',                         'new_item_name' => "New Category"                     ),                     'query_var' => 'news',                     'show_ui' => true,                     'show_tagcloud' => false,                     'hierarchical' => true,                     'rewrite' => array(                         'with_front' => false,                         'slug' => 'news'                     )                 )             );         }              add_filter('post_type_link', 'news_term_permalink', 10, 4);         function news_term_permalink($post_link, $post, $leavename, $sample) {             if ( false !== strpos( $post_link, '%news_categories%' ) ) {                 $glossary_letter = get_the_terms( $post->ID, 'news_categories' );                 $post_link = str_replace( '%news_categories%', array_pop( $glossary_letter )->slug, $post_link );             }             return $post_link;         }      Any help would be really appreciated Thanks


title: How to display an RSS feed widget inside a page?

text: I have an RSS feed (link) that I would like to display as a widget inside one of my posts. The wordpress RSS widget already does that on the sidebar, is there some solution to have it in the post? The best solution would latter let me do something like: So I could embed this also on other sites. Thanks.


title: wp_insert_user keeps echoing values

text:
This is bugging the heck out of me. Essentially I've narrowed the issue down to one line of code:               $user_id = wp_insert_user ($userdata);      From what I can tell nothing should be echoed here, but I should get the user_id returned from the wp_insert_user function. What I'm getting though is the email and other values echoed back. I will paste the code for the entire function at the moment, but I've tested it apart and this is the line of code causing the echo in my ajax call, messing up my return because its not formatted in my JSON variable. See code below ( **Thanks you in advance for any help I can get with this, really need it at this point** )               public function registerUser(){             $event = $_REQUEST['event'];             $nonce=$_REQUEST['ajax_nonce'];             if (! wp_verify_nonce($nonce, 'ajax_nonce') ) {                 $response = json_encode(                      array(                          'success' => false,                         'html' => 'Please stop trying break me. For security reasons your IP has been logged'                     )                  );                 header( "Content-Type: application/json" );                 echo $response;                 die();             }             global $wpdb;             $html = "";              //We shall SQL escape all inputs               $user_login = $wpdb->escape($_REQUEST['username']);               if(empty($user_login)) {                   $error = 1;                 $html .= "
Username could not be created because you have not completed your first and last name.
";               }             $user_email = $wpdb->escape($_REQUEST['email']);               if(!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/", $user_email)) {                 $error = 1;                   $html .= "
Please enter a valid email.
";               }             $user_pass = $wpdb->escape($_REQUEST['password']);             $confirm_password = $wpdb->escape($_REQUEST['confirm_password']);             if(empty($user_pass) || $user_pass != $confirm_password){                 $error = 1;                   $html .= "
Passwords do not match.
";             }             if(empty($error)){                 $first_name = $_REQUEST['first'];                 $last_name = $_REQUEST['last'];                 $display_name = $_REQUEST['first']." ".$_REQUEST['last'];                 $userdata = compact('user_login', 'user_email', 'user_pass', 'first_name', 'last_name', 'display_name');                 $user_id = wp_insert_user( $userdata );                 if ( is_wp_error($user_id) ){                     print_r($status);                     $error = 1;                     $html = "Username already exists. Please try another one or contact us";                   } else {                     update_usermeta( $user_id, 'phone', $_POST['phone'] );                       $from = get_option('admin_email');                       $headers = 'From: '.$from . "\r\n";                       $subject = "Painter Registration Successful!";                       $msg = "
Registration successful!

Your login details:

Username: $username
Password: $password

Thank you again for joining Brush Party, now you can login and finish signing up for the next party here!";                     $html = "Awesome! You are officially a registered painter at Brush Party. That was easy, and you thought painting was going to be hard... Now you just need to check your email for you login details";                   }               }             $response = json_encode(                  array(                      'success' => $status = (empty($error)) ? true : false,                     'first' => $_REQUEST['first'],                     'last' => $_REQUEST['last'],                     'phone' => $_REQUEST['phone'],                     'email' => $_REQUEST['email'],                     'html' => $html                 )              );             add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));             wp_mail( $email, $subject, $msg, $headers );               // response output             header( "Content-Type: application/json" );             echo $response;             die(); // WP AJAX calls must die         }      EDIT: I've since looked at the user.php file and targeted the issue at line 1371, here's the code there               if ( $update )             do_action('profile_update', $user_id, $old_user_data);         else             do_action('user_register', $user_id);


title: A Way to Auto update plugins using cron?

text: Is there a solution to keep plugins updated with wordpress by auto upgrade them without need to access to the admin panel every time?


title: W3 total cache - cache refresh programmatically

text: I am building a Digg like website in WordPress. After installing W3 Total Cache, I noticed certain elements such as number of votes (and voters ids) per post are cached even though they shouldn't be (at least not after a user votes for an article). I assume it is not possible to prevent specific elements in a page from being cached (or is it?), so I thought of triggering page cache refresh programmatically. Any suggestions?


title: wordpress upload http error?

text: I'm trying to uplaod video files,my upload file size limit is 96mb,and I can upload videos until 10mb size,but I want to uplaod videos that have 20mb size.If I try to uplaod bigger video I get http error,I found on web a lot of solutions but none of them acctualy help me.Is there any other solution how to fix http uplaod error and uplaod bigger files on my wordpress site? I have tried every thing from there links : http://wordpress.org/support/topic/http-error-on-image-upload-still http://wordpress.org/support/topic/flash-uploader-logs-out-during-crunching- phase http://wordpress.org/support/topic/http-error-image-upload Tnx in advance. Anybody have idea why is this happening ?


title: Wp-admin widgets have no title texts

text: In wp-admin when I enter widgets I see their bars, but the titles of widgets are missing. only :Something remain visible and the others are gone. What happened? How do I fix that? Edit: Found it in wp-admin/includes/widgets.php line that was `<div class="widget-title"><h4><?php $widget_title ?><span class="in-widget- title"></span></h4></div> ` should be `<div class="widget-title"><h4><?php echo $widget_title ?><span class="in- widget-title"></span></h4></div> ` Is that a wordpress bug or somebody on my team had to edit this? [noone takes the blame ;)]


title: Justin Stern's bulk export for users

text: I want to bulk export lists of users in WP. I found this tutorial which is great: http://www.skyverge.com/blog/add-custom-bulk-action/ The problem is, I cannot seem to figure out how I need to edit the code to get this to work on the users page instead of the posts page. Help! Thanks in advance!


title: how can i get posts from custom post type particular taxonomy category

text: I have registered custom post type Article in my template using **register_post_type** function. and i also having taxonomy category for this article posts. Here i want to filter the posts under particular category. using query post How can i do this Thanks in advance !


title: WordPress Page Template to Display Page Title, Custom Field, and Date

text:
I'm currently attempting to create a page template that will display all posts by the current logged in user, a particular custom field from those posts (i.e., Item Status), and the dates those posts were published. I am using the following code for the list of posts by the current user:               <?php     //if a certain page, then display posts authored by the logged in user     $page_title = 'Support History';     if ( is_user_logged_in()  && is_page($page_title) ) {     global $current_user;     get_currentuserinfo();     $args=array(         'author' => $current_user->ID,         'post_type' => 'post',         'post_status' => 'publish, private',         'posts_per_page' => -1,         'caller_get_posts'=> 1     );     $my_query = null;     $my_query = new WP_Query($args);     if( $my_query->have_posts() ) {     echo 'Your Support History';     while ($my_query->have_posts()) : $my_query->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
     <?php     endwhile;     }     wp_reset_query();  // Restore global post data stomped by the_post().     }     ?>      I would like for it to look roughly like this when complete: **Item Title** **Item Status** **Item Date** Essentially, a table display of the posts with their titles, status (i.e., the custom field value), and date. I cannot seem to get the second two bits of information to display properly (read: attempting to do so seems to break the post listing and cause the page to fail to load anything).


title: WP_Query with intersection of post meta field and user meta field

text: On the site I'm building, each post has a serialized array of strings. Let's say post ID 1234's value for `my_site_teams` is `array( 'Chess', 'Cheerleading', 'Football' )`. Each user also has a `my_site_teams` meta field setup in the same way. Let's say user 56's value is `array( 'Chess', 'Soccer', 'Hockey' )`. I want to limit WP_Query so that it only returns posts for the user where at least one of these values overlap. In this case, both post `1234` and user `56` include `Chess`. What I've tried so far:   1. Using `meta_query'. Problem is this can't take the intersection of two arrays. Only the values you're searching _against_ can be arrays.   2. Running a normal WP_Query, then filtering these afterward. This produces the correct results, but it breaks WP pagination.   3. Running a secondary query during `pre_get_posts` that loops through all the posts, notes any intersections, then sets `post__in` to an array of intersecting post IDs. This does work, but I dislike the extra query, and I'm worried about the sustainability of this approach as I scale to more site views and more posts. I suspect I'll need to edit the query's `JOIN` with `posts_clauses`, but I haven't been able to create a bug-free inner join.


title: how to exclude admin page from add_rewrite_rule in wordpress

text: I'm trying to add the following rewrite rules:               add_rewrite_rule('([A-Za-z0-9])/([A-Za-z0-9])', 'index.php/product?subcategory=$1&product=$2', 'top');          add_rewrite_rule('([A-Za-z0-9])', 'index.php/categories/?cat=$1', 'top');      The problem is that its affecting the admin page leading into an internal server error. After the rules has been flushed the `.htaccess` file has added the rules above into the following:               RewriteRule ^([A-Za-z0-9])/([A-Za-z0-9]) /wordpress/index.php/product/?subcategory=$1&product=$2 [QSA,L]          RewriteRule ^([A-Za-z0-9]) /wordpress/index.php/categories/?cat=$1 [QSA,L]      So something like:               <domain>/GameConsoles/Nintendo3ds     <domain>/GameConsoles      But the problem is that the rules that I have set seems to be matching in the admin. What am I doing wrong here? And with regards to SEO best practices should I be doing it this way or is it better to use something like:               <domain>/product/Nintendo3ds     <domain>/category/GameConsole      Thanks in advance!


title: Theme Review: post thumbnail, header image, content width

text: A followup to my previous question about my theme that was rejected for the WordPress.org theme directory: >   * RECOMMENDED: No reference to the_post_thumbnail() was found in the > theme. It is recommended that the theme implement this functionality instead > of using custom fields for thumbnails. >   * RECOMMENDED: No reference to add_custom_image_header was found in the > theme. It is recommended that the theme implement this functionality if > using an image for the header. > How do I correct it? This is my function:               // thumbnail list      function retImage($content){          $pattern="/<img.*?src=[\'|\"](.*?(?:[\.gif|\.jpg]))[\'|\"].*?[\/]?>/";          preg_match_all($pattern,$content,$match);           if(empty($match[0][0])){                      echo "<img src=\"";                      bloginfo('template_url');                      echo "/images/thumbnail.png\" />";          }else{              echo  $match[0][0];          }     }      I used an image for the header by css, why do they say this: >   * RECOMMENDED: No reference to add_custom_image_header was found in the > theme. > ![Header image CSS rules](http://i.stack.imgur.com/jPcaV.png) >   * Embedded videos overlap sidebar. Please set the content_width variable > In my the `functions.php` of my theme I did this:               if ( ! isset( $content_width ) )         $content_width = 992;      Why do they still give me that tip?


title: Conditional success callback based on Ajax Response not working

text: I am trying to run an ajax request to pass some data to a function I have written. I return the response, and try and run some javascript based on the response, but it doesn't seem to be running properly. Regardless of what the response is back, it always runs it as if the response was not 'Everything's Chimpy!'               jQuery.ajax({         type: 'POST',         url: ajaxurl,         data: {             action:      'chimp_form',             form_action: 'validate_api_key',             api_key:     apiKey,             data_center: dataCenter         },         success: function(validation_response) {             // alert(validation_response);             if(validation_response == "Everything's Chimpy!") {                 jQuery('.mailChimp_api_key_preloader')                     .fadeOut('fast', function() {                         jQuery('.mailChimp_api_key_validation_message')                             .html(' Valid API Key')                             .css("color", "green").fadeIn();                     });             } else {                 // alert(response);                 jQuery('.mailChimp_api_key_preloader')                     .fadeOut('fast', function() {                         jQuery('.mailChimp_api_key_validation_message')                             .html(' Error: '+validation_response+'.')                             .css("color", "red").fadeIn();                     });                                          };         },         error: function(response) {             alert('There was an error processing your request...');          }     });      I am getting a response back from the ajax request, and it says 'Everything's Chimpy!', but my conditional is not running. No matter what , the successfunction runs the second conditional. But I have tested the response and can see that it matches my first conditional statement. Why isn't the first one running? Weirdest part about it...I developed this on localhost installation. When I transferred it over to my live site, this ajax request and success callback is not working as it does on localhost. I can't think of a reason it would act differently on localhost than it does on the live site. **This is the response that is coming back:** Error: Everything's Chimpy!.


title: Hide update messages from non-admin users?

text: Is it possible to hide the update messages for any users other than the main admin? We use WP as a CMS for clients and it's a bit annoying that a normal user has to read something like: > WordPress 3.1.3 is available! Please update now.


title: Combine Multiple Categories Into One URL Slug

text: I have a Wordpress website with 20+ categories. To make it easier to navigate I want to decrease the categories, but at the same time keep the original categories. In other words I want to be able to query multiple categories with a category group or a virtual slug. Example categories:               /category/apples/     /category/pears/     /category/bananas/      I want to be able to query all three of them with a unique url slug:               /category/fruit/      But like I said, it should still be possible to go to i.e. **/category/bananas/** I know it's possible to query multiple categories the way I want to using **/category/apples,bananas,pears/** but it's not a elegant solution. Is it possible to do this virtual grouping with a plugin or even using a rewrite? Tips and recommendations are greatly appreciated!


title: Building a Data Intensive Website with Wordpress

text: I am an intemediate website builder and have been working with wordpress for a few years. I am attempting to build a website (for myself) that is data intensive. All I've built to date are sites that have 20-30 categories, and several pages. The new site is a business directory that will cover 50 U.S. States and have 20-30 Business Types. My problem is that I have never really worked with post types or taxonomies, and so I cannot wrap my small brain around how to structure this site so that the content is easy to search for users. For example, a user should be able to search for a motorcycle dealer in Florida. My plan is to cover cities and zip codes via tags (unless someone suggests a better way!). Most of the default wordpress search functionality is pretty weak as well. For instance you cannot sort results via something like a dropdown menu (as far as I've seen anyway). **I was thinking to structure the website like this:**   Post Type - California   Taxonomies - Bar, Cafe, Auto Dealer, Salon, etc...   Post Type - New York   Taxonomies - Bar, Cafe, Auto Dealer, Salon, etc...   So, any help determining the best way to put together this type of site in a fashion that doesn't bury the data and is usable as a directory would be really appreciated. It will be a photo intensive site, so although I know there's a nice directory plugin out there - it just wouldn't work! Each business location needs to be it's own post. In addition to structuring the directory, any ideas for the best way to implement advanced search functionality would also be greatly appreciated. Looking at the Relevanssi Pro Plugin at this point for search. Thanks for reading. Also, let it be known that I am not opposed to paying a pro for their time helping me with this information, or setting this up on the back end. \----------------- **FURTHER QUESTIONS:**   **Thanks** a lot. This is the most comprehensive advice I've gotten anywhere.      To be sure I understand correctly:      Step 1:   Create a post type: companies   Step 2:   Create 2 Taxonomies:   location   business_type      Step 3:   Create Taxonomy Terms for each of the above taxonomies:   Taxonomy: location   Terms: NY, CA, KY, TX, GA, etc...      Taxonomy: business_type   Terms: salon, auto_dealer, restaurant, etc...      Step 4:   Add custom fields to companies post type with custom meta boxes:   city   zip code   phone number   That all seems pretty clear and leaves me with a few more **questions** : Is Relevanessi the best method you know of to implement searches for this type of data? http://wordpress.org/extend/plugins/relevanssi/ Do categories/subcategories become completely irrelevant when implementing the above procedures? (my guess is yes they do, as this seems much more powerful) Lastly, I haven't read enough yet, but I assume the way to create menu items is to use taxonomies and taxonomy terms. Is that correct? Thanks so much for introducing me to this different level of wordpress usage. Never had the need before, so I just never learned it.


title: apply_filters() and the_excerpt are giving unexpected results

text: I feel like I must be missing something pretty obvious, here, but I can't seem to get WordPress to cooperate. I'm generating Facebook OG tags with a function. Everything works fine, except for the excerpt. Since the deprecation of `get_the_excerpt($post->ID)`, is there another way to create an excerpt without having to create a whole new loop? It seems excessive to me. My first instinct was to use `apply_filters()`:               $description = apply_filters('the_excerpt', get_post($post->ID)->post_content);      That gives me the full post, complete with HTML-formatted content. Okay, must be wrong. So I tried the next logical idea:               $description = apply_filters('get_the_excerpt', get_post($post->ID)->post_content);      No dice. Now there's no HTML, but it's still the full post (which is really confusing). Okay, no problem. Let's skip all the fancy stuff and just go for the trimmed entry:               $description = wp_trim_excerpt(get_post($post->ID)->post_content);      No change. So, my question is this: what the heck is going on? Is there something I'm missing, here? I got into the WP core to find how `the_excerpt()` works, and it appears to be identical to my call:               /**      * Display the post excerpt.      *      * @since 0.71      * @uses apply_filters() Calls 'the_excerpt' hook on post excerpt.      */     function the_excerpt() {         echo apply_filters('the_excerpt', get_the_excerpt());     }      I have a few questions based on my findings:   1. Why isn't the filter applying as expected?   2. Is there a way to get the excerpt outside of the loop without creating a new loop?   3. Am I crazy? Thanks in advance for having a look. I'm fairly stumped, here.


title: Static pages not being allowed

text: I followed the directions for creating a static front page and displaying the news on another page. I have done this before with success but now I am having a problem. When I go to mysite.com/news I am getting an Internal Server Error, but when I undo the static pages options, everything is fine. What am I doing wrong now?


title: get_posts meta_value is serialized array, how can I grab specific posts with combination of meta_key/meta_value[0]->is_featured?

text: I've a postmeta key saved in DB: `mediSHOP_product_extras` It's value is Unserialized: `Array ( [0] => Array ( [is_slider] => 0 [is_featured] => 0 [in_stock] => 0 [video_url] => [related_product_list] => ) )` For simplicity I didn't want to save each value as a new key/value combination in DB. But I might have made a mistake... I want to use get_posts to fetch posts that have `is_featured == 1` And I cannot figure out how to do this...               $slides_content = get_posts(array(         'post_type'      => 'post',         'posts_per_page' => 12,         'meta_key'       => 'mediSHOP_product_extras',         'meta_value'  => '1'     ));      meta value needs to be 1, but it also needs to be `is_featured == 1`. Simplest solution would be to just save is_featured as a separate key. But maybe you know how to solve my problem?


title: Find the Children of a Page then Echo it as a Bulleted List of Links (menu)

text:
I am trying to check if a parent Page has children. If it has children I would like to echo the children as a bulleted list with links to each child (basically a menu). Right now I have the following code in loop-page.php and it checks if the Page has any children and returns an array with the children. I use an if statement to check if the number is greater than 0.               $children = get_pages('child_of='.$post->ID.'&parent='.$post->ID);          if (count($children)) {         // Echo children as a bulleted list of links     }      This part seems to work. My question is how do I echo through the children as a bulleted list of links? Like the example below. Let's say "Services" is the parent page and its children pages are "Grass Cutting", "Water Gardens", and "Landscaping". count($children) would return 3 for the "Services" page since it has 3 children. Now it should echo them as so:

Grass Cutting

Water Gardens

Landscaping

      a href= should be the link to the page.


title: register_setting and AJAX?

text:
Please pardon me if this question is totally unrelated in itself, but I'll do my best to point out the issue I am having and what I would like to achieve. **Scenario:** I have a custom theme option's panel, that uses custom-made tabs.   **Goal:** Whenever the user saves the panel's options, the page and the panel's tabs should stay just like they are (i.e. no reloading and no taking- the-user-back to initial tab). I am almost completely certain that this is AJAX-related, thus the title. This is the PHP code of my panel: http://pastie.org/3102112   This is the JS that makes the tabs works (for the sake of this example, as the tabs themselves work flawlessly):               $('div#options_tabs div.block').hide();     $('ul.options_tabs li:first').addClass('active').show();     $('div#options_tabs div.block:first').show();          $('ul.options_tabs li').click(function() {              $('ul.options_tabs li').removeClass('active');         $(this).addClass('active');         $('div#options_tabs div.block').fadeOut(100);              var activeTab = $(this).find('a').attr('href');         $(activeTab).fadeIn();         return false;     });      And finally, my attempt at AJAXing the tabs and the way my panel is saved (note that I am really clueless as to what should be placed within the AJAX action; and I also feel I might be completely off-track, as my panel uses the WordPress built-in register_settings method):               (function ($) {          inlineEditOption = {         init: function () {             $('.save-options', '#the-theme-options').live('click', function () {                 inlineEditOption.save_options(this);                 return false;             });         },              save_options: function (e) {           var d = {             action: "options.php"           };           b = $(':input').serialize();           d = b + "&" + $.param(d);           $.post(ajaxurl, d, function (r) {             if (r != -1) {               $('.ajax-message').ajaxMessage('
 Theme Options were saved
');             } else {               $('.ajax-message').ajaxMessage('
 Theme Options could not be saved
');             }           });           return false;         }          }     });      Anyhow, I hope I was clear enough; if I forgot something please let me know!   Thank you all in advance,   Chris


title: Can I use two languages together in WordPress

text: com blog can I use two languages, lets say I want to have the Language English and other language. I also need my audience to write comments using either in Engish or another language. Is that possible in WordPress!!


title: How to display NextGEN gallery in templates?

text: I have installed the NextGEN Gallery plugin and have all my images in albums. Can someone please support me in displaying the NextGEN gallery with the use of the Galleryview plugin? Is there any easier way?


title: Second page (and next) of search results redirects me to the home page

text: WP 3.5, nginx (latest) and PHP5-FPM (latest). If you visit http://bombacarta.com/?s=coma the page is properly loaded. When you click on the link to go to the next page, you are redirected to the home page. Try it out: http://bombacarta.com/page/2/?s=coma I don't know what's the cause to this... I think it's something related to my nginx conf for WP (because it happens on also another installation on the same VPS with same config but different theme). Here's my nginx config:               location ~ \.php$ {         try_files $uri =404;         fastcgi_split_path_info ^(.+\.php)(/.+)$;                    include /etc/nginx/fastcgi.conf;         fastcgi_pass unix:/var/run/php5-fpm.sock;     }          location / {     # if you're just using wordpress and don't want extra rewrites     # then replace the word @rewrites with /index.php      try_files $uri $uri/ /index.php;          }


title: display tag slug as class per link in tag cloud

text: I would like to filter `wp_generate_tag_cloud` so each of the tag links include the slug as a class. More specifically, I would like to output "tag-" + the tag slug. Currently what is assigned as the class is "tag-link-" + the tag ID. The the end, I would happy with either a replacement or just adding this additional class to the links.


title: Query pages by category

text: Trying to query pages based on the category they are associated with. I am passing in the cat_ID, but it doesn't seem to be working. Always returns a single post with the title "Hello World" while there is an actual page with real title associated with this category.               // The Query     query_posts('cat='.$current);          // The Loop     while ( have_posts() ) : the_post();              the_title();          endwhile;          // Reset Query     wp_reset_query();


title: Template Page Content Made Searchable

text: I'm migrating a client site over to a WordPress CMS. I made templates for each of the pages that would have static content: about us, facility, FAQs, etc. The problem is that this content seems to be unsearchable (if that's the right term). Is there an easy way to make this content available to an internal (not Google.com) search query (along with the rest of the content that is available on a blog)? Should I have put this stuff (the copy) into the content editor and accessed it with the_content()? Is that the best way? As I'm finishing this I'm getting that "duh" feeling, but I'll post it anyway in case there are other ways that might help others doing the same. Thanks very much.


title: How can i list random author?

text:
Im listing current category of all author list but I want to list random author list from current category. I was try 'order' => 'RAND', RAND code its not worked. My Code:               function getCurrentCatID(){       global $wp_query;       if(is_category() || is_single()){         $cat_ID = get_query_var('cat');       }       return $cat_ID;     }          $current_category_ID = getCurrentCatID();     $current_cat_id = $current_category_ID;          $author_array = array();     $args = array(       'numberposts' => -1,       'cat' => $current_cat_id,       'orderby' => 'author',       'order' => 'asc',       'posts_per_page' => '10',     );     $cat_posts = get_posts($args);          foreach ($cat_posts as $cat_post) :       if (!in_array($cat_post->post_author,$author_array)) {         $author_array[] = $cat_post->post_author;       }     endforeach;          foreach ($author_array as $author) :       $auth = get_userdata($author)->display_name;       $auth_link = get_userdata($author)->user_login;       $autid= get_userdata($author)->ID;       $link = get_author_posts_url($autid);       echo ''. get_avatar( $autid, '46' ).'';       echo "";       echo '
'.$auth.'
';       echo "";       echo "

";       echo "
";     endforeach;


title: How can I include meta box content when searching?

text:
When I search on my site it currently doesn't search the content in my custom meta boxes. How can I include this content when searching? I'm registering my meta boxes as follows:               $meta_box['recipe'] = array(         'id' => 'recipe-meta-details',         'title' => 'Recipe Meta Details',         'context' => 'normal',         'priority' => 'high',         'fields' => array(              array(                 'name' => 'Country',                 'desc' => 'Country dish is from',                 'id' => 'recipe_country',                 'type' => 'text',                 'default' => ''             ),             array(                 'name' => 'Serves',                 'desc' => 'Number of people dish serves',                 'id' => 'recipe_serves',                 'type' => 'text',                 'default' => ''             ),              array(                 'name' => 'Ingredients',                 'desc' => '',                 'id' => 'recipe_ingredients',                 'type' => 'wysiwyg',                 'default' => ''             ),              array(                 'name' => 'Method',                 'desc' => '',                 'id' => 'recipe_method',                 'type' => 'wysiwyg',                 'default' => ''             )         )     );      And displaying them like this in my custom post archive loop:               $recipe_country = get_post_meta($post->ID, 'recipe_country', true);     $recipe_serves = get_post_meta($post->ID, 'recipe_serves', true);     $recipe_ingredients = get_post_meta($post->ID, 'recipe_ingredients', true);     $recipe_method = get_post_meta($post->ID, 'recipe_method', true);

Ingredients
     <?php echo $recipe_ingredients; ?>

Method
     <?php echo $recipe_method; ?>
      Thanks


title: How can I set the first link in my nav menu to simply be a drop-down to some other pages

text: I want to have a set of ~3 pages in a subdirectory called "about"               example.com/about/history     example.com/about/program     example.com/about/coaches      I don't want any `about/index.html` page, I just want "about" to be the label of the drop-down menu. The pages will be just regular WordPress pages. I don't need help writing the HTML/CSS, I just need to know what files to edit and how to set it up in the WP admin area. Hope my first post makes sense. This is my first WordPress project. Thanks in advance.


title: Fully-featured forum plugin

text: I'm looking for a plugin recommendation. I'm currently using bbPress to add a forums area to our website. However, it has been deemed "disappointing" in terms of functionality. Are there any forum plugins which have the following features?   * Easy image attachment (i.e. not like the bbPress GD add-on which uses the Media Library)   * Unread threads / mark as unread button   * Private messaging   * Quoting   * Rich text editor for new topics/replies Thanks in advance,


title: How to use variables from widgets in other pages?

text: I have a widget where I set some custom url's like register or login. I want to use those variables declared in a widget outside of the widget, in other pages (page templates). How can I save or use, for example, $login or $register variables, in other pages ?


title: Trouble with conditional tags

text: I've got some code I want to run on every page other than the blog page and the archive page. If I use               <?php if ( !is_home() )  { ?>      The code correctly doesn't show on the blog page. If I use               <?php if ( !is_page('archive') )  { ?>      The code correctly doesn't show on the archive page. But if I use               <?php if ( !is_home() || !is_page('archive') )  { ?>      The code incorrectly shows up on both the pages. Any suggestion what I'm doing wrong?


title: Structure with category setting

text: OK, it's more a philosophic question that a programming question, but at the end it will have a huge impact on code... I have 5 main product, a,b,c,d,e those 5 products have options those products can belong to multiple category So the end, i should show the product a, with below, option of product a witch is a1, a2, a3, a4 and below, the other products that belong to the same category as a, so it can be, x, y, z. So it look like   * a      * a1      * a2     * a3     * a4   * x   * y   * z How should i manage categories, should i create a category witch name is option for a or there is a better way. Organising is not my stongest point, but good organization can lead to easy coding.. thanks in advance * * * idea, if i can control the ID of the post created, i will create product a as id=100 and all option as product option a1 : id-101. option a2 : id=201 and so on ..


title: Simple custom theme option not being saved

text:
I'm not a web developer and have been following a tutorial on how to add options to a simple self-written theme. In functions.php I've added the following code:               <?php     $themename = "Theme Name";     $shortname = "sn";     $options = array (                   array(  "name" => "Price"),              array(  "type" => "open"),              array(  "name" => "Price",                 "desc" => "Enter a price to sell your item for.",                 "id" => $shortname."_price",                 "std" => "",                 "type" => "text"),              array(  "type" => "close"),          );     ?>      In index.php I have the following code                   <?php if ($sn_price) { ?>
<? echo "$" . $sn_price; ?>
         <? } else { ?>
Price on registration of interest.
         <? } ?>      The theme options are available in the back end, and I have saved the price in the theme options. The price is saved when I return to the back end to check the options, but $sn_price displays as empty on the front end. Any ideas why? **Edit** : Here is functions.php


title: What exactly do this function declared into functions.php file of a WP theme?

text: someone can help me to understand what exactly do this function declared into the **functions.php** file of a theme?               function exclude_featured_tag( $query ) {         if ( $query->is_home() && $query->is_main_query() ) {             $query->set( 'tag__not_in', 'array(ID OF THE FEATURED TAG)' );         }     }     add_action( 'pre_get_posts', 'exclude_featured_tag' );      I am not into PHP but looking it I think that if the user is on the home page it modifya query object exluding the posts having a specific tag. Is it right? If it's right can you explain me the last line:               add_action( 'pre_get_posts', 'exclude_featured_tag' );      I think that it is used to automatically call the previous function what a specific event happen...is it right? what event? can you help me to understand how exactly work? Tnx


title: Tax Query not working

text: I'm having some trouble with my tax query. Im getting some values by GET, but it seems my tax query refuses to work:               $args = array(                         'post_type' => 'imovel',                         'tax_query' => array(                                 'relation' => 'AND',                                 array(                                     'taxonomy' => 'finalidade',                                     'field' => 'id',                                     'terms' => $taxonomy_id,                                      ),                                 array(                                     'taxonomy' => 'cidade',                                     'field' => 'id',                                     'terms' => array($_GET['estado'], $_['cidade']),                                     'operator' => 'AND'                                 )                             )                              );      In fact, $_GET values are coming correct, so what's wrong? Thanks!


title: Query custom posts of logged in user only

text: I have a custom post type setup called `website` I thought using the code below would display only the logged in users posts but it's displaying all of the custom posts even those not belonging to the logged in user. Can someone show me what the query is to get only the custom posts by the logged in user               global $current_user;           get_currentuserinfo();     $authorID = $current_user->ID;         $args = array(                   'post_type' => 'post',//or whatever you need                   'posts_per_page' => 5,                   'author' => $authorID                   );              $temp = $wp_query;         $wp_query= null;         $wp_query = new WP_Query($args);


title: Save output of the_content_rss into variable

text: How can I save the output of the function `the_content_rss` into a string variable?


title: Background image in login showing in admin area

text: I have customized my login screen with a logo using html{background:#E2DEAF url(.../images/login_logo.jpg) center top no-repeat;} because it is so wide. Usually would not tie something to the HTML element. works great BUT... it also shows up in the admin area. Anyway to prevent this? I only want it on the login.


title: page template for attachement page?

text: hey guys, I couldn't find anything on the web. Is it possible to have custom template for the image attachement page. I wonder if it is possible to add a navigation to the image attachement page so people can easily navigate through a gallery. Maybe it's even possible to add comments to each image? edit: Moreover is it also possible to query if I'm currently on an attachement page? E.g. for breadcrumbs I want to insert something like "home > back to post > current_image.jpg" edit/update:               function breadcrumbs() {         if (!is_home()) {             echo "Home ⟩ ";             if (is_category()) {                 $category = get_the_category();                  echo $category[0]->cat_name;             } else if (is_single()) {                 the_category('title_li=');                 echo " ⟩ ";                 the_title();             } else if (is_page()) {                 $ancestors = get_post_ancestors($post);                 // echo ancestors                 foreach($ancestors as $id) {                     echo "" . get_the_title( $id ) . " ⟩ ";                 }             } else if (is_tag()) {                 global $wp_query;                 $tag = get_term( $wp_query->queried_object_id, 'post_tag');                 echo "Tag ⟩ " . $tag->name;             } else if (is_search()) {                 echo " Searchresults ⟩ " . get_search_query();             } else if (is_404()) {                 echo "Not found";             //} else if ( is_attachment() ) {             } else if ($post->post_type == 'attachment') {                 //echo "" . get_the_title() . "";                 echo "doesn't work?";             }         }     }


title: Why does my taxonomy code display the first alphabetical term?

text: What i am trying to do is echo the last hierarchial child term for the taxonomy. My taxonomy is `propertytype`. My hierarchial structure is:   * Real Estate (Parent)   * Commercial (Child)   * Offices (Child of Commercial)   * Basement (Child of Commercial) So in the above case i would only like to echo `Offices`, or which ever the last hierarchial child term is. I thought my code below would do this, but it actually echoes `Commercial` because `Commercial` is alphabetically before Offices. Now `Basement` will be ok because it is alphabetically before `Commercial`. How do I always echo the last hierarchial child term only? My code is:               $terms = get_the_terms($wp_query->post->ID, 'propertytype');                         //die(print_r($terms));     $props = array();     foreach ($terms as $term) {          $hasChildrenTest = get_term_children($term->ID, 'propertytype' );         if ($term->parent) {             if (empty($hasChildrenTest) && !is_wp_error($hasChildrenTest)) {                 $props[] = $term->slug;             }         }     }     echo $props[0];


title: problem with guid, when i change the folder name

text: I'm new to WordPress. I started the site as good with folder name `wordpress`. After I changed the folder name from `wordpress` to `test`. And also change the **siteurl** from `http://localhost/wordpress` to `http://localhost/test` in wp_options table. And I modified the **guid** with this refer. My problem is, still I click any 'post' or 'comment', that goes to `http://localhost/wordpress/?p=7#respond` page only. I want that's goes to `http://localhost/test/?p=7#respond`. Anyone can?


title: Filter to remove image dimension attributes?

text: I'm working on a site based on a fluid width css template which sets a max- width on images to the width of the column containing them, and I need to remove the inline **width** and **height** dimension attributes that WordPress adds to images. I'm doing it with my featured images with this filter:               add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10, 3 );          function remove_thumbnail_dimensions( $html, $post_id, $post_image_id ) {         $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );         return $html;     }      I know I can apply the same filter to **the_content** , if necessary. But is there a better way of doing this?


title: Custom Post Type Child Won't Come Through With Pretty Permalinks

text: I'm in a pickle and unfortunately, have almost zero working understanding of mod_rewrite/apache stuff. Here's what's going on: I've got a hierarchal custom post type with parents and children. On my test server, before I can see any of the custom posts, i needed to go to the permalinks settings page and hit refresh. Then I can see parents. When I hit it again, I can see children, and I'm golden. On the actual server (my friend's shared hosting account) -- I follow the same process and the parent's come through -- but not the children. I know it's not a plugin issue, because it's true with them all turned off, and also on the test server with them all turned on. The child posts DO come through when i have the settings at default permalinks -- so I know the posts are actually getting created. I'm thinking it has to be something on the shared server -- any ideas what to look for? It's so weird that parent's work but children don't... Thanks! martin \--Since it's working on the test server, I'm pretty sure my code is right -- but just in case, this is how i'm registering them:               register_post_type('book', array(         'label' => __('Books'),         'singular_label' => __('Book'),         'public' => true,         'show_ui' => true,         '_builtin' => false, // It's a custom post type, not built in!         '_edit_link' => 'post.php?post=%d',         'capability_type' => 'post',         'hierarchical' => true,         'rewrite' => array("slug" => "book"), // Permalinks format         'query_var' => false,         'supports' => array('title', 'editor', 'comments','thumbnail','page-attributes')     ));               add_action( 'init', 'create_book_taxonomies', 0 );     function create_book_taxonomies() {         register_taxonomy( 'format', 'book', array( 'hierarchical' => true, 'label' =>              __('Formats', 'series'), 'query_var' => 'format' ) );          }      -cheers, mc.


title: theme path in javascript file

text: I need to include the path to my theme file within a javascript file. How would I go about this? I have already tried:               var templateUrl = "<?php get_stylesheet_directory_uri(); ?>";          function LightboxOptions() {       this.fileLoadingImage = "'"+templateUrl+"/img/loading.gif'";       this.fileCloseImage = "'"+templateUrl+"/img/close.png'";       this.resizeDuration = 700;       this.fadeDuration = 500;       this.labelImage = "Image";       this.labelOf = "of";     }      This does not give me the path, but just inserts `<?php get_stylesheet_directory_uri(); ?>` instead of the actual path. Any ideas? Thanks in advance!


title: call a string/function from database

text: I need call a string from `$_POST["m_giambellino"]`, etc... (see down), saved in database of wordpress:               if ($_POST["send"] == "Save")              {                  update_option("mese_giambellino", $_POST["m_giambellino"]);             update_option("giorno_giambellino", $_POST["g_giambellino"]);             update_option("mese_teramo", $_POST["m_teramo"]);             update_option("giorno_teramo", $_POST["g_teramo"]);             update_option("mese_solari", $_POST["m_solari"]);             update_option("giorno_solari", $_POST["g_solari"]);                  echo "Evento/i salvati con successo!";              }      into a theme (for example: `<div><?php get_$_POST["m_giambellino"] ?></div>`). How can I do it?


title: Silently register plugin pages

text: I am developing one of my first plugins, and have come across a error: > You do not have sufficient permissions to access this page The plugin has a wizard that uses several forms, obviously I don't want people selecting later forms using the menu. Is there a way to "silently" register a page? Basically, register the page without having it appear in any menu. (I don't like my work around)


title: Blip Slideshow plug in Mootools/jQuery conflict

text: This particular site uses the Blip Slideshow plug in (because it's fed by a Picasa web rss feed) and also a jQuery powered slider. The plug in inserts the Mootools script links ahead of the jQuery ones in the header which breaks the slider. I can push the Mootools links to the footer but then Blip doesn't work. The script that calls the slider is already using jQuery no conflict - I think correctly:               jQuery(document).ready(function() {     jQuery('.fp-slides').cycle({         fx: 'fadeZoom',         timeout: 8000,         delay: 0,         speed: 500,         next: '.fp-next',         prev: '.fp-prev',         pager: '.fp-pager',         continuous: 0,         sync: 1,         pause: 1,         pauseOnPagerHover: 1,         cleartype: true,         cleartypeNoBg: true     });      });       I've read many forum answers about how to use no conflict but don't know where else it may need to be applied to resolve this. The scripts in use are: Mootools v1.3.1 jQuery v1.7.1 jquery.cycle.all I can post links or any other code that might need to be seen if someone can help sort this out.


title: Using dashboard uploader instead of FTP

text: Recently, I change my host server. that causing a problem. When I want upload a new theme or plugin instead of using dashboard uploader want me to enter FTP host and username and password, What I can do to come back to the previous uploader?


title: Use AJAX in shortcode

text: I have the following code to the shortcode to display a random quote. Question: how to make a button display a new random quote? I mean, that would hit the button and show you a new quote (without refreshing the page of course).               function random_quote() {              // quotes file          $array = file("/path to txt file");              // generate a random number between 0 and the total count of $array minus 1         // we minus 1 from the total quotes because array indices start at 0 rather than 1 by default         $r = rand(0,count($array)-1);              // return the quote in the array with an indices of $r - our random number         return $array[rand(0,count($array)-1)];     }          add_shortcode( 'randomquotes', 'random_quote');      I'm interested in how you can update the content on the page using ajax in WordPress? In my situation, because in fact be exactly that. Sorry for my bad English. I hope you understand me. Thanks!


title: Custom text for certain tags

text: Is it possible to write on the page (single post) to display text that changes depending on what kind of tag is specified in the record. I understand that correctly written. For example, through an associative array to make a couple TAG-TEXT. If the record is for the TAG that is specified in an array, it should be displayed corresponding to this tag TEXT. Do you understand what I want? I know there is a function in WordPress has_tag (), but what if I have too many tags? What I want: For example,               if (has_tag ('TAGNAME')) {     <p> TEXT tag TAGNAME </p>          elseif (has_tag ('TAGNAME1')) {     <p> TEXT1 tag TAGNAME1 </p>          ...      and so on (all different tags and text) But how to do it programmatically? Do not write the same each time the design elseif! Especially when the tag. Can not we all in the form of an array? $test = array ('TAGNAME' => 'TEXT', 'TAGNAME1' => 'TEXT1') And then to carry out the inspection on the tag, and the withdrawal of the text you want?


title: "the_excerpt" in loop just keeps repeating first post?

text: I'm trying to edit the loop in my `archive.php` template so that when I visit a category page, it only displays the post excerpt and uses the featured image as a thumbnail. When I add `the_excerpt()` to the loop it displays the excerpt of the first post, but then just keeps repeating it indefinitely? Here's the loop I'm trying to edit / modify:               // Start the Loop     while (have_posts())  {                          the_excerpt();         get_template_part('content', get_post_format());     }          // Display navigation to next/previous pages when applicable     if (theme_get_option('theme_bottom_posts_navigation')) {         theme_page_navigation();     }


title: Is it possible to debug plugins with Xcode?

text: I am mac user and I want to write a Wordpress plugin. Does Xcode work for me or do I need a different and specific IDE for this?


title: Are there any wordpress themes specifically designed for blogs on code?

text: I am using the syntaxhighlighter plugin, which is nice, but creates a horizontal scroll bar if the code is too "broad". I am thus looking for a theme with for wordpress which has much space in the horizontal direction (no sidebar, maybe). Secondary a "codish" look would be nice. I have looked at http://theme.wordpress.com/ but not found the right search phrase to get what I want. Any suggestion?


title: Remove the current item from a menu

text: I have a menu. It has two items:   * the first is a link ("Index", www.domain.com)   * the second one is a link to a category page I have the requirement to remove the first link when I'm on the index page and remove the second link when I'm on that category. Ideas?


title: Is it possible to setup Category wise Subsciption?

text: Is there any plugin in Wordpress, which will allow visitor to subscribe my WP Site category wise? Like when a user will enter his/her mail address to subscriber, (s)he will be asked to select categories on check boxes, so that he will only receive mail alerts for new posts on specific categories he selected.


title: How to make custom comment fields required and message field not required

text: I have a comment form that has `name`, `email`, `brief`, `detailed` and `rating` fields. The `name`, `email`, `brief` and `rating` need to be required, but the latter two are custom fields and I can only make them required through Javascript, but want to add proper WordPress/PHP validation to those fields. The detailed field is actually the `comment_field` which is currently required, but I want to removed the required for this field, but I don't want to do it via the WordPress settings as I still want `name` and `email` to be required.


title: wp_logout_url redirects to incorrect page because of pagination

text:
Following a Wordpress Pagination tutorial, `wp_logout_url( get_permalink() );` no longer redirects to the correct page. Instead of redirecting to say `domain.com/page/2/`, it redirects me to one of the posts in the listed category. Is there a way to fix this?               global $wp_query;            $total_pages = $wp_query->max_num_pages;            if ($total_pages > 1){              $current_page = max(1, get_query_var('paged'));              echo '
';              echo paginate_links(array(             'base' => get_pagenum_link(1) . '%_%',             'format' => 'page/%#%',             'current' => $current_page,             'total' => $total_pages,             'prev_text' => 'Prev',             'next_text' => 'Next'           ));              echo '
';            }


title: How to get gallery images?

text: I have some images uploaded in wordpress posts (eg. post#1, and post#2). Now I've created a new post (eg. Post#3), and in this post I have inserted the WordPress 3.5 gallery, I did not upload any image in the post#3, instead I used the images from the post#1 and post#2. Now in the post#3, I would like to get the links to the images, but I can not seem to get. I am using the following code:               $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );         foreach ( $attachments as $attachment_id => $attachment ) {                 echo wp_get_attachment_image( $attachment_id, 'medium' );        }      It will show only the image if I upload in the post, but it won't show the image if I add from the other posts. So, how can I get the links to the images which are added in the gallery but not uploaded. Thanks for any help.


title: There's some way to add a wrapper around posted images?

text: I need to add a wrapper (I'll use `<figure>` in my example) around images posted through the editor, with a variable depending on the size image is being posted (thumbnail, medium, large, full), something like:               <figure class="$size">         <a rel="attachment" href="....>              <img... />         </a>     </figure>      I already solved the first step, adding the wrapper with a filter through `image_send_to_editor`, but I can't find a way to get the image size so I can add it to the class. Any clue?