title: How can I hide certain submenus of the Settings tab in the dashboard?

text: I'd like to hide certain menus like Media, Privacy, and Permalinks. I've been using the following code to hide entire parent menus but not sure how to go about for submenus.               function remove_menus () {     global $menu;             $restricted = array(__('Links'), __('Comments'), __('Appearance'), __('Tools'));             end ($menu);             while (prev($menu)){                 $value = explode(' ',$menu[key($menu)][0]);                 if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}             }     }     add_action('admin_menu', 'remove_menus');


title: Looking for a simple e-commerce plugin

text: I looking for a simple Wordpress e-commerce plugin which will just associate a downloadable product to a post (here a custom post type) and handle the payment with Paypal and the download page. There are a lot of different plugin but they always provide a complex catalog, create a lot of useless page and don't provide a simple way to add in my post a simple "buy now" button which go directly to payment. Are you aware of a plugin which meets these needs?


title: Wordpress time queries

text: When we setup the timezone in wordpress settings page. Does it changes the server time? If I call `time();` does it returns unix time according to timezone setup in the settings page? I have checked this page here How to get WordPress Time Zone setting? So, if i need to show suppose the current time of a neighborhood site what modification i have to do with the output of `time();` function? The php `time();` returns the time in the server. So is that depends on where my host belongs? Thanks in advance!


title: Fixed top-level menu

text: I'm developing a site which has around 10 top-level pages in the menu and each have 4-5 child pages in the sub-menus. I am giving the site users the "Editor" role which I have customised using a plugin to change some of their capabilities. I'd like to give them access to the Wordpress menus editor so they can move pages from one sub-menu to another if necessary, but I don't want them to touch/move/delete/edit the top-level links. Is is possible to have these fixed so they are not draggable? The reason for this is that they can have less which is fine, but if they add more then the styling of the menu will all be misaligned etc. Thanks


title: How do I find the code executed when wp_head() is called?

text:
I am working on editing the header.php file and I am a bit confused. I am editing the header.php file and I see a call in it to wp_head(); I know that it calls a "callback function" with something like this:               add_action('wp_head' , 'callback_function');      But I am not sure how to find that. Where should I look for it? Basically I need to edit how the tag is configured there. EDIT: This is the full header:               <?php     /**      * Core header file, invoked by the get_header() function      *      * @package Suffusion      * @subpackage Templates      */          global $suffusion_unified_options, $suffusion_interactive_text_fields, $suffusion_translatable_fields, $suffusion_skin_dependence, $suf_color_scheme;     if (function_exists('icl_t')) {         foreach ($suffusion_unified_options as $id => $value) {             /**              * Some strings are set interactively in the admin screens of Suffusion. If you have WPML installed, then there may be translations of such strings.              * This code ensures that such translations are picked up, then the unified options array is rewritten so that subsequent calls can pick it up.              */             if (function_exists('icl_t') && in_array($id, $suffusion_translatable_fields) && isset($suffusion_interactive_text_fields[$id])) {                 $value = wpml_t('suffusion-interactive', $suffusion_interactive_text_fields[$id]."|".$id, $value);             }             global $$id;             $$id = $value;             $suffusion_unified_options[$id] = $value;         }     }          $queried_id = get_queried_object_id();     $hidden_elements = array();     if ($queried_id != 0) {         $hide_top_navigation = suffusion_get_post_meta($queried_id, 'suf_hide_top_navigation', true);         if ($hide_top_navigation) {             add_filter('suffusion_can_display_top_navigation', 'suffusion_disable_component_for_view');             $hidden_elements[] = 'no-top-nav';         }         $hide_main_navigation = suffusion_get_post_meta($queried_id, 'suf_hide_main_navigation', true);         if ($hide_main_navigation) {             add_filter('suffusion_can_display_main_navigation', 'suffusion_disable_component_for_view');             $hidden_elements[] = 'no-main-nav';         }         $hide_header = suffusion_get_post_meta($queried_id, 'suf_hide_header', true);         if ($hide_header) {             add_filter('suffusion_can_display_header', 'suffusion_disable_component_for_view');             $hidden_elements[] = 'no-header';         }         $hide_footer = suffusion_get_post_meta($queried_id, 'suf_hide_footer', true);         if ($hide_footer) {             add_filter('suffusion_can_display_site_footer', 'suffusion_disable_component_for_view');             $hidden_elements[] = 'no-site-footer';         }     }     ?>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>                   <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />         <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />          <?php         suffusion_document_header();         $suffusion_pseudo_template = suffusion_get_pseudo_template_class();         if (is_singular()) {             wp_enqueue_script('comment-reply');         }         $skin = isset($suf_color_scheme) ? $suf_color_scheme : 'light-theme-gray-1';         $extra_classes = $suffusion_pseudo_template;         if (isset($suffusion_skin_dependence[$skin])) {             $extra_classes = array_merge($extra_classes, $suffusion_skin_dependence[$skin]);         }         $extra_classes[] = $skin;         $extra_classes = array_merge($extra_classes, $hidden_elements);         wp_head();       ?>               <body <?php body_class($extra_classes); ?>>         <?php suffusion_before_page(); ?>             <?php                 suffusion_before_begin_wrapper();             ?>
             <?php                 suffusion_after_begin_wrapper();             ?>
                     <?php                         suffusion_after_begin_container();                     ?>      Thank you!


title: Register multiple users in one form

text: Is it possible to have a form in WordPress that would allow more than one user to register at a time? So say I wanted to be able to add 5 users at once, is this possible to do with the default registration form or is that limited to one user? It would be one form (or multiple, but need all to submit at once) on the front-end that the user could add multiple emails to and it would set them up as subscribers and send out the generated password to each email listed. I can't figure out a way to add more than one at a time. Would be using something similar to this, but with multiple users.               <form id="register-form" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post">         <input type="hidden" name="user_login" value="Username" id="user_login" class="input" />         <input type="hidden" name="user_email" value="E-Mail" id="user_email" class="input"  />         <?php do_action('register_form'); ?>     </form>      Any ideas? Thanks


title: How to target specific user role?

text: I'm trying to place a simple bunch of codes to redirect the 'Subscribers' only, to the home page (or a desired page) after login. I thought to use `if( current_user_can('read') ):`, but that's a global capability, will be applicable for all the other roles too. So I tried `get_role('subscriber')`. Here are my `functions.php` codes (thanks to Len):               function subscriber_redirection() {         global $redirect_to;         if( get_role('subscriber') ) {             if ( !isset( $_GET['redirect_to'] ) ) {                 $redirect_to = get_option('siteurl');             }         }     }      But it's redirecting the administrators too!   * **How can I target only a specific user role for a purpose?**


title: Planning on Multisite Before Creating A Network

text: On the page http://codex.wordpress.org/Before_You_Create_A_Network, this message I'm quoting seem to be implementing if the "types of multisite network" is **path-based** or **web pages** only. Can you also say that this message is applicable for subdomains and domains knowing that there can be issue on SEO duplicate content, user administration, and URL redirection from `partners.example.com/products` to `www.example.com/partners/products`? > If you plan on creating sites that are strongly interconnected, that share > data, or share users, then a multisite network might not be the best > solution. If all you want is for different collections of web pages > [“provided that this is a web page, but not subdomains”] to look very > different, then you can probably achieve what you want in a single site by > using a plugin to switch themes, templates, or stylesheets. If all you want > is for different groups of users to have access to different information, > then you can probably achieve what you want in a single site by using a > plugin to switch capabilities, menus, and link URLs. Because the way I see it, the biggest problem might be about URL redirection. Knowing that you have a single Wordpress site that was installed in `www.example.com` and your directory could be `www.example.com/partners`, then in your DNS you have configured to point `www.example.com/partners` to `partners.example.com`, if the link that you are going to give out is `partners.example.com/products`, would it be redirecting to `www.example.com/partners/products` or maybe worst... it goes to `www.example.com/products` because Wordpress was installed as `www.example.com`. So my question is... Is there a way to go about this? or should I use a multisite if this is the case?


title: What would prevent a custom role from viewing posts (both standard and custom)?

text: I am using a custom role (from the premium plugin wp-client) but for some reason it can't view posts or pages of any kind. WordPress shows the correct post count but only shows the message "No posts found". ![Post count shows posts exist but they aren't displayed...](http://i.stack.imgur.com/ShJQ8.png) Strangely, it is possible to edit the post content if you have the right edit url (i.e. example.com/wp-admin/post.php?post=XXX&action=edit). I have tried using multiple capability managers to assign the correct permission levels but this has no effect. This behaviour is identical across posts, pages and custom posts. Other custom roles made by the plugin can view everything normally. What could cause this?


title: How do I add a field only to certain default WordPress widgets

text: I've made a plugin that adds a language select field to all admin widget forms based on the following three pages and and a bit of extra googleing to solve some specific issues:   1. http://stackoverflow.com/questions/12351603/wordpress-add-config-option-to-all-widget-settings   2. http://shibashake.com/wordpress-theme/wordpress-widget-system   3. http://kreativkonzentrat.de/en/blog/wordpress-input-felder-und-klassen-zu-bestehenden-widgets-hinzufugen.html It works pretty much as I'd like it to. I only have one small problem left to solve. For now I've made it so that it will only affect certain widgets front end, e.g. the default text widget, using code like this:               if ($widget_class->id_base != 'text')         return $instance;      But how can I achieve the same back end, i.e. only show the select field on certain widgets, so that I don't confuse the client too much?


title: query only direct child and sub-terms of a current term archive

text:
i'm using woocommerce on my theme, and it comes with a proudct_cat term as a defualt catagory on the shop proudct. I need to show on every proudct_cat archive its direct child and the sub-tems, but not the sub terms child. I tried:                       <?php $thispage = $wp_query->post; wp_list_categories("taxonomy=product_cat&term=". $term->slug."&title_li=&child_of=".$thispage->slug);?>      and it returned all proudct_cat as ul and the sub-term of the archive im in, but not the archive's children. I tried:               global $post;             $terms = get_the_terms( $post->ID, 'product_cat');             foreach ( $terms as $term )             $currentID = get_the_ID();             $args=array(                 'taxonomy'=>'product_cat',                 'term' => $term->slug,                 'child_of'=>$currentID              );                  $my_query = new WP_Query( $args );          ?>                  <?php if ( $my_query->have_posts() ): ?>             <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
 <a href="<?php the_permalink(); ?>" id="booklink"><?php the_title();?>
             <?php endwhile; ?>         <?php endif; ?>      and it returned all the the current archive's children and the sub-terms children without the sub-term it self. So i tried :                       $term_id = $terms;             $taxonomy_name = 'product_cat';             $termchildren = get_term_children( $term_id, $taxonomy_name );                  echo '
';             foreach ( $termchildren as $child ) {                 $term = get_term_by( 'id', $child, $taxonomy_name );                 echo '
name, $taxonomy_name ) . '">' . $term->name . '
';             }             echo '
';      and it returned nothing. I'm Speechless. anyone have a clue? *sorry for my poor English


title: Create option for custom posts types

text: I'd like to add options to a custom post type and I have no idea how to deal with it. Options should be treated as parameters for my custom post type. For instance I'll get a "Plublic / private" flag which will allow some content of my post type to be readable or not. Any help would be appreciated !


title: plugins_url('',__FILE__) != WP_PLUGIN_URL with sym links

text: For one of my many sites, `plugins/plugin-name` is a sym link pointing to `universal-install/wp-content/plugins/plugin-name`. `echo WP_PLUGIN_URL` displays what I expect.   `echo plugins_url();` displays what I expect.   `echo plugins_url('',__FILE__)` displays what I expect followed immediately by the absolute path to the universal plugins directory. Is there any way I can fix `echo plugins_url('',__FILE__)` to return only the expected result?


title: Comment form in wordpress theme returns a javascript alert

text: I have a wordpress custom theme that started giving a weird error out from the blue. Every time you post a comment it will return a javascript alert with all the content of the page. I haven't made any changes to the theme that would have effect in this so I have no idea why is this happening, I tried removing all the javascript of the theme, updating the comments related files in the server (the same error happens locally) and replacing the comments.php with a generic template or using `<?php comment_form(); ?>` instead of `<?php comments_template(); ?>`. You can test it in http://www.faf.fi/uutiset/faf-international- ohjaajakoulutukset-alkavat-pian/ (text in Finnish, Nimi = Name, Sähköposti = Email). Any ideas?


title: How to add an image as a bullet point in a specific WordPress widget?

text: I am using a widget to show latest tweets in my blog. The widget shows latest tweets as a list item. The default list bullet point (black square bullet point) of the theme is shown. I want to change the bullet point to a custom image or symbol (for example, a small twitter bird picture). How can I do this specifically for that particular widget? PS. The widget directory does not contain any CSS file.


title: Implementing Zurb's Interchange Into Wordpress

text: I'm really scratching my head trying to figure out the best method for responsive images with Wordpress. Zurb just released a new javascript plugin for their Foundation framework. I'm using Foundation in my custom theme, but I'm just unsure as to how to make featured images work with this? Can anyone help me out with getting it to work with WP? http://zurb.com/playground/foundation-interchange Ps. Just want to clarify. Not exactly talking about making an images responsive. I know how to do that, but I'm talking about loading the different size images that WP creates, based on the screen size or device.


title: Email Subscribe for Downloads in Wordpress

text: I have a wordpress blog. I want to allow download files for only subscribers. How can I do that ? Any help would be appreciated. Also when I get the email of user, the user must be subscriber first and then can download the file or files. I removed feedburner I have nothing. I want only that to download any file subscriber condition for visitors. Like in the androidhive


title: How can recognize post's category?

text: I want my plugin to recognize post's categories before post is loaded. i wrote this code but it works in category page not in post's page with the category is specified from me.               function checkUser() {         if(is_category('programming')){//it doesn't work when post with "programming" category is being displayed                 echo "Bingo!";             include_once ('TEMPLATEPATH/get-messages.php');             exit();         }     }      add_action('template_redirect', 'checkUser');


title: Pagination problem

text: I have two custom rewrite rules:               add_rewrite_rule('foo/bar/?', 'index.php?post_type=foo', 'top');     add_rewrite_rule('foo/bar/([a-z]+)/?', 'index.php?post_type=foo&bar=$matches[1]', 'top');      Which gives me posts that match a custom variable `bar`. However, I want to handle pagination too, thus when a number succeeds `/bar/` wordpress should treat it as a page number. I wrote:               add_rewrite_rule('foo/bar/([0-9]+)/?', 'index.php?post_type=foo&paged=$matches[1]', 'top');      In my custom function which is attached to `pre_get_posts`, I process the page number:               if($query->get('paged')) {         $query->set('paged', intval($query->get('paged')));     }      However, when user accesses, say, `foo/bar/2`, wordpress automatically appends `/page/2/`, (e.g. in the address bar I get the following URL: `foo/bar/2/page/2/`). Although the pagination itself works fine (I get the desired records as expected for each page) this `/page/n/` messes up my links on the page and it is an unnecessary duplication in my url. How can I get rid of it?


title: Problem using is_single() to enqueue script from functions.php

text: I'm having trouble only adding scripts to single post pages. I need to both include and exclude certain scripts using is_single() but it doesn't work either way I try it. I have the template tag on the top of custom single post templates...               <?php /* Template Name: Single Default */ ?>      And I use this to call a script from the functions.php               if (!is_admin()) {      if (is_single()) {         wp_register_script( 'jquery-scroll', get_bloginfo('stylesheet_directory').'/libs/jquery.jscrollpane.min.js' );     wp_enqueue_script( 'jquery-scroll' );      }     }


title: Order terms by count - missing terms

text:
I have this problem: I'm using get_terms with ordering by count. And some terms are missing - I have no idea why, there is no exlude, or hide posts or anything like this. What is wrong? Here is the code:               <?php $terms = get_terms("autorzy", array('orderby' => 'count', 'order' => 'DESC'));         $count = count($terms);         if ( $count > 0 ){         echo "
";             foreach ( $terms as $term ) { ?>     <?php echo $term->name; ?>     <a href="<?php get_term_link( $term ); ?>" class="avatar-link">     <?php echo term_description( $term->term_id, 'autorzy' ) ?>         <?php } echo "
"; } ?>      EDIT: this term isn't empty, and that problem is only with orderby count. Now is set "name" and it shows: http://wszystkoconajwazniejsze.pl/autorzy/ my problem is with the last one - Lemańska.


title: Add anchor tag on previous_image_link / next_image_link

text:
I am using big headers on my website.I need the next/previous_image_link to target to the picture , not the top of the page. Is it possible to add anchor or to set the target on next/previous_image_link? or any other method to go to specific position on page. I found on my image.php:
<?php echo previous_image_link('','Previous Image') ?>

      __


title: Serialization problem after auto-update

text: I am having a problem with WP serialization. To cut a long story short: the problem appeared two months after the site launch. All the strings of text that were stored as a `theme_option` or as a meta box all turned into a letter "A". I guess it happened when WP self-updated to version 3.8.1, but I can't really be sure... At first - I thought it's a plugin bug. I use Option Tree as a solution to store theme options and meta boxes. I started an issue on the plugin's repo on github. The author of the plugin hasn't answered yet but after some digging and var_dumping I noticed that not only Option Tree's strings were "A"s but also Contact Form 7's. There on github I've described in more details. To solve the issue of "A"s of `theme_options` I wrapped the string in the `@unserialize` function - and it worked well. But the meta boxes remain. This solution is a temporary fix. So I'm at a loss ). You can see the problem online at http://saikoteam.by (mind it's in Russian). The `Warning`s there - are a result of different `foreach` loops getting `string("a")` instead of an array of values. I will be glad if anyone could point me to the direction of solving the issue.


title: show previous/next post orderer by title in custom post types

text: What's a working method to show link to next and previous same custom post type article, ordered by title and not id? (generally applying a filter to the order)


title: How to read a page's "Shortcodes" from the Template File?

text: Lets say i have a Page, and it contains some `shortcodes` like:               [myshortcode foo="bar" bar="bing"]     [anothershortcode foo="bing" bing="bar"]      Then how do i read those from my custom Template File, to manipulate please?


title: List Posts of a Custom Post Types Ordered by Terms of a Custom Taxonomy?

text: I've created a custom post type and custom taxonomy. I can now create a new post and associate it with a custom category. The problem is listing these news post types. This:               $loop = new WP_Query( array( 'post_type' => 'sobeedesce' ) );     while ( $loop->have_posts() ) : $loop->the_post();       the_title();       echo "<br />";     endwhile;`      lists all custom posts ok. But I want to list them by category, so adding `'cat' => 12` returns nothing. I know my custom category id is `12` and I can confirm that by doing               $custom_terms = get_the_terms(0, 'cat_sd');     print_r($loop);`      inside the loop. I'm missing something here. Can someone help me? Thanks.


title: Best Live Writer plugins to post code snippets on WordPress?

text: I have a blog about programming hosted on WordPress.com. To post code snippets I use the SyntaxHighlighter plugin that is installed on that platform, and I'm very happy with it. Now, I'd like to use Windows Live Writer to write my articles, because it's much more convenient than the web-based editor. I found many WLW plugins to post code snippets, but it would take ages to try them all... also, most of them seem to do their own formatting, or need custom CSS (which I'd prefer to avoid because it's not free). Ideally, I'd like to be able to continue using the SyntaxHighlighter WP plugin mentioned above, which allows me to simply paste code between `[sourcecode]` tags, like so:               [sourcecode language="csharp"]     public class SimpleGrid : Grid     {         public IList<GridLength> Rows { get; set; }         public IList<GridLength> Columns { get; set; }     }     [/sourcecode]      Which WLW plugins would you recommend ? Is there one that can produce the markup shown in the snippet above ? * * * EDIT: This one does exactly what I want, thanks to jjeaton for the link !


title: Pros/Cons of “WP e-commerce” and “Shopp” plugins

text: I've been looking around for ecommerce functionality for a project that I'm going to be working on. My partner and I will be converting an existing static catalog site with lots of items. We want to do it in Wordpress because it's a basic CMS. Many of the items are variations of other items, some items will have multiple variations. I guess the best example would be let's say a shoe...it has different sizes and different colors. But they don't stock every combination of variations. This is very typical of a store right. They have carry sizes 7, 9, 11 and the 11's only come in green/blue and red/yellow. I need a solution that will allow me to specify these variations easily so that I basically don't have to enter each variation as a new product. Looking around the web and on forums like Stackoverflow, WP e-commerce and Shopp seem to be the two standouts. What have people's experience been with these two products? What are the pros/cons? Which one would you recommend? **Followup** When would one move away from a Wordpress plugin to something like Magento or OS Commerce? What do those packages have that the plugins do not? I had a cursory view of Magento and OS Commerce and they seemed really complicated...lots and lots of options.


title: How to set a custom title per language?

text: I am running Qtranslate for my website. I am very impressed by this plugin. Now my only problem is that I cannot set a custom title and description for my homepage per language. I can only setup one line for the title in the general settings for my website. I have installed Qtranslate META where I can set a custom title and description per page, but my only problem is the homepage. Any help would be realy appreciated how to fix this! Thanks


title: How can I create a taxonomy meta-box with search suggestions but no new terms input?

text: I was wondering how I could setup a taxonomy metabox on a post edit page that would be similar to the "tags" kind (with search field and automatic suggestions), but without the right to add a new term. So for example if I'm typign a word, I get suggestions of terms that I can use from the existing terms list, but if I type a word that doesn't exist, then it doesn't add the terms to the list. **EDIT** Actually, what I'm looking for is exactly the behavior of the "Search" functionality in the Menu Editor : ![enter image description here](http://i.stack.imgur.com/WS7wS.png) As this is a core WP behavior, is there a way to use it on post edit pages too ? I'm wondering because these blocks look exactly the same, both have the "view all" and "most recent" tabs, but "search" is only present in the Menu Editor.


title: Crop images in both sides on wordpress

text: > **Possible Duplicate:**   >  How can I make add_image_size() crop from the top? When generating a thumbnail or featured image the wordpress resize the smallest side and then crop the largest side. I need to make it crop both sides on **post thumbnail** or on **featured image** in functions ( **preferable** ). Any way to reach this using an wordpress **plugin** or **hack**?


title: Override default cropping in Wordpress

text: > **Possible Duplicate:**   >  How can I make add_image_size() crop from the top? Is there any way to have cropping happen from the center point in an image? All of my Featured Image uploads are cropped poorly (mostly website screenshots), and I'd love to have those crop instead from top/center for preview versions of the image (such as what would show on index.php [loop] in the theme). I saw this, but I absolutely hate hacking the core out of fear a Wordpress upgrade with cause my changes to vanish. Any recommendations are welcome. I prefer to do this via functions.php if possible, rather than edit my 99% completed theme.


title: Change crop position on featured image crop

text: I've set a featured image on my pages and want to crop them to a certain dimension. The problem is that it crops those dimensions in the center of the photo vs. from the top left (0,0) position. How can I set it so that the the crop starts from the top of the photo? HTML:               <div class="post-thumb">          <?php the_post_thumbnail( array(960,300) ); ?>     </div>


title: How to display WP Query filters?

text: I'm wondering if there is a way to display current WP Query filters. I wrote a function that is supported to delete all posts and it does but when I'm using WPML and it filters posts by language then it does not remove non-English posts. I thought that using `'suppress_filters' => true` will help but will this cause any drawbacks? What other filters are applied to WP Query? Can I display them somehow?


title: How to get type of archive whether it is post or date or category archive?

text: using function `is_archive()` we can know whether it is archive page or not. But if it is archive page how can i find whether it is author archive page or category archive or date archive. I have found this code in wp-includes/query.php               if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax )     $this->is_archive = true;      but dont know how to use it in wp_head action. Based on archive page category or author or date archive, i want to out put specific meta tags in header. Any help??? Thanks in advanced. wordpress.stackexchange.com rocks!!


title: How to fetch serialized data from wordpress options

text:
I have the following serialized data in a wp option `a:2:{s:5:"Title";s:11:"your title";s:7:"Message";s:20:"Hola testing testing";}` I would like to return it to be used in a form, and show it also in the front end, I tried               <?php echo get_option('notice_data[Message]'); ?>      this is the array               $notice_data = array(         'Title' => '',         'Message' => ''     );     add_option("notice_data", 'Default', '', 'yes');      I am creating a plugin that have a settings page with two forms that save the data in the wp option in order to be used by the jquery function inside a js file, here is part of the settings page;               <textarea name="notice_data[Title]" id="notice_data" />     <?php echo get_option('notice_data[Title]'); ?>     </textarea>

     Body Message	          <textarea name="notice_data[Message]" id="notice_data" cols="40" rows="10" />     <?php echo get_option('notice_data[Message]'); ?>     </textarea>      I am also localizing the script to fetch the data saved in the wp option to be used inside a jquery function that shows the messages when certain conditions are met, so how do I fetch the serialized data?


title: Ajax : Call undefined function plugin_function() ... can't call any plugin function

text: I use a Ajax query to show some content, but I can't use any of my plugins functions. Javascript :               $('#load_more').click(function() {         var data = {             action: 'load_more',             id: $("input#id").val()         };         jQuery.post(ajaxurl, data, function(response) {             $("#content").append(response);         });     });      PHP in functions.php :               function load_more(){         $id = intval($_POST['id']);              if(!isset($id) or !is_numeric($id)){             echo "Error";}         else {             $works = plugin_function($id);             wordpress_function_works($id, $works);}         die;     }     add_action('wp_ajax_load_more', 'load_more');     add_action('wp_ajax_nopriv_load_more', 'load_more');      The Ajax works fine, it can call & work with any of my wordperss functions. But when I call a plugin function, it returns an error `Call undefined function plugin_function() line...` PS: `ajaxurl = /wp-admin/admin-ajax.php`


title: Problems with migrating a WooCommerce orders

text: I am trying to import/export orders from one WooCommerce website to another. After using the WordPress import/export tool for the "orders", the individual order page no longer shows the product(s) that were ordered for each invoice. When I view an individual order, the "Order Items" box is empty. Is there a way to fix this? Here is an image to show what I am talking about. http://support.woothemes.com/attachments/token/iddtqxsxdquthvv/?name=woocommerce.jpg


title: PHPUnit testing WordPress Plugin

text: Using answers on this site and from other resources, I have started writing my next plugin using PHPUnit tests and the WordPress test environment. Distilling down what I have in my plugin's `bootstrap.php`:               define( 'WP_TESTS_DIR', 'pathToMyWordPressTestsFromSVN');     define( 'TEST_PLUGIN_FILE', 'pathToMyPlugin/myPlugin.php' );     require_once WP_TESTS_DIR . 'includes/functions.php';     require WP_TESTS_DIR . 'includes/bootstrap.php';          function _manually_load_plugin() {         require TEST_PLUGIN_FILE;         if(is_plugin_active(TEST_PLUGIN_FILE)){             echo "PLUGIN IS LOADED AND WORKING!!!!";         }     }     tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );          // Normally you'd find "require WP_TESTS_DIR . 'includes/bootstrap.php';" down here...      In essentially every example, the WordPress test environment `bootstrap.php` is loaded last. This seems strange because if I load it earlier, I get access to functions like `is_plugin_active` which I imagine will be useful when testing plugins that require others...and bailing out if the requirements aren't loaded for some reason. **Is there a reason the test environment is bootstrapped at the end...other than habit/convention?**


title: How to list groupings and keep pagination

text: I have need to make a very custom query, and I'm not sure how best to approach it. Assume I have a custom post type that is called `Package` and three terms `(basic, pro, premium)` for the taxonomy `(level)`. What I need to do is list these in a loop with the premium ones first, followed by the pro ones, and finally the basics. Each grouping should be listed in a random order. I have accomplished this using three separate queries, but this makes paging basically impossible. I'm also using user input to generate this loop, so some code samples of how I should actually build the request would be extremely helpful. Let me know if more information is needed.


title: Cause of Blank Lines Being Added to WP FIles?

text: **Does anyone know why some of my websites add a blank line after every line of code, while others on the same host and server leave the files untouched?** A few details that might help:   * PHP Version 5.3.5   * Linux Servers   * MySQL- Client API version 5.1.56   * SERVER["HTTP_ACCEPT_CHARSET"] (ISO-8859-1,utf-8;q=0.7,*;q=0.7) **NOTE** : I can provide additional config info, I wasn't sure which details if any would be helpful. I can download the file via FTP and the additional lines are present, but if I copy and paste from the WP Theme Edit page the additional lines aren't there. This is more of an annoyance than a problem. I don't believe any problems are caused by the odd behavior, but I am curious to know if anyone else has noticed this and if anyone knows the cause. I'm not sure if this is a WordPress or simply a server config issue. Any input is appreciated. Regards, JJ


title: pop-up options for custom quicktags

text: I always use HTML editor when writing an entry in my wordpress blog, I'm not sure why I can't bring myself to like the TinyMCE editor. After a while, I started to think about creating my own quicktags for HTML editor to make writing easier in the future. thanks to this article, I now (kinda) understand how to make my own quicktags. but after re-reading the article a couple of times, I still couldn't find a way to make a pop-up window like the one that the default link quicktag has. Can anyone tell me how to make something like that? a way to make a pop-up options for quicktag, so that I could easily entered the arrays for my custom quicktags. Thank You.


title: get_posts output always same post

text:
I'm trying to output the last (chronologically) 4 posts having the tag (slug) "pp".
     <?php     $args = array( 'posts_per_page' => 4, 'taxonomy' => 'tag', 'field' => 'slug', 'terms' => 'pp' );     $tag_posts = get_posts( $args );     foreach ( $tag_posts as $post ) :        setup_postdata( $post ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endforeach;      wp_reset_postdata(); ?>
      This snippet though output 4 entries of the same post, which is the fourth from last! How come? :)


title: Limit number of posts in WP_query per month

text: How can I limit number of posts per month in the loop as follows: Today is June. In the loop there should be ten most popular posts (based on custom field page_views) for June and May, five for April, three for March and then one most popular post per month. Thank you.


title: How does register_setting and settings_fields work?

text: In the WordPress settings API, I understand that `register_setting()` must be called for `add_settings_field()` to be saved and updated according to the codex. Since almost every WordPress function has an ID, slug, name, key or whatever they might be called which links from one function to another, I don't see how `register_setting( $option_group, $option_name)` link to any settings api function. `$option_group` is used when `settings_field()` is called. Question 1: But what does that really do? The second parameter `$option_name` is simple, `get_option($option_name)`. Yes I unsderstand that. Another function `do_settings_sections()`, from what I understand, is pretty simple. It asks for the slug / id / name of the page from `add_options_page()` you defined, which is linked to `add_settings_section()` and `add_settings_field()` in the same sensible manner (id / slug / name / etc). So now for the main question: How does `register_setting()` knows which settings I'm relating to? I'm sorry if I sound so confused, because maybe I AM confused. Gladly appreciate any help guys. Thanks.


title: Add posts of a certain category to a page

text: I have posts with a certain category(Blog Posts) and I would like to add these to a certain page(Blog). What can I do to add my category to a certain page? I really appreciate your help!


title: Server ip to Domain

text: Currently my server instance is running wordpress (for example: `http://12.345.678.901`) if that were my ip once you hit that URL you would then get the index page. I'm going to move all this of course to a domain, and wasn't sure what I needed to change on the port over. (I know about the Apache configs to point to the domain etc.) I'm mostly wondering about url links etc? Can I do the suggested WP_config method? IE:               define('WP_HOME','http://example.com');     define('WP_SITEURL','http://example.com');      Or do I go hardcore and do a search and replace in the database? (I know previously I had to do that from moving to one server to another, but in this case I'm still on the same server..) Better to be safe then sorry, thanks for the help!


title: Moving WP from /blog to root directory

text: I'm moving a WordPress installation from /blog to the root directory on the server. There weren't more than ten blog posts in the blog, but I'm concerned about Google finding dead urls. Is there an easy way to handle redirects? A plugin, etc. Or a simple best practice? Thanks very much.


title: Problem when i configure permalink

text: When I changed the permalink to `/%postname%/` I lost the connection with server... and I need to clean .htaccess to access again... how can i fix it? What do I need to put in .htaccess? My current `.htaccess` is:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d          </IfModule>     # END WordPress


title: Downloading Wordpress: Nightly Build vs. Stable Download

text: Whats the difference between a nightly build and the latest stable download, and what is the ideal use case for each? On the Nightly Build Page it says: > Development of WordPress moves fairly quickly and day-to-day things break as > often as they are fixed. This high churn is part of our development process > that aims to produce the most stable releases possible. Should this be interpreted to mean that the Nightly is a version with less bugs? I've been on support threads where an issue is brought up and it's suggested to download the nightly build (on WordPress forums and elsewhere) and I'm wondering if this is a best practice? Thanks very much.


title: How to create a custom loop ordered by Categories on a Page Template?

text: Ex. Category 1 Post 1 Post 2 Post 3 Post .... Category 2 Post 1 Post 2 Post 3 Post .... Category .... Post 1 Post 2 Post 3 Post ....


title: Run a jquery script on on a certain template page

text: All I want to do is basically this:               wp_register_script( 'jquery_zebra', get_bloginfo('stylesheet_directory') . '/library/scripts/jquery.zebra.js', array('jquery'));         wp_register_style( 'css_zebra', get_bloginfo('stylesheet_directory') . '/library/styles/zebra.css' );     //enqueue scripts     wp_enqueue_script('jquery_zebra');     wp_enqueue_style('css_zebra');      But only on a certain template page. I don't care if this is in a plugin or my functions.php or in the template-page.php iteself.


title: How to run a test WordpressMu to Wordpress3 update?

text: Currently I am running a wordpress MU site with ~100 blogs. It's Wordpress MU version 2.8.x Because it was so heavily used, I was asked not to update to Wordpress 3 right away. The users are worried that their plugins and themes may not work once I've upgraded. Indeed, we activated some plugins that I suspect will stop working because there have not been any updates to them in a while. Other users are anxious to start using Wordpress 3 and the new features. So, what I have to do now is somehow test what the update will look like, and let users log in to test how their site will look in Wordpress 3. My question is, what is the best way for me to test the upgrade? My the root of my Wordpress MU is at mydomain.com, and the sites are in the directory below, such as mydomain.com/henrys-blog Thanks for your help


title: Set padding for all content except images and few more elements

text: I want to have left and right 10px padding for all content inside post/page, but not for images, videos, galleries, tweets, pre, hr and few more. So that elements must be full width. So I set:               .content {       padding: 0 10px;     }      Now I bring desired elements back to no-padding by setting negative margins:               pre,     hr,     .gallery {       margin-right: -10px;       margin-left: -10px;     }      And that works like expected, but not for images. So this:               .wp-caption {       margin-right: -10px;       margin-left: -10px;     }      Doesn't work. It does work for right margin OR left if I set float:left, but not both right and left at a time. I tried to remove all theme's styles to figure out what to blame for such behavior, but it didn't help. Also, Wordpress adds 10px to the width of .wp-caption container. Why is that? Does it have something to do with my problem? Thanks!


title: wordpress custom login successful redirect hook

text: I am using a custom login form imported on my theme's home page through jqModal. In that, when i successfully login it redirects to the same page. I want to redirect based on the logged in user role. I will prefer a response with some editing in my functions.php or adding a mini plugin. Because I dont want wordpress original files to be edited for future updating hassles.


title: Problem displaying one post from each category

text:
i had been banging my head for almost a day but could not resolve it. i need to show one post from 4 xx categories here is my code                               <?php                     $cat_args = array(                       'orderby' => 'name',                       'order' => 'ASC',                       'include' => '44,45,46,51'                     );                          $fcategories =   get_categories($cat_args);                           foreach($fcategories as $fcategory) {                         echo '
';                         echo '
 term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $fcategory->name ) . '" ' . '>' . $fcategory->name.'
';                               $post_args = array(                           'showposts' => 1,                           'category' => $fcategory->cat_ID                         );                              $fposts = get_posts($post_args);                          foreach($fposts as $fpost) : setup_postdata($fpost);    ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                         <?php                              echo '
 term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $fcategory->name ) . '" ' . '>View all posts in ' . $fcategory->name.'
';                         echo '
';                     endforeach;                          }                     ?>      Every think seem to work perfectly except.... its showing only one post for all category while it should have shown one post from each category to be more specific its showing like cat-1 cat-2 cat-3 cat-4 (this is ok)   post-1 post-1 post-1 post-1 (this is the prob) while it should have been cat-1 cat-2 cat-3 cat-4   post-1 post-2 post-3 post-4 Please help


title: How to get blog_id of an MU site when running a custom function on the parent site

text: Simple enough question, but one which is proving difficult to find a solution to. Quick preamble - the situation this is addressing is a MU network using sitewide tags plugin which pulls all network posts to the main site's home page, then timthumb is used to scale the images of each post which are retrieved using a custom get_first_image function. The usual problem occurs whereby the image retrieved by the get function has a relative path rather than the absolute URL needed by timthumb, hence I run it through a filter to reconstruct the absolute URL. All works fine except blog_id always equals '1' for every post. This is clearly because the blog_id on which the function runs upon (i.e. the main parent blog) is '1' and therefore I need to determine the blog_id for the original post and use this when reconstructing the absolute URL. Can anyone help? I have tried using the wordpress function, `get_blog_id_from_url` but there's very little guidance or examples on its use. I have also tried variations of `$current_site->blog_id` and `$GLOBALS['current_site']->blog_id`, but I have been so far unable to return any blog_id value except 1.


title: Timepicker-addon doesn't show - Datepicker works fine?

text: **UPDATE** It seems that it might be a problem with the,                 $("#opening_time").datetimepicker();       $("#opening_time_end").timepicker();       $("#closing_time_end").timepicker();      If there is a `datetimepicker` call before a `timepicker` then the `timepicker` doesn't work. I do not understand since I have the `datepicker` working and everything is included in the same way. What am I missing? Succesfully added the jQuery UI Datepicker and even added a time picker for just time `meta_box` fields. I have been trying to ad Trent Richardson's Timepicker-addon and I can not get it to show up. Here is the `wp-enqueue` in functions.php.                     /**        * Adds a jQuery datepicker script to Event pages.        * http://jqueryui.com/demos/datepicker/        */       function pbd_events_jquery_datepicker() {           wp_enqueue_script(               'jquery-ui-datepicker',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/jquery-ui-1.8.16.custom.min.js',               array('jquery')           );               wp_enqueue_script(               'jquery-ui-timepicker',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/jquery.ui.timepicker.js',               array('jquery')           );           wp_enqueue_script(               'jquery-ui-timepicker-addon',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/jquery.ui.timepicker-addon.js',               array('jquery')           );                wp_enqueue_script(               'pbd-datepicker',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/pbd-datepicker.js',               array('jquery', 'jquery-ui-datepicker', 'jquery-ui-timepicker', 'jquery-ui-timepicker-addon')           );       }       add_action('admin_print_scripts-post-new.php', 'pbd_events_jquery_datepicker');       add_action('admin_print_scripts-post.php', 'pbd_events_jquery_datepicker');            /**        * Adds CSS for the jQuery datepicker script to Event pages.        * http://jqueryui.com/demos/datepicker/        */       function pbd_events_jquery_datepicker_css() {           wp_enqueue_style(               'jquery-ui-datepicker',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/css/smoothness/jquery-ui-1.8.16.custom.css'           );           wp_enqueue_style(               'jquery-ui-timepicker',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/css/jquery.ui.timepicker.css'           );           wp_enqueue_style(               'jquery-ui-timepicker-addon',               get_bloginfo('template_directory') . '/jquery-ui-datepicker/css/jquery.ui.timepicker-addon.css'           );       }       add_action('admin_print_styles-post-new.php', 'pbd_events_jquery_datepicker_css');       add_action('admin_print_styles-post.php', 'pbd_events_jquery_datepicker_css');      Here is the function call in pbd-datepicker that is added in the `wp-enqueue`.                     jQuery(function($) {           $( "#start_date" ).datepicker({ dateFormat: 'yy/mm/dd', numberOfMonths: 2, minDate: 0 });           $( "#end_date" ).datepicker({ dateFormat: 'yy/mm/dd', numberOfMonths: 4 });                               $("#opening_time").datetimepicker();                $("#opening_time_end").timepicker();           $("#closing_time_end").timepicker();           $("#artist_talk_time_end").timepicker();           $("#lecture_time_end").timepicker();           $("#panel_time_end").timepicker();           $("#special_event_time_end").timepicker();           $("#workshop_time_end").datetimepicker();       });      The input field `id`s are accurate. I have checked and double-checked typos. Why would the first two scripts, jquery.ui.timepicker.js and datepicker work but not jquery.ui.timepicker-addon.js?? Am I calling the js wrong? Thank you in advance.


title: How to check an array of $curauth fields?

text: How do I check an array of $curauth user data? I need to check to see if one or more $curauth fields have data, and if so, print some html. This throws an array error:                   <?php if ( !empty( array ( $curauth->facebook, $curauth->linkedin, $curauth->twitter)))     { echo 'echo me if any $curauth info exists for the fields in the array above'; } ?>      **Update - this works:**               <?php  if (!empty ($curauth->facebook) || ($curauth->linkedin) || ($curauth->twitter))     { echo 'echo me if any $curauth info exists for the fields in the array above';  }  ?>


title: User management system similar to wordpress one?

text: I am in very big need of a user management system just like the one that wordpress uses but without being blog related. I need to be able to manage users and apply certain privileges depending on user level. I tried to take apart the WP engine and take out the users part but I think it's so tied to the whole engine, I wasn't able to... Does anyone know of any scripts that offer the same register, login etc functions? Also, could it be open source? I already bought my first user management system but it sucks really bad... :( Thanks in advance to anyone willing to help me.   Andy


title: WP_Query class not found

text: The idea is simple. I have a drop-down menu generated with get_categories(). This outputs a list of categories in an unordered list, each in it's own li element.   I'm getting the text values of those li elements when a user clicks them, and based on that i want to create a custom wp_query, that returns posts from that category only. To do this, i`m loading the text value of the list element into a JS variable, send it over to a php file for processing. That php file constructs the string like so:               $ff_query = new WP_Query('posts_per_page=2&category_name='.$_POST['JSvariable']);       … and ideally should execute it, returning the info from the DB. The error i get is: > " **Fatal error** : Class 'WP_Query' not found in > **C:\xampp\htdocs\suply\wp-content\themes\suply\includes\proc_cat.php** on > line **3** " This is what my 2 files look like: 1) file that sends the ajax request:               <script>         $(document).ready(function(e) {             $("#ddmenu li").on('click', function() {                 var cValue = $(this).text();                 $.post("<?php bloginfo('template_url');?>/includes/proc_cat.php", {name: cValue}, function(cat){                                     alert(cat);                     $(".browse-big-slider").append(cat);                 });//end of post             });//end of click         });//end of ready     </script>      2) file that should process the               if(isset($_POST)){             $name = 'posts_per_page=2&category_name='.$_POST['name'];             $ff_query = new WP_Query('posts_per_page=2&category_name='.$_POST['name']);           something else, but it won`t reach this part.     }      What can i do to make this work? Or as an alternative, how can i create the type of functionality i want? (basically, a different query, generated dynamically, based on a user selection).


title: ACF: What hook can I begin to use get_field()

text: So I have a nifty trick for my theme " _modules_ " in which case I scan my modules directory (THEME_MODULES_DIR) and create an array of the module directories found. That array is then used to pass as the **$fields** array for the ACF PHP export which is included in my theme. Once that is done I get dynamic ACF radio buttons to Enable/Disable my modules (works wonderfully). **Now the problem is this** : Depending on which hook I use next I can fetch the ACF field value **OR** include() my _init.php file to load the module, but I can't do both which is what I need to do.               add_action('after_setup_theme', 'enable_modules');     function enable_modules(){         global $theme_modules;         foreach ($theme_modules as $module => $path) {             $field_name = CUSTOM::slugify($module).'_module';                  if(get_field($field_name,'options') == "Enable"){                require_once( THEME_MODULES_DIR.'/'.$module.'/_init.php');         }     }      From this action hook `after_theme_setup` with no logic I can easily execute the require `require_once( THEME_MODULES_DIR.'/'.$module.'/_init.php');` But I don't want that to happen unless **get_field()** value is true, but that value doesn't seem to be available until _init_ action; but by then my `require_once` no longer works :( It's nearly 3am and I am at a loss so any help with this issue would be AWESOME! Thanks so much.


title: Hard Define Custom Field Value

text: Is it possible to hard define a custom field value with a function? As in, no matter what WordPress will always set the value of 'some_meta' => 'this'


title: wpalchemy repeating fields dropdown issue

text: I need to allow user to select portfolio items from a dropdown, these selected portfolio items will be displayed on homepage. I have used wpalchemy class to create repeatable section that contains a dropdown list of all portfolio pages. Issue is whenever i click on update button, a copy of dropdown is automatically added to repeating list.               <?php while($mb->have_fields_and_multi('col1-project')):          $mb->the_group_open();          $mb->the_field('portfolio-list1');         $args = array (             'name' => $mb->get_the_name(),             'id' => $mb->get_the_name(),             'selected' => html_entity_decode($mb->get_the_value()),             'post_type' => 'portfolio'         );         wp_dropdown_pages($args);          $mb->the_group_close();     endwhile; ?>      Gist: https://gist.github.com/alokjain-lucky/6682775


title: Carrying information from button click into form

text: I had a question for a project I am finishing for a client. He would like it so that every time a user clicks on "Sign Up Today" for the given workshop (http://yft.ac/upcoming-workshops/), the name of the workshop is somehow transferred over the contact form (http://yft.ac/contact-us/). Now the workshop page is just a simple table with a button pointing to the contact us page, and the contact us page is powered by a simple Gravity Forms form. Is there anyway of doing this either by using Gravity Forms or not? I'm not the best at PHP and have not yet been able to find a way to accomplish this. Thanks in advance to anyone that can help me out with this.


title: using wp_footer hook in a plugin

text: I'm using the wp_footer hook into the plugin and it doesn't work, but when I copy the code to the "functions.php" file of the active theme it does work, what is the possible problem in this situation ?                   function mixpanel_footer(){          echo '';               }          add_action( 'wp_footer', 'mixpanel_footer' );


title: Display list of custom taxonomies from a custom post type ordered by their parent

text:
I'm not quite sure the question explains my point. And it's interesting to have a look at this previous answer, since the code to display the custom taxonomies is explained in there. What I need is to display the child item category under his father, but I can't figure it out. What I'm creating is a list of books under every category I've created. I have my custom category and it's related to a custom post type which have additional custom meta boxes, in my this case, for books. When making the query, it's working well, but I have two issues: The first is, because I really don't know how to display the child under his father, actually the child is displayed as another category as the others and its totally separated from his father. And the same query is displaying post both, under the father category as the child category. So it seems to be kind of duplicated in my list: being the "astrological" the father category it has a child named "stars". So in my list, the category "astrological" has 2 post related to it, but that's because its displaying the post related to it and the post related to his child, which is "stars". Explained best is: > ASTROLOGICAL (father) (has one post related, "Aquarium") > > -STARS (child) (has one post related, "Andormeda") What I see being displayed is a list in this way: > ASTROLOGICAL > > -Aquiarium > > -Andormeda > > ANOTHER CATEGORY > > -his post related > > STARS > > -Andormeda Don't know if I was clear, so I post my code for the query... As you can see above categories is for giving an example, actually my query is for books but its in spanish, that's why I'm using the "astrological" example.               <?php                  $custom = get_post_custom($post->ID);                  $autor = $custom["autor"][0];                  $editorial = $custom["editorial"][0];                ?>             <?php     //for a given post type, return all     $post_type = 'Libro';     $tax = 'categoria_libro';     $tax_terms = get_terms($tax);          if ($tax_terms) {       foreach ($tax_terms  as $tax_term) {         $args=array(           'post_type' => $post_type,           "$tax" => $tax_term->slug,           'post_status' => 'publish',           'posts_per_page' => -1,           'caller_get_posts'=> 1       );                   $my_query = null;         $my_query = new WP_Query($args);              if( $my_query->have_posts() ) {             echo '

 '. $tax_term->name. '
';                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(); ?> <?=$autor?> <?=$editorial?>
                            <?php endwhile;?>
         <?php }         wp_reset_query();       }     }     ?>      .....EDITED...... With my code this is what is displaying Link actual displaying Notice that in my backend the category "energia" is actually a child of "herramientas terapueticas" And what I want is to display this The category "herramientas terapeuticas displaying its posts, and displaying too another list of its child, in this case "energia". I really dont know how to write the code for this. I hope this help to clear my point Thanks in advanced!!!


title: Where to place PHP for shortcodes

text: My custom plugin is broken into two parts: a frontend.php and admin.php for loading code conditionally. Here is a rough outline of the code:               <?php     /*     My plugin info here     */          if (is_admin()) {       include_once('admin.php');     } else {       include_once('frontend.php');     }          ?>      I have written several shortcodes for use in pages and posts. In which file (admin.php or frontend.php) should code related to shortcodes be placed?


title: Custom Post Types - Taxonomy and Customization

text: I'm trying to learn Custom Post Types and I have some questions. I'm trying to add a categories menu but that doesn't seem to be working for some reason - I don't get an error or anything. Here's my code, let me know if I should add in / improve on something:               // Create The Custom Post Type     function products_post_type(){         register_post_type( 'generic_prodcts',             array(                 'labels'    =>  array(                     'name'          =>  __( 'Products' ),                     'singular_name' =>  __( 'Product' ),                     'add_new_item'  =>  __('Add New Product'),                     'edit_item'     =>  __('Edit Product'),                     'search_items'  =>  __('Search Products')                 ),                 'public'        =>  true,                 'has_archive'   =>  true,                 'rewrite'       =>  array('slug' => 'products')             )         );     }     add_action( 'init', 'products_post_type' );          // Create The Columns     function generic_products_columns($columns){         $columns = array(             'check'     =>  '<input type="checkbox" />',             'title'     =>  __('Title',      'trans'),             'desc'      =>  __('Description','trans'),             'price'     =>  __('Price',      'trans'),         );         return $columns;     }     add_filter("manage_generic_prodcts_posts_columns", "generic_products_columns");          // Create The Column Data     function generic_products_column_data( $column, $post_id ) {         switch ( $column ) {             case "title":                 $title = get_post_meta( $post_id, 'title', true);                 echo '' . $title. '';                     break;             case "desc":                 echo get_post_meta( $post_id, 'desc', true);                     break;             case "price":                 $price = get_post_meta( $post_id, 'price', true);                 echo '' . $price. '';                     break;         }     }     add_action( "manage_posts_custom_column", "generic_products_column_data");          // Make Post Type Columns Sortable     function generic_prodcts_sortable() {       return array(         'title' => 'Title',         'desc'  => 'Description',         'price' => 'Price'       );     }     add_filter( "manage_edit-generic_prodcts_sortable_columns", "generic_prodcts_sortable" );          register_taxonomy(         'Categories',          array('generic_products'),          array(             'hierarchical'      => true,              'label'             => 'Categories',             'singular_label'    => 'Category',             'rewrite'           => true         )     );      Also how do I go about customizing the custom post type page? Like I'd like to remove the text box and add in my own fields. I've tried googling it but I don't exactly know how to explain it to find decent results. For reference, I've just been following: Yoast and Wordpress Codex


title: What file is the </body> tag located in Genesis default theme?

text: I need to add some tracking code for Aweber and they said to add it before the `</body>` tag. I've looked through all the Genesis files and cannot find it!


title: Remove navigation from header in custom page template

text: I'm building a landing page and want to remove the navigation menu from the page. The navigation menu is in header.php which is of course in the page template. Is there a WordPress function I can use to remove the navigation menu from this specific page? I know I could do it with jQuery and do display:none for the nav menu but i'd like to do it server side before the page loads. Thanks


title: How to hide a piece of code from a wordpress web page?

text: I installed a plugin called Sociable on my Wordpress website. It displays social media share icons below each blog post, but on my website it's also showing up in the footer. Like here http://amsa.mn/%D0%B1%D0%BB%D0%BE%D0%B3 I've been trying to figure out how to remove it from the footer for quite a while, but can't figure it out. Can anyone help? Thanks!


title: How to use wp_terms_checklist() on front end

text: Getting a Fatal Error using `wp_terms_checklist()` in one of my advanced search form in Front End. > **Fatal error:** Call to undefined function `wp_terms_checklist()` With search I got that it's creating problem because the function is for _admin panel use only_ , BTW _not_ deprecated.               <?php     $args = array(         'descendants_and_self'  => 0,         'selected_cats'         => false,         'popular_cats'          => false,         'walker'                => null,         'taxonomy'              => 'mytaxonomy',         'checked_ontop'         => true     );     wp_terms_checklist( 0, $args );     ?>      But if I need a similar thing in my front end. How can I achieve that? Is that possible in current flow?


title: Bestway To Define Theme and Plugin path and url

text: I am in a mess.I know this is a silly question.You see the theme path is not so good.So is there any other way?How can I use `get_template_directory()` here?                   // theme folder path         if ( ! defined( 'TZSC_THEME_DIR' ) ) {             define( 'TZSC_THEME_DIR', dirname(__FILE__).'/' );         }              // theme folder URL         if ( ! defined( 'TZSC_THEME_URL' ) ) {             define( 'TZSC_THEME_URL', plugin_dir_url( __FILE__ ) );         }


title: Why does my Posts page only show a single post when using Thematic?

text: This seems to be a Thematic theme bug becuase if I switch to other themes, everything is working as expected. This is not the first time I created a frontpage using a static page. I made sure I followed this: http://codex.wordpress.org/Creating_a_Static_Front_Page. Any idea pls?


title: Why am I locked out of the system?

text: I've installed a wordpress site for a client. The site resides on mttv.co.il For some reson I'm being locked out of the system most of the time with no error message displayed The system takes the login & password and just redirecs me back to the login page. Any help would be much appreciated


title: WordPress kills an IFRAME's apostrophes

text: I'm using an IFRAME to let multiple sites embed one interactive element. On the IFRAME's actual page it works fine, and it looks fine on another website I embedded it. But when I embed it in a WordPress blog, all my apostrophes show up as squares. I tried removing all smart quotes and apostrophes with "dumb" quotes, no luck. I tried replacing all the apostrophes with ' and, again, no luck Any clues what my cause this? The IFRAME code:               <iframe src="http://necir-bu.org/wp/interactives/sheriffinteract/interactive.html" name="interactive" scrolling="no" frameborder="0" marginheight="5" align="center" vspace="5" widtha"590px" height="720px"></iframe>      And you can see the interactive code by just viewing the first link


title: Error activating certain plugins

text: When I try to activate All-In-One SEO Pack or ANY (I've tried all by now!) caching plugin, the page goes blank - i.e the content of the page empty, except the WordPress bar on the top and the toolbar on the left. No error is displayed. What is wrong? All other plugins are activated and work just fine! Please help!


title: Show taxonomy and custom post type in the same query

text: I am not sure how to raise the question, because I find all that goes in another way, I will try... I have three custom post types and these have their own taxonomies. The following is a simplified example:   * Photos      * Photo # 1     * Photo # 2   * Videos      * Vid # 1     * Vid # 2   * Websites      * Site # 1     * Site # 2  What I want to do is showing all post photographs and videos and also the category Website, can I do this? And every time some post to be updated within the category is displayed websites.


title: wp_update_post() doesn't update post_status?

text: I'm using this bit to insert/update a custom post type from the front-end. The date is set from a custom jquery datepicker.                   if (strtotime($date) < strtotime('tomorrow')) {                 $newpostdata['post_status'] = 'publish';         } elseif (strtotime($date) > strtotime('today')) {                 $newpostdata['post_status'] = 'future';                 $newpostdata['post_date'] = date('Y-m-d H:i:s', strtotime($date));         }              if ('insert' == $operation) {             $err = wp_insert_post($newpostdata, true);         } elseif ('edit' == $operation) {             $newpostdata['ID'] = $post_id;             $err = wp_update_post($newpostdata);         }      **This works** when first publishing the post, setting it correctly as `publish` or `future`, with the correct date. **This doesn't work** when editing the same post, neither from `publish` to `future` nor the other way around. Everything else is properly updated, except for the post status/ ~~future_date~~. **UPDATE Oct. 9th** I'm starting to think this might be a bug, so i started a conversation at the wp-hackers mailing list, about this. There's some fresh install test results on the link. * * * **OTHER FAILED ATTEMPTS:** i've tried leaving `post_status` decisions to `wp_insert_post()` using:               elseif ('edit' == $operation) {             $newpostdata['post_status'] = '';             $newpostdata['ID'] = $post_id;             $err = wp_update_post($newpostdata);         }      And this sets the post status to `draft` while maintaning the requested dates. I've also tried calling `wp_transition_post_status()` again (it's called once inside wp_insert_post()):               elseif ('edit' == $operation) {             $newpostdata['ID'] = $post_id;             $err = wp_update_post($newpostdata);             wp_transition_post_status($old_status, $status, $post_id);         }      but that also didn't seem to work. I'm running out of ideas here. Any clues?


title: How to exclude certain portfolios from a loop

text: I am new to the site and have racking my brain on a Wordpress issue for days. Hope you the intelligent people here can help me figure this out. I have a page on my website that displays all my portfolios at once. My portfolios can be categorized into different 'sets'. There are particular 'sets' that I would like to not display on this page. The page can be viewed here: http://www.industrygallerydc.com/works/ I believe I have pinpointed the loop that causes the portfolio 'sets' to display:               //prepare data for pagintion     $offset_query = '';     if(!isset($_GET['page']) OR empty($_GET['page']) OR $_GET['page'] == 1)     {         $current_page = 1;     }     else     {          $current_page = $_GET['page'];         $offset = (($current_page-1) * $portfolio_items);     }          $args = array(         'numberposts' => $portfolio_items,         'order' => $portfolio_sort,         'orderby' => 'date',         'post_type' => array('portfolios'),         'offset' => $offset,     );     if(!empty($term))     {         $args['portfoliosets'].= $term;     }          $page_photo_arr = get_posts($args);               //Get all portfolio items for paging          $args = array(         'numberposts' => -1,         'order' => $portfolio_sort,         'orderby' => 'date',         'post_type' => array('portfolios'),     );     if(!empty($term))     {         $args['portfoliosets'].= $term;     }          $all_photo_arr = get_posts($args);     $total = count($all_photo_arr);          if(isset($page_photo_arr) && !empty($page_photo_arr))     {        ?>      Is there a way I can exclude a 'set' here?


title: Watermark featured image as soon as it is set on post edit page

text: I want to watermark featured image of specific category when featured image is set on post edit page. I made a small script which watermarks but how can I know that featured image has been set so that script function runs automatically before publishing the post?


title: Authors list Pagination : result set from $wpdb->get_results()

text:
Using this solution : Paginate result set from $wpdb->get_results() I did make my code for Authors list page template as follow:

          <?php      // Get the authors from the database ordered by user's display name      global $wpdb;      $query = "SELECT ID, display_name from $wpdb->users ORDER BY display_name LIMIT 10";      $author_ids = $wpdb->get_results($query);     $authcount = -1;          $total = $wpdb->get_var("         SELECT COUNT(ID)         FROM $wpdb->users     ");     $authors_per_page = 10;     $page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;          echo paginate_links( array(         'base' => add_query_arg( 'cpage', '%#%' ),         'format' => '',         'prev_text' => __('«'),         'next_text' => __('»'),         'total' => ceil($total / $authors_per_page),         'current' => $page     ));           // Loop through each author      foreach($author_ids as $author) :      // Get user data      $curauth = get_userdata($author->ID);           // If user_ID is 1 or 24, remove them from list      if( ! in_array($curauth->ID, array(1, 24 )) ) :      // Get link to author page      $user_link = get_author_posts_url($curauth->ID);         $post_count = get_usernumposts($curauth->ID);      ?>     <tr<?php echo $authcount % 2 ? ' class="odd"' : ''; ?>>          <?php echo $authcount; ?>     	     <a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>"><?php echo $curauth->display_name; ?>     	     ( <?php echo $post_count; ?> )
          <?php endif; ?>     <?php $authcount = $authcount + 1; ?>     <?php endforeach; ?>

      But every page-number link display only the authors list from 1 to 10, whereas the database have a list of atleast 50-authors. Please help me to find out the error and its rectification. Thanks a lot.


title: Custom Post Type, Two categories, Two columns with Pagination

text: I searching a lot to found a way solves that and no luck at least. Sorry for my unpulish english, I do my best explaining my issue. I have a Custom Post Type called `'Events'` this have two categories `'Congresses in Argentina'` and `'International Congresses'`, I need to show the list of posts sorted by columns (2) and with pagination after 5 of each other. Something like this: Format: `Cat 1 / Cat 2 [ 1 = most recent / 5 = oldest post ]`                [1] [1]      [2] [2]      [3] [3]      [4] [4]      [5] [5]     « 1 2 3 »      I wondering if I can show the last posts of each category on a row and later the next two ones and so on, this because the design needs to be in this way to show up nicely. Thanks in advance for your help, any comment would be appreciate it.


title: Disable Visual editor for all users

text: Is there a way to Disable the visual editor for all users without logging in and setting each user's setting in the admin panel, preferable some way to do it with code in the functions file?


title: Use Wordpress Built In Jquery

text: I see that on every page Wordpress is loading in jquery, how do I go about using that jquery as it keeps telling me that it doesn't recognize `$` or `$noConflict();` - I'm trying to add some jquery under `wp_head()`.


title: How to run a SQL Query for character in Post Titles

text: Pretty much self explanatory. I have a development server running the latest WP, and I imported a bunch of posts from a blogger account. After the import, every post was titled as such: **>Example Title** . What i want to do is a run a sql query to delete all the " **>** " characters in the post titles. I've checked other tutorials already, but still do not understand the complete syntax of the query. Any help is appreciated. okay this is the query i 'want' to run. update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’); but what I don't understand is that, I'm trying to update my table name (which is by default wp_, right?), and I'm guessing the next step is updating the field name (which is by default wp_posts, right?), and I want to update ALL the Post Titles to remove a character that shows up in front of all of them. Example: >This Is A Post Title . I want to remove the ">" character. But what I'm lost on is if I'm doing it wrong by naming "wp_" for "TABLE_NAME", and "wp_posts" as the "FIELD_NAME". Or am I missing something in that query just all together? Hope I'm making it clear and not too confusing.


title: Importing into wp_postmeta

text: I am converting a custom site to WordPress but I have a problem. I have about 20,000 posts for one Custom Post Type that has custom fields for both "source_name" and "source_url". Both these Custom Field Values need to be entered into the "wp_postmeta.meta_key" column for each article that has the custom field data. Each unit of custom field data also needs to be imported into the "wp_postmeta.meta_value" column. While every "post_id" is unique, both the "meta_key" and "meta_values" share the same "post_id". I am working with SQL and CSV. Does anyone have insight into how I can get all this custom data into the wp_postmeta table correctly? Thank you in advance!


title: How to create notification on frontend using heartbeat api for multiple custom post types

text: How can I get correct action hook on publish_posts for multiple custom types ? I have a following problem, I can use this hook for posts or single custom post_type, but I don't know correct hook for multiple custom post types:               // Post publication for posts     add_filter ( 'publish_post', 'notify_published_post' );     function notify_published_post( $post_id ) {      I would like to publish to all even future custom post_types, so I would like to get something like this:               // Post publication hook for all custom posts     add_filter ( 'publish_anypost', 'notify_published_post' );     function notify_published_post( $post_id ) {


title: get meta value from database by post id

text: I am just really confused how to do this, becouse I am newbie in wordpress. So what am trying to do: I have a custom form on home page and posting form value by post method. Now I want to fetch meta value by the comparision of post value. I am trying               <?php      $from=$_POST['a'];     $to=$_POST['b'];     $froms = get_post_meta( 139, 'from',true );     print_r($froms);     $tos = get_post_meta( 139, 'to',true );      if($froms=$from && $to=$tos)      {     echo "test match";     }     else     {     echo "Not found";     }      Now for whatever value of $from its showing match found. and if i tried to `print_r($from)` it always show `Array([0]=>"test")` feel free to ask me if my question is unclear, how can i fetch meta value by some comparision of posted value.. **I just want to check if my meta value and posted form value are same then`echo "test match"`, if my posted value did not match with meta value then `echo "not found"`** Thanks


title: Personalized Gallery what are my options?

text: In my game website I would like to implement a Screenshot page where my registered users can upload images to it (it might be more then 1 screenshot page, 1 for the users and 1 for the game in question what I mean is users can upload and the staff will be using the game website available images so it would be 2 different categories or w/e). Once an image is uploaded it will be pending for approval before becoming available on the gallery page. I would like that the page that will display the list of images will be displaying it as thumbnail or resized images to a smaller size and the bigger image will show uppon click or something alike. **What i would like to know is:**   * Is there a plugin with such features ?   * What are my options here ? * * * I've got a good programming background, if i were to make such changes what would be my best approch to it ? like creating a custom template page or what ?


title: Display some arbitrary HTML or content in a sidebar

text: I need to have a bit of frequently changing content in a sidebar (the time and location of the next meeting of a club). What I'd really like is a nice widget that displays `the_content()` of a selected page or just has a rich text field and displays what's in that. I figured there would be something like this around, but I can't find it. (Maybe because the search terms are too cloudy and overloaded?) I wrote a widget that displays `the_content()` of a hardcoded page, but that's not an ideal solution.


title: Redeclare function (override)

text: What is the best method, to change the previously declared function into the new one? for example, there is already declared:               function smth(){     echo 'aaa';     }      and i want that it displayed not **aaa** , but **bbb**               function smth(){     echo 'bbb';     }      but when i insert the new function ( _inside functions.php_ ), i get error message `(Fatal error: Cannot redeclare **smth()** (previously declared in ... )`       # UPDATE - I have found a solution: http://stackoverflow.com/a/8125517/2165415


How to remove comment section from page only , not from posts pages?


title: How to overwrite youtube embed?

text: I really like how you can just paste a URL right into the post... such as: `http://youtube.com/watch?v=xyz` or `http://vimeo.com/123456` What I want to do is change the default code for this to support the code from here: http://embedresponsively.com/ How can I go about overwriting the youtube and vimeo code, I'm assuming in functions.php somehow?


title: Filtering categories in the permalink structure

text: Using `/%category%/%postname%/` for the permalink I get a URL string of all the categories that the specific post is included in. I would like the categories in the url to be filtered down to only one branch of the categories structure, and starting not from the root parent category. I have a travel blog and I have this category structure:   **places › countryName › regionName › cityName**   ex: _www.mytravelblog.com/places/indonesia/java/jakarta/myPostName/_ I would like to skip the root category in the URL or even just use the smallest child   ex: _www.mytravelblog.com/jakarta/myPostName_ Is it possible? (WP 3.0.1)


title: Show all posts of all categories but excluding a category on custom blog page with pagination of my theme

text:
Recent Posts
       <?php // Display blog posts on any page @ http://m0n.co/l         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $temp = $wp_query; $wp_query= null;         $category_id = get_cat_ID('Tour');         $wp_query = new WP_Query(); $wp_query->query('showposts=6' . '&paged='.$paged);         while ($wp_query->have_posts()) : $wp_query->the_post();    if(in_category($category_id)){?>
             <time datetime="2013-01-01"><?php echo date("j"); ?>
     <?php echo strtoupper(substr(date("F"),0,3)); ?></time>

        <?php the_title(); ?>

         <?php if(has_post_thumbnail()) { ?> <?php the_post_thumbnail('full', array('class' => 'img_inner fleft')); ?> <?php } ?>
         <?php the_excerpt(); ?>
           <a href="<?php the_permalink(); ?>" class="btn">Details

      please give a suitable guidance for that customization in retrieve posts of all category exclude one category post in Wordpress custom theme. thanks in advance.


title: Directory structure for plugin changes

text: When I'm working in Wordpress, I quite often need to make adjustments to plugins. The recommended method, as I understand it, is to take the plugin file I'd like to modify (say, `mypluginfile.php`), and copy it to my theme folder. The file will now override the plugin's version of the file. My problem with this is that in order for it to work, the file HAS to be in the root of the theme directory...which means that the theme root quickly becomes incredibly messy. With adjusted plugin files strewn throughout the theme root, it's also very difficult to, at a glance, keep track of which file belong to which plugin. Is there any way of modifying plugin files but still maintaining a nice directory structure. Maybe something like:               - /mytheme/style.css     - /mytheme/functions.php     - /mytheme/myplugin/mypluginfile.php     - /mytheme/myplugin/mysecondpluginfile.php     - /mytheme/mysecondplugin/anotherpluginfile.php      I have a hard time believing that everyone out there just fills their theme folder with an array of files belonging to different plugins. What's best practice here?


title: Theme licensing and permission on changing content

text: When using themes on a WordPress site, can I customize (I mean modify/change files) that makeup the theme? So as to remove a particular section on stock photo provided in the pages? I like certain themes, but most of them include a footer, header, or something somewhere with extra information I would not want displayed, i.e.) theme name/version, developer link, etc. Is it ok to remove those from displaying on the website?


title: Why would apply_filters return a non-empty string, when the value returned is empty?

text:
Been breaking my keyboard over this. Did a proper install, uploaded the database to a fresh MySQL and been working on using child themes properly. But there is something plaguing me I can not figure out. On my new install (ver2.whowhatwhy.com) I intentionally left some of my widgets blank. I would expect, when reading the `default-widgets.php` file in wp-includes that there would be no title element showing on that widget. Instead, the title widget is showing because, for some reason, the value being passed by `apply_filters` is a space, rather than a blank value when the `$instance['title']` is blank.               $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );      Has anyone seen this before? The problem I have is that the original installation has no problem with this call (returns a blank value). If you go to the site, you can see the vardumps of the different elements of the code:               function widget( $args, $instance ) {             extract($args);             $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );             $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );             echo $before_widget;             if ( !empty( $title ) ) { echo $before_title . '[' . $title . '] ' . $after_title; } ?>
<?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?>
             <?php             echo $after_widget;         }      I also removed all of the widgets and then replaced the one widget on the page. This is what is in the database: @Otto - I also looked in the database and eliminated all of the other widgets. And here is what I found:               a:2:{i:916707761;a:3:{s:5:"title";s:0:"";s:4:"text";s:1333:"

     <form name="ccoptin" action="http://visitor.r20.constantcontact.com/d.jsp" target="_blank" method="post" style="margin-bottom:3;">
Do you need the truth?
         Sign up for our weekly email updates and stay informed.

             <input type="text" name="ea" size="22" value="" style="font-family:Verdana,Geneva,Arial,Helvetica,sans-serif; font-size:14px; border:1px solid #999999;">             <input type="submit" name="go" value="JOIN" class="submit"  style="font-family:Verdana,Arial,Helvetica,sans-serif; font-size:10px;">             <input type="hidden" name="llr" value="">             <input type="hidden" name="m" value="">             <input type="hidden" name="p" value="">
     </form>

     ";s:6:"filter";b:0;}s:12:"_multiwidget";i:1;}      Note where the `a:3` is, you can see that the `title` value is an empty string with no length. So, why would apply_filters return a non-empty value?


title: wp_nav_menu add some element to container

text:
I've tried to hook `wp_nav_menu_args` to get an ID for the nav menu. I tried to add an element using javascript to container menu. But I never get the ID for the menu. How can I add an element to a nav menu container from:

.....

      to:

.....


title: Conditional to grab parent page thumbnail URL

text: I'm currently using this code to grab the featured image URL and insert it as a background image:               <?php $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );?>     <div class='guideHeader' style='background-image: url(<?php echo $thumb['0']; ?>);'>      What I'd like to do is make this a conditional:   1. If Parent Page > Insert Thumbnail URL.   2. If child of Parent and has no featured image > insert parent thumbnail URL.   3. If child of Parent and has featured image > Insert Thumbnail URL.


title: Latest comments from each category?

text:
On the "home"-page I'm trying to display the most recently commented-on post for each category. I managed to display the most recently published post for each category, but if an older post from each category gets a comments, that post should be bumped to the top of the list with that latest comment displayed. Here's the code I tried:               <?php $cat_args=array(       'child_of'=>1,       'exclude'=> 12,       'orderby' => 'name',       'order' => 'ASC'        );     $categories=get_categories($cat_args);       foreach($categories as $category) {         $args=array(           'showposts' => 1,           'category__in' => array($category->term_id),           'caller_get_posts'=>1         );         $posts=get_posts($args);           if ($posts) {             echo '

term_id ) . '">' . $category->name.'
 ';             foreach($posts as $post) {               setup_postdata($post); ?>                           <?php $recent_reviews = get_comments('post_id='.$post->ID.'&status=approve&number=1');?>                       <?php                       foreach($recent_reviews as $recent_review) {                         $comment_url = get_permalink($recent_review->comment_post_ID).'#reviews';                         $comment_info = get_comment_meta($recent_review->comment_ID, 'comment_info', true);                         $comment_rating = get_comment_avg_rating($comment_info);                     ?>

Restaurant: <a href="<?php echo get_permalink($recent_review->comment_post_ID); ?>"><?php echo get_the_title($recent_review->comment_post_ID); ?>

<?php echo get_limit_content(strip_tags($recent_review->comment_content), 150); ?>

<a href="<?php echo $comment_url; ?>" class="more-link">read review

                       <img alt="" src="<?php bloginfo('template_directory'); ?>/images/star-m-<?php echo $comment_rating; ?>.png" />                       <?php echo date('m/d/Y', strtotime($recent_review->comment_date)); ?>
                     <?php } // foreach($recent_reviews as $recent_review) { ?>               <?php             }              echo '
';// foreach($posts           } // if ($posts         } // foreach($categories     ?>


title: How to echo excerpts with wp_list_pages?

text: I've tried to echo excerpts in `wp_list_pages` with the code below. It works, but only for one of the child pages. How would I echo the excerpt and title for each child page?               <?php     $children = wp_list_pages('title_li=&depth=1&child_of='.$post->ID.'&echo=0');     if ($children) { ?>         <h2>             <?php echo $children; ?>             <?php the_excerpt(); ?>          </h2>     <?php } ?>


title: Custom taxonomy/category order

text:
My products are sort by menu_order, but I would like to sort category name too. I tried a few plugins and all doesn't works. Code, which display category name and products list:               <?php $custom_terms = get_terms('product-cat');     foreach($custom_terms as $custom_term) {         wp_reset_query();         $args = array(         'post_type' => 'product',         'posts_per_page' => 9999,          'orderby' => 'menu_order',          'order' => 'ASC',         'tax_query' => array(             array(                 'taxonomy' => 'product-cat',                 'field' => 'slug',                 'terms' => $custom_term->slug             ),         ),         );              $loop = new WP_Query($args);         if($loop->have_posts()) {             echo '

'.$custom_term->name.'
';             echo '
';             while($loop->have_posts()) : $loop->the_post();                 echo '
'.get_the_title().'
';             endwhile;             echo '
';             echo '
';         }      } ?>      Thanks for reply. Regards.


how to change location of the plugins & wordpress themes folder I am waiting for reply and in which file changes required also mention please....


title: How do I make the selected layout display for all MarketPress pages?

text: I've set up a WordPress site and installed MarketPress. It works fine overall and the `/store/` page is correctly displaying my selected template/layout. However, all subpages such as `/store/products`, `/store/cart`, `/store/categories` etc. are not using the template/layout that I chose, but rather some default. Maybe this is because they are "virtual" pages that MP itself are handling. Question is: How do I tell MarketPress to use my chosen template/layout for all of MarketPress´ pages? I've tried a solution that I found here, but it doesn't work for me. It could be a solution connected to some other product or plugin that the author has but not me.


title: Clarification on filters and hooks

text: I am about to start my first WordPress project and I have the task of moving customized core code that override the core into separate functions/files (this way it'll be easier to maintain when we upgrade in the future. I have been doing research and it looks like `add_filter` and `apply_filter` and `do_action` and `add_action` seem to be the way to go. I'm still unsure about how they work though. Are those methods what I use to overwrite core methods? I am confused because `add_filter` uses the word `add` when I feel like it is more on the lines of `replace` or `overwrite` (unless I am misunderstanding) I just read the first answer to this: http://wordpress.org/support/topic/fliters-vs-actions-from-a-newbe (the one about the tacos) So there were three steps the author used in describing how to use add_filter: Step 1 : a static value for the $taco variable `<?php $taco = 'chicken'; ?>` Step 2:                   <?php         $taco = apply_filters( 'get_taco', 'chicken' );         ?>      Step 3:                   <?php         add_filter( 'get_taco', 'my_special_order' );         function my_special_order( $content ) {             return 'shredded beef';         }         ?>      So in this situation is the apply_filter just creating a dynamic method on the fly and making it return the `chicken` string? Or is the assumption here that there is a core WordPress method called `get_taco` and that using `apply_filter` would help in overriding whatever the original functionality was? Also, can you only `apply_filter` something that you've `add_filter`ed ? In other words, would `apply_filter('get_taco');` not work if I did not define `add_filter('get_taco', 'my_special_order');` AND `function my_special_order ($content) ...` first? Do I put these filters in my functions.php file? Sorry for bombarding you with questions, I am coming from Ruby on Rails so I'm completely clueless in WordPress.


title: How to use wp cron job to run a function

text: I have one function: "update_user_like" to sum all facebook likes from all user's posts. How to run that function at 3am every day by wp cron job? Thanks much!


title: Load script only on selected Pages

text: The following function within my functions.php loads a JS script..               function my_scripts_method() {         wp_enqueue_script(             'myashdrop',             get_template_directory_uri() . '/js/dropdown.jquery.min.js',             array('jquery')         );     }          add_action('wp_enqueue_scripts', 'my_scripts_method');      How could i modify this function so that the JS script is loaded only on specified pages (perhaps by providing their ID in the function's arguments..)


title: Permalink clashing with Custom Post Type rewrite rule

text: I have created a custom post type called **'members'** which works correctly. I have set the rewrite rule to...               'rewrite' => array('slug' => 'our-members'),      I have then added some items to this custom post type which gives me permalinks like so...               http://www.mydomain.com/our-members/john-doe     http://www.mydomain.com/our-members/jane-doe     http://www.mydomain.com/our-members/tom-tompson     http://www.mydomain.com/our-members/joe-blogs      I also have a page called **'About Members'** which has the slug **'about- members'** meaning the permalink for the page is....               http://www.mydomain.com/our-members/about-members      This doesn't work as it is clashing with the rewrite rule, is there a way to have this working with the permalink?