title: Include HTML template file in wp mail

text: I'm using wp mail to send an html email. But there's quite a lot of html code in the email, so rather than including all the code in my wp mail function, is it possible to have the code in a separate template and just include this template in the function? Here is what I have               <?php if ( isset( $_POST['submitted'] )) {        add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));        $emailTo = 'person@gmail.com' ;        $subject = 'This is the subject';        $body = get_template_part( 'includes/my_email_template' );        $headers = 'From: My Name' . "\r\n";        wp_mail($emailTo, $subject, $body, $headers);     }?>      I'd like to be able to put all of my html code in 'my_email_template' but when I try this, no email is sent. Am I including the template incorrectly? Thanks in advance for any answers.


title: How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()?

text: I read this question but it wasn't what I was looking for exactly. I'm new to Wordpress and a little confuse with the functions and everything. How can I get the metadescription in the loop for each post? Thanks !


title: Show Custom Post id in shortcode button on tinymice editor

text:
I have created a custom post Testimonial for my custom theme and i have to display posts using shortcode , i want a shortcode button on tinymice editor so i create a js file for shortcode button Here is a code wptuts-plugin.js               (function() {         tinymce.create('tinymce.plugins.Wptuts', {             init : function(ed, url) {                           ed.addButton('showtestimonial', {                     title : 'Add Testimonials shortcode',                     cmd : 'showtestimonial',                     image : url + '/testimonial.png'                 });                           ed.addCommand('showtestimonial', function() {                     var number = prompt("Enter your testimonial id "),                         shortcode;                          if (number !== null) {                         number = parseInt(number);                                  shortcode = '[testimonials id="' + number + '"]';                             ed.execCommand('mceInsertContent', 0, shortcode);                          }                 });             },             // ... Hidden code         });         // Register plugin         tinymce.PluginManager.add( 'wptuts', tinymce.plugins.Wptuts );     })();      and in function.php               require_once('wptuts-editor-buttons/wptuts.php');         add_action( 'init', 'wptuts_buttons' );         function wptuts_buttons() {             add_filter( "mce_external_plugins", "wptuts_add_buttons" );             add_filter( 'mce_buttons', 'wptuts_register_buttons' );         }         function wptuts_add_buttons( $plugin_array ) {             $plugin_array['wptuts'] = get_template_directory_uri() . '/wptuts-editor-buttons/wptuts-plugin.js';             return $plugin_array;         }         function wptuts_register_buttons( $buttons ) {             array_push( $buttons,'showtestimonial' ); // 'showtestimonial             return $buttons;         }      wptuts.php is for custom post of testimonial               <?php      function create_post_type() {         register_post_type(             'testimonials',//new post type             array(                 'labels' => array(                     'name' => __( 'Testimonials' ),                     'singular_name' => __( 'Testimonial' )                 ),                 'public' => true,/*Post type is intended for public use. This includes on the front end and in wp-admin. */                 'supports' => array('title','editor','thumbnail','custom_fields'),                 'hierarchical' => false             )         );       }     add_action( 'init', 'create_post_type' );               //adding the URL meta box field     function add_custom_metabox() {         add_meta_box( 'custom-metabox', __( 'Link' ), 'url_custom_metabox', 'testimonials', 'side', 'low' );     }     add_action( 'admin_init', 'add_custom_metabox' );          // HTML for the admin area     function url_custom_metabox() {         global $post;         $urllink = get_post_meta( $post->ID, 'urllink', true );              //validating!         if ( ! preg_match( "/http(s?):\/\//", $urllink ) && $urllink != "") {             $errors = "This URL isn't valid";             $urllink = "http://";         }               // output invlid url message and add the http:// to the input field         if( isset($errors) ) { echo $errors; }     ?>
         URL:
             <input id="siteurl" size="37" name="siteurl" value="<?php if( isset($urllink) ) { echo $urllink; } ?>" />
     <?php     }          //saves custom field data     function save_custom_url( $post_id ) {         global $post;                 if( isset($_POST['siteurl']) ) {             update_post_meta( $post->ID, 'urllink', $_POST['siteurl'] );         }     }     add_action( 'save_post', 'save_custom_url' );          //return URL for a post     function get_url($post) {         $urllink = get_post_meta( $post->ID, 'urllink', true );              return $urllink;     }          //registering the shortcode to show testimonials          function load_testimonials($a){              $args = array(             "post_type" => "testimonials"              );              if( isset( $a['rand'] ) && $a['rand'] == true ) {             $args['orderby'] = 'rand';         }         if( isset( $a['max'] ) ) {             $args['posts_per_page'] =(int) $a['max'];         }         if( $a['id'] ) {             $posts_in = array_map( 'intval', explode( ',',$a['id'] ) );             $args['post__in'] = $posts_in;         }              //getting all testimonials         $posts = get_posts($args);              echo '
';             echo '
';                  foreach($posts as $post)             {                      $url_thumb = wp_get_attachment_thumb_url(get_post_thumbnail_id($post->ID));                 $link = get_url($post);                 echo '
';                 echo '
';                     if ( ! empty( $url_thumb ) ) { echo ''; }                     if ( ! empty( $post->post_content ) ) { echo '
'.$post->post_content.'
'; }                     echo '
'.$post->post_title.'
';                     if ( ! empty( $link ) ) { echo 'Visit Site
'; }                 echo '
';                 echo '
';             }                  echo '
';         echo '
';     }     add_shortcode("testimonials","load_testimonials");     add_filter('widget_text', 'do_shortcode');     ?>      write now shortcode button show a pop up box where i enter the testimonial custom post id and show that post but i want on click shortcode button it show a dropdown where all the custom post id of testimonial shows and on choose particular custom id it shows that particular post please suggest me some solutions so that all custom post id shows in js


title: how do I filter single_cat_title to remove all instances of a particlular word

text: I have certain names in my category title (that need to stay there for other reasons). I am displaying all category titles with the blog name prefixed, but on categories that already have this name I would like to automatically remove the blog name from the single_cat_title. i.e. "My Blog My Blog Category" is what is showing using but where single_cat_title allready has the blogname as part of the title, I would like to only show "My Blog Category". Can one do this with single_cat_title as I have used it everywhere and manually replacing these would be problemattic?


title: How do I fix problems with users not being able to publish and only submit for review after upgrade of Multisites installation?

text: We have a previous WPMU installation that has been upgraded to a WordPress Multisites installation. Since upgrading to 3.3.2 from 3.2.1 we have problem with editors/admin not being able to post on some of their blogs. They see a "Submit for review" button instead of "Publish" despite being admins or authors. My first hunch while looking in the database was that the users having the problems all had their capabilities stored in the new way:               a:1:{s:6:"editor";s:1:"1";}      while users with capabilities stored in the old way:               a:1:{s:6:"editor";b:1;}      seemed to have no problems. But even after manually changing this in the database the problems was the same. Also tried to change `wp_NNN_user-settings` in `wp_usermeta` to a value used for the same author in another blog where he could post with no change. Then tried to register a complete new user and give it admin rights. Also got "Submit for review" button. The super admin is also unable to publish and gets the message "Are you sure you want to do this?" upon publish. How do I fix this? I see that this Wordpress.org support thread describes a behavior with publish buttons being replaced by Submit for Review after 3.3 upgrade


title: Exclude main blog from get_blogs_of_user

text: I use WordPress Multisite and in the sidebar i have a box that shows a list of blogs the logged in user is a member of. I'm looking for a way to exclude the mainblog from this list.   The main blog ID is 1 **Here is parts of the code I use:**               <?php // Gets user-info ?>     <?php global $current_user; get_currentuserinfo();           $user_info = get_userdata(1);           $user_id = $current_user->ID;      ?>           <?php // start the loop ?>     <?php $user_blogs = get_blogs_of_user( $user_id ); echo '<div>'; foreach ($user_blogs AS $user_blog) { echo '';?>          <?php // lists user blogs ?>     <?php echo ''.$user_blog->blogname.' '; ?>      Can anyone help me? :)


title: Post Ancestor and Child Post in Custom Post Type

text: ![enter image description here](http://i.stack.imgur.com/ZTsvh.png) Hierarchical structure of custom post type "Book" (for example). When we are on `Post 2-95`, I want to know:   * Does the post has this post ancestor(`Post 1-31`)?    * Does it have child posts(`Post 3-19`, `Post 3-10`)? Then, if it has:   * an ancestor post: retrieve (object) of this post.   * a child posts: retrieve (objects) of these posts.


title: Using a menu walker add a custom item at the end of the menu's items

text:
I need to add a search field at the end of a menu in a list item. I've been looking at walkers but finding it really hard to figure out what is the last item (or even get the total). Also where would i add the code for the custom item. I've currently got;               class mainNav_walker extends Walker_Nav_Menu     {         public function start_el( &$output, $item, $depth, $args )         {             //print_r($item);                  $output .= $this->custom_content( $item );             parent::start_el( &$output, $item, $depth, $args );         }              protected function custom_content( $item )         {            // add
SEARCH FIELD HERE?
         }     }


title: How do I set the sizes of my thumbnails when inserting a [gallery]?

text: A really simple thing, yet my images are uploaded as about 500px wide, I have them selected as full size, yet when I use the [gallery] shortcode, it crops the thumbnails to 100w x 75h. This isn't even the thumbnail size I have set in my media settings! My page is here


title: Can I prevent "wp_user_level" from getting added to wp_usermeta on registration?

text: I've heard this meta key is obsolete, but they are still getting created every time a user registers. Can I prevent this? I'm trying to slim down that table.


title: Can I use add_option for a plugin categories and how?

text: So I am creating my first plugin for positioning ads around my site. I created one separate table where I store ads with all their options, such as position, expire date, active, name, type etc... But Now I need just one field where I can allow users to create categories for these ads, add new, delete existing categories etc, so an array of data... I am looking at add_options and update_options ,can I use this options API for array ? For example, I have a form where user can add new categories, but if I use update_options, I suppose that I will just replace latest added category, instead adding it to an array ? Shall I extract current data, add this one and update it ? I am also relative new with PHP but expert in front end. I know that I can do it easly with new table, but I am trying to use WP built in stuffs as much as possible.


title: single-mySlug.php works: archive-mySlug.php does not. Custom Post Type

text: I am registering a custom post type (listing) with a plugin and it has two taxonomies. It all seems to work as expected. I can display individual posts from the CPT using `single-listing.php` but I can't display a full page using `archive-listing.php`. I just tried `taxonomy- organisation.php` which is the CPT taxonomy and this works too. I am using a child theme and just used a copy of the parent archive/siingle/taxonomy pages This is a copy of WP 2012 theme file which I named `archive-listing.php`: http://pastebin.com/3BBr7eDu This is my CPT plugin: http://pastebin.com/btWqXDwE This URL uses the archive.php file in the parent theme: http://martcol.co.uk/listing/organisation/children/


title: WP_Table_List and ob_start() memory limit

text: I have class which extends WP_Table_List and renders a table. See the events results In the prepare_items() function I querys the DB               function prepare_items($race)     {         $columns = $this->get_columns();         $hidden = array();         $this->_column_headers = array($columns, $hidden, $this->get_sortable_columns());              $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'position+0'; //If no sort, default to title         $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc         if($orderby!='position+0')             $order .= ', position+0';              global $wpdb;         $query = '             SELECT wp_bhaa_raceresult.*,wp_users.display_name,             wp_users.user_nicename,gender.meta_value as gender,wp_posts.id as cid,wp_posts.post_title as cname             FROM '.$wpdb->prefix .'bhaa_raceresult              left join wp_users on wp_users.id=wp_bhaa_raceresult.runner              left join wp_usermeta gender on (gender.user_id=wp_users.id and gender.meta_key="bhaa_runner_gender")             left join wp_usermeta company on (company.user_id=wp_users.id and company.meta_key="bhaa_runner_company")             left join wp_posts on (wp_posts.post_type="house" and company.meta_value=wp_posts.id)             where race='.$race.' and wp_bhaa_raceresult.class="RAN" ORDER BY '.$orderby.' '. $order;         $querydata = $wpdb->get_results($query,ARRAY_A);         $this->items = $querydata;     }      and i'm using an outputbuffer to capture the html of the table into a single string via               function renderTable($race)     {            error_log("render table ".$race);         ob_start();         $this->prepare_items($race);         $this->display();         return ob_get_clean();     }      In our most recent event, we had 500 results and this seems to a memory issue for the output buffer. I'm wondering is there better way for me to flush the table html code into the buffer to that it does not cause an out of memory issue. My memory limit setting is                define('WP_MEMORY_LIMIT', '128M');      The full class code can be seen at               https://github.com/emeraldjava/bhaawp/blob/master/table/raceresulttable.class.php      EDIT I added a call to memory_get_usage() when each row of the table is being built               function column_default( $item, $column_name ) {         error_log('column_default '.$item['position'].' '.memory_get_usage());      the results are               [24-Apr-2013 15:14:12 UTC] column_default 489 48477784     [24-Apr-2013 15:14:12 UTC] column_default 489 48477784     [24-Apr-2013 15:14:12 UTC] column_default 489 48477832     [24-Apr-2013 15:14:12 UTC] column_default 489 48477816     [24-Apr-2013 15:14:12 UTC] column_default 489 48477832     [24-Apr-2013 15:14:12 UTC] column_default 489 48477832      which indicates i'm below the MEMORY_LIMIT? EDIT 2 I decided to implement the 'display_rows()' method and flush the html content after every row of the table is generated               function display_rows() {         parent::display_rows();         ob_flush();     }      This solution allows the whole table to be generated but i cannot control the output witih the template.


title: WordPress Custom Post Type Pagination for Taxonomy giving 404

text: I'm developing a custom post type-based site on WordPress and have run into trouble on pagination - but only specific pagination. The custom post type has two taxonomies, pagination for these individually works fine. Page one of combining them works fine, however subsequent pages produces a 404 page. e.g.   * CPT = suppliers   * Taxonomies = type, location   * OK - http://www.planningmyscottishwedding.co.uk/suppliers/bridal/   * OK - http://www.planningmyscottishwedding.co.uk/suppliers/bridal/page/2/   * OK - www (dot) planningmyscottishwedding.co.uk/suppliers/bridal/west/   * 404 - www (dot) planningmyscottishwedding.co.uk/suppliers/bridal/west/page/2/ I don't believe this is to do with the `paged` variable in the query - as it isn't getting to that part, it's related to the permalink structure. The rewrite rules have also been flushed (by manually updating the permalink structure). Anyone able to offer any advice? The custom post type and taxonomies are defined as:               function pmsw_post_types() {         $args = array();         $labels = array(             'name'               => _x( 'Suppliers', 'post type general name' ),             'singular_name'      => _x( 'Supplier', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New Supplier' ),             'edit_item'          => __( 'Edit Supplier' ),             'new_item'           => __( 'New Supplier' ),             'all_items'          => __( 'All Suppliers' ),             'view_item'          => __( 'View Supplier' ),             'search_items'       => __( 'Search Suppliers' ),             'not_found'          => __( 'No suppliers found' ),             'not_found_in_trash' => __( 'No suppliers found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Suppliers'         );         $args = array(             'labels'        => $labels,             'description'   => 'Suppliers for the PMSW Database',             'public'        => true,             'menu_position' => 20,             'supports'      => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions' ),             'has_archive'   => true,             'rewrite'       => array('slug' => 'suppliers/%type%/%location%'),         );         register_post_type( 'suppliers', $args );        }     add_action( 'init', 'pmsw_post_types' );               function pmsw_taxonomies() {         //Locations         $labels = array(             'name'              => _x( 'Supplier Locations', 'taxonomy general name' ),             'singular_name'     => _x( 'Supplier Location', 'taxonomy singular name' ),             'search_items'      => __( 'Search Supplier Locations' ),             'all_items'         => __( 'All Supplier Locations' ),             'parent_item'       => __( 'Parent Supplier Location' ),             'parent_item_colon' => __( 'Parent Supplier Location:' ),             'edit_item'         => __( 'Edit Supplier Location' ),              'update_item'       => __( 'Update Supplier Location' ),             'add_new_item'      => __( 'Add New Supplier Location' ),             'new_item_name'     => __( 'New Supplier Location' ),             'menu_name'         => __( 'Locations' ),         );         $args = array(             'labels' => $labels,             'hierarchical' => true,             'has_archive' => true,             'rewrite' => array('slug'=>'suppliers', 'with_front'=>true),         );         register_taxonomy( 'location', 'suppliers', $args );              //Categories         $labels = array(             'name'              => _x( 'Supplier Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Supplier Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Supplier Categories' ),             'all_items'         => __( 'All Supplier Categories' ),             'parent_item'       => __( 'Parent Supplier Category' ),             'parent_item_colon' => __( 'Parent Supplier Category:' ),             'edit_item'         => __( 'Edit Supplier Category' ),              'update_item'       => __( 'Update Supplier Category' ),             'add_new_item'      => __( 'Add New Supplier Category' ),             'new_item_name'     => __( 'New Supplier Category' ),             'menu_name'         => __( 'Categories' ),         );         $args = array(             'labels' => $labels,             'hierarchical' => true,             'has_archive' => true,             'rewrite' => array('slug'=>'suppliers', 'with_front'=>true),         );         register_taxonomy( 'type', 'suppliers', $args );          }     add_action( 'init', 'pmsw_taxonomies', 0 );


title: Re use authenticated HTTP connection or cUrl handle

text: We have a bespoke Wordpress plugin, which adds a meta box to the edit post page. The plugin accesses data from a semi-private HTTP REST API. The connection is authenticated (DIGEST) and accessed regularly - every person writing a post will interact with it several times (usually in tight bursts) and there are > 100 such people. So, we would like to ensure the HTTP calls are working efficiently. We see two problems:   * No evidence of Keep-Alive being used to stop the TCP socket opening and closing constantly.    * Every request is done twice for the DIGEST authentication. Since it is the plugin that is authenticated (not the user) this is > 99% waste. Apache have called their solution for this pre-emptive authentication. We can see latency in the meta box as users interact with it, so this is a real issue. I hear some of these problems can be solved by re-using the cURL handle, but cannot find any best practice advice around implementing that in a WordPress plugin specifically. One issue we have with that is that WordPRess effectively re-initialises the plugin on a per request basis, as far as we can tell.


title: How to prevent automatic conversion of dashes to –

text: When I put -- into a post it is automatically converted to the - `–` character in the output by wordpress. How can I get normal `'--'` double dashes in my content.


title: Notify admin when page is edited?

text: I found this previous post to automatically notify the admin when a post or page is published: Alert Email when any Post or Page is Changed Works like a charm, thanks! However, it looks like the page has to be changed from draft or pending to published to trigger the action. Is there a modification to notify the admin when an already published page is updated? thanks!


title: After being hacked Fatal error: Call to undefined function get_header() in 404.php on line 1

text: After having timthumb.php exploited. The site was upgraded to WP 3.5 It was compromised again, (wp-config included encrypted data as well as the functions.php in the wp-include directory. After reviewing various sites, I opted to remove ALL files (after backing up the site) and reinstall the code to insure no corrupted files, and to remove any unneeded files still lingering from the various theme/plugin/and versions of WordPress updates. The home page loads, but all links beyond that are unusable, giving this error Fatal error: Call to undefined function get_header() in ...404.php on line 1. The Header and 404 php files are in the root of the theme's directory, and there is not modification of the code. I've wiped the site clean twice now, and extracted the 3.5 install and theme back onto the site to ensure correct file placement.


title: Custom post_type search's $wp_query->query_vars do not correspond

text: I have been having this issue, with integrating events manager among my other post types, where the other custom post types show up in the $wp_query->query_vars array, except for the event manager ones. The search works, and does grab the event post types, but for some strange reason the post_type query variable does not include "event". Why is this happening? Below is the code I am using to force the query to use the event post type:               function _search_all($query) {          if($query->is_search()) {     $query->set("post_type", array(EM_POST_TYPE_EVENT, FEATURES_ID, BRIEFS_ID, CAMPUS_NEWS_ID));     }          return $query;     }     add_action("pre_get_posts", "_search_all");      EM_POST_TYPE_EVENT = 'event', and is registered in the plugin code, and it shows up everywhere else on the site, but in the search result's query variables. The other 3 post types are custom as well. The 'event' post type is set to exclude_from_search = false, so I am at a complete loss here, as to why I cannot get the event post type included in any search. **Just for clarification** Here is an example query string                 ?s=science&post_start_date=&post_end_date=&post_type[]=event      and the result of $wp_query->query_vars is               array(6) { ["post"]=> string(4) "post"                 ["page"]=> string(4) "page"                 ["attachment"]=> string(10) "attachment"                 ["features"]=> string(8) "features"                 ["briefs"]=> string(6) "briefs"                 ["campus_news"]=> string(11) "campus_news"       }       Where's my event post_type?


title: Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?

text: I am running a site for a German NGO under the domain `sub.example.org`.   Recently, I added `sub.example.ch` for its Swiss spin-off. Both (sub-)domains are pointing to the same physical location, a WP install ( _not_ multisite). I have it setup such that `sub.example.ch/register`, for instance, will correctly show the content found under `sub.example.org/register`. However, when a Swiss visitor surfs the site using regular on-site links, he or she will inevitably end up on the "regular" domain, since those utilize the "WordPress address" (or "site address") as defined in general settings, either via `get_home_url` or `get_site_url()` (or their less-deep `get_bloginfo()` equivalents). _Ideally_ , I'd like the visitor to keep surfing under the domain that he or she used to reach the site. Hence, I suppose I'd have to somehow filter the return value of the mentioned functions. A filter, which, as far as I know, does not exist.   1. Does anybody have experience with this sort of thing and a decent solution handy?   2. Is this maybe a dumb idea and I should let it go in the first place?


title: can I orderby one custom field and meta_query another in the same query

text: I have a custom query and I am filtering out events by custom field: event- month. I simple filter our the events that dont have a month_number = to date("n"); Its a pretty great little query, but I need to orderby another custom field, event_date. Do I need a custom function or something to get this done. I simply want to orderby => event_date but I am currently using event-month for my query.               <?php              $event_query = new WP_Query(             array(                'post_type'   => 'event',        // only query events               'meta_key'    => 'event-month',  // load up the event_date meta               'order_by'    => '',               'order'       => 'asc',         // ascending, so earlier events first               'meta_query'  => array(                  array(         // restrict posts based on meta values                   'key'     => 'event-month',  // which meta to query                   'value'   => date("n"),  // value for comparison                   'compare' => '=',          // method of comparison                   'type'    => 'NUMERIC'         // datatype, we don't want to compare the string values                 ) // meta_query is an array of query ites                ) // end meta_query array               ) // end array             ); // close WP_Query constructor call      ?>


title: Exclude a category name using cat name

text: I'm trying to exclude a category because I have a post that i have in multiple post. How do I like for example I have a post in the categories lastest news and pictures but I want to exclude latest news and show only the pictures name. I tried using $category = get_the_category(); echo $category[0]->cat_name; but that's no help. any help is appreciated.


title: Custom WordPress Installation

text: I am wondering whether there is an updated version of the methods described in the post below for customising the WordPress install. http://wpbits.wordpress.com/2007/08/10/automating-wordpress-customizations- the-installphp-way/


title: How custom Wordpress Page Builders work?

text: I wonder how custom page builders work. I want to create page builder in my theme's control panel. Currently i created simple system which creates Page Templates with generated HTML for each layout and save the file with /* Template Name: My Template */ as custom page template in themes directory. I incorporated jQuery to allow drag and drop and layout design like blogger and some themes i have seen. But you have to choose the designed Template on Create Page editor which uses the layout of previously designed template. This seems to be working however i wonder if this is right or i'm missing something. I've been using WordPress to power many sites and now i started building custom templates. Thank you !


title: Plugin Settings not Saving on Ajax re-ordered table

text:
This is an extension of Update Option Stored in Multi-Dimensional Array which was help getting draggable plugin options to save via ajax (which works), but unfortunately this is specific to the actual plugin settings saving to the database correctly. Ajax re-ordering works, but upon page-save (plugin settings save), the options are cleared from the database. Here is the settings page:               <?php          function mouldings_options_page() {              global $mouldings_options;              ob_start(); ?>

<?php _e('Mouldings Options','roots'); ?>
                  <form method="post" action="options.php" id="mouldings_options">                  <?php settings_fields('mouldings_settings_group'); ?>

<?php _e('Thumbnail Sizes'); ?>

                                             <?php _e('Post Type','roots'); ?>	                                             <?php _e('Width (px)','roots'); ?>	                                             <?php _e('Height (px)','roots'); ?>

                                             <?php _e('Idea Gallery','roots'); ?>	                                             <input id="mouldings_settings[idea_gallery_thumb_height]" name="mouldings_settings[idea_gallery_thumb_height]" type="text" value="<?php echo (isset($mouldings_options['idea_gallery_thumb_height'])) ? $mouldings_options['idea_gallery_thumb_height'] : ''; ?>">	                                             <input id="mouldings_settings[idea_gallery_thumb_width]" name="mouldings_settings[idea_gallery_thumb_width]" type="text" value="<?php echo (isset($mouldings_options['idea_gallery_thumb_width'])) ? $mouldings_options['idea_gallery_thumb_width'] : ''; ?>">

                                             <?php _e('Moulding Collection','roots'); ?>	                                             <input id="mouldings_settings[collection_thumb_height]" name="mouldings_settings[collection_thumb_height]" type="text" value="<?php echo (isset($mouldings_options['collection_thumb_height'])) ? $mouldings_options['collection_thumb_height'] : ''; ?>">	                                             <input id="mouldings_settings[collection_thumb_width]" name="mouldings_settings[collection_thumb_width]" type="text" value="<?php echo (isset($mouldings_options['collection_thumb_width'])) ? $mouldings_options['collection_thumb_width'] : ''; ?>">

                                 <?php echo '
'.__('Information','roots').'
';                                 _e('
Used to resize the various images that appear throughout the Mouldings plugin. If any values are left blank, they are assumed to be un-restricted.
','roots'); ?>                                 <?php                                 if(function_exists('RegenerateThumbnails')) {                                     echo '

Regenerate Thumbnails after altering these values

';                                 }                                 else {                                     echo '

Notice: Regenerate Thumbnails is not installed. This is required so that you can regenerate thumbnails after changing any of these values.

';                                 }                                 ?>

<?php _e('Profile Sidebar Order'); ?>

                                             <?php _e('Name', 'roots'); ?>	                                             <?php _e('Order', 'roots'); ?>

                                     <?php                                         $count = 0;                                         foreach($mouldings_options['profile_element_order'] as $key => $item) :                                             echo '
';                                                 echo '' . $item . '	';                                                 echo '' . $count . '	';                                             echo '
';                                             $count++;                                         endforeach;                                     ?>

                                 <?php echo '
'.__('Information','roots').'
';                                 _e('
Drag \'n drop the order of the elements that appear on the sidebar for both Profiles and Combinations.
','roots'); ?>

                     <input type="submit" class="button-primary" value="<?php _e('Save Options','roots'); ?>">
                      </form>
              <?php         echo ob_get_clean();     }          function mouldings_plugin_admin_styles() {         wp_enqueue_style('mouldings-admin-styles', MOULDINGS_BASE_URL . 'css/admin-global.css','','',$media = 'all');         wp_enqueue_script('jquery-ui-sortable');         wp_enqueue_script('mouldings-admin-settings-scripts',  MOULDINGS_BASE_URL . 'js/admin-settings.js', array('jquery'), '', true);     }          function mouldings_add_options_link() {         $mouldings_options_page = add_options_page(__('Mouldings Options','roots'),__('Mouldings','roots'),'manage_options','mouldings-options','mouldings_options_page');         add_action( 'admin_print_styles-' . $mouldings_options_page, 'mouldings_plugin_admin_styles' );     }     add_action('admin_menu','mouldings_add_options_link');          function mouldings_register_settings() {         register_setting('mouldings_settings_group','mouldings_settings');     }     add_action('admin_init','mouldings_register_settings');          ?>      I'm thinking this may have something to do with "how" the `profile_element_order` items are rendered? They are properly created on activation using this hook:               <?php          function mouldings_activate() {         global $wpdb, $mouldings_options;         if( false == get_option( 'mouldings_settings' ) ) {             $mouldings_options = array(                 'img_base64_enable'         => '1',                 'moulding_combination_page' => '',                 'moulding_collection_page'  => '',                 'idea_gallery_thumb_height' => '200',                 'idea_gallery_thumb_width'  => '200',                 'collection_thumb_height'   => '200',                 'collection_thumb_width'    => '200',                 'profile_item_columns'      => '4',                 'idea_item_columns'         => '2',                 'collections_item_columns'  => '2',                 'combinations_item_columns' => '4',                 'profile_element_order'     => array(                     'Option 1',                     'Option 2',                     'Option 3',                     'Option 4',                     'Option 5'                 )             );             update_option( 'mouldings_settings', $mouldings_options );         }     }     register_activation_hook( MOULDINGS_PLUGIN_FILE, 'mouldings_activate' );      but are removed upon save. Thanks!


title: One for the gurus: upgrade to 3.x messed up only filenames with accented chars

text: After upgrading from 2.8.x (maybe it was 2.9.x) to 3.1.2, all the references inside posts to filenames (usually images) which contain accented chars stopped working. Before, filenames that are displayed in the filesystem like "EXPRESSÃƒO.jpg" would be correctly called out in the post content HTML as "EXPRESSÃƒO.jpg". WP 3.x decided to convert those references to "EXPRESSÃO.jpg" (which is what the filename looked like when created/uploaded by the blog author), so now all the images that have such chars are broken links. ONLY references to filenames are mangled. All other accented text works fine. i was able to, with the help of a perl script via SSH, obtain a list of all the files that have special chars. **Tabel with all the mangled chars** : http://pastebin.com/MMbjJphU (BTW which table is this?) **wp-config** shows (yes i already tried to comment them out)               define('DB_CHARSET', '');     define('DB_COLLATE', '');      **mySQL shows** :               DB Collation in effect: latin1_swedish_ci         default DB Collation: latin1_swedish_ci         Tables Collation: latin1_swedish_ci         Columns Collation: latin1_swedish_ci      **whats the quickest way to solve this problem?** from what i see, i have 2 options: A) i could rename the files to use the correct spelling (EXPRESSÃƒO.jpg -> EXPRESSÃO.jpg). I am leaning towards this. **Maybe someone could help with a php/perl/python script that would rename the files?** B) i could batch update wp-posts in phpmyadmin to start using all those weird chars (EXPRESSÃO.jpg -> EXPRESSÃƒO.jpg).


title: Customise Author Page?

text: On my website I would enjoy to make it so that if a reader clicks an author or user's name it takes them to a page displaying their profile picture and bio. All users on my blog have the option to add a profile picture or bio before signing up. How could I make it so that it displays the information they submit when their username is clicked? I think to do this you have to edit the author.php file but I'm not sure where to go from there. Any help is greatly appreciated thanks. BTW - I am currently trying to learn PHP so hopefully soon I won't be asking questions like this.


title: Query multiple taxonomy in Custom Post Type

text: Currently I use: `query_posts("post_type=listing");` to pull all entries of my custom post type. But I have a taxonomy called status with the values of Available, Pending, Sold. I only want to show Available and Pending on one page, and sold on another. How do I go about this? thanks!


title: Displaying Custom Taxonomy List Posts By Slug?

text: Is it possible to list the posts from a custom taxonomy by slug along? This link kind of does it but i want to target the slugs rather than just the whole taxonomy itself http://codex.wordpress.org/Template_Tags/wp_list_categories#Display_Terms_in_a_custom_taxonomy So i have Custom Taxonomy 'Books' within that i have Book 1 and Book 2. I want to list all the posts attached to Book 1 and then separately all the posts attached to Book 2 ideally. Possible? Thanks for any help.


title: Using WP Multisite for multi language site? A good option?

text: I´m going to develop a site for a client which requires multiple languages. I have no experience with this from beforehand so I´m researching what might be the best way to do this. The webpage will be in swedish, english and norwegian. I must have the ability to have separate content in each language, like separate news posts for each language, or separate products etc. Would using WP multisite be a good way to achieve this? I´m thinking I can do like this: Start a network with three sites: www.domain.se /en and /no. Develop for the first language version (swedish) and fill it with the correct content. Export the content, and import it from the other installations. Then replace the contents with the same content in the other languages. Would this be a good way to achieve what I want, or would you suggest some other way? Regards


title: While in "the loop", detect if a post is the most recent

text: While inside "the loop" in WordPress, is there an easy way to detect if a post is the most recent? A Usage Example: I want to make the first post output an H1 for the title instead of an H2. Or I want the first post to display a thumbnail image (and not the rest). Here is some pseudocode what I'm trying to get across:                       if (have_posts()):                 while (have_posts()):                     the_post();                     the_excerpt();                     if(is_most_recent()):                         // do this                     endif;                 endwhile;             endif;


title: I don't need 'view' page for my custom taxonomy

text: I have a custom post type with a custom taxonomy. I don't link to the taxonomy on the page but from the admin anyone can visit the taxonomy/term url and the unstyled list page will be visible. How can I force wp to not use the default layout (index.php) for that listing? What's the best method? For example I creat a taxonomy template and I redirect it to the front page?


title: Display background color or image with custom meta box?

text:
With custom meta boxes, how would I go about displaying the background image (or color if no image is linked) within the page. Code for the page where I want data to displayed. I want to apply the background color/image to section id="masthead".               <?php if (get_post_meta($post->ID, '_sqcmb_masthead_select', true)) { ?>

                     <?php                         $content = get_post_meta( $post->ID, '_sqcmb_masthead_content', true );                         echo do_shortcode( $content );                     ?>

          <? } else { ?>     <?php } ?>      Code for the custom meta boxes.               /*Metaboxes for masthead section */     $meta_boxes[] = array(         'id'         => 'masthead-options',         'title'      => 'Masthead Options',         'pages'      => array( 'page' ), // Show on Pages         'context'    => 'normal',         'priority'   => 'high',         'show_names' => true, // Show field names on the left         'fields'     => array(             array(                 'name'    => 'Display Masthead',                 'desc'    => 'Check this box id you want to display the Masthead Section.',                 'id'      => $prefix . 'masthead_select',                 'type'    => 'checkbox',                 ),             array(                 'name'    => 'Masthead Content',                 'desc'    => 'Enter the content of the masthead section here. You can insert media, shortcodes, etc.',                 'id'      => $prefix . 'masthead_content',                 'type'    => 'wysiwyg',                 'options' => array( 'textarea_rows' => 5, ),             ),             array(                 'name' => 'Background Color',                 'desc' => 'Choose a background color.',                 'id'   => $prefix . 'masthead_bg_color',                 'type' => 'colorpicker',                 'std'  => '#ffffff'             ),             array(                 'name' => 'Background Image',                 'desc' => 'Upload an image as the background. This will override the Background Color. (optional)',                 'id'   => $prefix . 'masthead_bg_image',                 'type' => 'file',             ),         ),     );


title: Posts of specific category on page and excluded from index.htm

text:
hope things are going well. I'm trying to create a member's only section specific for posts of about job opportunities. My goal is to have posts of this category displayed on this page and excluded from the index.php page. I have created a template page by altering archive.php. The category ID for this "employment opportunities" category is 9. I have used the following php code to succesfully only display posts from that category on the template page and exclude posts of this category from index.php:               <?php query_posts('cat=9'); ?>      My issues are these.   1. This template page is not keeping the same template formatting as index.php and archive.php, even though I have not changed the CSS in any way. The code for index.php, archive.php, and empopp-template.php are below.  **index.php**               <?php     /**     * Index Template     *     * This is the default template.  It is used when a more specific template can't be      found to display     * posts.  It is unlikely that this template will ever be used, but there may be rare    cases.     *     *      *      */          get_header(); // Loads the header.php template. ?>
              <?php get_template_part( 'menu', 'secondary' ); // Loads the menu-     secondary.php template.  ?>              <?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template.   ?>
          <?php do_atomic( 'before_content' ); // oxygen_before_content ?>

                  <?php do_atomic( 'open_content' ); // oxygen_open_content ?>
                      <?php query_posts('cat=-9'); ?>                      <?php if ( have_posts() ) : ?>                          <?php while ( have_posts() ) : the_post(); ?>                              <?php do_atomic( 'before_entry' ); // oxygen_before_entry ?>                                  <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">                                         <?php do_atomic( 'open_entry' ); // oxygen_open_entry ?>
                                      <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>                                      <?php echo apply_atomic_shortcode( 'byline', '
' . __( '[entry-published] · by [entry-author] · in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" · "]', 'oxygen' ) . '
' ); ?>

                                      <?php the_excerpt(); ?>                                      <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'oxygen' ), 'after' => '
' ) ); ?>

                                      <?php userphoto_the_author_thumbnail() ?>
                                                 <?php do_atomic( 'close_entry' ); // oxygen_close_entry ?>
                              <?php do_atomic( 'after_entry' ); // oxygen_after_entry ?>                          <?php endwhile; ?>                      <?php else : ?>                          <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>                      <?php endif; ?>
                  <?php do_atomic( 'close_content' ); // oxygen_close_content ?>                  <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
              <?php do_atomic( 'after_content' ); // oxygen_after_content ?>           <?php get_footer(); // Loads the footer.php template. ?>          **archive.php**               <?php     /**     * Archive Template     *     * The archive template is the default template used for archives pages without a more     specific template.      *     *      *      */          get_header(); // Loads the header.php template. ?>
                   <?php get_template_part( 'menu', 'secondary' ); // Loads the menu-     secondary.php template.  ?>              <?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template.     ?>

              <?php do_atomic( 'before_content' ); // oxygen_before_content ?>
                  <?php do_atomic( 'open_content' ); // oxygen_open_content ?>
                      <?php if ( have_posts() ) : ?>                          <?php while ( have_posts() ) : the_post(); ?>                              <?php do_atomic( 'before_entry' ); //    oxygen_before_entry ?>                              <div id="post-<?php the_ID(); ?>" class="<?  php hybrid_entry_class(); ?>">                                       <?php do_atomic( 'open_entry' ); // oxygen_open_entry ?>
                                      <?php echo   apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>                                      <?php echo   apply_atomic_shortcode( 'byline', '
' . __( '[entry-published] · by [entry-author] · in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" · "]', 'oxygen' ) . '
' ); ?>

                                      <?php the_excerpt(); ?>                                      <?php wp_link_pages( array(   'before' => '
' . __( 'Pages:', 'oxygen' ), 'after' => '
' ) ); ?>

                                      <?php   userphoto_the_author_thumbnail() ?>
                                       <?php do_atomic( 'close_entry' );   // oxygen_close_entry ?>
                              <?php do_atomic( 'after_entry' ); // oxygen_after_entry ?>                          <?php endwhile; ?>                      <?php else : ?>                          <?php get_template_part( 'loop-error' ); // Loads   the loop-error.php template. ?>                      <?php endif; ?>
                  <?php do_atomic( 'close_content' ); // oxygen_close_content ?>                  <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
              <?php do_atomic( 'after_content' ); // oxygen_after_content ?>           <?php get_footer(); // Loads the footer.php template. ?>          **empopp-template.php**               <?php      /**      * Template Name: Employment Opportunities      *      * Employment Opportunities Template. Used to display restricted posts with "employment opportunities"      * category. Category number is 9      *      *       *       */           get_header(); // Loads the header.php template. ?>
              <?php get_template_part( 'menu', 'secondary' ); // Loads the menu-secondary.php template.  ?>              <?php get_sidebar( 'primary' ); // Loads the sidebar-primary.php template. ?>

              <?php do_atomic( 'before_content' ); // oxygen_before_content ?>
                  <?php do_atomic( 'open_content' ); // oxygen_open_content ?>
                      <?php                           $args = array('cat' => 30);                     $category_posts = new WP_Query($args);                          if($category_posts->have_posts()) :                          while($category_posts->have_posts()) :                              $category_posts->the_post();                 ?>                              <?php do_atomic( 'before_entry' ); // oxygen_before_entry ?>                              <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">                                         <?php do_atomic( 'open_entry' ); // oxygen_open_entry ?>
                                      <?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>                                      <?php echo   apply_atomic_shortcode( 'byline', '
' . __( '[entry-published] · by [entry-author] · in [entry-terms taxonomy="category" before=""] [entry-edit-link before=" · "]', 'oxygen' ) . '
' ); ?>

                                      <?php the_excerpt(); ?>                                      <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'oxygen' ), 'after' => '
' ) ); ?>

                                      <?php     userphoto_the_author_thumbnail() ?>
                                       <?php do_atomic( 'close_entry' ); // oxygen_close_entry ?>
                              <?php do_atomic( 'after_entry' ); // oxygen_after_entry ?>                          <?php endwhile; ?>                      <?php else : ?>                          <?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>                      <?php endif; ?>
                  <?php do_atomic( 'close_content' ); // oxygen_close_content ?>                  <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
              <?php do_atomic( 'after_content' ); // oxygen_after_content ?>          <?php get_footer(); // Loads the footer.php template. ?>      The theme I'm using allows for a unique home page where you manually insert posts with various featured images into pre-defined sections. Since this page requires manual post selection, I selected in the settings to have posts go to a separate "news" page. The inclusion/exclusion of a specific category is for specific pages. If I can apply this pre_get_posts to these non-home pages then I should be golden. So far, both the and new one with wp_query is doing the job, but not inheriting the css elements. I really appreciate the help. Thank you. – The link to the index.php page is http://www.biz.uiowa.edu/bta/news/. That is what ideally I would want the formatting to look like. This formatting is matched on searches and archives as well. The page where I applied the category query to is http://www.biz.uiowa.edu/bta/test/. Thank you for your time. Could someone please let me know if I've perhaps used the query_posts incorrectly or alternate code to use wp_query (if necessary). My main goal is to have the formatting match. The query_posts appears near line 32 or about 1/3rd of the way down. Thank you for your time.


title: Converting Static HTML pages to Wordpress

text: I have copied the HTML page content to the pages of the WordPress. The words have shown up under Preview but all the CSS and styling are gone. I have also imported the style.css into the Theme folder. My question, why my contents missing their corresponding CSS?


title: user_level being reset to 0 when user CUSTOM USER DB

text: I am trying to migrate two existing wordpress sites to use one database for user login. In the SECOND site I have changed the table prefix to 'xp_' and added the custom user table definition to the wp-config.php               define('CUSTOM_USER_TABLE', 'wp_users');     define('CUSTOM_USER_META_TABLE', 'wp_usermeta');      In the DB for the first site, I added "xp_capabilities = a:1:{s:13:"administrator";b:1;}" and xp_user_level = 10 to wp_usermeta for an admin user to the FIRST database. Now, I can basically login to the second site with credentials from the first site. When trying to access the wp-admin on the second site I get the error "You do not have sufficient permissions to access this page." **Also the record for "xp_user_level" in the FIRST DB been reset from 10 to 0.** What gives? This is basically working, except something is resetting the admin perms when the user logins into the SECOND site. I have also disabled all plugins on the SECOND site.


title: Insert Extra fields added in the front end registration form to DB

text:
I have added some extra fields like first_name,middle name,last_name etc into the custom registration form. I want to add those details int the DB also. Now only username,email,Display name and user_nice name are inserted into the db. How can i add the extra fields added in the front end to the DB? Following is the template i used to create login/Register/Forgot page               <?php     /*     Template Name: Registration Template     */     get_header();?>
          <?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID) { ?>

Login

Register

Forgot?

                  <?php $register = $_GET['register']; $reset = $_GET['reset']; if ($register == true) { ?>
Success!

Check your email for the password and then return to log in.
                  <?php } elseif ($reset == true) { ?>
Success!

Check your email to reset your password.
                  <?php } else { ?>                  <?php } ?>                  <form method="post" action="<?php bloginfo('url') ?>/wp-login.php" class="wp-user-form">
                     <?php _e('Username');_e("/");_e("Email"); ?>:                      <input type="text" name="log" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" id="user_login" tabindex="11" />

                     <?php _e('Password'); ?>:                      <input type="password" name="pwd" value="" size="20" id="user_pass" tabindex="12" />

                                                      <input type="checkbox" name="rememberme" value="forever" checked="checked" id="rememberme" tabindex="13" /> Remember me
                     <?php do_action('login_form'); ?>                     <input type="submit" name="user-submit" value="<?php _e('Login'); ?>" tabindex="14" class="user-submit" />                     <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />                     <input type="hidden" name="user-cookie" value="1" />
             </form>

Sign Up

We encourage you to do a one-time signup with us to be able to download content from this website
             <form method="post" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" class="wp-user-form">
                     <?php _e('Title'); ?>:                      <Select>                         <option>Mr</option>                         <option>Ms</option>                         <option>Mrs</option>                     </select>

                     <?php _e('First Name'); ?>:                      <input type="text" name="first_name" value="<?php echo esc_attr(stripslashes($first_name)); ?>" size="20" id="first_name" tabindex="101" required/>

                     <?php _e('Middle Name'); ?>:                      <input type="text" name="middle_name" value="<?php echo esc_attr(stripslashes($middle_name)); ?>" size="20" id="middle_name" tabindex="101" />

                     <?php _e('Last Name'); ?>:                      <input type="text" name="last_name" value="<?php echo esc_attr(stripslashes($last_name)); ?>" size="20" id="last_name" tabindex="101" required/>

                     <?php _e('Username'); ?>:                      <input type="text" name="user_login" value="<?php echo esc_attr(stripslashes($user_name)); ?>" size="20" id="user_login" tabindex="101" required />

                          <?php _e('Email Address'); ?>:                      <input type="text" name="user_email" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" id="user_email" tabindex="102" required/>

                     <?php _e('Organisation'); ?>:                      <input type="text" name="organisation" value="<?php echo esc_attr(stripslashes($user_org)); ?>" size="25" id="organisation" tabindex="102" />

                     <?php _e('Designation'); ?>:                      <input type="text" name="Designation" value="<?php echo esc_attr(stripslashes($user_desig)); ?>" size="25" id="designation" tabindex="102"/>

                     <?php _e('Which Product are you interested in'); ?>:                      <Select>                         <option>COREDC</option>                         <option>COREAE</option>                         <option>COREQROPS</option>                         <option>CORE Point Solutions</option>                         <option>Just Exploring</option>                     </select>

                     <input type="button" name="user-cancel" value="<?php _e('Cancel'); ?>" id="user-cancel" tabindex="103" />

                     <?php do_action('register_form'); ?>                     <input type="submit" name="user-submit" value="<?php _e('Sign up!'); ?>" class="user-signup" tabindex="103" />                     <?php $register = $_GET['register']; if($register == true) { echo '
Check your email for the password!
'; } ?>                     <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />                     <input type="hidden" name="user-cookie" value="1" />
             </form>

Lose something?

Enter your username or email to reset your password.
             <form method="post" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" class="wp-user-form">
                     <?php _e('Username or Email'); ?>:                      <input type="text" name="user_login" value="" size="20" id="user_login" tabindex="1001" />

                     <?php do_action('login_form', 'resetpass'); ?>                     <input type="submit" name="user-submit" value="<?php _e('Reset my password'); ?>" class="user-submit" tabindex="1002" />                     <?php $reset = $_GET['reset']; if($reset == true) { echo '
A message will be sent to your email address.
'; } ?>                     <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?reset=true" />                     <input type="hidden" name="user-cookie" value="1" />
             </form>

          <?php } else { // is logged in ?>

Welcome, <?php echo $user_identity; ?>

             <?php global $userdata; get_currentuserinfo(); echo get_avatar($userdata->ID, 60); ?>

You’re logged in as <?php echo $user_identity; ?>

                 <a href="<?php echo wp_logout_url('index.php'); ?>">Log out |                  <?php if (current_user_can('manage_options')) {                      echo '' . __('Admin') . ''; } else {                      echo '' . __('Profile') . ''; } ?>

          <?php } ?>
          <?php get_footer(); ?>


title: Tumblr importer

text: Is it possible to import tumblr post to wordpress WMS without automatic publication? My wordpress site has a multi-account. And I'd like to be able to check post, modify if needed before online publication. and Does someone know in what format tumblr posts are exported? Thanks for your help !!!


title: How to totally get rid of Category in my blog?

text: I prefer using tags and have no interest in using the categories. All my posts now are labeled with a category named "Uncategorized" and I want to turn them off! I want no more categories at all. How can I do that? Please help! **[Edit]** I'm using `wordpress.com`, not `wordpress.org`


title: Pagination on child category returns 404

text:
Can anyone figure out why viewing pages in my child categories results in a 404, when the same `$paged` code works fine for my index file? This is inside of my category-15.php (it's to affect all child categories under parent category ID 15).                 <?php         $PostNum = 1;         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $args = array(             'cat' => $cat,             'posts_per_page' => 2,             'orderby' => 'date',             'order' => 'ASC',             'paged' => $paged,         );         $CustomQueryIdentifier = new WP_Query($args);       ?>
<a href="<?php the_permalink(); ?>"><?php the_category(' '); ?>
              <?php           if ( $CustomQueryIdentifier->have_posts() ) : while ( $CustomQueryIdentifier->have_posts() ) : $CustomQueryIdentifier->the_post();         ?>

<a href="<?php the_permalink(); ?>"><?php $postnumber = $CustomQueryIdentifier->current_post; echo $postnumber+1 ?>
           <?php the_content(''); ?>
            <?php endwhile; endif; ?>
         <?php next_posts_link('« Older Entries', $CustomQueryIdentifier->max_num_pages) ?>         <?php previous_posts_link('Newer Entries »') ?>
            <?php wp_reset_postdata(); ?>


title: mqTranslate removes empty paragraphs / line breaks when updating post

text: I am using WordPress 3.9.1 with TinyMCE 4 by default, and so far I had no problems with formatting. However, I have now installed mqTranslate and whenever I update a post, all the empty paragraphs or line breaks (however you want to call it) are automatically removed. I have looked for possible fixes on Google to prevent TinyMCE removing the empty paragraphs to preserve the formatting, but nothing has worked with TinyMCE 4 so far.


title: Replacing the title in admin list table

text: Here is my situation: I am trying to filter the content of the title column in my custom post type edit table but I can't get it working. Here is what I have tried:               add_filter('manage_edit-mycpt_columns', 'replace_title_products');          function replace_title_products() {         $oldtitle = get_the_title();         $newtitle = str_replace(array("", ""), array("", ""),$oldtitle);         $title = esc_attr($newtitle);         return $title;       }      I just want to filter the `<span>` tags in my title. Could someone help me please?


title: Show the online status of the current post's author

text: Is there a way that I can show the online status (Either online or offline) of the author of the post that a site visitor is viewing? I imagine it's something to do with the Transients API (http://codex.wordpress.org/Transients_API) ? Unfortunately that's one aspect of Wordpress that is beyond me.


title: Multisite installation without using domain root

text: I would like to create a multisite installation using subdirectories, but I don't want any of the sites to use the domain root as their home URL. I'd like to have the multisite install in www.mydomain.com/multi/ Then my sites will be at www.mydomain.com/site1/ www.mydomain.com/site2/ I've got a feeling that this isn't easily possible. It seems like all sites within the network need to be subdomains of the core site (wherever that may be). The documentation (http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory) indicates that this should be possible, but doesn't give any details. I think that the only thing which is possible is to give your multisite a different directory to the installation, but the sub-sites will still need to sit within that. I can create a multisite installation in /multi/, then create the sites, changing their site url afterwards to be outside the multisite root. This seems to work, but when I try to navigate to their admin areas I get stuck in redirect loops. Does anybody know if this should be possible without too much hacking?


title: Overriding methods in a child theme

text: Guided by the Codex doc on Child Themes I have created a `twentythirteen- child` theme for my website by copying the unchanged `index.php` file from the parent theme and by creating this simple `style.css` file:               /*      Theme Name:   Twenty Thirteen Child      Theme URI:    http://example.com/twenty-fourteen-child/      Description:  Twenty Thirteen Child Theme      Author:       Alexander Farber      Author URI:   http://afarber.de      Template:     twentythirteen      Version:      1      Tags:         light, responsive-layout, accessibility-ready      Text Domain:  twenty-thirteen-child     */          @import url("../twentythirteen/style.css");          .site-header .home-link {             min-height: 800px;     }      However since my website uses a custom header image I've also edited 2 files in Wordpress - 1) I have changed the logo image height in the wp- content/themes/twentythirteen/inc/custom-header.php:               #'height'                 => 230,      'height'                 => 800,      2) I have added `#main` anchor to the `home-link` in wp- content/themes/twentythirteen/header.php               <a class="home-link" href="<?php echo esc_url( home_url( '/#main' ) ); ?>"      I realize, that the core WordPress files shouldn't be edited, because the changes will be overwritten and lost after the next WordPress version update. But I don't quite understand, how to put the 2 above changes in the `functions.php` suggested by the doc? Could someone please give me some hints?


title: Shortcode returns values in the wrong order

text:
I have a shortcode function that returns:               return '
'. wp_list_pages( $args ) .'
';      Of course it returns:               {pages}

      Instead of:
        {pages}
      There is almost the same question, but for echo: Why does this echo values in the wrong order? And it works perfectly for echo, but I don't know how to use PHP line breaking with "return" (it breaks the whole code). Thank you!


title: Wordpress Admin Tooltip hooks

text: I want to know if there is a way to use Wordpress Adminitration Tooltips (de gray and blue ones) that are shown one you update your worpdress (3.x). Showing the new features. Thanks!


title: modify plugin to support RTL

text: I've developed a plugin and now I want to make it RTL compatible. Does anybody know how to determine is RTL enabled in admin panel or not? Or maybe somebody knows any CSS tips for RTL support?


title: How to exclude a specific template from being cached by a CDN

text: I’m using a specific template on my self-hosted WordPress blog to display a page with randomized posts. Recently, I configured W3 Total Cache to make use of a content delivery network (CDN). When not logged in as the administrator, a user will have some elements of the site served through the CDN instead of fetching a “live” version from the original server where it is hosted. I noticed the randomization will not worked if the site is served through the CDN, but works perfectly well is served directly from the original server. More precisely, random posts will be displayed the first time the random post page is invoked. However, if the page is invoked again (or refresh from the browser) the very same posts will be displayed again. Whereas, when working normally, the page will displayed random posts each time it is accessed (or each time the page is refreshed from the browser). W3 Total Cache has a specific field where the user can input content that must be exclude from the CDN. An example involving such an exclusion can be found here. The question is simple: how can I exclude my random post template from being served through the CDN? Do I need to input the URL of the random post page or maybe the location of the template that does the randomization? Thanks a lot, P.


title: Pagination not working

text:
$paged for pagination is awlays returning 1, so no matter what page i click "1" is always highlighted and it always shows the same posts. i have tried a million different combinations of things to fix and nothing works :(
          <?php                             wp_reset_query();                  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     echo $paged;             $mixtapes = new WP_Query ( array               ( 'post_type' => 'mixtapes', 'posts_per_page' => 4, 'paged'=>$paged )              );                       while ($mixtapes->have_posts()) : $mixtapes->the_post();                    $img_id = get_post_meta($post->ID,'image',true);               $img_url = wp_get_attachment_url($img_id);               ?>
               <a href="<?php the_permalink(); ?>"><img class="cover" src="<?php echo get_bloginfo('url').'/timthumb.php?src='.str_replace("http://freshnewmixtapes.net","",$img_url).'&q=100&h=176&w=176'; ?>" alt="<?php the_title(); ?>" />
<?php echo the_title(); ?>
                    <a href="<?php the_permalink(); ?>" class="download">Download               <a href="<?php the_permalink(); ?>" class="play">Play
                  <?php              endwhile;?>            <?php ?>

     <?php wp_pagenavi( array( 'query' => $mixtapes ) );     wp_reset_postdata();     ?>


title: Use Wordpress to create a custom CMS?

text: I am new to Wordpress, but i am good with php, javascripts, SQL and with other stuff. One of my friends asked me to do a site using Wordpress for his travel agency. There should be ability to him, to add tour packages and update them, and also web site visitors should have a chance to register as a member on site and upload their photos, write reviews and rate each tour packages. I made a content management system for this, simply with php and SQL, but I don't know how to attach that system to Wordpress. I don't know if there is a way to do so. Please tell me, then I can inform to my friend that it is impossible.


title: How to call function from another plugin?

text: I am using the Advanced Custom Fields plugin and want to read the value of the custom fields. For dropdown and text fields, this is straightforward as the value is kept in plain text, so the `get_post_custom_values` functions works. For multi-select field, however, ACF keeps data like this:               a:1:{i:0;s:3:"Value2";}      So the sensible thing to do is to use the `get_value` function from ACF to read the value and parse it into objects. In the ACF plugin, the first line does:               $acf = new Acf();      So I assumed I could just use the $acf variable in my plugin and do:               $afc->get_value ($post_id, $key);      but received error with               PHP Notice:  Undefined variable      I am new to php development so I might not have understood the scoping rule correctly. So, what's the right way to do this and what am I doing wrong?


title: Add paragraph tags to comments

text: The line breaks on my comments are not being considered. I've inspected the elements in google chrome and it seems that wordpress is not adding paragraph tags `<p>` to them, while in the body text it does. The comments.php in my template has the following snippet:               <ol class="commentlist">         <?php wp_list_comments(); ?>     </ol>      No options of wp_list_comments() seems to be related to this. Also, in the file `default-filter.php` I have the line               add_filter( 'comment_text', 'wpautop', 30 );      So I don't understand why it's not adding the tags. Is anyone facing the same problem?


title: Internationalization and functions that use it

text: I'm building a new design into WP and so technically it is a theme, however it is only a design for one site and won't be a theme anyone can use and hence I don't want to bother with internationalization. I have noticed WP makes use of internationalization in many functions by passing in the `textdomain` via functions such as..               _e( 'Featured', 'twentyeleven' );     esc_attr__( 'Permalink to %s', 'twentyeleven' )      How I have been told that it's a bad idea to remove the `textdomain` as it may end up with odd results, but if I'm not bothering with internationalization what do I do?


title: Hierarchical taxonomy UI

text: I don't like the way the taxonomies are displayed within the Wordpress admin and was wondering if anyone knew the best way to hook in and change it. Currently if I select some terms within my post those selected terms go to the top of the list and the hierarchy is broken making it visually confusing for the user. Please see these images for an idea of what I'm talking about ![enter image description here](http://i.stack.imgur.com/7wDWp.png) ![enter image description here](http://i.stack.imgur.com/oiMxO.png) I want to display the taxonomies exactly how they are displayed initially with just the correct terms ticked. Is there a way of doing this without having to edit the Wordpress core directly, I can't see any hooks for me to use. Thank you for any help you can give! Helen


title: what is the best way to add things to a side bar

text: I have a user that is wanting to be able to add items to the side bar (images / text) I'm rather new to wordpress development - fulltime c# developer, so I'm at a loss for a solution. Can anyone advice what the best solution would be? thanks,


title: which theme is this?

text: Could anyone help me finding which WP theme has been used in this site? http://www.laquilacittaaperta.it/ I only have found concerning a DM theme but I really haven't been able to find it anywhere thank you Mari0


title: Does Wordpress have a "Form API"

text: I do most of my development in Drupal, however I am working on a Wordpress site and I need to make a form. Which got me thinking, is there a Form API for wordpress like there is Drupal? Is there a way to add a form by using php? Any links to documentation (which I haven't found) or blog posts would be greatly appreciated. Thanks


title: Plugin: List category posts - How to show the caption under thumbnail

text:
I've been trying to get the caption to show under the thumbnail with css but to no avail. It keeps appearing on top. css:               .lcp_catlist {         float:left;         text-align:center;     }          .lcp_catlist li {         display:block;         float:left;         width: 160px;         height: 150px;         margin-bottom: 10px;     }          div.project-title {     }          .project-thumb {         float: left;         padding: 3px;     }      the shortcode:               [catlist id=3 numberposts=20 orderby=title order=asc title_tag=div title_class=project-title thumbnail=yes thumbnail_class=project-thumb thumbnail_size=thumbnail ]      From what i've search so far, the thumbnail need to be in a div for the float css to work. however, the plugin didn't give the option of using thumnail_tag option. is there a workaround to get the thumbnail to be in a div? I'm not sure if this will help, but this is the html template for each post:

POST TITLE

My THUMBNAIL

`      the problem is that the div for the image is at the bottom while div for the title is on top. even though i played around with the settings for css, it seem to stay in that position. however, i cannot switch their places as that is in the core of the plugin. Thank you so much for helping!


title: the_post_thumbnail("size") returns same image for all sizes except thumbnail

text: I've got 3 default image sizes set up in "Setting > Media Settings > Image Sizes" However, when I use anything but "thumbnail" as the image size parameter in the_post_thumbnail(), it returns the full size image. Am I doing something wrong or could there be an active filter making this happen? For example, this _should_ return the medium 300x300px max size image:               echo the_post_thumbnail("medium");      And this should return the "large" 1024x1024px max:               echo the_post_thumbnail("large");


title: Make blog secret during design construction

text: I am a n00b at wordpress. I'd like my blog to be secret while I finish the design. How do I do this? Thank you!


title: Customize Plugin

text: I am trying to create custom welcome panel in dashboard for WP and can't see where I went wrong. It's not allowing me to add html.


title: Display posts of the last 7 days

text: I'm trying to display the 5 best rated posts of the last week (7 days) on my website, however I can't seem to figure out how to display them. Here's what I've achieved so far but it doesn't seem to work:               <?php $slider_query = new WP_Query('posts_per_page=5&cat=3&orderby=highest_rated&order=desc'); ?>          <?php          $mylimit = 7 * 86400; //days * seconds per day          while ($slider_query->have_posts()) : $slider_query->the_post();              $post_age = date('U') - get_post_time('U');              if ($post_age < $mylimit) {      ?>          //The Post          <?php } ?>          <?php endwhile;?>


title: Can't show comments count per post outside loop

text:
How can I show the amount of a comment per post outside the loop? I tried this in a function already: `' . get_comments_number . '` , but that outputted the text "array" on the screen... What do I have to do for getting it to work? On my `single.php` I used this to output some list items (posts):
     <?php echo wowPosts(2); ?>
      And in my functions.php I used this:               function wowPosts($num) {         global $wpdb;              $posts = $wpdb->get_results("SELECT comment_count, ID, post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , $num");              foreach ($posts as $post) {             setup_postdata($post);             $id = $post->ID;             $title = $post->post_title;             $count = $post->comment_count;             $comment_count = get_comment_count($post->ID);             $all_comments = get_comment_count( array ( 'post_id' => get_the_ID() ) );                  if ($count != 0) {                 $popular .= '
';                 $popular .= '' . $title . ' '. count( $all_comments ) . ' ';                 $popular .= '
';             }         }         return $popular;     }      As you can see, I have edited your first code and implemented in this function so that I can use it per list item (per post)... It still shows a 4 everywhere.


title: Search and replace image urls in posts

text: I'm struggling with my recently imported posterous data. All the image urls in the imported posts looks like this:               http://getfile1.posterous.com/getfile/files.posterous.com/temp-2013-03-30/kBpHaviyoumcvCEHnGnrDfwHwmJIrnqrHrxhCnHwfBIHuDsxbemHlxwEwCdi/IMG_6870.jpg      Now I tried to search and replace them with the Search and Replace Plugin, but it looks like it doesn't work with placeholders like:               http://%.posterous.com/getfile/files.posterous.com/temp-2013-03-%/%/      Has anybody any idea how i can get an url like above into:               http://my.domain.com/wordpress/wp-content/uploads/2013/03/IMG_6870.jpg      I'm able to execute SQL as well, if this helps. Thank you very much!


title: AJAX Contact Form Issue

text:
I created a contact form for my sidebar that is working perfectly in Chrome but not in IE or FF. I've been staring at it for hours and can't find out what I did wrong. I'm not getting any errors anywhere, but when I submit it in FF or IE, it logs "nope" in my console and echos out a message of -1 in #jvmsg. My html is:

Test

       <form id="jvcontact" name="widget_contact" action="" method="post">         Email Address (required)         <input class="required" type="email" name="email">         First Name (required)         <input class="required" type="text" name="firstName">         Last Name (required)         <input class="required" type="text" name="lastName">         Any questions for us?         <textarea rows="5" name="question"></textarea>         <input type="submit" value="Send it" style="display: inline-block; ">     </form>

Thanks for the email

      My js file is like this:               jQuery(document).ready(function($) {     jQuery('#jvcontact').submit(function() {         jQuery('.widget_contact input[type="submit"]').hide();         jQuery('.jvloading').show();         var str = jQuery(this).serialize();         jQuery.ajax({             type: 'POST',             url: '/wp-admin/admin-ajax.php',             data: 'action=contact_form&'+str,             success: function(msg) {                 //jQuery('#jvmsg').ajaxComplete(function(event, request, settings){                     if(msg === 'sent') {                         console.log('sent');                         jQuery('#jvmsg').hide();                         jQuery('.jvloading').slideUp();                         jQuery('.widget_contact input[type="submit"]').slideUp();                         jQuery('#jvcontact').slideUp();                         jQuery('#jvsuccess').fadeIn('slow');                     }                     else {                         console.log('nope');                         jQuery('#jvmsg').html(msg);                         jQuery('.jvloading').hide();                         jQuery('.widget_contact input[type="submit"]').show();                         jQuery('#jvmsg').fadeIn('slow');                     }                 //});             }         });         return false;     });      }); My php file:               function ajax_contact() {     if(!empty($_POST)) {            $error = "";            //Check to make sure sure that a valid email address is submitted       if(trim($_POST['email']) == '')  {         $error .= "An email address is required
";       } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {         $error .= "A valid email address is required
";       } else {         $email = trim($_POST['email']);       }            //Check to make sure that the first name field is not empty       if(trim($_POST['firstName']) == '') {         $error .= "Your first name is required
";       } else {         $firstName = trim($_POST['firstName']);       }            //Check to make sure that the last name field is not empty       if(trim($_POST['lastName']) == '') {         $error .= "Your last name is required
";       } else {         $lastName = trim($_POST['lastName']);       }            if(trim($_POST['question']) == '') {         $question = "They had no questions at this time";       } else {         $question = $_POST['question'];       }            $admin_mail = get_bloginfo('admin_email');               if(empty($error)) {            $message  = "Someone wants to get in touch with you. \n\n                    Name: " . $firstName . " " . $lastName . "\n                    Email: " . $email . "\n                    Question: " . $question . "\n";            $jvMail = wp_mail($admin_mail, 'Contact from your website', $message);       echo "sent";          } else {       echo $error;     }     die();     }     }          add_action('wp_ajax_contact_form', 'ajax_contact');      Thanks for the help!


title: Get next/previous cousin page

text: Hey Guys, I'm trying to build pagination links for the next/previous cousin page. For example, my page structure is like this:   * Top Level      * A        * a1       * a2     * B        * b1       * b2 When I'm on a2, I want the 'Previous Page' link to go to a1, but the 'Next Page' link to go to b1 (skipping B). I'm using great Next Page, Not Next Post plugin at the moment, but it can only go to next page (so it would include B in the above example). I'm trying to modify it to only show cousins, but running into some trouble. So far I have this:                   // query gand parent page level, go to next parent page, and then loop to find it's next child, eke!         // get grandparent id         $parentInfo = get_page($post->post_parent);              // query the level above's pages         // $getParentPages = get_pages('child_of='.$parentInfo->post_parent.'&parent='.$parentInfo->post_parent.'&'.$getPagesQuery);         $getParentPages = get_pages($getPagesQuery);         $parentPageCount = count($getParentPages);                    for($pp=0; $pp < $parentPageCount; $pp++) {             // get the array key for our entry             // if ($post->post_parent == $getParentPages[$pp]->ID) break;             if ($post->ID == $getParentPages[$pp]->ID) break;         }              // assign our next key         $parentNextKey = $pp+1;              if (isset($getParentPages[$parentNextKey])) {             $anchorName = $getParentPages[$parentNextKey]->post_title;                  $output = '<a href="'.get_permalink($getParentPages[$parentNextKey]->ID).'" title="'.$anchorName.'">';         }      So how would I make that skip B, and go to b1 and so on? Thanks for the help! -Drew


title: How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?

text: I just upgraded from 3.0 to 3.1.2 and in the comments column under Posts in the WP Admin, this error keeps appearing for every row: > Warning: number_format() expects parameter 1 to be double, string given in > /path/mysite/wp-includes/functions.php on line 155 Can someone tell me how to fix this?


title: how to force CUSTOM POST TYPES to use default permalink

text: my custom post type sample link is :               mysite.com/custom-type-name/post_slug      i want that my custom post types used the permalink structure, which i have set in Options>Permalinks (exactly, i want /%category%/$postname%) how to do that?


title: How can I specify the position of an admin bar item added with $wp_admin_bar->add_menu() or add_node()?

text: I want to add a link to my site in the admin bar, and make that link the leftmost item in the admin bar. I can add a link with this in a plugin function:               $wp_admin_bar->add_menu( array(             'id' => 'my-link',             'title' => __('MySite'),             'href' => site_url()          ) );      But I'd like to make it the leftmost link in the admin bar, i.e. all the way in the top left corner. Is there a way to do this?


title: Do WordPress cron jobs slow down page loading?

text: If a user visits a site and his visit triggers a cron job that is quite intensive, the page load speed will be slower for him right? As I understand the page doesn't wait for the cron job to execute before loading, but since the cron job would be running in parallel, it might still be the case that the page loads slower since the server is busy right?


title: How accurate is P3 Plugin profiler

text: How accurately does the P3 Plugin Profiler plugin measure the loading time of plugins, and what mechanism does it uses to estimate the loading time?


title: Invalid post type when click "Filter" or "Apply" button in Wordpres admin Post list

text: I need your help to resolve 1 Issue in Wordpress admin page. I'm using WP 3.7.1 and twentytwelve template. I have some posts and pages. Currently, when I click Filter or Apply button in Post/Page list, it always shows the error "Invalid Post Type" and the URL looks like this . > post_type=&_wpnonce=54fb54b00f&_wp_http_referer=%2Fwp- > admin%2Fedit.php&action=-1&m=0&cat=0&paged=1&mode=list&action2=-1 I tried to active another template and it works fine! Please help me to understand and fix this issue!!! Thank you!!


title: wp_list_pages hierarchical help

text: So I have been searching online for something that I think is simple to achieve and I am most likely over thinking it. I have found many related articles on the matter but can't seem to get it to apply to my scenario. I have a sidebar menu on my site that displays a tier of sub-pages. So if you click on "Services" the sidebar shows   * Service 1   * Service 2   * Service 3   * Service 4   * Service 5 This is perfect, as these are my 5 sub-pages underneath "Services". Now "Service 1, 2 & 3" have anywhere from 5-15 sub-pages under them. What I want to achieve is if you click on "Service 1" in the sidebar and the page loads the sidebar will adjust to show:   * Service 1 -- sub-page 1 -- sub-page 2 -- sub-page 3   * Service 2   * Service 3   * Service 4   * Service 5 So on the 3rd tier of pages I still want the sidebar to display the main sub- services links but if you are on a sub-service page that has its own sub-pages I would like it to display those sub-pages as well as the original main service sub-pages. Currently I have only been able to get this show like this: Click on "Service 1", sidebar menu reflects: - Service 1 -- sub-page 1 -- sub- page 2 -- sub-page 3 - Service 2 - Service 3 - Service 4 - Service 5 Which is good, but then if I click on one of those "sub-pages" the menu updates to only show the sub-pages of that service and not the menu structure that was there before. Sorry for the long post. I have tried this link using a custom walker: http://wordpress.mfields.org/2010/selective-page-hierarchy-for-wp_list_pages/ I have also tried:                       <ul class="sidebar_menu">                 <?php wp_list_pages( array('title_li'=>'','include'=>get_post_top_ancestor_id()) ); ?>                 <?php wp_list_pages( array('title_li'=>'','depth'=>1,'child_of'=>get_post_top_ancestor_id()) ); ?>             </ul>      No luck though. Thanks for any help! EDIT: Also have tried the following (which works up until the 3rd tier is reached, then it drops the "2nd" tier of sub-pages.)                       <?php                 $ancestor_id=$post->post_parent;                 $descendants = get_pages(array('child_of' => $ancestor_id));                 $incl = "";                      foreach ($descendants as $page) {                    if (($page->post_parent == $ancestor_id) ||                        ($page->post_parent == $post->post_parent) ||                        ($page->post_parent == $post->ID))                    {                       $incl .= $page->ID . ",";                    }                 }             ?>                  <ul>                 <?php wp_list_pages(array(                     "child_of" => $ancestor_id,                     "include" => $incl,                     "link_before" => "",                     "title_li" => "",                     "sort_column" => "menu_order"                     ));                 ?>             </ul>


title: Custom Post Type: Get most recent permalink

text: Stupid question, I bet: I'm doing a website for an artist where I have a custom post type of "Painting". How do I get the permalink of the one added most recently?


title: How do i export the HTML from text widgets?

text: I placed HTML in several text widgets which where lost after i deleted all inactive widgets and changed themes but i have found the data in the tables. The only problem, its mixed in with all this other crap code and i only want the HTML or text. All the export options don't allow for export of text or HTML even though that's what i entered into the text widgets in the first place.


title: How to setup a single post page for my custom post type?

text: This my Custom Post Type Code               /* Job Opening */     add_action( 'init', 'create_job_opening' );     function create_job_opening() {         register_post_type( 'job_opening',             array(                 'labels' => array(                     'name' => 'Job Opening',                     'singular_name' => 'Job Opening',                     'add_new' => 'Add New',                     'add_new_item' => 'Add New Job Opening',                     'edit' => 'Edit',                     'edit_item' => 'Edit Job Opening',                     'new_item' => 'New job opening',                     'view' => 'View',                     'view_item' => 'View job opening',                     'search_items' => 'Search job opening',                     'not_found' => 'No Job Opening found',                     'not_found_in_trash' => 'No Job Opening found in Trash',                     'parent' => 'Parent job opening'                 ),                      'public' => true,                 'menu_position' => 15,                 'supports' => array( 'title', 'editor', 'thumbnail' ),                 'taxonomies' => array( '' ),                 'menu_icon' => get_bloginfo('template_directory') . '/images/Careerpost-icon.png',  // Icon Path                 'has_archive' => true             )         );     }     add_action( 'admin_init', 'my_admin_job' );          function my_admin_job() {         add_meta_box( 'job_opening_meta_box',             'job Details',             'display_job_opening_meta_box',             'job_opening', 'normal', 'high'         );     }      I can call my post to sidebar               $args = array( 'post_type' => 'job_opening', 'posts_per_page' => 30 );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();         the_title();     endwhile;      my `single.php` is blank now. how can i create a `job-single-post.php` how to specify `job-single-post.php` is the single post template for job_opening CPT?.


title: Invalid Taxonomy

text: So I registered a custom post type as well as a taxonomy for that post type. I then created a couple items in that taxonomy, but when I go to click on any of them it turns up as Invalid taxonomy. http://i42.tinypic.com/ncffi1.jpg Here is the code I use to create my custom post type + taxonomy. I have it in a plugin.               class GW_Guides_Post_Type {         public function __construct() {             $this->register_post_type();             $this->metaboxes();             $this->guides_taxonomy();         }              public function guides_taxonomy() {             register_taxonomy(                 'Guide Categories',                 'gw_guides',                 array(                     'hierarchical' => true,                     'label' => 'Guide Categories')             );         }              public function register_post_type() {             $args = array(                 'labels' => array(                     'name' => 'Guides',                     'singular_name' => 'Guide',                     'add_new' => 'Add New Guide',                     'add_new_item' => 'Add New Guide',                     'edit_item' => 'Edit Item',                     'new_item' => 'Add New Item',                     'view_item' => 'View News',                     'search_items' => 'Search Guides',                     'not_found' => 'No Guides Found',                     'not_found_in_trash' => 'No Guides Found In Trash'                 ),                 'query_var' => 'guides',                 'rewrite' => array(                     'slug' => 'guides',                 ),                 'public' => true,                 'menu_position' => 5,                 'menu_icon' => admin_url() . 'images/media-button-other.gif',                 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ),                 'has_archive' => true             );             register_post_type('gw_guides', $args);         }                 public function metaboxes() {             add_action('add_meta_boxes','add_guides_meta');                  function add_guides_meta() {                 // css id, title, cb funct, page, priority, cb funct arguments                 add_meta_box('gw_guides_meta', 'Featured', 'guides_meta', 'gw_guides');                  }                  function guides_meta($post) {                 $featured = get_post_meta($post->ID, 'featured', true);                 ?>                     <p>                         <label for="featured">Featured:</label>                         <?php                              if ($featured == "True") {                                 $checked = 'checked';                             } else {                                 $checked = '';                             }                         ?>                         <input type="checkbox" name="featured" id="featured" value="True" <?php print($checked) ?> />                         <?php echo $featured; ?>                     </p>                 <?php             }                  add_action('save_post', 'save_guides_meta');                  function save_guides_meta($id) {                 update_post_meta(                     $id,                     'featured',                     strip_tags($_POST['featured'])                 );                   }         }          }          function add_gw_guides() {         new GW_Guides_Post_Type();     }          add_action('init', 'add_gw_guides');          ?>