Media Upload Directory to MMYY instead of YYYY/MM

Is there a way to change the upload directory's location and format from `YYYY/MM` (`/wp-content/uploads/2013/06`) to `MMYY` (`/news/0613`)?   I've searched everywhere and could not find an answer - in fact, the latest version of WP even removed the ability to change where to even put the upload directory. Thank you! :)


Remove 'rel' attributes from the_category() output

I am trying to get the categories associated with a post in it's meta section by using the following code:
FILED AS: <?php the_category(' • ')      ?>
      WordPress is generating the markup as:
FILED AS:          Uncategorized
      This part `rel="category tag"` is making my code invalid. W3C validator throws an error saying: > Bad value category tag for attribute rel on element a: The string category > is not a registered keyword or absolute URL. Whitespace in path component. > Use %20 in place of spaces. > > …w all posts in Uncategorized" rel="category tag">Uncategorized Any idea how to rectify this?


How to give a download link to a .csv file from the custom plugin?

I have made a custom plugin, which exports MYSQL table contents into a **.csv** file which gets saved in to wp uploads directory. Now, I am trying to give a download link for downloading directly a **.csv** file. But, I am getting this error " **Warning: Cannot modify header information - headers already sent** " I'm so very grateful for all of the help you all give. I've searched for this topic and couldn't find it, if this topic is already answered here, please comment with the link to the question with the answer. Thanks. **Code Which I tried for Downloaing:**               header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );     header( "Content-Length: " . strlen( $out ) );          // Output to browser with appropriate mime type, you choose ;)     header( "Content-type: text/x-csv" );     header( "Content-Disposition: attachment; filename=$filename" );          echo $out;     exit;


Performance impact of rewriting WordPress URLs

I'm currently rewriting author URLs in WordPress.   1. I've removed the author base slug `/author/`. Please note I have total control over page slugs so can guarantee there will be no conflicts.   2. I've added 3 endpoints (posts, comments, articles) so that author links can look like: example.com/username/posts example.com/username/comments example.com/username/articles Will rewrite rules such as this have an impact on my website's performance? For theoretical sake let's say the number of authors were in the millions. **References:** Endpoints https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/ Rewrite rules http://codex.wordpress.org/Rewrite_API/add_rewrite_rule


Getting post content within wp_nav_walker

I have a custom walker set up designed to add content into the nav menu. The problem being that it is not pulling the content. The post object returned by the get_post/get_page has an empty post_content attribute. What is causing this? Walker:               class mobile_walker_nav_menu extends Walker_Nav_Menu {                    function start_lvl( &$output, $depth ) {     // depth dependent classes     $indent = ( $depth > 0  ? str_repeat( "\t", $depth ) : '' ); // code indent     $display_depth = ( $depth + 1); // because it counts the first submenu as 0     $classes = array(         'sub-menu',         ( $display_depth % 2  ? 'menu-odd' : 'menu-even' ),         ( $display_depth >=2 ? 'sub-sub-menu' : '' ),         'menu-depth-' . $display_depth         );     $class_names = implode( ' ', $classes );          // build html     $output .= "\n" . $indent . '
' . "\n";     }               function start_el( &$output, $item, $depth, $args ) {     global $wp_query;     $indent = ( $depth > 0 ? str_repeat( "\t", $depth ) : '' ); // code indent          // depth dependent classes     $depth_classes = array(         ( $depth == 0 ? 'main-menu-item' : 'sub-menu-item' ),         ( $depth >=2 ? 'sub-sub-menu-item' : '' ),         ( $depth % 2 ? 'menu-item-odd' : 'menu-item-even' ),         'menu-item-depth-' . $depth     );               $depth_class_names = esc_attr( implode( ' ', $depth_classes ) );          // passed classes     $classes = empty( $item->classes ) ? array() : (array) $item->classes;     $class_names = esc_attr( implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ) );     // build html     $output .= $indent . '
ID . '" class="' . $depth_class_names . ' ' . $class_names . ' ' . $theBack . '">';          // link attributes     $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';     $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';     $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';     $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';     $attributes .= ' class="menu-link ' . ( $depth > 0 ? 'sub-menu-link' : 'main-menu-link' ) . ' ' . $class_names . '"';          $item_output = sprintf( '%1$s%3$s%4$s%5$s%6$s',         $args->before,         $attributes,         $args->link_before,         apply_filters( 'the_title', $item->title, $item->ID ),         $args->link_after,         $args->after     );          // build html     $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );          $output .= '
';     var_dump(get_page($item->ID));     if(is_page($item->ID)){             $the_page = get_page($item->ID);             var_dump($the_page);             $output .= apply_filters('the_content', $the_page->post_content);     } elseif (is_single($item->ID)){             $the_post = get_post($item->ID);              $output .= apply_filters('the_content', $the_post->post_content);     }     }          function end_el( &$output, $item, $depth = 0, $args = array() ) {         $output .= "

\n";     }     }


Upgrading themes never works

I have a Wordpress installation running on my own server at home, serving a domain name I bought. It's running on Debian Linux, currently installed under `/usr/share/wordpress`. When I'm in the Admin panel, I see notifications for updates to the themes or plug-ins. So, I SSH into my server, turn on the FTP daemon, then start the update. Below is an example output:               Downloading install package from http://downloads.wordpress.org/plugin/akismet.3.0.0.zip…     Unpacking the package…     Installing the plugin…     Could not create directory. /var/lib/wordpress/wp-content/plugins/akismet/     Plugin install failed.      This is starting to get a little annoying. The directory exists, and the user that the FTP is running on (www-data) has write access to the folder. Why can the Updater not remove the old plug in, then install the new one? * * * Meta Discussion about being on or off topic


How to create network-wide taxonomy terms on multisite?

I am trying see if it's possible to create shared network-wide taxonomy _terms_. Specifically, I want to create a few custom taxonomies for Users (a network- wide resource) and I want them to all share the same available terms. One solution I have found for network-wide taxonomy terms is Multisite Global Terms. The problem with this plugin is that it directly manipulates `$wpdb->terms` to use the main site as the "master site" for ALL terms. This will not work for me, as I still need the individual sites to have their own terms for other taxonomies. Other solutions I have seen hook into actions for create/delete terms and merely sync all sites to have the same ones. This is also not what I'm looking for. Some possible solutions I have thought of are:   * creating a global user query class based on `WP_User_Query` which is modified to manipulate `$wpdb` similarly to the way MGT does, but returns it to the way it was after the query. (or just creating a function that wraps the query with this)   * creating new db tables for global taxonomies, terms and relationships and mimicking existing taxonomy/term related code to interact with it. (this might be the best solution as it wouldn't be object-specific).   * giving up and using user meta instead.. Does anyone have any experience with this? Any comments or other possible solutions are much appreciated!


Make a vertical dynamic list of posts in alphabetically order and in columns

I have a page that lists all the posts from a given category of an custom post type dynamically. I do this with a plugin that list posts and a shortcod and with css i created 9 columns where they are sorted horizontal after letter. Instead I would like to have this in a vertical alphabetically dynamic ordered lists, preferably sorted under a letter. like this: http://skatematic.com/channels Since css doesn't seem to cut it with this, I'm not sure where to start. Any pointers?


Forced profile plugin ..and link to field

I use the plugins Bp forced profile that display a message for complete a missing required field with a list of field (title). Howto link a title to the field missing in the message ? if you have more field in plus tab ..the user require navigate to all tab for find the missing field required, but if linked to come directely to tab with missing required field and speedup the completation. if any have a code inminded for this thankyou +++ sara


List posts related to category on a div

i want to display posts related to selected category at the same page(on a different div). What i want is as the image attached, when i click the category name on the left side, all related posts must be listed on right. Thanks in advance   **EDIT** i couldn't set up the logic, the code is not my issue. i couldn't realize how to solve the matter. i dont ask for codes, i just want an idea ![Display of my page](http://i.stack.imgur.com/m0N2i.jpg)


Remove arrows from previous and next link

In the wordpress theme I am developing I inserted some code to display links to the previous and next posts which appears at the bottom of each post. The code looks like this..               <?php previous_post_link(); ?>     <?php next_post_link(); ?>      The problem is that these arrows << and >> appear next to them. Does anyone know how to get rid of them? Any help will be appreciated.


How to disable hoverIntent in Wordpress 3.3 admin

I don't like hoverIntent in the new flyout menus or admin bar; to me, it makes my page feel slow. What would be the Wordpress-friendly way to disable hoverIntent (or change its options) in the new Wordpress admin and toolbar? The only place I see hoverIntent in the Admin page source is here: `<script type='text/javascript' src='http://mysite.com/wp-admin/load- scripts.php?c=1&load=admin-bar,hoverIntent,common,jquery- color,suggest,inline-edit-post,jquery- form&ver=26e0371f31adb44206d9f999828c9182'></script>`


Paypal buttons disappear in the text editor

I have a series of paypal buttons on a web page that I am trying to migrate from another site onto Wordpress. When I copy the html and paste it into the (HTML TAB) of the wordpress editor, I can see the buttons. But when I press save the code disappears...


Site blocked by WebSense on fresh WP Install

Just put up a new WP 3.2.1 install running twenty eleven, with one post "coming soon". I haven't yet begun developing the site. At my place of business, it is currently blocked by WebSense as "potentially damaging content", yet I was able to access the site yesterday. Does it appear as if my site is hacked or has spam links, or does the web filter just not like my newfound sense of freedom? :) The site is here, I can't currently check into it due to the whole web filter issue. It does look fine on my iPhone, but I can't view source. **Theme** : Twenty Eleven (no modifications)   **Plugins** : Remove Double Space


Get current page id, title, url, etc

Sorry but I get lost on Wordpress's codex. I am trying to add a mail this page sharing link and want to include some info from the page. In pseudo code is this possible? `<a href="mailto:?subject=".CURRENT_BLOG_NAME." ".CURRENT_PAGE_TITLE."&body="intro%20text%20".WP_PLUGIN_URL.$_SERVER['REQUEST_URI'].">Mail to a friend</a>` Where `CURRENT_BLOG_NAME` is ??? and `CURRENT_PAGE_TITLE` is ??? `WP_PLUGIN_URL.$_SERVER['REQUEST_URI']` **does** get me the path to the current page.


Html and links via Quick press

Is there anyway I can add an html link from the quick press on the Wp-admin Dashboard? Does it accept html? If only I could do that, I wouldn't have to go to create new post everytime I wanted to blog.


Want to add a custom author link to a single.php

I want to add a custom link to linkedin near author name. It should be very easy if it would be only one author, but now it's not. So, I have to add something on all single.php and somewhere the real links. Can anybody help me with this? Thanks!


woocommerce questions - trying to pic an ecommerce solution

I need to have a conversation with someone familiar with woocommerce. Is there a phone number for support, i am willing to pay for the support call. I have a company that messed up the redo of my website and is willing to rewrite it in either WordPress or Magento. I told them wordpress and they are using woocommerce as my eCommerce solution. I sell medical products and will use it as a catalog for my more expensive products but want a robust eCommerce site for the smaller products. I am looking for: 1. excellent SEO and Filtering. 2. great newsletter potential. nothing fancy but I need to be able to have a doctor inform me of a product that he needs or has to sell me and turn the email around to me list quickly and efficiently as this is how i source my used equipment. 3. i could have over 1000-2000 products. There are more things that i need but that's why I would like to discuss them with someone who understands the product at a high level. That's also why i like the WordPress backbone because I pretty much know what it can do. Magento on the other hand seems to get great reviews from developers but not so good reviews from the people who work the site on a daily basis, huge file sizes, bulky code, slow and not so user friendly. Please let me know if there is a resource that i can talk to. . Thank you. Rick


Create hooks based on an array of hook names?

I have this idea where I would create a class that would take in a set of hook names then create them, for me to use when ever, and where ever. Currently the way to create a hook is we do something like:               function some_hook_name(){         do_action('some_hook_name');     }      And then from there we write some other function, well call - add_content and then pass it to the action as such:               add_action('some_hook_name', 'add_content');      and there we go. But what if I wanted to create a class where I do something like:               $array_of_hook_names = array(         'hook_one', 'hook_two', ...     )      so that later on, I could do:               add_action('hook_one', 'add_content');      Is there any way to do this? Could I just do something like:               public function setup_hooks($array){         foreach($array as $hook_name){             do_action($hook_name);         }     }      Ideas?


Add tinymce to widget textareas

I've got several custom widgets which are extended from WP_widget. Many of these have textarea fields. I'd like to be able to apply a special css class to certain of these textareas in order to convert them to rich text areas with a basic TinyMCE toolbar control. How involved is this to do? I'd like to implement a solution that inherits most or all of its code from the WP core and just piggyback off that.


How to specify expiration of cacheable resources?

I'm trying to speed up a wordpress site -- this site: http://richardclunan.net I'm following the observations here: http://gtmetrix.com/reports/richardclunan.net/9ps7Zc0j The first item says: "The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:" How do I specify expirations for those things? (I'm not very technically-minded, and likely won't know relevant terminology -- really appreciate baby-steps explanation if possible :)


How to use wp_editor(); in functions.php then retrieve content in the template

I want to use wp_editor(); (custom editor) I've tried several methods but I am lost and I can't get it to save the post and retrieve the content in template How to edit posts with the new wp_editor api? also               add_action( 'edit_page_form', 'my_second_editor' );     function my_second_editor() {         // get and set $content somehow...         wp_editor( $content, 'my_second_editor' );     }      Looking for a simple solution which allow me to post the content and display in a same manner as the_content(); would with default editor... any ideas?


Affect on speed of wordpress membership plugins -- currently trying s2member

I'm taking a look at s2member -- I have it running, and my site is very slow -- it's taking on average about 9 or 10 seconds to load. This is the site: http://richardclunan.net I want to figure out if the s2member plugin is causing it to be slow. And whether there are other faster membership plugins... 3 questions:   1. Are there particular settings or things specific to s2member that I should take care of to ensure s2member doesn't make my site slow?   2. If I deactivate the plugin to test the speed of the site with the plugin deactivated, will that mean I'll have to respecify s2member settings when I reactivate it? After it's reactivated will members' accounts work ok?   3. Anybody have observations on s2member or other wordpress membership site plugins and their affect on site speed?


Word count not accurate - potential bug

My editors reported that there appears to be an issue with my word count on the post edit page. Testing this proved true, check the word count: ![wordcount](http://i.stack.imgur.com/46gOk.png) This is affecting all posts, for instance, a post with around 1600 words shows as 8000+ words. My question is, what can be the cause of this? How do I troubleshoot this and find a solution? Is anyone else experiencing similar issue on Wordpress v3.5.1? I am baffled... **Update** : Appears it calculates characters (instead of words). It sums all letters without spaces. It doesn't count periods or other symbols either. Now, this is getting obscure. **Update 2** : The perks of moving servers. Once moving server, I could start debugging this issue on the old server to find the cause. So I deactivated all plugins, same problems. Finally, I found this code hiding in the theme of which I used as a template:               // Tells wp_trim_words() function to use characters instead of words     function et_wp_trim_words_to_characters( $default_translated_text, $original_text, $context ) {         if ( 'words' == $original_text && 'word count: words or characters?' == $context ) {             return 'characters';         }              return $default_translated_text;     }     add_filter( 'gettext_with_context', 'et_wp_trim_words_to_characters', 20, 3 );      My question is, **what would be the purpose of this code**? I suspect that it was not intended to conflict with the word count on the post edit page.


Sort Posts by Multiple Meta Values

1) Custom Post Type named "Buying_Locations" 2) Each Post has three meta values of: State, City, Store Name **QUESTION:** How can you show a list of these posts sorted alphabetically by State, then City and then the Store Name? For example... **STATE 1**   * CITY 1     * STORE NAME     * STORE NAME     * STORE NAME   * CITY 2     * STORE NAME     * STORE NAME     * STORE NAME   * CITY 3     * STORE NAME     * STORE NAME     * STORE NAME **STATE 2**   * CITY 1     * STORE NAME     * STORE NAME     * STORE NAME   * CITY 2     * STORE NAME     * STORE NAME     * STORE NAME **STATE 3**   * CITY 1     * STORE NAME     * STORE NAME   * CITY 2     * STORE NAME     * STORE NAME     * STORE NAME   * CITY 3     * STORE NAME I've gotten a little further with this:               $mypost = array(      'post_type' => 'buy_locations',      'posts_per_page' => -1,      'meta_key' => 'store_city',      'orderby' => 'meta_value title',      'order' => 'ASC'      );      $loop = new WP_Query( $mypost );       Just need to figure out how to sort by the State first, then the city, then title. Not sure how to add the extra "meta_key" value. How do I add the 3rd sorting request?               $mypost = array(          'post_type' => 'buy_locations',          'posts_per_page' => -1,          'meta_key1' => 'store_state',          'meta_key2' => 'store_city',          'orderby' => 'meta_value1 meta_value2 title',          'order' => 'ASC'          );


How to change value of $menu_class in ep_nav_menu?

How can i change value of $menu_class parameter in wp_nav_menu() so that I can give a special css class to one of items in menu for example "Home"? here is some code but they didn't show me the message at all:               function clear_nav_menu_item_id($id, $item, $args) {         echo "nav_menu_item_id";     }          add_filter('nav_menu_css_class', 'clear_nav_menu_item_class', 10, 3);     function clear_nav_menu_item_class($classes, $item, $args) {         echo "nav_menu_css_class";     }


Passing conditional arrays to WP_Query()

I've looked around at a few places and could not find an answer. I was wondering what the best way to create a WP_query from possibly empty variables were. I have about 16 of these $_GET variables.               if( isset($_GET['promotion']) ){         $promotion = $_GET['promotion'];              if($promotion == 'promotion'){             $promo = 1;         } else if($promotion == 'regulier'){             $promo = 0;         }     }      In some cases `$promo` might not be set. So how can I create a `meta_query` let's say with dependant on if `$promo` is set or not.               'meta_query' => array(         array(             'key' => 'model-promotion',             'value' => $promotion         )     )      If the `meta_query` is not set but present in my `WP_query()` the query breaks. Thanks for the help!


Wordpress communication through XML-RPC.NET

I'm currently using XML-RPC.NET library to communicate with my Wordpress site. I have successfully created a simple client for adding postings under Posts. However, I cannot seem to find something that can add or edit new things under Gallery. Can anybody guide me or help me on this? Does the current XML-RPC.NET library support this feature? Thank you very much. CookComputing supports the XMl-RPC method called metaWeblog.newPost, but this is for Posts. Is there anything for Gallery? Thanks again. ![enter image description here](http://i.stack.imgur.com/sHPfs.jpg)


How to disable wp content editor while using qtranslate for custom post types in wp-admin

Is it possible to remove the editor completely for some CPTs?   * If you remove the editor support for the CPT, qtranslate does not init for the title field. So, if you want to use it, you should get the tinymce no matter what.


Get All In One SEO Pack to use custom field instead of Content

I'm having an issue with a custom theme whereby All in One SEO pack isn't auto-generating descriptions because I am using a custom field to enter the main body of the page/post. Is there way to specify that All in One SEO uses a specific field to read from for the purpose of generating the SEO content automatically?


Creating a custom abstract/excerpt function: retrieving text between a specific tag or id

Unfortunately, the functions for retrieving the abstract and the excerpt don't fit my needs. I want to define a part in my text that should function as abstract without falling back to JavaScript/jQuery as I do not want my readers to necessarily have it enabled for reading the content. I want to define a custom tag or shortcode like [my_abstract] and retrieve the text between it. It also could be a div-tag with a specific id. Unfortunately, I'm not well versed in PHP, could this be done?


How can I use 'orderby' => 'meta_value_num' to order by the numerical value even if the value starts with a word?

I'm using `'orderby' => 'meta_value_num'` to order some boats I have as a custom post type, the meta values ordered by, are boat models, which are normally just numbers but if you look at this page: `http://boats- barcos.com/brands/ferretti/` you will see the ALTURA 840 is listed last when it should be between the 800 and 870. This is obviously because the value starts with a word. How can I get the `orderby` query to only order by the numerical value and ignore the word?


Delivering Page Templates With Plugins

My company is asking me a lot of requests that are "theme territory" for a plugin that inserts a custom types and taxonomies. My current approach has been using 'wp_ajax_nopriv_' to set a function that responds a JSON object of the posts, and displays theme on the frontend. However, they also have the need to search using the WordPress native search, and to display taonomies and custom type single requests using templates. I've been using:               function my_taxonomy_template() {              $term = get_queried_object();                   $templates = array();              if ( $term ) {             $taxonomy = $term->taxonomy;         }                   $plugin_dir = plugin_dir_path(__FILE__);         if ( $taxonomy == 'my_taxonomy' ) {                  if(file_exists($plugin_dir. '/includes/taxonomy-sponsorship_category.php'))                 return $plugin_dir . '/includes/taxonomy-sponsorship_category.php';         }          }          add_filter('taxonomy_template', Array($this, 'my_taxonomy_template' ));      But seems error prone, specially since now I'm about to use advanced searching using wordpress' default search, etc. I've seen some plugins instructing the user to add the pages manually and set them to use a shortcode. What's the recommended way to do this?


Cant use php fopen() function in functions.php

I am trying to simple run fopen() in the **functions.php** , and have also tried it in a **test.php** wordpress template file. But it does not work. If I move the test.php file and csv file to a location outside the theme folder then it works first time.               function csv_to_array($filename='', $delimiter=',')     {         if(!file_exists($filename) || !is_readable($filename))             return FALSE;              $header = NULL;         $data = array();         if (($handle = fopen($filename, 'r')) !== FALSE)         {             while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE)             {                 if(!$header)                     $header = $row;                 else                     $data[] = array_combine($header, $row);             }             fclose($handle);         }         return $data;     }          echo '<pre>';     print_r(csv_to_array('csv/nationality-codes.csv'));     echo '</pre>';      This is my folder structure in the theme file... ![enter image description here](http://i.stack.imgur.com/KqrBF.png) Any ideas why it does not work?


wp_insert_link not working

Im using this code to insert links into my blog:                       $linkdata = array(                  'link_name' => $title,                  'link_url' => $url,                  'link_catetory' => 3, // my cat id                  );                  $link_id = wp_insert_link( $linkdata );       Links are inserted, but not in the correct category, I missed something?


Getting a 'slide down' js panel implemented within WP

**I'm trying to implement a very simple vertical slide down panel in Wordpress** , I've tried jbar _(http://tympanus.net/codrops/2009/10/29/jbar-a- jquery-notification-plugin/)_ and an easy JS method I found in **http://jsfiddle.net/ahr3U/** But I still cannot get this implemented, I've tried inserting the below code in the _footer.php_ right before it's close, and within the _header.php_ and still nothing appears.                     **And CSS:**               #notification {         background-color: #F00;         color: #FFF;         height: 25px;         position: absolute;         top: -25px;         width: 100%;         transition: top 0.5s;         -moz-transition: top 0.5s;         -webkit-transition: top 0.5s;         -o-transition: top 0.5s;     }          #notification.visible {         top: 0px;     }      **The HTML CTA via the div, I've tried calling with the** `<head>` and `<body>`
Page load complete...


Customing Annual Archive plugin

I'm using the Annual Archive plugin which shows the year in the sidebar. I want to display in the dropdown only the years that have posts in category 17. How can i achive this?   My code is below...                   function widget( $args, $instance ) {              extract($args);         //$c = $instance['count'] ? '1' : '0';         //$d = $instance['dropdown'] ? '1' : '0';              $format = empty($instance['format']) ? 'html' : apply_filters('widget_type', $instance['format']);         $type = empty($instance['type']) ? 'yearly' : apply_filters('widget_type', $instance['type']);         $before = empty($instance['before']) ? '' : apply_filters('widget_type', $instance['before']);         $after = empty($instance['after']) ? '' : apply_filters('widget_type', $instance['after']);         $limit = apply_filters('widget_limit', $instance['limit']);         $title = apply_filters('widget_title', empty($instance['title']) ? __('Annual Archive', 'anarch') : $instance['title'], $instance, $this->id_base);              //$wpdb->query('select * from my_plugin_table where foo = "bar"');              echo $before_widget;         if ( $title )             echo $before_title . $title . $after_title;              if ($format == 'option') {             $dtitle = __('Select Year', 'anarch');             if ($type == 'monthly'){                 $dtitle = __('Select Month', 'anarch');             }             else if($type == 'weekly'){                 $dtitle = __('Select Week', 'anarch');             }             else if($type == 'daily'){                 $dtitle = __('Select Day', 'anarch');             }             else if($type == 'postbypost' || $type == 'alpha'){                 $dtitle = __('Select Post', 'anarch');             }              ?>         <select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo esc_attr(__($dtitle, 'anarch')); ?></option>  <?php wp_get_archives(apply_filters('widget_archive_dropdown_args', array('type' => $type, 'format' => 'option', 'show_post_count' => $c, 'before' => $before, 'after' => $after, 'limit' => $limit))); ?> </select>         <?php         } else {         ?>         <ul>         <?php wp_get_archives(apply_filters('widget_archive_args', array('type' => $type, 'limit' => $limit, 'format' => $format, 'before' => $before, 'after' => $after, 'show_post_count' => $c))); ?>         </ul>         <?php         }              echo $after_widget;     }


category_description() shows raw html after version 3.x?

Just looking for some history on the output of category_description() I have categories whose "description" fields are formatted with rich text and I'm trying to understand the differences in WP version with respect to the output of this method so that I can do a version check if necessary to implement desired output. For example, before 3.0.1, it appears that category_description() returned the output stripped of any html markup. However, with the current 3.3.1 release, the output appears to be raw.


How to show products attributes in loop?

I added custom attributes to my products, and I would like to show one of these on the product loop page(loop/price.php). The attribue name is: "garan".               $garanvalues = get_the_terms( $product->id, 'pa_garan');          foreach ( $garanvalues as $garanvalue ) {         echo $garanvalue->name;         var_dump($garanvalue);     }      I used the code above, but the var_dump output the following:               array(1) {   ["invalid_taxonomy"]=>   array(1) ..      I hope you know solution. Thank you very much!


Show validation warning if no Excerpt is added

Is it possible to display a warning in the admin section when posting if the excerpt section hasn't been filled out to stop a post being published without an excerpt? Does anyone know of a plugin that has this facility?


Carrington Build: Overriding module view file not working

I am attempting to create a filter in my theme to override the view file used for the Loop Module in Carrington Build, but nothing is happening.                           function my_load_loop_view($view, $data) {                     if (is_home() || is_front_page()) {                              $view = trailingslashit(get_stylesheet_directory()). 'views/cfct-module-loop-view.php';                     }                     return $view;                 }                 add_filter('cfct-module-loop-view', 'my_load_loop_view', 10, 2);                      If I'm understanding the documentation correctly, this is pretty much exactly how it's done. This is the example the manual shows:               function my_load_callout_view($view, $data) {         if (is_home() || is_front_page()) {             $view = trailingslashit(get_stylesheet_directory()).'views/callout-home-view.php';         }         return $view;     }     add_filter('cfct-module-cfct-callout-view', 'my_load_callout_view', 10, 2);      I've also experimented with different values for the add_filter() priority, but that had no effect.


Specific custom searches (user profiles by their user name and posts by their title only)

I need to make these kinds of searches on my site:   1. Search for user profiles by user name.   2. Search for posts by post title only (i.e., exclude their content). How should I go about this?


Changing www prefix in General Settings and Interior Links

This may be the most redundant/dumbest question known to man, but if I go into Wordpress' General Settings and modify my Site Url to include a `www`, so               http://mysite.com      becomes               http://www.mysite.com      do I need to run a MySQL query to find/replace my image sources, my interior page links, etc? They all currently point to an address without the `www`, will this cause an issue?


Disable registration on certain condition

I have a certain condition in my code (if the user is visiting the page from a network range) and I can ask for this condition easily, let's say:               if ( $user_in_allowed_range)      What I want is to offer the registration button only to users who fulfill this condition, and other users should still be able to login. Is there any way to do this in WordPress without hacking the core? An additional custom login form is not a solution as the original one is still available. I found some hooks (`login_form`, `login_head`, `user_register` …) and the theme function `wp_login_form()` but they do not offer my needed feature.


Saving Custom Post types and fields to a custom table

I have a project in which I am trying to import a large amount of data into a WordPress installation and from that data, create pages on my site (as a custom post type). Since these pages will be visited far less often than the rest of our site, we decided to keep the data separate from posts and postmeta, so that it doesn't affect load times. The information does need to create the custom posts so that they can be added to the sitemap (using google xml sitemaps - too many to add by hand). I have created a custom post type and created the beginning of a plugin that creates a custom table in the database. My thought is that I could then create a function that saves the post information to this database rather than post or post meta when it is being created. I know enough php to get by and am new to sql, but have help to turn to if I need it. Unfortunately, they are less well versed on the wordpress side than on coding, so I would like to try to gather as much information as possible before turning to them. So does this sound like a reasonable plan and does anyone know of resources where I could get a feel of what I would need to do?


Help with rewrite rule

I have a probleme with a rewrite rule. On my page, I have a link to : mySite/pubmed/article/23919219 I would like to convert it to               http://example.com/index.php?page_id=165&article_id=23919219      to catch it with my plugin. My page with id 165 exists of course. My rule is :               add_action( 'init', 'pubscore_addMyRules' );     function pubscore_addMyRules(){         add_rewrite_rule('^pubmed/article/([^/]*)/?','index.php?page_id=165&article_id=$matches[1]','top');         add_rewrite_tag('%article_id%','([^&]+)');     }      But it doesn't work, I have a 404 error.


Change twentytwelve sidebar responsive relocation?

I'm using twentytwelve as a base theme and I want to change a behavior of the sidebar. When viewing in mobile view (you can collapse your browser window all the way horizontally to see the same view) the sidebar items drop below the content. I would like one item (the top item) of my sidebar to go above the content but stand under the navigation. So for example say I have recent posts, recent comments and subscribe in my sidebar. When in mobile view I want recent posts to stay on top of the content, and recent comments and subscribe to go below. Is this possible? Thanks a bunch for any and all help! Best, George


How to load javascript on custom page template?

I have a custom page template where I would like to load some javascript. I suppose I could always include the javacsript in the actual file, but that seems ugly. Is there any way to identify if wordpress is loading my custom- page.php file so I can enqueue the script only on that page? It should work dynamically, so checking page id is not an option.


Subpage Conditional

I am looking for a way to write a condition for a subpage...in other words `if` we're on the subpage "duck" then do something...`if` not do something else. I found some code I thought would work, but it shows up on all of the pages under a given parent page, not just on its individual page...I'm only trying to target the individual page. This goes in functions:               // Subpage Shortcode     function is_child($page_id_or_slug) {         global $post;         if(!is_int($page_id_or_slug)) {             $page = get_page_by_path($page_id_or_slug);             $page_id_or_slug = $page->ID;         }         if(is_page() && $post->post_parent == $page_id_or_slug ) {             return true;         } else {             return false;         }     }      This is my `if`:               if (is_child("Youth")) {         echo "duck";     } else {         echo "something else";     }      Thanks,   Josh


Excerpt with image

I would like to use my excerpt field to display a different image for each post to represent that post. For instance a post about a new album instead of having a title/text excerpt would simply be an image of that album. I create i new post like :                                           TEST               `single-photos.php` :               <div <?php post_class() ?> id="post-<?php the_ID(); ?>=">         <?php   echo get_the_excerpt(); ?>
        With this code, displays only the text, and not the image. I want to display only image or gallery. How to do that? Thanks.


How do i best handle custom plugin page actions?

I'm constantly running into the same annoyance, so i thought i'd see if there's any ideas or experience out there... I've created a plugin that uses it's own admin page. It has to. Now that i sorted out the WP_List_Table() stuff, i must say it's great...but.... Custom plugin pages always load as `admin.php?page=...` unless i want to load them from the plugin directory directly, which i don't. Now if i do an 'action' from that page, i need to process that somehow and then redirect back to the page _without_ the action parameter. No matter if i do a GET or POST, really. On all it's internal pages WP does this on the same page, it checks if there's an action, if so processes it and then redirects to itself without the action. This is possible, because on these pages the `admin-header` hasn't been loaded, yet. If you try doing it on your own page, though, half the admin interface has already been sent to the browser, so a redirect isn't possible anymore. Clearly, the solution is to POST/GET directly to another page, load the WP framework on that, do the processing and then redirect back to the original page...but...that's a bit annoying, because...my original page is loaded via a callback, so it runs within a method of my class. That's beautiful. If i load a separate page, i have to manually include `wp-load.php` and am outside of my class, which is annoying, and in my particular case bugs me especially, because i'm only instanciating my plugin class anonymously so that no-one can access it from the outside. So after this long story...did anyone come up with a good solution to load another page via a callback _without_ having the whole admin interface already setup around it? (I know of a workaround...i can hook a function into `load-....` that checks for the action parameter and does the processing and redirect. But i'm wondering if there's a better way.) Thanks.


Display latest post depending on Meta Box content

What I want to do is display my latest post's content on a custom template page, ONLY if a meta box is filled in with the right word. In other words, if the post has a meta box named, "FEATURED" with a value of "YES", then I would like to show the post on my custom template page. If the "FEATURED" meta box says, "NO", then I do not want the post to show up. With some previous help, I am currently using the following to show the latest post on my homepage:               $my_most_recent_post = get_posts( 'numberposts=1' );     $my_most_recent_post_id = $my_most_recent_post[0]->ID;      My homepage will show the latest post no matter what, but on this particular page, I only want it to display conditionally depending on the meta box. So can I take that code and make it work in a conditional statement?


Make homepage the newest post of a custom post type

I am using the plugin "Custom Post Types" to create an issue based magazine, where one of my types is "Covers." There will be one of these posts for each issue and will include the cover art and an list of articles in the issue. My question is, how can I make the main page default to display a single view of the newest post of this type?


Custom Post Types and Taxonomies

I am building an issue based wordpress magazine and am running into a few issues with custom post types and taxonomies. I created a taxonomy called "Issues" so that any custom post type could be attached to a specific issue. I also create a custom post type called "Covers" which has the main cover art and issue information on it. The cover will be the main hub for each issue, providing access to all posts linked to the specific issue in the taxonomy. My question is, how can I automatically generate a list of links to all the posts of an issue on the Covers post? Could I create a custom template for the Covers post type and include a query to grab all posts of any post types (besides the cover) with the same issue set? Would there be a better/easier way of doing this? I'm just trying to avoid having to manually generate the index of each issue.


php nested IF statements to hide content (possible syntax error)

I cannot see what is incorrect here, I'm trying to hide an entire element if all (and some) options are empty, but it is hiding everything even though at least options are filled in. My code:                   <?php $sitename = get_bloginfo( 'description' );               $phone1 = get_option( 'show_phone1' );               $phone2 = get_option( 'show_phone2' );               $email = get_option( 'show_email' );               $address1 = get_option( 'show_address1' );               $address2 = get_option( 'show_address2' );               $town = get_option( 'show_town' );               $county = get_option( 'show_county' );               $postcode = get_option( 'show_postcode' );         if ( ! empty( $sitename ) && ( ! empty( $phone1 ) || ! empty( $phone2 ) ) && ! empty( $email ) && ( ! empty( $address1 ) && ! empty( $address2 ) ) && ! empty( $town ) && ! empty( $county ) && ! empty( $postcode ) ) : ?>
                  <?php if ( ! empty( $sitename ) ) : ?>                 <?php echo get_bloginfo( 'name' ); ?>                  <?php endif; if ( ! empty( $phone1 ) ) : ?>                 <?php echo get_option( 'show_phone1' ); ?>                  <?php endif; if ( ! empty( $phone2 ) ) : ?>                 <?php echo get_option( 'show_phone2' ); ?>                  <?php endif; if ( ! empty( $email ) ) : ?>                 <a href="mailto:<?php echo get_option( 'show_email' ); ?>" title="Send and email to <?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"><?php echo get_option( 'show_email' ); ?>                  <?php endif; if ( ! empty( $address1 ) ) : ?>                 <?php echo get_option( 'show_address1' ); ?>                  <?php endif; if ( ! empty( $address2 ) ) : ?>                 <?php echo get_option( 'show_address2' ); ?>                  <?php endif; if ( ! empty( $town ) ) : ?>                 <?php echo get_option( 'show_town' ); ?>                  <?php endif; if ( ! empty( $county ) ) : ?>                 <?php echo get_option( 'show_county' ); ?>                  <?php endif; if ( ! empty( $postcode ) ) : ?>                 <?php echo get_option( 'show_postcode' ); ?>                  <?php endif; ?>
         <?php endif; ?>      Any help is much appreciated, please bare in mind I (obviously) do not code PHP.. I'm just trying my hand at some editing.. which is always fun.


Previous and Next Navigation buttons take the user to the wrong posts

I am currently developing a portfolio section on my website and when the single posts are viewed, there are some previous and next links to take the user to the next post. Upon reaching the first post single view, the previous button takes the user to the fifth post in the series rather than looping to number 12 in the series as expected. Here is the code I used to generate the previous and next buttons,

<?php previous_post_link('%link'); ?>

<a href="<?php echo get_permalink( 187 ); ?>" class="backportfolio">My link

<?php next_post_link('%link'); ?>

      the portfolio test site is at http://sandpit.jonathanbeech.co.uk/portfolio- two/ Is there a way of configuring these buttons to allow them to move to the appropriate post


How to change the order of elements within a post?

I have a site with several thousand posts. They all have just a single attached image of varying size. All posts are displayed in full (no thumbnail view). I'd like to be able to change the way the elements display within the posts to be:   * date (at the top)   * image caption   * the attached image (actual size)   * post title   * post text content   * tags


Sort category page with custom field

This is similar to another question I asked, but I can't recognize how this query string works. I have a custom field called "category_order" and I would like to sort my category page by this order (and not the date). Here is my code:               <?php wp_reset_query(); ?>

               <?php if (is_category()) {                 $cat_ID = get_query_var('cat'); ?>                    <?php echo '
'; wpzoom_breadcrumbs(); echo'
'; ?><?php }                  elseif (!is_category() && !is_home()) { ?>                 <?php echo '
'; wpzoom_breadcrumbs(); echo'
'; ?>                 <?php }                 else { ?>
Recent Videos
                 <?php } ?>

              <?php if (have_posts()) : ?>
                 <?php             $i = 0;                       while (have_posts()) : the_post();                     $i++;                 ?>


Get page by template?

I'm in a complicated situation. I'll try to explain it as easy as possible. Imagine the following pages:   * Page 1   * Page 2      * Subpage 1     * Subpage 2     * Subpage 3 Each subpage of page 2 lists posts from a custom post type with a specific taxonomy. Let's call the post type Objects, and the taxonomy just Categories, to keep it simple. To list the different posts from the different Categories, i have three different page templates for the subpages: `subpage-1-templ.php`, `subpage-2-templ.php` and `subpage-3-templ.php`. Each one of these templates lists the posts from a specific Category for the post type (Objects). It's hardcoded. So far all good, it works as expected. It's a little ugly to have to hardcode it but i don't know of any other way, so this'll have to work for now. (I'd prefer to ditch wordpress alltogether but that's another story) All of those subpages lists the siblings in a sub menu. So, if you're on subpage 2 it will show subpage1, 2 and 3 (but subpage 2 has a current class on it). Works good. Now to the actual problem; when you click one of the posts listed in a subpage, you get to a page which displays more info for the post, as expected. The problem is i want to show the submenu for page 2 in there (so, subpage1, 2 and 3). I don't know how to do that without hardcoding it. Perhaps, and i don't know if this will work, but maybe i can find a page by it's template. I can create a template for page 2 (not for it's children, the actual parent page) called `objects-template.php` and then on a post, i can grab the page that uses the template, then get all it's children, and then just simply list them up. I just don't know how to get a page by it's template, if that's even possible (Preferably by the template file name, but the template name works too). Any suggestions? **Edit**                   // Query looks fine right?         $query = new WP_Query(array(             'meta_key' => '_wp_page_template',             'meta_value' => 'objects-parent-page-template.php'         ));         // Dump the id (also tried just getting the object with get_queried_object(), still get null)         echo '<pre>'; var_dump($query->get_queried_object_id()); die();


Add a class to a menu item depending on a body class

I need to have a class of current-menu-item added to a li with the id of #menu-item-127 if the body class is post-type-archive-team I can do this with jQuery -               $(function(){         if ($('body').hasClass('post-type-archive-team')) {             $('#menu-item-127').addClass('current-menu-item');         }     });      But it's needed before jQuery loads to make something else work. Any ideas if I can do this with PHP? Thanks in advance


How to display non-page / post content

I have a custom made Twitter stream on my site. I want to have a permalink for each tweet which would go to a page which would display only the tweet - no other content - surrounded by my custom theme. Ideally I would get Wordpress to display a Page Template on a certain url (something like /tweet/<tweet_id>), but I don't want to create a Page because it will appear in the main menu. I'm happy to write a plugin but my Google-fu is failing help me to figure out how to display just that plugin's content on a page.


Featured Image problem with resizing

I want include function to resize featured image to 80x80, im add this code in my function.php               add_theme_support('post-thumbnails');     set_post_thumbnail_size(80, 80);       But is not work very good, images is not resized, looks like scaled to 80x65 or something.. i need exactly 80x80 on every images uploaded...


Rename "post" to "article" throughout the admin back end

> **Possible Duplicate:**   >  Is there a way to change 'Posts' to be 'Portfolio' is the WP backend? Is there a way to accomplish this by the functions.php file ? I tried:               add_filter(  'gettext',  'change_post_to_article'  );     add_filter(  'ngettext',  'change_post_to_article'  );          function change_post_to_article( $translated ) {             $translated = str_ireplace(  'Post',  'Article',  $translated );             return $translated;      } but it does not change all the entries for "post". I still have "Post tags" for example. Any suggestion?


remove last separator?

using;               $args = array( 'menu' => 'mainmenu', 'container' => 'ul', 'menu_class' => 'span-10 clearfix', 'after'=>'/');     wp_nav_menu($args);      which gives me; london/munich/artists/fairs & events/publications/news/contact/ but using the args (or similar) can i remove the / from contact? any help welcome!


buddypress slug issues

i created a bp-custom.php and regrouped the menu items fine. But now i am trying to add a link to go to /site/members. It list all the members. When i add it though it goes under the profile I am viewing. I am redirecting to a wordpress page if that helps. example with it added http://website.com/log-in/members/username/members/ i want it to go just here http://website.com/log-in/members/ I would love to learn how to just put a url and no slug but whatever works Here is the function               function mb_bp_profile_menu_posts() {     global $bp;     bp_core_new_nav_item(     array(         'name' => 'Members',         'slug' => 'members',          'position' => 60,                )       );     }


Connection lost. Saving has been disabled... (Updating Posts/Pages)

I've been developing for Wordpress for a few years now without any trouble on an old XP/WAMP development server (v1.7.4) but recently have been getting the error " **Connection lost. Saving has been disabled until you’re reconnected** " whenever I try to update either Wordpress Posts or Pages. The majority of what I've turned up on the subject points to plugins as the source of the problem, Sadly, I find that even in a clean install of wordpress 3.8.1, in a new DB, without any plugins the problem persists. Next logical culprit then is the server. I check the logs, and find nothing. In the process of migrating my workflow to a newer Windows 7 platform (WAMP v2.2.22) I created a new install there, and the problem is gone. I've run the php.ini's from both servers through a difference engine hoping to suss out the cause, but I'm afraid it's a bit beyond me where the issue might be, nor how to share the results of the comparison here, either as a flat file, or CSV. Any thoughts?


Show all wp_get_post_terms slugs

I am using the following code to display my custom taxonomy slugs. However it is only displaying the first category and not all the related categories. I know this is fairly simple and is to do with [0] but I can't figure out how to change it.               $getslugid = wp_get_post_terms( $post->ID, 'opd_taggallery' );      $getslug = $getslugid [0]->slug;     echo $getslug;


Front end URL to restore a post/page

I was wondering if a url exists where one can click on a link and would automatically populate in the edit post of the most current revision. revision.php?action=restore&revision={newestcurrentrevisionID} doesn't seem to work. all it does is brings me to the revisions page. Am I supposed to link to post.php? what would the action be?


Change font-size within a shortcode

I have a simple shortcode like this....               function myshortcode( $attributes, $content = null ) {         extract( shortcode_atts( array(             'class' => ''         ), $attributes ) );                return 'This is the content : ' . $content . ';     }     add_shortcode('my_shortcode', 'myshortcode');      This works great and if I use the following in a post...               [my_shortcode]This is the content that I want to display[/my_shortcode]      But what I want to do now is vary the font size of the content for example...               [my_shortcode]This is the [25px]content[/25px] that I want to display[/my_shortcode]      I want this to change the word 'content' to 25px font size. Anyone know a way, maybe str_replace?


Any Short code Availble for Get Post List With Thumbnail Plugin?

Any Short code Availble for **Get Post List With Thumbnail** Plugin? or else how to Create Short code for this Particular plugin? Thank u in Advance.


Excluding a page with a certain name from wp_page_menu

A client of mine has a WP multisite network of sites which all use the same template. This template uses wp_page_menu. I just added a mobile version of the template by using a certain plugin. It will use the same pages as the desktop version of the website, but the client has requested a different landing page. The problem is that if I create a new page to facilitate this landing page, it will show up in the code generated by wp_page_menu. Since all sites in this network uses the same template and the page will have different page IDs on different sites, I cannot exclude it manually in the wp_page_menu function. I was thinking that if I could exclude the post by title or category name instead of by ID, this might work. But I don't know how to do that. Please help?


Add class to before_widget from within a custom widget

I have a simple custom widget that asks for its width (that is used later in the front end). The width field is a select dropdown, so a user have predefined options. I will have many instances of my widget, each will have its own width setup. Now, in my widget code I have the following code:               echo $before_widget;      which results in:

      What I'd like to do is somehow hook into `$before_widget` and add my own class (the specified width from the select dropdown). So, I want the following markup:

      And if there is no class specified then I want to add `class="col480"`. How do I achieve this? Thanks for help! Dasha


Login "Lightbox" for specific category content

There's a specific category on my website that should be restricted to teachers only using login. However, I don't want to hassle the teachers with the not so welcoming admin Wordpress offers. I would like to offer a "lightbox" that's basically a login that doesn't automatically forward to the admin, but only makes the teachers category content available. Do you know any plugin that allows that? Thanks, Sarit


How can I extend Quick Edit option with 2 more fields

I wonder if WordPress gives me the ability to add 2 fields (`input` and `textarea`) in the `Quick Edits` of **Tags**. Actually these 2 fields I want to add in `Quick Edit` which are available in **Edit** Tag page, but I want to display these 2 fields in `Quick Edit` so I'll able to access them easily. Please check image to get more idea: ![](http://i.stack.imgur.com/cOKyS.png) Is there any way to do this?


Multiple og:image for Facebook

I've actually been searching on this site for the answer to this question for quite some time. Looking for a way to 'echo/print' multiple og:images for facebook. What I have here used only 'the_post_thumbnail'               function fb_image() {     if (is_single()) {         global $post;         $feature_image = get_the_post_thumbnail($post->ID);         $doc = new DOMDocument();         $doc->loadHTML($feature_image);         $imageTags = $doc->getElementsByTagName('img');              foreach($imageTags as $tag) {                 $image_url = $tag->getAttribute('src');         }     }     ?>          <meta property="og:image" content="<?php echo $image_url; ?>" />     <?php }     add_action('wp_head', 'fb_image');


Upload Image Not accessible

I'm getting a 500 error when trying to access the full version of any image. As soon as it's uploaded to the server, it becomes 'unavailable', and each file cannot be accessed/deleted/anything - like Wordpress is holding on to the file somehow. However, any thumbnails work fine. We have tried:   * Changing permissions on the server   * Allowing media to be put into date and month folders, and to not be.   * Changing the folder that images get put into. We're running a Windows 2008 install. Everything else seems to work but this. As I mentioned, the thumbnails are all fine. Any ideas?


custom walker wp menu last element

I have a menu list with many subitems that contain submenus as well (at the moment some reach 4th level). How can I put on each last descended ul of each li element a class ".last"? for example I have               MENU      PASTA       SUBITEM 1 (.last)        ITEM 1.1        ITEM 1.2       SUBITEM 2 (.last)        ITEM 2.1        ITEM 2.2      PIZZA       SUBITEM 3        SUBITEM 3.1 (.last)         ITEM 3.1.1         ITEM 3.1.2      DESSERTS       SUBITEM 4        SUBITEM 4.1         SUBITEM 4.1.1 (.last)          ITEM 4.1.1.1          ITEM 4.1.1.2       SUBITEM 5 (.last)        ITEM 5.1        ITEM 5.2


Network created blogs URL

I'm building a blog network where people can register their blogs. As default if my domain is domain.com and if user creates a blog, the URL will be domain.com/mynewblog/ Now I would like that all blogs would be under /blogs subfolder/slug. So each time when user creates a new blog, it will be under /blogs slug, like this: domain.com/blogs/mynewblog domain.com/blogs/anotherusersblog Propably I could achieve this my altering the htaccess file. But I'm not really comfortable with that and I have been going through the WP settings but don't find any solution for this. Is there? What should I do? Thanks.


Export wordpress table to excel

I have created PHP scripts before to export a database table to .xls format like this:               $select = "SELECT * FROM tracking";     $export = mysql_query ( $select ) or die ( "Sql error : " . mysql_error( )  );     $fields = mysql_num_fields ( $export );     $file = 'export';     for ( $i = 0; $i < $fields; $i++ )     {     $header .= mysql_field_name( $export , $i ) . "\t";     }     while( $row = mysql_fetch_row( $export ) )     {     $line = '';     foreach( $row as $value )     {         if ( ( !isset( $value ) ) || ( $value == "" ) )         {             $value = "\t";         }             else         {             $value = str_replace( '"' , '""' , $value );             $value = '"' . $value . '"' . "\t";         }             $line .= $value;      }      $data .= trim( $line ) . "\n";      }      $data = str_replace( "\r" , "" , $data );      if ( $data == "" )      {      $data = "\n(0) Records Found!\n";      }          $filename = $file."_".date("M-d-Y");          header("Content-type: application/octet-stream");     header( "Content-disposition: filename=".$filename.".xls");     header("Pragma: no-cache");     header("Expires: 0");     print "$header\n$data";      What I'd like to know is how to "convert" this to wordpress format using the $wpdb class? I can get the initial query down to actually select the data from the table I want, but I get lost in some of the semantics of the wpdb class. I also wanted to know where I would put this code in wordpress, so if say a user clicks on a link, it would run this query and download the .xls file? Any help is greatly appreciated! This site is great!


Multiple Loops Meta Data

I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. > `pods_product_grps`: (p_high, p_med, p_low, m_type, group_id) > > `product_variant`: (cogs, area, img_min, img_max, product_sku, grp_id) Post are connected in **1 to many relationship** where `group_id==grp_id` So when displaying both the archive of `pods_product_grps` and the single post that has a subloop of each `product_variant` I need to display the calculated price based on a function I created. The archive post only displays the lowest calculated price of the child variants. Right now in my function, I have dummy variables to calculate the final price, but I need those to be populated automatically. So I think I need to use this function:               get_post_meta(get_the_ID(),$key, true);      but do I need to run that function for each key I need to define, or is there a way to make the key value an array and then return the values as individual variables.               //used in calculations-- dummy data     $p_high= 3.2; //get_post_meta(get_the_ID(),$key, true);     $p_med= 1.3;     $p_low =1.1;     $cogs= 11.53;     $img_count =3; //number of selected images between $img_min and $img_max     $img_cost= 10; //defined in settings page     $area= 40;     $client_lvl; //defined in user meta          //used in product display     $product_sku      I am not including the price calculation here, but it is in my other questions, and I can post it if needed. I am assuming that after my function, I would then create an action hook for it to display in the content. Would these variables extractions need to happen within the actual loop of say (`single-pods_product_grps.php`) or would including them in the function itself work and then call via the action?


How to redirect root blog to a specific one in multilang WP?

After installation I've got a default root blog '/'. Then I've created a new one '/en'. I really don't want to use the default blog. How can I redirect all accesses from / to /en ?


For some reasons I'm having this error appears in my dashboard Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'admin_init' was given in /home/devromot/public_html/wp-includes/plugin.php on line 405 has anyone came across that before? if so do you know where problem might be?


prevent post submission

I'm using a meta-box for custom post type. I have three problems:   1. WP seems to run the function that I attached to the "save_post" action, every time a new post is opened for editing or reloaded. Is there a way to prevent it from running?   2. WP saves the post even when I add "return false" after validation fails. Is there another way of doing it?   3. how can I validate the built-in WP title field? (I assume it is sent as $_POST['something']) TIA for your help.


how to randomly list 5 authors with at least 3 published posts

Bit of a newbie here... As the title states, I am trying to generate a list of 5 random users (taken from authors, editors and administrators) who have published at least 3 posts each. (Also, I would like to exclude the author whose user ID is 4.) I think I have managed to do all this (hacking together various solutions gratefully taken from useful previous posts here in wordpress.stackexchange!) but I am not sure if this is the best solution or if it's coded correctly. I use this feature on many pages throughout my website and am worried it might be too db query intensive.               <?php     global $wpdb;     $min_posts = 3;      $user_ids = $wpdb->get_col("     SELECT `post_author`      FROM       (SELECT `post_author`,          COUNT(*) AS `count`          FROM {$wpdb->posts}         WHERE `post_status`='publish'           GROUP BY `post_author`)      AS `stats`     WHERE `count` >= {$min_posts} AND post_author !=4;");     shuffle($user_ids);          for($someNumber = 1; $someNumber <= 5; $someNumber++) {     $user = get_userdata($user_ids[$someNumber]); ?>                <?php echo get_avatar( $user->ID, '60' );?>           <h7><a href="<?php echo get_author_posts_url( $user->ID ); ?>">             <?php echo $user->display_name ;?></h7>
     <?php     }     unset($user_ids);     ?>      Any help truly appreciated, many thanks!


Boldy theme  - Regarding the images above the boxes

Hello I am using the Boldy theme for my Wordpress website. I have a problem with the boxes (all 3 of them). All these three boxes have a "read more" that takes the user to another page, and above these boxes there is a small image. Now I want the images for each box to take the user to another page as well, but how can you make each image to turn them into a link in wordpress? Here is my home.php this might help.               <?php get_header(); ?>
                      <?php if(get_option('boldy_slider')!=''){                      $page_data = get_page(get_option('boldy_slider'));                              $content = $page_data->post_content;                              echo $page_data->post_content;                      }else{?>
                              This is the slider. In order to have items here you need to create a page in which to insert the images, simply one after another, setting up the link to point at ( if needed ) and text captions in the Title field. Then select the page as the "slider page" in the Theme Options Page. Make sure your images are 960px x 370px.
                      <?php }?>
                 <div style="width:960px; margin:0 auto; background:url(<?php bloginfo('template_directory'); ?>/images/bk_shadow_slider.png) 0 0 no-repeat; height:50px;">
                                                   <?php if(get_option('boldy_blurb_enable')=="yes" && get_option('boldy_blurb_text')!=""){ ?>

                      <a href="<?php                       if(get_option('boldy_blurb_page')!=""){                          echo get_permalink(get_option('boldy_blurb_page'));                      }elseif(get_option('boldy_blurb_link')!=""){                          echo get_option('boldy_blurb_link');                      } ?>"><img src="<?php bloginfo('template_directory'); ?>/images/but_blurb.png" alt="" />                      <?php echo get_option('boldy_blurb_text'); ?>

                 <?php }?>                                                                     <?php $box1=get_post(get_option('boldy_home_box1'));                            $box2=get_post(get_option('boldy_home_box2'));                            $box3=get_post(get_option('boldy_home_box3'));                             if(get_option('boldy_home_box1')!= null && get_option('boldy_home_box2')!= null && get_option('boldy_home_box3')!= null){?>

<?php echo $box1->post_title?>
                          <?php echo apply_filters('the_content', $box1->post_content);?>                          <a href="<?php echo get_option('boldy_home_box1_link')?>">Read more »

<?php echo $box2->post_title?>
                          <?php echo apply_filters('the_content', $box2->post_content);?>                          <a href="<?php echo get_option('boldy_home_box2_link')?>">Read more »

<?php echo $box3->post_title?>
                          <?php echo apply_filters('the_content', $box3->post_content);?>                          <a href="<?php echo get_option('boldy_home_box3_link')?>">Read more »


What is the importance of mod_rewrite?

If my hosting provider does not provide mod_rewrite mode. What thing will get effect on my wordpress? I bought a hosting, they claim they does not provide it. I have installed WP and the web is running. I dont know what features I am missing. The output of following command does not have mod_rewrite anywhere.               <? php phpinfo(); ?>       I put following contents in my .htaccess file. And mydomain.com/google.html redirect to google.com.               Options +FollowSymLinks     Redirect /google.html http://www.google.com      That means mod_rewrite is working? And my hosting representative does not know this. Thanks.


Has anyone developed a anti-spam plugin to simply allow users to BLOCK whatever they wish to, but one that will also go easy on IP addresses?

I'm new here xD I'm thinking of developing a plugin to allow users to block ANY spammy traces (IPs, Email addresses, Website URLs, phone numbers, phrases, etc etc) from those evil spammers. BUT, after some research, I've found that these evil idiots use random IP addresses, which means the plugin could result in blocking legit users (which isn't cool). So, this is my idea: The plugin is installed and activated on the domain `bob.com.` `Mr Robot` then decides to pay a visit to `bob.com` and begins spamming (posting useless, silly comments). The robot uses Website URL: `www.mypornsite.com` and email: `jimmy@g_mail.com` with IP: `123.123.123.15.` Then the victim (manager at `bob.com`) decides to block the website url, email address and IP used in the spammy content from `Mr Robot`. But because that IP could be random, we could be blocking legit users. SO, The IP does not actually get blocked. What actually happens is, a user with the same ip as Mr Robot's will be able to access the site just like anyone else would. BUT if ANY user visits bob.com and posts a comment containing the blocked email, website url or any other blocked material, then the IP of that user will be blocked for a day, and the comment will not go through (`bob.com` manager wont see it, as if it never happened). After 24/hours of the comment being posted, the IP will then be allowed full access to the site. Actually, maybe I shouldn't allow it to block complete access, instead, just to block submitting any forms on the domain? Anyway guys, my question is, is there any other plugin out there that will do EXACTLY this. I know there are a few IP blockers, email blockers and so on... But any like the one I've described above? Feel free to give any tips if you wish to. Thanks


What is the recommended behavior for the post formats?

I will be modifying a theme to add post types to it here soon. I know there are post formats and I realize I could make the behavior be whatever I want. However, I would like them to be used for how they were intended. So for instance, on a link type, if I click the title should it go the the item I linked to? If there is no title, should it be the title of the link? The codex seems to try to explain this, but I am not fully understanding what it is saying. In my searches, I am not seeing a detailed "this is what we recommend" listing. Any additional direction would be appreciated.


WP_Query search by multiple meta key and distance

I am having two meta keys, longitude and latitude, and what I am trying to do is the equivalent of the google store location algorithm for distance, in wp_query: > SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( > radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) > ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT > 0 , 20; What I am trying to do, is get a list of custom post types (stores) that contain long/lat (custom fields), and having an x distance (it's for a store locator, like google's example). I have already done it with $wpdb way, but I am looking for a wp_query because I want the paging and the extra filtering by using/removing an add_filter() directive to the page. Is it possible to execute such complex query, or should I stick to $wpdb method?


Safe to disable wptexturize?

To optimise the speed of my platform (beyond caching, database optimisation, JPEG compression, CSS sprites etc), it has come to my attention that disabling the `wptexturize()` function may give some minor results. We can disable this function by using this script (written by our own "observer of everything" toscho):               foreach ( array (             'bloginfo'         ,   'comment_text'         ,   'comment_author'         ,   'link_name'         ,   'link_description'         ,   'link_notes'         ,   'list_cats'         ,   'single_post_title'         ,   'single_cat_title'         ,   'single_tag_title'         ,   'single_month_title'         ,   'term_description'         ,   'term_name'         ,   'the_content'         ,   'the_excerpt'         ,   'the_title'         ,   'nav_menu_attr_title'         ,   'nav_menu_description'         ,   'widget_title'         ,   'wp_title'         ) as $target )     {         remove_filter( $target, 'wptexturize', 40 );     }      My question is, how safe is it to disable `wptexturize()`? When is this function being used? What should I consider when disabling it? The codex page gives an overview but doesn't detail when it is being used.


Current location plugin

What plugin would you suggest that will show my current location (in GoogleMaps) at one single post (a post that gets updated each time I change a location). I don't need a location for each of my blog posts, only a location for that one post. Updating my current location should be as easy as possible, preferably I would just have to input city name but would also have the ability to write coordinates if GoogleMaps doesn't recognize a city name.


Faster way to put images into a blog post by using Add Media dialog

One of the most time consuming things for me in blogging with Wordpress is adding images to the blog post. For each image, the user needs to click first "Add Media" button. Then, the user waits for the appearance of the "Add Media Dialog". Then he clicks "Media Library" tab in the dialog to see all the images he previously uploaded. Then he waits for the appearance of the "Media Library" form. So, there are two latencies that waste time:   1. Appearance of the Add Media dialog   2. Appearance of the Media Library form Every time, these two visual components are the same in the same blog post. So actually, there might be a way to cache these two components once and present them to the user instantly. I wonder if there is a faster way to put images into Wordpress blog posts where I will be able to specify meta data about the image such as caption, alignment, and size?


Get total posts found, but while using limit for pagination? get_posts

I have a ton of posts that I need to get the IDs of based on a custom taxonomy search. As it's used for pagination, I also need to get the total posts without a limit, but I'm not sure how. I use the following get_posts to find them:               $args = array('posts_per_page'   => $limit,                   'offset'           => $offset,                   'category'         => '1',                   'orderby'          => 'post_date',                   'order'            => 'DESC',                   'post_type'        => 'attachment',                   'post_status'      => 'inherit',                   'suppress_filters' => true,                   'tax_query' => $search_terms, // Fairly complex search array                 );     $attachments = get_posts($args);      But the trouble comes when I want to build a paging system based off of these results - I need to get the total posts without the limit in place. I could do the same search again and exclude $limit, but due to the sheer number of posts (300k+) it's extremely slow especially when I only need the total number of posts and not all their information. Even get_posts seems a bit too heavy for something as simple as just getting attachment IDs. I tried building a good old fashion MySQL query to handle it, but handling taxonomies is done so much cleaner with the above method and I couldn't seem to get it working right. Any advice would be greatly appreciated! Thank you!


Add pubDate to Nextgen gallery RSS feed

I want to add the `<pubDate>`tag to the NextGen gallery RSS feed, but I can't figure out how, the date I want to put in the tag is the gallery creation date, I have used `date(DATE_RSS)` but that will make all the RSS items to have the same date, I have tried also with `get_the_time()`but that doesn't work, maybe NextGen have a variable that I can tap into? Thank you for your help.


Archive of year for some categories using the featured image

I know that it should be quite easy to do but I can't seem to figure it out. Firstly, I have a category, with some sub-categories. I would like to have a page that displays all the post made in that year, from within those categories using only their featured images. However, I haven't added featured images for all the posts and would like it to default to set images for each category if it doesn't have a featured image. In addition, I would also like to have the post name and the publication date as the link title. Sorry for being so demanding. I'm almost there. I can display a featured image with the link and attributes I want but I can't seem to get the fallback image working. Here is the code I have. I know it must be a simple elementary mistake. I will need to add more ElseIf statments.               <?php query_posts('cat=81&year=2011'); ?>                         <?php while (have_posts()) : the_post(); ?>                             <?php if ( has_post_thumbnail()) ; {                             <a href="<?php the_permalink(); ?>"><?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );?><img src="<?php echo $url; ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" height="90" width="180" />;                             }                             else if(in_category(91))                             {                             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?> <?php the_time('jS F Y') ?>" >;                                  <?php endif; ?>                         <?php endwhile; ?>      Any help would be greatly appreciated. TIA


Using Ajax call in jQuery doesn't work in widget

So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is that it outputs the whole homepage in the #results div rather than just the results figure:


Gallery set to "Media file", showing as attachment page

I am using WP 3.5.1 and lightbox plus 2.5.5 I have my lightbox set to "Use for WP Gallery" Lightbox is working successfully on one of my posts with a single image, but on another post I have 3 images and they are set to "media file" but when I go to the post, they are navigating to the attachment page instead, thus lightbox is not working. Any thoughts on why its navigating to the attachment page even though the gallery has been set to media file? I have tried recreating the gallery with no success as well as reuploading the images. Gallery example --> http://santacruzsurvivors.com/2013/01/20/aquaponics- construction-part-2/               Notice: get_theme_data is deprecated since version 3.4! Use wp_get_theme() instead. in /home/www/santacruzsurvivors.com/wp-includes/functions.php on line 2839          Notice: Undefined variable: supported in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Warning: preg_match() [function.preg-match]: Compilation failed: missing ) at offset 166 in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Warning: preg_match() [function.preg-match]: No ending delimiter '/' found in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 396          Notice: Undefined index: page in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/administrator.php on line 16          Notice: Undefined variable: format in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 456     Notice: Undefined variable: class in /home/www/santacruzsurvivors.com/wp-content/themes/tank/inc/library.php on line 359     class="single single-post postid-30 single-format-standard logged-in admin-bar no-customize-support content-r" layout='2'>


How to Create a Custom Panel and Fields in Post Page [Plugin]

I would like to write a custom plugin that adds a custom panel below the post compose panel that will have a few fields and a submit button. JS will kick-in to submit content to the database, without saving or interfering with the post save/submit mechanism. The purpose is to save data to be used and quickly access while writing a post. I could do a plugin settings page, but I don't like the idea of using two screens when it can be done at the same place :) I saw the Custom Fields plugins, but they add value to a post while I want something more flexible that is created while writing a post but not necessarily linked to this post. I can't seem to find how to do this... Thanks!


How to add stylesheets only to pages with specific shortcode?

I'm running a function on pages where the shortcode `[make-me-a-map]` is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the stylesheets to only those pages in a similar fashion. **functions.php (Current)**               add_shortcode("make-me-a-map", "create_new_map");     add_action("wp_head", "style_my_new_map");          function create_new_map () {         global $new_map_called_for;         $map_called_for = true;              wp_register_script('make-a-new-map', get_template_directory_uri() . '/js/new-map.js', array('jquery'), '0.1', true);         wp_enqueue_script('make-a-new-map');         }          function style_my_new_map() {         global $new_map_called_for;         if ($new_map_called_for == true) {             $tDir = get_template_directory_uri();                  // Echo stylesheets because wp_register_style & wp_enqueue_style don't work atm             // And add_action('wp_enqueue_script', 'style_my_new_maps') with those functions would add style to all pages             // Not just the ones with [make-me-a-map] shortcode             echo "<link rel='stylesheet' href='", $tDir, "/css/new-map.css' />", PHP_EOL;                  // Echo Javascript straight to page (couldn't do it with wp_enqueue_script) to let js code know the template directory             echo '<script type="text/javascript">var templateDir = "', get_template_directory_uri(), '";</script>', PHP_EOL;             $map_called_for = false;         }     }      This doesn't seem to be working unfortunately. The styles are being added to all pages. I didn't use wp_register_style & wp_enqueue_style because this bug is still adding `<Link />` tags to the footer from those functions. I could have used `add_action("wp_enqueue_scripts", "style_my_new_map")` instead of `add_action('wp-head', "style_my_new_map")` but as far as I can see and have checked, there's no difference? Still adds the stylesheets to all pages. So my question is actually in two parts: :)   1. Why is the current functions.php not working and adding styles to all pages? I'm not sure if it's the `global` call or the `if` statement...   2. What's the best way for me to add the stylesheets to the header of only the pages that the above shortcode is used on, assuming I will not know the page ids, etc? Thanks in advance! P


get_comment_author_link not working properly

I have this snippet:               <a href="<?php bloginfo('url'); ?>/writer/<?php echo get_comment_author_link(); ?>"><?php echo get_comment_author_link(); ?>      I am displaying the username of the author but it's weird because it works well on the posts... Beneath the post, the username is linked like `/writer/username`, which is fine, but beneath the comment, the username is linked like `/writer/Username`. So for example, a user is called Blackboy 3 , than beneath the post it gets `/writer/blackboy-3`, beneath the comment it gets `/writer/Blackboy 3`. This makes a problem... Because if there is a post called `Blackboy 3`, than the link beneath the comment gets me to the post instead of the `author page`. Why is this? And how can I solve it?


Is there a wp-config.php option or constant that I can set to allow me to download nightly / beta builds?

### Nightly Builds or Beta Releases? I like using the `/wp-admin/update-core.php` utility to update wordpress. But I'd like to be able to use it to download beta releases or nightly builds. Does anybody know of a way to enable this? Perhaps a constant or option in `wp-config.php`?


How to hide certain tags from the_tags()?

I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone tell me how to do this?


Remove tabs from buddypress groups and members pages

Basically if you see the picture below there are 5 tab items in my groups page: ![Screenshot](http://i.stack.imgur.com/S7L7w.png) Now, I want to be able to remove some of them. I want to be able to remove "Members" and "Send Invites" (for instance). This is on the frontend groups page. When you select a group and go to view it. I don't want to edit core files really, is there any other way to do this? Maybe a remove_action? Thank you.


Developing Themes on WordPress, Looking for Excellent Tutorials

I am a beginner at WordPress. I know html, asp, a little PHP and I'm familiar with WordPress. I want to be an WordPress expert. So far I know WordPress involves designing themes, making plugins and customized websites. Please let me know of any other things I need to do. Please provide links of some excellent tutorials( free to access, not want to buy) ..to get started with WordPress from beginner to expert.


post-excerpt not one of the options under screen options

I want to turn the post-excerpt function on but it doesn't even show as an option under 'screen options' for posts. How do I get it to display as a check box under screen options? I have tried inserting the code...// Change what's hidden by default... into the function.php but this causes problems. Perhaps I am not inserting the code into the correct part of the file or something or have left something vital out?


Next & Previous (Pagination in this case) Not Appearing

I am using a custom page template for my portfolio. The code is calling the correct number of posts per page but for some reason the pagination links won't show up :-S My query               <?php          $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 2));      ?>     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>     <?php            $custom = get_post_custom($post->ID);         $screenshot_url = $custom["screenshot_url"][0];         $website_url = $custom["website_url"][0];     ?>      The entire markup               <?php     /*     Template Name: Portfolio     */     ?>          <?php get_header(); ?>

              <?php              $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 2));          ?>         <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>         <?php                $custom = get_post_custom($post->ID);             $screenshot_url = $custom["screenshot_url"][0];             $website_url = $custom["website_url"][0];         ?>               <a href="<?php the_permalink() ?>">               <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'thmb-portfolio' ); } ?>                    <?php the_title(); ?>                        <?php my_excerpt('short'); ?>                                           <?php endwhile; ?>                 <?php if (function_exists("pagination")) {         pagination($additional_loop->max_num_pages);     } ?>

          <?php get_footer(); ?>


Is there any global functions.php file which works for any theme?

Is there some global kind of functions.php file that works for any theme? The problem is here: When I change a functions.php file in any theme, I need to take care of two changes: First, I need to take care of the updates of that theme. Second, I need to take care of changing the theme of the site. So, instead of making changes in the functions.php of a theme, is it possible to make changes in some functions.php file that is independent of any theme?


Custom post type single display is ommited

I've created a custom post type: `tutorials` using generatewp.com generator and registered it with `register_post_type()`. I'm querying the list of tutorials in a custom page template like that:               <?php $query = new WP_Query('post_type=tutorial'); ?>     <?php if($query->have_posts()) : ?>       <?php while($query->have_posts()): the_post(); ?>         <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
<?php the_excerpt(); ?>
       <?php endwhile(); ?>     <?php endif; ?>      To target single tutorial template I've created a file `single-tutorial.php`, placed a loop inside it, and fired the tutorial permalink in the browser. The `single-tutorial.php` file is ommited from Template Hierarchy and goes directly to index.php. The premalink is for example: `http://example.com/tutorial/tutorial-name/`. `index.php` content is loaded instead of `single-tutorial.php` Why is that? Any help very appreciated.


Downloads Gallery plugin?

I am designing a blog for a software vendor. They have a number of downloads available, both their own, and also from their clients. Downloads are usually tools that can be bolted onto the main software products. They want to have a slick interface to be able to search and download these items. I am looking for Wordpress plugins that might fit the description? What we are after, could be something like this, or like this. i.e. A thumbnail, name of tool, and maybe a user rating (not essential). Hovering over the tool would provide more info. Flexible on how it looks and feels, even something similar to Wordpress Plugins directory might work. Any clear plugin winners out there? :EDIT: Sounds like I should be looking at Custom Post Types. From what I have read so far, looks good, but still looks like I will need to write a fair bit of code to get what I want.   - Would love to be proved wrong --> perhaps there is a custom post template for what I am after?   _(I will research further)_


How to get parents of custom taxonomy, as what get_category_parents() do?

I have a custom taxonomy 'portfolio category', while i need to show all hierarchy categories of a portfolio post, for example the post is under `topcat -> childcat -> yetchildcat`, i want to show 'topcat, childcat, yetchildcat' on the post page, but `get_the_terms only` return '`yetchildcat`', how do i get all?


How to do admin CRUD & Pagination

I am wondering how might I create an admin page to do CRUD. I know how to add a basic/options page to the admin menu. But I want to go further, how might I manage data (CRUD) and for the index/listing page, I will need pagination, can someone point me in the right direction?


How to determine if an admin is logged in outside the loop

I need to be able to tell if an admin is logged in ouside of the loop. This is needed for some php files that are part of a WP site but do not use `require( '../wp-load.php );` What I need to do is keep the Google Analytics tracker JS from firing for logged in admins, but track everyone else. How do I find out if an admin is logged in outside of the loop? Checking the WP logged in cookie? Or must I use `wp-load.php`?


How to disable category without deleting?

Is there a plugin or some php code to do this: I want to disable some categories from the category box on the add/edit message page. I don't want to delete the categories and I want to leave the disabled categories to the previously assigned posts.


Shortcode not displaying HTML within the function

I am working on a function that displays all authors but it appears I am doing something wrong the HTML within does not display until the bottom of the page separate from the output.               /* Add shortcode to display authors */     function all_authors() {     global $wpdb;          $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users where ID not in(1)");          $retval = '

';     foreach($authors as $author) {     $retval .= '
';     if(userphoto_exists($author->ID))         echo userphoto($author->ID);     else     $retval .= get_avatar($author->ID, 96);     $retval .= '
'.the_author_meta('display_name', $author->ID).', '.the_author_meta('tagline', $author->ID);     $retval .= '

'.the_author_meta('description', $author->ID).'

'.the_author_meta('phone', $author->ID);     $retval .= ' | ID).'" target="_blank">'.the_author_meta('user_url', $author->ID).'

';     }     $retval .= '

';     return $retval;     }          add_shortcode('myauthorbox', 'all_authors');


Intelligent Search Filtering

I need some help with a search plugin: WP Custom Fields Search. I have three drop down menus: 1. City 2. Suburb 3. Cuisine What I need is so that when you select a City, it automatically moves the 2. Suburbs to relevant to that city. 3. is a custom field ie. there can be chinese restaurants in any city. suburb so it doesnt matter but only certain suburbs in certain cities... So how do I filter it any ideas?


Form Value of drop down category + Translation of 'show option none'

I am building a form where a user can submit an article from the front end.. So far so good... To this form i am doing some submission check using javascript.. When i get to check if a category is choosen This is the line the retrives categories in the form:               <?php wp_dropdown_categories('show_option_none=---------------->&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1'); ?>      I dont know how to check it.. what is the value being sent to wordpress? Also.. Can i change this:               show_option_none=---------------->      into somthing i can translate using the regular tranlation method aka __() or _e()?? Thanks guys


Get the most repeated post contents from a search?

In my site the posts content is always the name of a school, so if I search for Chicago I get a lot of posts with different schools as content. What I want to do is to get the Schools with the most posts, so I could display this somewhere:               School A - 4     School B - 3     School C - 2     School D - 2      (The number at the right is the number of posts the school has) So what I need to get the most repeated post contents from a particular search including the ones that don't appear in first results page. I don't know how complicated it can be so if there is no simple way I would be very grateful for just being pointed towards the right direction, so I later figure out how to do it. My site is made with wordpress and the posts are on a SQL database. Please ask if it's not clear or for any more info. Thanks


How do I display the function the_content in this loop?

I have this loop in my wordpress site which displays the latest posts with their titles, I want to display the post content after the title. I normally retrieve it with the function get_the_content but I cannot make it work in this case. This is the loop:                  while ( $q_query->have_posts() )        {              $q_query->next_post();         $question = get_post($q_query->post);        $loophtml = $loophtml . "
" . "ID) ."'>" . $question->post_title . "";        $loophtml = $loophtml . "" . get_comments_number($question->ID) . " comentarios ·&nbspID) ."'>Comentar";        $loophtml = $loophtml . "
";        }      Anyone knows how I could do it? Thanks


Make Images appear in the same order as in media browser using get children?

I would really like my images to display in the same way I've ordered them in the media browser. What am I doing wrong?               $images =& get_children( array('post_parent' => $post->ID,                                                    'post_type' => 'attachment',                                                    'post_mime_type' => 'image',                                                    'orderby' => 'menu_order',                                                    'order' => 'asc' ));