title: Instead of submiting an entire post, is there any way to submit a lite-post or a simple message?

text: I was wondering if there is a way or a plugin to post something like twitter update messages instead of a post. Something like http://p2demo.wordpress.com/ but better, where a user will post update messages not an entire post (in database matters). That means you will save space, make it quicker and fewer database resources. I am looking for a way to post lite messages, that database will only save the must, like IDs, title, post and a thumb, through php maybe. No taxonomies and and and. I hope you understand what I am trying to say (sorry for any bad English) Thank you. **Updated** : I found this code, should I use this as a twitter posting feature? (As I said I need fewer db resources)               // Create post object     $my_post = array();     $my_post['post_title']    = 'My post';     $my_post['post_content']  = 'This is my post.';     $my_post['post_status']   = 'publish';     $my_post['post_author']   = 1;     $my_post['post_category'] = array(0);     // Insert the post into the database     wp_insert_post( $my_post );"


title: WP_Query and next_posts_link

text:
I cannot figure out how to make next_posts_link() work within my custom WP_Query. Here is the function:               function artists() {       echo '
';       $args = array( 'post_type' => 'artist', 'posts_per_page' => 3, 'paged' => get_query_var( 'page' ));       $loop = new WP_Query( $args );       while ( $loop->have_posts() ) : $loop->the_post();         echo '';         echo '
'.get_the_title().'
';         $attachments = attachments_get_attachments();         $total_attachments = count( $attachments );         for( $i=0; $i<$total_attachments; $i++ ) {           $thumb = wp_get_attachment_image_src( $attachments[$i]['id'], 'thumbnail' );           echo '';         }         echo '';       endwhile;       echo '
';       next_posts_link();     }      Can anyone tell me what I am doing wrong? Thanks


title: Is wordpress good enough for ecommerce?

text: I'm familiar with Wordpress and some e-commerce back-ends like Magento, etc. I think I could build it with these, but I got advice not to do this as it will be hard to scale in the future. Should I listen to them? Also, I will need custom features like custom product pages, user profile pages, voting elements, file uploads. Will I abe able to implement such features and more with wordpress?


title: fetching posts and showing on frontpage

text: I am having two sites viz. **www.a.com** and **www.a.com/b** . Now, these are two seperate wp installations, in the same /root where 'b' is kind of an extended vertical site of 'a'. I want to achieve the technique where I'd be able to show recent (or all that I publish) posts of B on A's front page. The post should look like as it the usual part of A's native posts. For ex- if I post any topic title "my post" on B, then it should appear on its front page plus, it should also appear on A's frontpage. Any help?


title: Making a plugin only available on the front-end for the logged in super admin

text: I made a little plugin that enqueues 1 .js file and 1 .css file into a theme's front-end. All it does it load a grid on top of the theme so I can visualise the design. If this plugin was activated on a live site, is it possible that only I (the super admin) can see the JS and CSS files included onto the front-end? All I have inside the plugin file is this:               function load_grid() {         wp_enqueue_style('grid_css', plugins_url('/lib/css/grid.css', __FILE__) );         wp_enqueue_script('grid_js', plugins_url('/lib/js/grid.js', __FILE__), array('jquery') );     }     add_action('wp_enqueue_scripts', 'load_grid');


title: How to avoid repeatedly use the new statement to instantiate a class?

text: I have a Class with a lot of variables. To get a variable, I have to write this line in each function:               $x = new MY_Class();      I guess there has to be another way? I tried:               function my_data(){     global $x;     $x = new MY_Class();     return apply_filters( 'my_data', $x )     }      Then, I tried to use `$x->var` in other functions that need the variables, but it doesn't work. How can I make the `global $x` and its variables accessable by other functions? Thanks!


title: Fetch Google Calendar in a custom way

text: I have to integrate the next upcoming events from a Google Calendar. Just a custom list of the events with a few CSS-enhancements to style the date and the title. Is there a way to do so? I checked plugins etc but I don't find solutions to integrate it in my theme. Is there a way to do this with the rss- feed? Thank you!


title: Divs appearing everywhere in post content

text: Whenever somebody writes a post on our site, the Paly Voice (http://palyvoice.com) there are automatically a lot of `<div>` elements created. This is bad for layout, since we have a style that applies to divs that we don't want to apply to story styles. Is there a way to remove the automatic div insertion? If not, can I add a function hook to parse the post and remove them before saving to the DB? Edit: Example here: http://palyvoice.com/2012/08/22/new-grade-reports-to-be- mailed-home-every-four-weeks-2/


title: How to display list of child pages of parent page in wordpress?

text: I have following format of menu.               Treatment      -Beauty       --Services       --Products      -Surgery      -washing      I have followed follwed following link: How to Display a List of Child Pages For a Parent Page in WordPress But I do not want subpages of "Beauty" page. I want only "Treatment" Subpages.


title: Creating custom user roles

text: I need to create a custom user role who will be able to create posts (of a specific post type) but not publish them (just like the current contributor role. I'm being a bit confused on how to create a new role or capability to achieve this. How/where do I start? Thanks **UPDATE:** I added these to the custom post function as suggested by Eric Holmes               'capabilities' => array(         'edit_posts' => 'edit_helps',         'edit_post' => 'edit_help',         'read_post' => 'read_helps',     ),      Added these to plugin activation hook, and the opposite in deactivation hook (I'm modifying the contributor role itself):               function modify_user_capabilities() {       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );       $role->add_cap('edit_helps');       $role->add_cap('edit_help');       $role->add_cap('read_helps');       }          register_activation_hook( __FILE__, 'modify_user_capabilities' );      Now only the contributor can edit this post type, not other users (Eg admin) Is there a better way to batch assign them these capabilities? I edited my activation hook to:               function modify_user_capabilities() {       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );            foreach (array('administrator', 'editor', 'author', 'contributor') as $user_role) {         $role = get_role($user_role);         $role->add_cap('edit_helps');         $role->add_cap('edit_help');         $role->add_cap('read_helps');       }       }      **UPDATE 2:** I totally forgot to assign someone to delete the posts. So I updated the function:               function modify_user_capabilities() {            //remove the contributor from editing any post       $role = get_role( 'contributor' );       $role->remove_cap( 'delete_posts' );       $role->remove_cap( 'edit_posts' );            foreach (array('administrator', 'editor', 'author', 'contributor') as $user_role) {         $role = get_role($user_role);         $role->add_cap('edit_helps');         $role->add_cap('edit_help');         $role->add_cap('read_helps');       }       //let admins delete posts       $role = get_role('administrator');       $role->add_cap('delete_helps');       $role->add_cap('delete_publised_helps');       $role->add_cap('delete_others_helps');       $role->add_cap('delete_help');     }      Now the admin can delete these posts.


title: How to find all links between pages

text: I'm trying to have sort of a functionality that will let me find all internal links on my site that are pointing to a page. i.e - I want to know all pages on my site that are linking to (any) page in my site. I tried to find sort of a ready made plugin for that, but didn't seem to find. I can develop one by myself, but I wonder what will be the best way to have such functionality. Any ideas will be very welcomed . Thanks


title: The Correct Way to Use Nonce Field without Settings API

text:
I'm trying to create an admin option page without the Settings API for some reasons. Then if I do so, I've heard that I need to use nonces for security. I'd like to know the correct way to use them. This is what I've tried by following this page: Using nonce external of WP Admin admin.               <?php     /*     Plugin Name: Demo for Using Nonce     Description: Demo plugin demonstrating how to use nonce     Author: Teno     */          // define constants     define("DEMONONCE", "demo_nonce");     define("DEMONONCEPAGESLUG", "demo_nonce_adminpage");          // create an option array     $arrOption = get_option(DEMONONCE);     update_option(DEMONONCE, array_merge(array(), is_array($arrOption) ? $arrOption : array()));          // admin menu     add_action('admin_menu', 'demo_nonce_adminmenu');     function demo_nonce_adminmenu() {         add_options_page('Demo Plugin Menu for Nonce without Settings API', 'Demo Plugin Menu for Nonce without Settings API', 'manage_options', DEMONONCEPAGESLUG, 'demo_nonce_adminpage');     }     // admin page     function demo_nonce_adminpage() {         $options = get_option(DEMONONCE);              print_r($_POST); // for debugging         echo '
';              if(isset($_POST[DEMONONCE]['submitted']) && !wp_verify_nonce($_POST['name_of_nonce_field'], 'name_of_my_action')){             return;         }              if(isset($_POST[DEMONONCE]['submitted']) && $_POST[DEMONONCE]['submitted'] == 1){             if (strlen(trim($_POST[DEMONONCE]['option_a'])) == 0) {                 $options['invalid'] = True;                      echo '

Options are not saved.

';             } else {                     $options = array_merge($options, $_POST[DEMONONCE]); // it seems the tab caption is erased here                 update_option(DEMONONCE, $options);                 echo '

Updates are saved.

';             }         }            ?>
             <?php // heading              screen_icon(); ?>
Demo Plugin for Nonces without Settings API

Page 1
             <form method="post" action="">  <?php // 'action=""' means to send the form post data to this page itself. ?>                 <?php wp_nonce_field('name_of_my_action', 'name_of_nonce_field'); ?>                 <input type="hidden" name="<?php echo DEMONONCE; ?>[submitted]" value="1" />

                         Option A	                                                      <input name="<?php echo DEMONONCE; ?>[option_a]" size="40" type="text" value="<?php echo $options['invalid']  ? $_POST[DEMONONCE]['option_a'] : $options['option_a']; ?>" />                             <?php echo ($options['invalid'] && $options['invalid'] ) ? '* cannot be blank.' :'' ?>

                         Option B	                                                      <input name="<?php echo DEMONONCE; ?>[option_b]" size="40" type="text" value="<?php echo $options['invalid'] ? $_POST[DEMONONCE]['option_b'] : $options['option_b']; ?>" />

                 <?php submit_button(); ?>                </form>
          <?php     }     ?>      I placed `if(isset($_POST[DEMONONCE]['submitted']) && !wp_verify_nonce($_POST['name_of_nonce_field'], 'name_of_my_action')){ return; }` before displaying the form and placed `<?php wp_nonce_field('name_of_my_action', 'name_of_nonce_field'); ?>` in the form tag. I'm still not sure if this is all okey. What strings should I put for 'name_of_nonce_field' and 'name_of_my_action' ? Could they be whatever I name? And what else should I do besides nonces for creating a more secure administration page?


title: Detect featured image among the attached images

text: I use the following code to extract the attached images from a post with ID:               $args            =   array(         'post_type'      => 'attachment',         'post_parent'    => $product_id,         'post_mime_type' => 'image',         'orderby'        => 'menu_order',         'order'          => 'ASC',         'numberposts'    => -1     );          $attachments     =   get_posts($args);      The problem is that the above code return all the attached files. Is there a way to remove from the results the featured image ? I don't mind if I will do it through the $args query, by some if statement or by filtering the $attachments array. Kind regards Merianos Nikos


title: Cannot post comments if I don't post a website?

text: I have a severe problem with my comment template. For some reason comments won't show up unless somebody also clicks on the website field. It's not necessary to actually post a website, but you have to click on the field, otherwise the comment just won't show up. Here's my website so you can try yourself. Here's my comment.php: http://pastebin.com/pgpQ2Cx3 And here my comment- template.php (which I haven't changed but maybe a plugin did): http://pastebin.com/5zaubXWm Any ideas? :( I already tried various things modifying my comment.php, but nothing worked. Thanks a lot in advance.


title: Add metabox with media uploader in a custom post type

text: I need to create a "media uploader metabox" and add it to my custom post type. I've already create normal metaboxes, the function to add to the custom post type and the function to save them, I only need to use the wordpress' media uploader but I can't figured out how to do that. After that I would insert something like "Add more image" that add more metaboxes into the page.   Something like that: ![enter image description here](http://i.stack.imgur.com/PFe5P.jpg)


title: Scheduling a task using class methods

text: I need to implement a scheduled task in my plugin, and I tried to follow the examples in the documentation, passing one of class methods as the target. I installed Cron Manager plugin, and I see that my hook has been scheduled, but the first schedule is a few seconds in the past. I guess that's because WP sets the very first schedule to "now", which, supposedly, should call the hook straight away. The issue is that the method I attached to the hook is not called, and Cron Manager displays " _seconds left: -X_ " (where X is the amount of seconds passed from the moment I scheduled the task). I will skip the `wp_schedule` stuff as I know that it works (the hook is in the scheduled list, although with a timestamp in the past), so here's the relevant code:               // Cron hook is called myclass_cron     class MyClass {         public function __construct() {             add_action('init', array($this, 'wordpress_loaded'));         }              public function wordpress_loaded() {             add_action('myclass_cron', array($this, 'cron_tasks'));         }              public function cron_tasks() {             // Cron stuff. I tried adding a "sleep()" command to see if page load was slower, but it clearly doesn't go through this method         }     }      If I add a `do_action('myclass_cron')`, `cron_tasks()` runs as expected. I was wondering if I was calling `add_action()` too late (i.e. when WP is loaded), but I tried to move it to the Class Constructor, and the issue persisted. Thanks in advance for the answers.


title: how to open page, defined in plugin, from dashboad widget

text: I have a plugin that adds a number of admin pages, and drives two page templates for the public facing documents. It also loads one dashboard widget for "subscribers". In this widget is a list of links to a summary pages. The summary page is located in the plugin directory tree, and has the same ownership and privileges as all other php files. The links appear and I can click on them, but get the "you do not have permissions to access this page" notice. In the plugin functions, I have declared this function:               function pgc_certificate_display() {         include('pg-certificate-display.php');     }      In plugin initialization I declare the page slug:               add_users_page('edit.php?post_type=page', 'Certificates', 'Certificates', 'read', 'certificate-display', 'pgc_certificate_display');      In the code that manufactures the list of summary pages is in the dashboard widget php, where the URL is constructed as follows:               $_SERVER['SCRIPT_NAME'] . '?page=certificate-display&cert_number=' . $cert['cert_number']      I have error display enabled and none are being raised. What are the incorrect bits in this?


title: How to export/import theme customizer settings?

text: I am wondering if it is possible to export theme customizer settings(theme_mods) to be imported into another install of the same theme. I know that the settings are saved into the database so I am wondering if there is a plugin or tool to create a XML file for import like many themes have for settings.


title: Complex WP_Query Using Post Date And Post Meta

text: I am using Wordpress as a CMS on a website which has standard posts, a custom advert post type and a custom event post type. The event post type has some custom meta which stores the event start date. I am attempting to make a feed of all three post types on the home page (i.e. index.php). The standard posts and advert posts need to be ordered by their post date, but the events need to be ordered by their start date and slotted into the feed in the correct position. Is it possible to run a query which selects all three post types and two of the post types by post date and one post type by a meta value? I'm currently using this query to bring in the standard posts and advert posts:               if (is_home() && $query->is_main_query())         $query->set( 'post_type', array('post', 'ecs_adverts'));


title: Change category block name/title in add/edit post screen

text: `Category` taxonomy is a default taxonomy comes with wordpress on `post` type. I want to change the name of this taxonomy to something else. How can I achieve that?


title: Show a Category Specific Info Box

text: I have a number of categories which are regions of the country (north, south, etc). I would like to display some kind of info box at the end of each post which falls into one of these categories with an icons and links specific to that category, such as MAPS, HISTORY. Each region category would have the same link names and icons, but each would direct to a different URL relevant to that category. For instance NORTH Maps - maps.com/north History - history.com/north SOUTH Maps - maps.com/south History - history.com/south Thought about creating a widget area, but it could become messy. Any better ideas?!?


title: wordpress problem

text: After wordpress installation, i try to access and make current config. but it shows:               <?php     /**      * Front to the WordPress application. This file doesn't do anything, but loads      * wp-blog-header.php which does and tells WordPress to load the theme.      *      * @package WordPress      */          /**      * Tells WordPress to load the WordPress theme and output it.      *      * @var bool      */     define('WP_USE_THEMES', true);          /** Loads the WordPress Environment and Template */     require('./wp-blog-header.php');     ?>


title: Adding a wp_head hook from an included PHP file

text: I am using a WordPress plugin for including PHP code within posts and pages, and it's working great - however, I need to insert some styles and scripts, and in order to do that, I need to add a hook to wp_head. I tried it, creating a function and using `add_action('wp_head','my_func');` but it didn't work - my stuff is not being included. I think its because wp_head is being called before my script it being included. I would like to do this without changing any of my themes files. Is there any way to do this? I am using the latest WordPress version.


title: basic shortcode - Why 1st paragraph not wrapped in p tag, but 2nd is

text:
I'm working on a basic plugin that adds shortcodes for columns, buttons, panels, ect. Nothing new here. I haven't altered wpautop in anyway; I've tried removing it and delaying it - no change. What happens with all shortcodes used is, the first paragraph isn't wrapped within a p tag (the p tags are actually appearing directly after the first paragraph and empty), but all paragraphs after the first within the same shortcode ARE wrapped in p tags. I need to figure out WHY the first paragraph isn't being wrapped. Function:               function vc_shortcode_panel($atts, $content = null) {       extract( shortcode_atts( array(         'type' => ''       ), $atts) );      return '
' . do_shortcode( trim($content) ) . '
';      }     add_shortcode('panel', 'vc_shortcode_panel');      Shortcode:               [panel type=""]paragraph 1          paragraph 2[/panel]      Output looks like this:
       paragraph 1

paragraph 2

      I know if I add a line break between the [panel] and the first paragraph, it will then wrap that first paragraph in a p tag. But shouldn't shortcodes be able to be formatted correctly without requiring that line break? What am I doing wrong and can anyone tell me why this is happening?


title: Theme Options page not saving data correctly

text:
I am struggling to save the correct data in my themes options page. Here is my code in my functions.php file:               <?php      if ( get_option( 'everes_options' ) ) {          $everes_options = get_option( 'everes_options' ); }     else {         add_option( 'everes_options', array(             'everes_pdf' => '1',              'everes_showBlog' => '1'         ) );         $everes_options = get_option( 'everes_options' ); }     }          function everes_options(){         global $everes_options;         ?>

Resume Options
           <form action="edit.php?post_type=employment&page=resume_options" method="post">

                 Print as PDF?	                                    <select name="everes_pdf">                     <option value="1" <?php selected( '1', $everes_options['everes_pdf'] ); ?> >Yes</option>                     <option value="0" <?php selected( '0', $everes_options['everes_pdf'] ); ?> >No</option>                   </select>

                 Show blog	                                    <select name="everes_showBlog">                     <option value="1" <?php selected( '1', $everes_options['everes_showBlog'] ); ?> >Yes</option>                     <option value="0" <?php selected( '0', $everes_options['everes_showBlog'] ); ?> >No</option>                   </select>

                 <?php submit_button(); ?>

           </form>
     <?php } ?>      When I submit the data, it will save the data, but after a few clicks in the menu, or refreshed in the website, the data disappears. I can't see where the issue is, but I do believe that it would be glaringly obvious to someone here. Any help? Please?


title: Why in this archive page that call query_posts() function show only the last 10 posts?

text:
I am pretty new in WordPress theme development and I am finding 2 problem with this **posts archive page** : http://lnx.asper-eritrea.com/archivio/ The previous page have to show ALL the blog posts into an unordered list. The main problem is that are shown only the last 10 published posts. The other problem is related to the warning caused of an erroneus call to the **query_posts()** function. This is the PHP code that generate the posts loop:               <?     // get the term using the slug and the tag taxonomy     //$term = get_term_by( 'slug', 'featured', 'post_tag' );     // pass the term_id to tag__not_in     query_posts();     ?>               <?php     if (have_posts()) :         echo '
';         // Start the Loop.         while (have_posts()) : the_post();                  /*              * Include the post format-specific template for the content. If you want to              * use this in a child theme, then include a file called called content-___.php              * (where ___ is the post format) and that will be used instead.              */                  echo '
';             get_template_part('contentArchive', get_post_format());             echo '
';              endwhile;         echo '
';          else :         // If no content, include the "No posts found" template.         get_template_part('content', 'none');          endif;     ?>      So why the previuos loop show only the last 10 records? How can I fix it and show all the blog post? What can I do to fix the **query_posts()** call? I think that maybe the 2 problems are related togheter because maybe I have to use a paramether to say to show all blog posts.


title: Clicking on a new blog post shows the homepage

text: I'm a newbie to WP and have recently come upon an issue after installing the plugin WP Permastructure. When I click on new blog posts, the static homepage is displayed. However, clicking on posts created prior to installing the plugin do NOT take me to my homepage and instead display the correct content. I've tried uninstalling the plugin (to no avail). The blog page works fine in the 2010 theme, however (I'm using a custom theme). Any and all suggestions are appreciated, thanks for the time.


title: Get next and previous page of paginated post

text:
A lot of a site I'm creating for a client is going to be posts with different pages for posts like "Top 10 " etc. This means I need to paginate the posts to create different pages. The best way I've found to do this is by using `<!-- nextpage-->` in the content to separate the post up and create the pages. To navigate through the pages, I've tried to use `get_pagenum_link`. There is here my full code:               function postPagination() {         global $paged;         $paged = (get_query_var('page')) ? get_query_var('page') : 1;         $output .= "
";             $output .= "Previous Page";             $output .= "Next Page";         $output .= "
";         return $output;     }      I have two main problems:      1) The links are in the form `http://domain.dev/2014/03/03/post- title/2/page/2`, which returns 404. Also, if I press the Next Page link, it will return `/post-title/2/page/3`, i.e the /page/3 part is correct but it's still on page 2. If i go to `/post-title/page/3` or something, it will just redirect back to the first page. `/post-title/3/` works fine. I'm assuming this is something to do with permalinks.      2) The Previous Page code doesn't work at all, it just returns the Current page link, e.g if you're on page 2, the Previous Page link will return `/post- title/2/`. i.e it doesn't even have the `/page/2` bit on the end. Sorry if that's confusing, happy to answer any questions and re-explain if necessary. I should also mention that this code is a function which is in functions.php and will be called in content pages. Thanks for any help in fixing my two problems so the Previous/Next links work correctly:)


title: wp_enqueue_style for Plugin with multiple stylesheets

text: I'm making a navigation plugin which adds animations to your wordpress navigation. I read in Wordpress Codex that I would need to use wp_enqueue_style(). First, How do I use this code for multiple css files? in my main plugin file. Now according to this question, I would add stylesheets like this:               function add_my_stylesheet()      {         wp_enqueue_style( 'myCSS', plugins_url( '/css/myCSS.css', __FILE__ ) );     }          add_action('admin_print_styles', 'add_my_stylesheet');      Since my plugin requires multiple stylesheets to be added, which of the two codes should I use?               function add_my_stylesheet()      {         wp_enqueue_style( 'myCSS', plugins_url( '/css/myCSS.css', __FILE__ ) );     }          add_action('admin_print_styles', 'add_my_stylesheet');          function add_my_stylesheet1()      {         wp_enqueue_style( 'myCSS1', plugins_url( '/css/myCSS1.css', __FILE__ ) );     }          add_action('admin_print_styles', 'add_my_stylesheet1');      Or               function add_my_stylesheet1()      {         wp_enqueue_style( 'myCSS1', plugins_url( '/css/myCSS.css', __FILE__ ) );         wp_enqueue_style( 'myCSS1', plugins_url( '/css/myCSS1.css', __FILE__ ) );     }          add_action('admin_print_styles', 'add_my_stylesheet1');      Now I know where to add this code. But how do I call the stylesheet I want to use? Also, just to clear what my plug would do: The main plugin file would only load the stylesheet required. And the options page would allow the user to select which of the stylesheet to require. for example, in php format I would use the following:               <link href="nav-<?php echo $name; ?>.css">      The $name should be the one selected from the options page, but how do I call in the required stylesheet? I hope my question is clear enough.


title: standard post with extra parameter brings permalink problem

text: This problem concerns several rewrite rules, but i'll stick to one, for clarity. In my theme, i use a parameter "parentid" which gives me the page/post/custom post i've clicked on (the parent). **in content.php** instead of               <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?>      i put               <a href="<?php the_permalink(); ?>&parentid=30" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?>      In this example i arbitrarily set parentid=30, in my code,i would have a value retrieved by get_query_var('p') for instance. **in functions.php**               //I declare the custom query var     function add_query_vars($query_vars)     {         $query_vars[] = "parentid";          return $query_vars;     }     add_filter('query_vars', 'add_query_vars');      and **in header.php**               $parentid = get_query_var( 'parentid');      So in my case, i have links like               ?p=12&parentid=30      using permaling rewriting, how to add the custom parameter "parentid" ? I tried               function wp_insertMyRewriteRules($rules)     {         $newrules = array();         $newrules['([^/]+)/([^/]+)$'] = '?p=$matches[1]&parentid=$matches[2]';         return $newrules + $rules;     }     add_filter('rewrite_rules_array','wp_insertMyRewriteRules');      but "obviously" it doesn't work. With that rule, the url becomes               /wordpress/nom-de-l-article/&parentid=30/      instead of               /wordpress/nom-de-l-article/30/      In fact, in this case, the generic rewrite rule is applied my rule is ignored because using the plugin Monkeyman Rewrite Analyzer, my rule, first in the list, has the parameter "p" crossed with the comment : this query variable is not public and will not be saved My questions :   * what rule should i write, to take into account this custom parameter for a "standard" post (?p=xx&parentid=yy)    * Why parentid is not retrieved when the rewrite is active ? if i echo get_query_var( 'parentid'); without rewrite i get "30" but with rewrite, i get "&parentid=30" !


title: WP welcome email depending on user role

text: I'm looking for a way to customize the welcome email, ONLY for new users with a certain role. (I use the Gravity Form User Registration Add-On to allow visitors to vote, thereby registering as "Voter".) I've managed to customize the email for all new users:               function customize_activation_email_voter($message) {     return 'To confirm your vote, click on the following link: %s';     }     add_filter('wpmu_signup_user_notification_email', 'customize_activation_email_voter', 20, 2);      But not for only "Voters". One problem is that there is no regular user metadata stored in the WP database yet, because technically, the user is not yet a user - that happens only after activation (in my case, confirmation of the vote). Is there a way to get the user's role before the activation of their account?


title: Large image size stuck on old value, even for new images

text: I changed the 'Large' image size in Settings > Media > Image Sizes from the default to max-width 586px. That was wrong, so I changed it back to max-width 1024px. However, the smaller size seems to have stuck. When I upload new images now, the size option for Large is 586px wide, even if the image is larger than that (e.g. 1600 x 2133) Wordpress version is 3.7.1 I have some custom image sizes, which were working correctly before I changed the Large size, and now will not insert as any larger than 586px wide. Here's the relevant section in functions.php for the custom image sizes:               if ( function_exists( 'add_image_size' ) ) {          add_image_size( 'top-stories-home', 1014, 672, true );         add_image_size( 'full-width-desktop', 576, 9999 );         add_image_size( 'text-wrapping', 350, 9999 );     }     add_filter( 'image_size_names_choose', 'my_custom_sizes' );     function my_custom_sizes( $sizes ) {         return array_merge( $sizes, array(             'top-stories-home' => 'Home Top Stories',             'full-width-desktop' => 'Post Photo wCaption',             'text-wrapping' => 'For Wrapped Text'         ) );      }      Here is a screenshot of the Dashboard: ![Media Settings Image Sizes](http://i.stack.imgur.com/5XPxz.png) And here is a screenshot of the dialog you get when you click 'Add Media' inside a post: ![Attachment Details](http://i.stack.imgur.com/gOYsn.png)


title: How can i show pagenavi in my author.php?

text: With this query in author.php i show all posts from a specific author_id/name/slug. But the problem is when i set the minimum of posts to show in the page. I have tried with posts_per_page= but if i set for example 6(for show last 6 posts) and i put my pagenavi code at the end of the foreach, i can't see the pagenavi. And also another problem is that it count the six posts only for a specific blog_id and not for all blogs_id. This is my code:                        <?php        $original_blog_id = get_current_blog_id(); // prendi blog corrente        $bids = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); // inserisce l'ID nell'Array            foreach($bids as $bid):            switch_to_blog($bid); //switch             ?>                                     <?php                 $posts = get_posts('author='.$curauth->ID.'&posts_per_page=6');            foreach($posts as $post): setup_postdata($post);            ?>               <?php     endforeach ;          switch_to_blog( $original_blog_id ); //switched back to current blog     ?>                    </ul>                    <!-- End Loop -->     <?php wp_reset_query(); ?>         <?php if (function_exists ('wp_pagenavi')) {wp_pagenavi ();};?>                          <?php get_sidebar(); ?>          <?php get_footer(); ?>


title: WP Debug set to true but still wsod

text: I'm trying to do my first wordpress plugin, and I've added this on my wp- config.php               define('WP_DEBUG', true);          define('WP_DEBUG_LOG', true);          define('WP_DEBUG_DISPLAY', false);      but i still have white screen of the dead...


title: WordPress site front page fails to load in IE

text: _Disclaimer: I'm a front-end guy dabbling in back-end work._ I have WordPress serving up a company Intranet site on a CentOS VM in a multiple vhost setup (LAMP). It resides at `http://intranet.domain.com/` and is only accessible inside our network. The site has been working well in Chrome and Firefox, but for some reason, the front page fails to load in IE for a few users. They can get to other parts of the site (i.e. `http://intranet.domain.com/news/`) by appending the path to the URL... and those pages load just fine. Up until today, it's only affected a few other people in our company. Today, it's finally showing itself on my machine - so I can **finally debug it!** ## DNS Config at the moment DNS Config shot   1. Using Windows Server 2008 DNS.   2. Research led me to create a new Forward Lookup Zone called `intranet.domain.com`.   3. I was directed to create an unnamed A record that pointed to the the IP of the CentOS box. ## Apache vhost config Intranet vhost config shot ## Troubleshooting **IE 11, Win 7 x64.**   1. Open IE w/ `http://intranet.domain.com` set as homepage. Fails to resolve.   2. Refresh. Still nothing.   3. Append `/news/` to URL and the page loads without issue.   4. Click home link. Fails to resolve.   5. Pings to `intranet.domain.com` return from proper internal IP: 192.168.50.89.   6. Test in Chrome & Canary... `intranet.domain.com` **Loads w/o issue**.   7. Test in Firefox & Aurora... `intranet.domain.com` **Loads w/o issue**.   8. Test `http://capsule.domain.com` in IE (setup the same way intranet is in DNS)... loads w/o issue.   9. Notice that it redirects to `http://capsule/wp-admin/`...   10. Test `http://intranet/` in IE. Loads!   11. Close IE, open IE (`intranet.domain.com` still set as Home)... Fails.   12. Config IE to open `http://intranet/` and `http://intranet.domain.com/` in two tabs at startup.   13. Close IE, open IE ... FQDN tab fails. `http://intranet/` LOADS. ## What gives? Anyone encountered anything like this? * * * ### Update (3/5) Looks like opening the site in IE's **InPrivate** mode at the fqdn works. Then, closing IE and reopening it normal mode and all is well. Stumped as to why this is... but that _workaround_ has gotten the affected users into the site successfully.


title: Fixing plugin for wpdb::prepare

text: A previous developer created a plugin for a website I manage and everything seems to work okay, except I'm getting the error "Missing argument 2 for wpdb::prepare()". I understand that the arguments need to be added, but I'm not clear how to add them in to this specific code, or what arguments to add in this case. The code is below. Any pointers would be amazing. The error comes up after the fourth closing curly bracket, before "$judges =". It seems also like the query should now be $wpdb->prepare, but again, I'm not clear in this instance how to implement that into this code. UPDATE: Apologies, but I am a big bone-head. The code below is the real code from the plugin. I had looked at the wrong line of code previously.               $categories = $wpdb->get_results($wpdb->prepare(sprintf("SELECT c.categoryid as id, c.name, c.public, COUNT(jc.categoryid) as submissions FROM ".$wpdb->prefix."judge_category c LEFT JOIN ". $wpdb->prefix. "judge_submission_category jc ON jc.categoryid = c.categoryid %s GROUP BY c.categoryid %s",$_where, $_order)));      Based on the feedback already provided, I'll see if I can make it work now and I'll post the correct answer once I figure it out, unless anyone else spots it first.


title: Post curl function save twice using plugin hook function wordpress

text: when i save a data with my curl function using hook to save a data twice.               public function __construct() {                 add_action('init', array(&$this, 'init'));                 add_action('admin_init', array(&$this, 'admin_init'));                 add_action('admin_menu', array(&$this, 'add_page'));                 add_action('admin_notices', array(&$this,'socipilot_admin_notice') );                 add_action('admin_bar_menu', array(&$this, 'socipilot_adminbar_links' ), 1001 );                 add_action('add_meta_boxes', array(&$this, 'add_meta_box' ) );                 add_action('admin_enqueue_scripts', array(&$this,'socipilot_enqueue_scripts'));                       add_action('save_post', array(&$this, 'save'));                 //add_action('publish_post', array(&$this, 'save'));                 //add_action('edit_post', array(&$this, 'save'));                 //add_action('pre_post_update',array(&$this, 'save'));                      add_filter('plugin_action_links_'.SOCI_PILOT_PLUGIN_BASENAME, array(&$this,'ts_add_plugin_action_links'));                 // Listen for the activate event                 register_activation_hook(SOCI_PILOT_FILE, array(&$this, 'activate'));                 // Deactivation plugin                 register_deactivation_hook(SOCI_PILOT_FILE, array(&$this, 'deactivate'));             }                             public function save($post_id) {                    global $post;                                   // Autosave, do nothing                         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )                                  return;                         // AJAX? Not used here                         if ( defined( 'DOING_AJAX' ) && DOING_AJAX )                                  return;                         // Check user permissions                         if ('post' == $_POST['post_type']){                             if ( ! current_user_can( 'edit_post', $post_id ) )                             return;                         }                          // Return if it's a post revision                         if ( false !== wp_is_post_revision( $post_id ) )                                 return;                                   // Check if our nonce is set.                     if ( ! isset( $_POST['socipilot_inner_custom_box_nonce'] ) )                     return;                      $nonce = $_POST['socipilot_inner_custom_box_nonce'];                              // Verify that the nonce is valid.                 if ( ! wp_verify_nonce( $nonce, 'socipilot_inner_custom_box' ) )                     return;                             if(isset($_POST['soci-pilot'])):                             $all_sociuser_posts = $_POST['soci-pilot'];                             foreach ($all_sociuser_posts as $key=>$val){                                 $mydata[] = sanitize_text_field($key);                             }                                  if(!empty($mydata)):                                           $mydata1 = get_post_meta( $post->ID, '_socipilot_meta_value_key', true );                                      if(!empty($mydata1)):                                     $update_soci = array_unique(array_merge($mydata1,$mydata));                                     update_post_meta( $post_id, '_socipilot_meta_value_key', $update_soci);                                 else:                                     update_post_meta( $post_id, '_socipilot_meta_value_key', $mydata);                                 endif;                                      update_post_meta( $post_id, 'soci-pilot_account_type', $_POST['soci-pilot_account_type']);                                 update_post_meta( $post_id, 'soci-pilot_schedule_date', $_POST['soci-pilot_schedule_date']);                                      $options = get_option($this->option_name);                                       $data[].= implode(',',$mydata);                                  $data[].= get_permalink($post_id);                                  $data[].= $_POST['post_title'];                                  $data[].= wp_get_attachment_url(get_post_thumbnail_id($_POST['post_ID']));                                  if($_POST['post_excerpt']):                                     $len = strpos(substr(strip_tags($_POST['post_excerpt']),25,100),'.')+1;                                     $data[].= substr(strip_tags($_POST['post_excerpt']),0,25+$len);                                  else:                                     $len = strpos(substr(strip_tags($_POST['post_content']),25,100),'.')+1;                                     $data[].= substr(strip_tags($_POST['post_content']),0,25+$len);                                 endif;                                      $data[].= $_POST['soci-pilot_account_type'];                                      if($_POST['soci-pilot_post_is_auto']=='Y'){                                     $data[].= "";                                 }else{                                     $data[].= $_POST['soci-pilot_schedule_date'];                                 }                                      if(($options['public_key']!="")&&($options['private_key']!="")):                                     $res = actionTest($options['public_key'],$options['private_key']);                                      $error_id = $res['error'];                                 else:                                     $error_id = 1;                                 endif;                                      if($error_id==0 && isset($res)):                                     $res = actionPosttest($options['public_key'],$options['private_key'],$data);                                     if($res->error==1){                                          global $my_error;                                          echo $res->msg;                                     }                                 endif;                             else:                                 //add_post_meta($post_id, '_socipilot_meta_value_key', $mydata, true);                                 update_post_meta( $post_id, '_socipilot_meta_value_key', $mydata);                             endif;                       else:                                   $update_soci = get_post_meta( $post->ID, '_socipilot_meta_value_key', true );                             update_post_meta( $post_id, '_socipilot_meta_value_key', $update_soci);                       endif;                            return;                 }


title: get_query_var['s'] not working

text: When I use transposh plugin `get_query_var('s')` returns me blank. But I can get value of s by using $_GET['s']. So, my search functionality has been stopped. How can I resolve this issue?


title: adding a dashboard widget for multisite

text: I would like to add a dashboard widget for a WP multisite and need to include/require a php file from a directory in my root. I combined a couple of things together that I found on different websites and it works, but I don't know php very well so I'm just checking to see if there is a better way to write the php include part especially if it causes problems with security/performance.               function andym_dashboard_widget_1() {         wp_add_dashboard_widget(                      'andym_dashboard_app_widget',         // Widget slug.                      'Test Widget',                               // Title.                      'andym_dashboard_widget_1_function'   // Display function.         );     }     add_action( 'wp_dashboard_setup', 'andym_dashboard_widget_1' );     function andym_dashboard_widget_1_function() {      $path = $_SERVER['DOCUMENT_ROOT'];        $path .= "/myfolder/myfile.php";        include_once($path);     }      ` Thanks in advance


title: Limit top level menu items on wp_nav_menu

text: I've got a situation where I need to limit the top level menu items on a custom menu. The design only has room for 4 fixed width items, and I want to future proof it from displaying more. Looking at Is there a way to limit the number of top level items in a custom menu?, the answer referred to using `wp_nav_menu_items`. Unfortunately, looking through the wordpress.org forums and various blog posts, I can only examples that add items, and nothing that removes them. When I echo out `$items`, I only receive a list of each menu item in it's full html. I'm not good enough with regex to figure out how to set a limit to stop after 4 items (and am not sure if that's actually possible with regex anyway). I have also tried just using css to hide all remaining items through `overflow:hidden`, but that also hides the dropdowns, so that isn't an option either. Is there any way I can limit top level items through my custom `wp_nav_menu`?


title: How to list out post category name and description in page

text: I want to display this all categories and description in home page and for each category the division will be like this: Category name **Category Description** Link to particular Categories post. Help me that how to list out my categories name & in description how to add the tag in wordpress?


title: PHP Syntax getting PHP terms

text: I'm trying to figure out the php syntax here, so I can show only related products that are of the current taxonomy term. I would like the $args filter 'product_brand' to dynamically grab the current products term. So I need a method of getting the slug for the current product term. I've tried this but it's not working, and is returning more than one term. `$mjrelatedproducts = get_brands( $post->ID )->slug;`               $args = apply_filters('woocommerce_related_products_args', array(         'post_type'             => 'product',         'ignore_sticky_posts'   => 1,         'product_brand'         => $mjrelatedproducts,         'no_found_rows'         => 1,         'posts_per_page'        => $posts_per_page,         'orderby'               => $orderby,         'post__in'              => $related,         'post__not_in'          => array($product->id)     ) );


title: How to grab a specific page of content from paginated post?

text: In my case I've got to create articles where each article has a custom, unchanging "header" part far too rich for the title and the excerpt (it's to contain image, media etc), and then a few different pages of content. I've decided to do this using `<!--nextpage-->` to keep it lightweight and easy for whoever will create the pages - treat the first page as the unchanging header and attach page 2, 3, 4 under a fixed set of links - an custom menu generated in that category, replacing standard pagination "Page 1 2 3 4" links. In order to do that, I'll have to call `the_content()` twice; once for page 1, and once for whichever page is chosen through the dedicated menu. Except I have no clue how to make `the_content()` extract _n_ -th page, other than through appending / _n_ / to the URL. Is there some variable, function, plugin, modification to the code that lets me extract a specific page of paginated post?


title: Javascript not loading on certain page

text: My Javascript doesn't seem to get called on this page called news, this uses the default post custom type in wordpress. Every other page that uses's this javascript is a custom post type I've implemented, I've got an idea of what's causing it and thats the if conditional at the top, but I've tried removing !is_home and it still doesn't load the js on the page.               <?php if (!is_home() || !is_front_page()) { ?>         <script type="text/javascript">              jQuery(document).ready(function($){                 // Clone portfolio items to get a second collection for Quicksand plugin                 var $portfolioClone = $(".portfolio").clone();                 // Attempt to call Quicksand on every click event handler                 $(".filter a").click(function(e){                          $(".filter li").removeClass("current");                           // Get the class attribute value of the clicked link                     var $filterClass = $(this).parent().attr("class");                          if ( $filterClass == "all" ) {                         var $filteredPortfolio = $portfolioClone.find("li");                     } else {                         var $filteredPortfolio = $portfolioClone.find("li[data-type~=" + $filterClass + "]");                     }                          // Call quicksand                     $(".portfolio").quicksand( $filteredPortfolio, {                          duration: 800,                          easing: 'easeInOutQuad'                      }, function(){                              //Blur newly cloned portfolio items on mouse over and apply prettyPhoto                         /*                         $(".portfolio li").hover(function(){                             $(this).children('.title').addClass('hover');                             $(this).children('.desc').slideDown('slow');                         }, function() {                             $(this).children('.title').removeClass('hover');                             $(this).children('.desc').slideUp('slow');                         });                         */                     });                               $(this).parent().addClass("current");                          // Prevent the browser jump to the link anchor                     e.preventDefault();                 });             });         </script>


title: Redirect not logged in users if they are on a specific page

text: I've seen this question posted before but not exactly trying to achieve what I want. Basically what I want is: If user is not logged in AND is on -this page- OR -this page- OR -this page, redirect him to -this page- (which is a custom registration page) I'm tweaking this piece of code, but it's not working. I'll appreciate any type of guidance.               <?php     function redirect_non_logged_in(){       // if user is not logged and is on this pages       if( !is_user_logged_in() && is_page( array( 250, 253 ) ) {          //This redirects to the custom login page.         wp_redirect(site_url('/user-registration'));         exit();       }     }     add_filter('get_header','redirect_non_logged_in');     ?>


title: Creating complex URLs with Wordpress permalink structure

text: I'm trying to self-educate so I can have a more informed conversation for a WP site development spec I'm trying to create. Grateful for any answers to what I would like to accomplish. I want to create a way for visitors to my Wordpress site to fill out contact information, which includes personal information, and for that information to be automatically captured and placed on a unique and complex URL that can be accessed by a web browser but that is highly unlikely to be discovered. I am not sure how to do this using Wordpress' permalink structure and frankly don't understand enough about Wordpress and PHP to formulate a solution to my situation. Here's a example. Assume my new visitor is Fred Jones. Fred Jones visits mycoolnewwpsite.com and fills out a standard contact form with his name, email, favorite song, whatever. I would like Fred's information to be automatically placed into a separate page (possibly not a Wordpress page) and created under a very difficult-to-guess/hack URL. So I don't want a URL like www.mycoolwpsite.com/users/fredjones. I actually want something more like mycoolwpsite.com/z34,90)2#1lqpe~3. Basically a URL that would be next to impossible for someone to guess or even want to hack. But I do want the information to be available for quick access by a web browser if in fact I knew that specific URL. I'm trying to figure out whether I can use some sort of custom permalink structure in Wordpress or whether there is some better solution to this. The important thing is that I cannot use the standard log in for users that Wordpress has, but I also need to protect the data users are providing using a complex/randomly generated URL path. Many thanks for any light you can shed!


title: Showing current subcategory

text: I have problem.               <?php query_posts('category_name=events&posts_per_page=2&offset=1'); ?>     <?php while (have_posts()) : the_post(); ?>     <div>     <?php $children = get_categories('child_of=3');     foreach ($children as $child) {         $child = get_category($child);         echo $child->cat_name;     }; ?>     </div>     <?php endif; ?>     <?php endwhile; ?>      I would like to show the current subcategory name from any parent category. With this I only manage to output all the subcategory names from the specified parent... I didn't use `the_category()` because it outputs the subcat names wrapped in a list and I would like them to be without any markup.


title: Translating long texts with html formatting

text: I was wondering what is the best way to translate some longer texts with html formatting. There was a couple of solutions I came across, but did not know what would be the best one.   * Writing a couple of html files with language extension (e.g. maintext_en.html, maintext_de.html, ...) and import this files. _Pro_ : It's easy for me _Contra_ : Not so easy for translators   * Writing only one html file with some markers and parse the file. _Pro_ : A bit easier for translators, they have to edit only one file. _Contra_ : I need a parser   * Using l10n inside the code _Pro_ : The easiest way for translators _Contra_ : Uses a lot of memory when the plugin runs. And the risk of losing some formattings. What is the best and most efficient way to make long texts within a plugin translateable?


title: How can I resolve name collisions between custom taxonomies?

text: I am developing a site which uses custom taxonomies `writer` and `artiste`. I am using a custom taxonomy for writer because the site is a collection of old articles that I want to be searchable by author, and WordPress requires separate logins for each author, and only one person will be maintaining the site. Using my own custom taxonomy seemed the simplest thing to do. So I edited the theme and made a custom taxonomy for `writer` that allows the admin to specify writer and it shows up in the correct place. Some of the articles are about artists, and I want to search by artist as well, and so we have the `artiste` taxonomy (never mind the 'e'). Now, some artists are writers as well. So I want `http://root/writer/artist- name` to give me all articles which mention "Artist Name" as a writer, and `http://root/artiste/artist-name` which mention him as an artist. But WordPress says two tags in two different taxonomies cannot have the same permalinks, and tags the later one `http://root/artiste/artist-name-2` (depending on which one was tagged later). I had imagined that (from a database perspective) each tag in a custom taxonomy would be stored depending on the taxonomy itself (like a weak entity, with a foreign key for parent taxonomy), so such collisions (as a design decision) do not make sense to me. In the next step of development, I am going to make it so a specific `writer` or `artiste` query returns only that, but there be another superset query such as `http://root/person/artist-name` which returns both (i.e. all articles in which "Artist Name" is tagged as either writer or artist or anything else). Since the `-2` is assigned to the later tag, and there is no clear way to predict if `writer` or `artiste` will be tagged first, this is problematic and inefficient for me. So my question is, how can I change WordPress codebase (or database permissions) which will allow two separate custom taxonomies to have the same tag?


title: How to remove "Taxonomy name:" from wp_title

text: The wp_title-generated `<title>` in my custom taxonomy archive pages contains the singular taxonomy name with a colon. I can't figure out where this is coming from (or if it's default Wordpress behavior), and I'd like to remove it. For example, in the archive page for the term 'Vanilla' in a taxonomy called 'Flavors', the `<title>` is > Flavor: Vanilla | My Site Name What I would like the title to be is simply > Vanilla | My site name The code in header.php is this:               <title><?php wp_title('|', true, 'right'); ?></title>      There's only one function in functions.php that's hooked into wp_title, and it looks unrelated to the Taxonomy name. I can't figure out where this is coming from or how to remove it. How can I remove this? (The answer in How to remove parent taxonomy name from the title generated by wp_title()? is not generalizable to this, and I'm guessing there's a more direct way to do it.)


title: Auto Changing Text Case

text: So I'm using all static pages and I specify that in my WP settings. When I specify what the 'Front Page' should be it turns my link in to Title Case instead of all Capital Letters like I would prefer. I have set in all caps in the title of my page so I'm not sure why it is converting it or how to stop it from converting it. I'm using the default 'twenty eleven 1.2' theme not sure if it has something to do with that or not. Can somebody help me please? Here's a link to what I'm talking about. http://www.trileafweb.com/omni/


title: How to implement a customizable free OpenID authentication?

text: OpenID is a standard commonly used nowadays. I am trying to implement OpenID on my blog, but I have many difficulties. I tried OpenID plugin but it seems to be incompatible with Wordpress 3.0. I tried also Janrain plugin but the free version is too limited. I would like to integrate the login screen into my blog theme style. Do you have any suggestions how to proceed? Any other plugins? Or any PHP library that can be adapted to an easy integration with Wordpress?


title: Run Jquery Script after delete post in front end

text: I have a list of posts on a page on the front end. With each post I have created a delete button with get_delete_post_link. This works fine but I now need to execute some jQuery after the post is deleted. I can't figure out how to do this.   Could someone help me out? Thank you


title: Relative links for performance?

text: I have a blog out there, for the sake of this answer you may take a look at it: http://blog.alphasmanifesto.com/. I'm currently working my way through some performance optimizations. As you may see, the main HTML is currently at 8.5 KBs. Between category, permalinks, tags, navigation and some other link out there, there is a total of 190 references to the same base path: "http://blog.alphasmanifesto.com" (32 characters). I've made some small math and I think I would be able to cut around 5 KBs if I were to make most of these into relative links. Now, here's the question: I know that there are some unintended side effects with making every link a relative link in Wordpress, but still, I would like to make the best out of every possible byte. So, what approach would better improve the serving size of the HTML page while keeping these unintended side-effects to a minimum? In the case where you decide that relative links is the right way to go, please elaborate on what method you would use -- I've been looking around and there are may ways in which that can be done in Wordpress.


title: Permalink Problems

text:
From the WordPress support forums: > Hi, this is my website http://www.mp3ojax.com. I want to insert permalinks > on the images on main page > > This is the code:               <a href="<?php the_permalink() ?>     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>           > But I get urls like this:   >  http://mp3ojax.com/joseph-krikorian- > artarutyun-2008/%3C/a%3E%3C/div%3E%3Cdiv%20class= > > please can someone help me? **Edit:** > Here is the full page:               <?php get_header(); ?>
     <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
          <?php if (have_posts()) : ?>     <?php while (have_posts()) : the_post(); ?>

     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">     <?php the_title(); ?>
     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <a href="#" title="<?php _e('Author', 'kubrick'); ?>"><?php the_author() ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (current_user_can('edit_post', $post->ID)): ?><?php ob_start(); ?><?php edit_post_link(__('Edit', 'kubrick'), ''); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <a href="<?php the_permalink() ?>"><?php echo $metadataContent; ?>
          <?php endif; ?>
     <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>

     <?php ob_start(); ?>     <?php $icons = array(); ?>     <?php if (!is_page()): ?><?php ob_start(); ?><?php printf(__('Posted in %s', 'kubrick'), get_the_category_list(', ')); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><?php comments_popup_link(__('No Comments »', 'kubrick'), __('1 Comment »', 'kubrick'), __('% Comments »', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>     <?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
     <?php echo implode(' | ', $icons); ?>
     <?php endif; ?>     <?php $metadataContent = ob_get_clean(); ?>     <?php if (trim($metadataContent) != ''): ?>
     <?php echo $metadataContent; ?>
     <?php endif; ?>

          <?php endwhile; ?>          <?php     $prev_link = get_previous_posts_link(__('Newer Entries »', 'kubrick'));     $next_link = get_next_posts_link(__('« Older Entries', 'kubrick'));     ?>     <?php if ($prev_link || $next_link): ?>

      <?php if(function_exists('wp_page_numbers')) : wp_page_numbers(); endif; ?>

          <?php endif; ?>     <?php else : ?>
<?php _e('Not Found', 'kubrick'); ?>

<?php _e('Sorry, but you are looking for something that isn’t here.', 'kubrick'); ?>
     <?php if(function_exists('get_search_form')) get_search_form(); ?>     <?php endif; ?>
     <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>

          <?php get_footer(); ?>


title: Using Custom Templates for Custom Post Types for the Genesis Theme Framework?

text: _( **Moderator's note:** The original title was "How can I create create and use a custom template for custom post types in the Genesis theme framework?")_ I'm using the Genesis theme framework, with an almost completely 'stock' child theme. I have the WP Easy Post Types plugin installed, and have created one custom post type ("Members"). I have two custom fields created to use for the 'member' post type (phone number and address). I'm trying to figure out how to display the information from those fields in two places: `example.com/members` and `example.com/members/bob`. Genesis doesn't support the typical `single- posttype.php` file to create a template for the custom post type, but even if it did, that doesn't take care of `example.com/members`. Any suggestions on how to get the desired information to display?


title: Jetpack Infinite Scroll - Add more then 7 posts each time?

text: By default, everytime the infinite scroll loads some more posts, it loads 7 posts. Is there a way to load more posts than just 7 each time?


title: Allowing Loading/Downloading of .mp3

text:
The site I am working on gives new members the opportunity to download an original .mp3 (no licensing or copyright issue here), so on the confirmation email, I put a direct link to the file. However, when that link is clicked, the user is redirected to the 404 error page. The file is located at 'http://www.playpromedia.com/assets/artists/music/The_Armory_Hands_Up_D-Phi- E_Remix.mp3' and I checked via FTP and the file is definitely there. When I click that link in a webpage, the song plays and can be downloaded. But when the link is clicked in the email, 404!!! Here's my registration/confirmation code. Any help is appreciated.               <?php          // Exit if accessed directly     if ( !defined('ABSPATH')) exit;          /*     Template Name: Register Page     */          require_once(ABSPATH . WPINC . '/user.php');       global $wpdb, $user_ID;          get_header();     ?>                    <?php     if (!$user_ID) {        if(get_option('users_can_register')) {             if($_POST){                $role = $wpdb->escape($_REQUEST['role']);                $username = $wpdb->escape($_REQUEST['username']);                $password = $wpdb->escape($_REQUEST['passwrd']);                $email = $wpdb->escape($_REQUEST['email']);                $fname = $wpdb->escape($_REQUEST['fname']);                $fname = $wpdb->escape($_REQUEST['fname']);                $lname = $wpdb->escape($_REQUEST['lname']);                $zipcode = $wpdb->escape($_REQUEST['zipcode']);                $dob = $wpdb->escape($_REQUEST['DOB']);                $school_name = $wpdb->escape($_REQUEST['school_name']);                $band_name = $wpdb->escape($_REQUEST['band_name']);                $band_url = $wpdb->escape($_REQUEST['band_url']);                $url = $wpdb->escape($_REQUEST['band_url']);                     $new_id = wp_insert_user( array (                     'user_login' => $username,                     'user_pass' => $password,                     'user_email' => $email,                     'role' => $role,                     'first_name' => $fname,                     'last_name' => $lname,                     'user_url' => $url,                     'user_registered' => date('Y-m-d H:i:s')                ) ) ;                     if ( is_wp_error($new_id) ){                    echo "Username already exists. Please try another one.";                } else {                    update_user_meta($new_id, 'zip_code', $zipcode);                    update_user_meta($new_id, 'band_name', $band_name);                    update_user_meta($new_id, 'band_url', $band_url);                    update_user_meta($new_id, 'school_name', $school_name);                    update_user_meta($new_id, 'dob', $dob);                         $from = get_option('admin_email');                    $headers = 'From: '.$from . "\r\n";                    $subject = "Registration successful";                    $msg = "<title>Registration successful</title>
Thank you for signing up for a FREE account with our online community. As a member you will be able to connect to our network of artists and music enthusiasts while gaining access to exclusive content and networking opportunities. You will also gain firsthand experience in the music industry by participating in PlayPro Media industry events and projects.

As a member you will find new music in areas around you. Active members will have access to free shows, music, prizes and Album credits. V.I.P and private parties will be available along with travel aboard the PlayPro Media tour bus. Our community allows for communication among concert goers and bloggers across the nation to discuss upcoming concerts and events on our properties.

Start connecting with like-minded music lovers today!

Play On,
PlayPro Media

To redeem your free download from PlayPro Media, right-click the link below and choose \"Save Target as..\" on Windows or \"Download Linked File\" on Mac OS X.

DOWNLOAD SONG
";                         add_filter( 'wp_mail_content_type', 'set_html_content_type' );                    wp_mail( $email, $subject, $msg, $headers );                    remove_filter( 'wp_mail_content_type', 'set_html_content_type' );                    echo(  "
Thank you for signing up for a FREE account with our online community. As a member you will be able to connect to our network of artists and music enthusiasts while gaining access to exclusive content and networking opportunities. You will also gain firsthand experience in the music industry by participating in PlayPro Media industry events and projects.

Please check your email for further details and a link to your FREE DOWNLOAD. If you don't receive the email in a few minutes, please check your spam folder for the message.
" ); exit;                } // end if            } else { ?>
Connect With PlayPro Media

                       <form id="frmRegister" action="" method="post" autocomplete="off" style="width:60%; margin: 0 auto;">

                             PPM Role	                                                              <select name="role" id="ppmRole" style="width: 200px;">                                     <option value="member">Member</option>                                     <option value="streetteam">Street Team</option>                                     <option value="artist">Artist</option>                                 </select>

                             Username	                             <input type="text" id="username" name="username" class="text"  autocomplete="off" />
NO SPACES ALLOWED. If you want to enter multiple words, separate each with a hypen (i.e., plucking-guitarist) or just use your email as your username.

                             Password	                             <input type="password" id="passwrd" name="passwrd" class="text"  autocomplete="off" />

                             Confirm Password	                             <input type="password" id="passwrd2" name="passwrd2" class="text"  autocomplete="off" />

                             Email Address	                             <input type="text" id="email" name="email" class="text"  autocomplete="off" />

                             First Name	                             <input type="text" id="fname" name="fname" class="text"  autocomplete="off" />

                             Last Name	                             <input type="text" id="lname" name="lname" class="text"  autocomplete="off" />

                             Phone	                             <input type="text" id="phone" name="phone" class="text"  autocomplete="off" />
Please enter only numbers (i.e., 5551234567)

                             Zip Code	                             <input type="text" id="zipcode" name="zipcode" class="text"  autocomplete="off" />

                             Date of Birth	                             <input type="text" name="DOB" class="text"  autocomplete="off" />
Please enter as YYYY-MM-DD

                             Name of School	                             <input type="text" name="school_name" class="text"  autocomplete="off" />
Please enter None if you are not currently enrolled

                             Artist/Band Name	                             <input type="text" name="band_name" class="text"  autocomplete="off" />

                             Artist/Band URL	                             <input type="text" name="band_url" class="text"  autocomplete="off" />
Please include the entire address including http://

                             <input type="submit" id="submitbtn" name="submit" value="Register Now" />

                 </form>                                <?php                 } // end if $_POST             } else {                 echo "Registration is currently disabled. Please try again later.";             } // end if user_can_register     } else {        echo "Logged in";        //wp_redirect( home_url() ); exit;     } // end if               get_footer();          ?>


title: How to use my custom menus as seperate pages?

text: I want my site to have different pages, so basically, I want to make it that when you select a menu, it takes you to a different part of the site.. with different information that I have typed in.. how do I do this? Example - if you click the ´Contact Us´ menu, I want our contact details to appear, and then if you click on ´Pictures`, our pictures will appear etc.. Thanks! Much appreciated.


title: jquery masonry effect on archives page, group by month

text:
I have this archive page (using the Thesis theme, version 1.8.5): http://testblog.squeesome.com/columns/ I'm trying to make the structure look like the Tumblr archives. I got so far as applying the jQuery Masonry effect, the image hover effect and making the month headers appear, but I can't wrap my head around how to group it by month, like the Tumblr archive page does it. Here is the code I'm using in my custom_functions.php file:               // Archives page layout     function mason_script() {         wp_enqueue_script( 'jquery-masonry' );     }     add_action( 'wp_enqueue_scripts', 'mason_script' );     function custom_archive() {     if (is_page(181))  {     ?>
     <?php     $blogtime = date('Y');     $prev_limit_year = $blogtime - 1;     $prev_month = '';     $prev_year = '';     $args = array(              'posts_per_page' => 12,              'ignore_sticky_posts' => 1     );     $postsbymonth = new WP_Query($args);     while($postsbymonth->have_posts()) {         $postsbymonth->the_post();         if(get_the_time('F') != $prev_month || get_the_time('Y') != $prev_year && get_the_time('Y') == $prev_limit_year) {                        echo "
".get_the_time('F Y')."
\n\n";             }         ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
<img src="<?php bloginfo('template_directory'); ?>/custom/scripts/timthumb.php?src=<?php echo catch_that_image(); ?>&w=240&zc=1&a=t" alt="<?php the_title(); ?>" width="240" />

                     <?php // your other template tags ?>         <?php         $prev_month = get_the_time('F');         $prev_year = get_the_time('Y');     }             ?>
     <?php } }          remove_action('thesis_hook_custom_template', 'thesis_custom_template_sample');     add_action('thesis_hook_custom_template', 'custom_archive');      My grasp of PHP is rudimentary at best, but I'm very eager to learn :) If you could point me in the right direction it would be great!


title: Create a Blog Template Page

text:
I am trying to create a template that will display a list posts of a specific custom type. However, I am missing something fundamental. So far, here is what I have: ### functions.php               add_action( 'pre_get_posts', 'query_filter', 1);     function query_filter($query)     {         if (!$query->is_admin            OR              $query->is_main_query()     OR              is_page_template( 'page-events.php' ))         {             $query->query_vars['posts_per_page'] = 3;         }              return $query;     }      ### page-events.php               <?php     /*     Template Name: Events Page     */     ?>          <?php get_header(); ?>          <?php get_template_part('includes/breadcrumbs'); ?>     <?php get_template_part('includes/top_info'); ?>

             <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                     <?php the_content(); ?>
                             <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                                     <a href="<?php the_permalink(); ?>">                                         <?php the_title(); ?>
                             <?php endwhile; endif; ?>

             <?php endwhile; endif; ?>

          <?php get_footer(); ?>      As you can see, I still haven't attempted to filter for the custom post type, because currently what is happening is the 'the_content()' is being repeated over and over 100's of times (there should only be about 12 posts). In addition, the_title() doesn't appear anywhere on the page. What am I missing?   * William ## UPDATE After a few suggestions, here is my updated code: ### EventManager.php This is where my custom post type is created.               add_action('init', 'Initialize');     static function Initialize()     {     register_post_type(Event::POST_TYPE,         array(             'labels' => array(                 'name'                => 'Events',                 'singular_name'       => 'Event',                 'add_new'             => 'Add New',                 'add_new_item'        => 'Add New Event',                 'edit_item'           => 'Edit Event',                 'new_item'            => 'New Event',                 'view_item'           => 'View Event',                 'search_items'        => 'Search Event',                 'not_found'           => 'No Events Found',                 'not_found_in_trash'  => 'No events found in trash',                 'menu_name'           => 'Events',                 ),             'public'               => true,             'publicly_queryable'   => true,             'query_var'            => true,             'rewrite'              => false,             'show_ui'              => true,             'hierarchical'         => false,             'has_archive'          => true,             'menu_icon'            => JUPITER_PLUGIN . 'images/small-greyscale.png',             'supports' => array(                 'title',                 'editor',                 'author',                 'thumbnail',                 'excerpt',                 'comments',                 'revisions'                 ),             )     );          global $wp_rewrite;          $gallery_structure = '/' . Event::SLUG . '/%year%/id=%event_id%/%event%';     $wp_rewrite->add_rewrite_tag("%event%", '([^/]+)', "event=");     $wp_rewrite->add_rewrite_tag("%event_id%", '([0-9]+)', "event_id=");     $wp_rewrite->add_permastruct('event', $gallery_structure, false);          add_filter('post_type_link', 'gallery_permalink', 10, 3);     function gallery_permalink($permalink, $post_id, $leavename)     {         $post = get_post($post_id);              if ($post->post_type == Event::POST_TYPE)         {             $rewritecode = array(                 '%year%',                 '%event_id%'                 );                      $unixtime = strtotime($post->post_date);                      $date = explode(" ",date('Y m d H i s', $unixtime));                      $rewritereplace = array(                     $date[0],                     $post->ID                     );                      $permalink = str_replace($rewritecode, $rewritereplace, $permalink);                 return $permalink;         }         return $permalink;     }      ### archive-event.php               <?php     /*      * Template Name: Events Archive     */     ?>     <?php get_header(); ?>          <?php get_template_part('includes/breadcrumbs'); ?>     <?php get_template_part('includes/top_info'); ?>

         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                 <?php echo the_title(); ?>
         <?php endwhile; endif; ?>

     <?php get_footer(); ?>      This should be the page that is automatically loaded when I navigate to domain.com/event. However, that address currently says 'No Results Found'. If I don't include the custom rewrites when creating the custom post type, then this works as expected. Do I have to include some sort of additional rewrite to redirect the archive to this page?


title: Posts created in a Custom Post Type are lost if published without a title

text: I searched around and the URL below is all I could find on this problem. If I publish a custom post type's post without entering in a post title, it wipes the whole post's info and says "published". However, the post is nowhere to be seen. Looking into the database, I can see the post is created, but it's set to auto draft. The post_name value is empty Found this. Sounds like exactly what I'm experiencing http://www.wptavern.com/forum/plugins-hacks/1851-custom-post-type-posts- published-without-title-lost.html Any ideas on how to fix this? Or maybe someone can suggest a way of checking to see if a post title exists when the post it published, and display a error message to the user? **Update** Thanks to Manny's solution below, I managed to make a few modifications from WordPress prompt checklist before publish? and fix the publish button so it doesn't keep spinning when you close the alert box.               add_action('admin_head', 'post_title_check');     function post_title_check() { ?>          <script type="text/javascript">         jQuery(document).ready(function() {             jQuery('#post').submit(function() {                      if(jQuery('input[name="post_title"]').val() == '') {                     alert("Please input a title");                           jQuery('#ajax-loading').hide();                    jQuery('#publish').removeClass('button-primary-disabled');                    return false;                   }                  });          });     </script>


title: Cropped thumbnail still displaying as full image

text: Steps to reproduce... 1) Add to functions.php:               add_image_size( 'half-size', 200, 200, false );      2) Add to template file (inside loop):               <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >           <?php the_post_thumbnail ('half-size', array('class' => 'profile_image')); ?> </a>      3) Go to media library and add image to post gallery. Then crop image, click "thumbnail" radio button and click save underneath the image. 4) Click set as featured image then "save all changes" at the bottom of the gallery dialog window. Then update the post (may not be necessary). Do not insert into gallery. Click over to the actual post and see if it is showing the part of the image you cropped or the whole image. What am I doing wrong? Or does cropping inexplicably not work with Featured Image? Apparently, there is no ticket out for this issue.


title: Featured image metabox not showing up

text: I have a theme installed on WordPress Multisite 3.5.1 which has a one custom post. Now I wanted to have two more so I have created them. Everything is working besides one thing. The featured image metabox is not showing up. I have added it to custom post                  $args = array(             'labels' => $labels,             'public' => true,             'exclude_from_search' => false,             'publicly_queryable' => true,             'show_ui' => true,             'rewrite' => array( 'slug' => $md_cssitems_rewrite ),             'menu_icon' =>  get_template_directory_uri() . '/admin/assets/images/icon-porfolio-16x16.png' ,             'query_var' => true,             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => 8,             //features support in Pofolio post type               'supports' => array('title','editor','excerpt','thumbnail','page-attributes')           );       I also have read I might need to activate it using in my functions.php               add_theme_support( 'post-thumbnails',array('custom-post1','custom-post2') );      I also have checked in screen options and it is not hidden there. I am running out of ideas. What else might be wrong?


title: How can I bulk edit variations in woocommerce?

text: I’m setting up a store selling art prints that have multiple canvas/paper types, and ten different print sizes for 200 photos. All prices on all sizes with specified canvas-type are the same from image to image, but they have to be entered one at a time on the variations drop-down admin. That means thousands of entries if it has to be done for each variation on each product. And then if there’s a price increase, thousands of edits instead of just a few dozen. The “Bulk Editing” feature for variations changes all the prices of ALL the variations. (That is, if you "Bulk Edit" the price, all variations-- small, medium, large -- end up with the same price.) If you’re managing any real number of products with multiple variations and prices that need to be changed, this is a real shortcoming of woocommerce. Is there a way to batch edit variations for multiple products, or create a product template that would have the same variations for prices with different sizes?


title: Get all media files for current author

text: I'm trying to create a list on the frontend of my site of all media items that the current user has uploaded. It seems like the way to do this would be to loop through and compare the ID of the current author with the ID of the author of the media item and then only display the items when a match is found. But, I can't figure out how to get the author of the media item. Is there a function for this? Does someone have a better (easier) way to do this?


title: How to hide W3 Total Cache from non admins?

text: I would like to be able to hide W3 Total Cache from non admins. How can I go about doing so? The following code I tried implementing in my functions.php file does not work:               function hide_w3tc() {         if (!current_user_can('super_admin')) {             remove_submenu_page('admin.php?page=w3tc_dashboard');         }      }          add_action( 'admin_menu', 'hide_w3tc');


title: Hooks to run after a core upgrade?

text: Are there any hooks for running plugin code after a core upgrade? Specifically, I'm running into issues that a users wp-admin column choice in the 'Screen Options' are modified after an upgrade - I believe if they choose "auto". After doing an svn sw I lost my "publish" box from the post/pages page. This is causing some major issues in my wp-admin skin.


title: WooCommerce - PrettyPhoto appending URL with #prettyPhoto

text: For some reason the PrettyPhoto script that WooCommerce is now using is adding #prettyPhoto to the end of URL's once it's been opened in that page. See here for an example Also, when you close the lightbox down it takes 2 or 3 clicks of the back button to get back to where you were previously. Anyone have any idea why?


title: Use standard WordPress categories with a CPT

text: I've just converted all of my blog posts to a CPT because I needed them to be hierarchical. Problem is, I had categories assigned to all of the posts. How can I use the standard WordPress categories in my CPT? I've tried adding `'taxonomies' => array('category'),` to the `register_post_type` function, but that didn't work. And I tried `register_taxonomy_for_object_type( 'category', 'illustrations' )` and that didn't work either. Any suggestions? UPDATE: Thanks all for the replies but as mentioned above — I've tried both `'taxonomies' => array('category')` and `'taxonomies' => array('category'),` and neither have worked. Here's the whole register_post_type function — with the 'taxonomies' parameter:               /* Register the 'Illustrations' post type */          register_post_type(         'illustrations',         array(             'label' => 'illustrations',             'description' => '',             'public' => true,             'menu_icon' => get_bloginfo( 'template_directory' ) . '/images/help-icon.png',             'show_ui' => true,             'show_in_menu' => true,             'capability_type' => 'post',             'taxonomies' => array( 'category' ),             'has_archive' => true,             'hierarchical' => true,             'rewrite' => array( 'slug' => '' ),             'query_var' => true,             'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail', 'page-attributes', 'revisions', 'comments','author' ),             'labels' => array (                 'name' => 'Illustrations',                 'singular_name' => 'Illustration',                 'menu_name' => 'Illustrations',                 'add_new' => 'Add Illustration',                 'add_new_item' => 'Add new Illustration',                 'edit' => 'Edit',                 'edit_item' => 'Edit illustration',                 'new_item' => 'New illustration',                 'view' => 'View illustration',                 'view_item' => 'View illustration',                 'search_items' => 'Search illustrations',                 'not_found' => 'No Illustrations Found',                 'not_found_in_trash' => 'No Illustrations Found in Trash',                 'parent' => 'Parent Illustration',                 ), ) );          register_taxonomy_for_object_type( 'category', 'illustrations' );


title: How to show only 1 post from a specific category on the front-page

text:
On my front-page i have a 3 col block section below the fold. The final and third column is an excerpt of the most recent post from my art category blog, hopefully this is clear up until here in terms of explanation of setting the stage. This is how i'm approaching the solution: I created a php file called "content-art-blog" which i pull into my front-page file using this php code               <?php get_template_part( 'content', 'art-blog' ); ?>      On the actual content-art-blog.php file however i'm formulating my solution so far like this:

art blog
          <?php get_post( $id, $output, $filter ); ?>          <?php       $linkdata = array(       'link_name' => 'art',       'link_url' => 'http://domain.com/categories/art/'       );     ?>          Read more      NOTE: the actual A tag i just put in the local directory file path (since i'm developing on MAMP) but i realize this won't work once the site goes live. So the question is two fold: 1) How do i pull in 1 post excerpt for a specific category into this block section 2) How do i link to the post (or will this be pulled in with the excerpt meaning i don't have to actually include this A tag to begin with?) I went through the functions to get an idea of what actually is out there in terms of what i can actually do with these functions but i'm such a noob it will take time to digest what all these functions do and hence properly interpret how i can go about solving problems with them. In my case i'm not aware of what i don't know yet. Thanks hope that was understandable.


title: Custom Fields Value As Taxonomy

text: I creating a real estate platform where allow users to add their listing. The users are people who may not know how to using wp platform, so I make it as easy as possible for them to make a post. Thanks for the custom post type, I manage to create a post type that specifically for add listing. In this post type, there are many custom fields to store the necessary information like location, property type and etc... Since I make it simple to use, so I didn't use the categories to sort the posts. However, what I like to do is let the custom field values as the taxonomies. For example: **[States] <- this is custom field in select/radio type**   * [state 1] <- this is custom field value option for states   * [state 2] <- this is custom field value option for states   * [state 3] <- this is custom field value option for states   * [state 4] <- this is custom field value option for states   * [etc...] <- this is custom field value option for states So I want to sort the posts according to the value in State that user selected. My idea is to make each of the value [[state 1],[state 2],[state 3]...] to be the categories. When the user select the option, it will automatically become the categories of the post. Possible to do this?


title: Can I use wordpress comments system to build a user review system within my website?

text: I am creating a part of my site where a user can enter a comment (review) and rate my web application. When a user enters a comment and rates my site out of 5, their comment will be available to the entire site (after approval). I am not sure whether to go about this by making a database table for this and manually setting up user input fields into my custom DB table, or trying to use a wordpress plugin, or try and leverage the wordpress comment system in a mixture of both. Can anyone provide an idea of the best way to go about doing this?


title: Override user authentication with external credentials

text: I'm working on a site running WordPress along with a vBulletin forum. The user base is registered on vBulletin. I need to allow users to appear logged in on WordPress as well **for the sole purpose of posting comments** with their forum user. The user **must not be replicated on WordPress** , so every solution involving the creation of users in the WordPress database is not applicable. Users recognized in this way need not have any admin or publishing privileges, only the ability to comment so that their comment appears under their forum username. I had written a simple plugin which was working on an older version, but it's not working anymore with the most recent version of WordPress (3.3.2 at the moment). That solution relied on overriding the pluggable functions `wp_validate_auth_cookie` and `get_userdata`. What are the correct steps to take in order to implement this functionality?


title: Sort posts by most recently modified

text: Is there a way to list posts in the order in which they were modified? For example; A user posts 5 posts (#1 being the oldest and #5 being the newest), by default they would be listed with #5 being at the top, but say the user edited post #3 at a later date, is it possible to then list post #3 above #5 without manually changing the page attributes? This is a secondary query by the way, using get_posts


title: zip download plugin works well in localhost but not on live site

text: I need to offer a zip file download [to registered users] on every post, containing all the images attached to the post. The solution provided in this thread works well for the purpose, although it did not work in old version of PHP 5.2 due to a `namespace` syntax in the first line of the plugin code - `namespace GalleryZip;`. I tested the plugin offered in the thread on my localhost with wordpress 3.6.1 installed with this line of code in single.php `<?php echo do_shortcode('[gallery]'); ?>` which offers a nice zip-download link 'Get as Zip', so far so good. But, now when I installed the same plugin on my live site which also runs on latest wp 3.6.1 it displayed a link as expected but the **link does not prompt a zip-download** and when clicked just refreshes the page. Earlier the plugin also displayed an unexpected native gallery of the images attached to post which was promptly solved by @cybnat. ENVIRONMENT : My live site uses PHP 5.3.27 and localhost is a WAMP on windows 7 and uses PHP 5.3.1. I have tested in latest firefox, chrome and safari browsers, works as expected on localhost and not on live site. I changed the theme into default twenty-thirteen ( tried it inside and outside the loop ) and also disabled all the other plugins, no change in result. Firebug console displays `http://website.com/wp-admin/admin-ajax.php 200 OK` on clicking the link. In the view source of live site js is loaded as expected, here is the print.               <script type='text/javascript' src='http://website.com/wp-content/plugins/gallery-zip-master/js/gallery_zip.min.js?ver=3.6.1'></script>      **UPDATE** : Following an advice below I upgraded my localhost wp install to 3.6.1 and have ruled out the possibility of any issue due to a difference in wp versions. The plugin still works as expected and offers a zip download link on click while tested in local environment. The issue that remains is that on live server the link **does not** prompt a zip-download instead **just refreshes the page**. Although I am continuously testing and in every way I can, a little help or a hint would be greatly appreciated. **Title and content of the question are being adjusted in accordance to latest feedbacks and situation. If you may, kindly take a look at the plugin code at github and let me know if this could be solved or correct me if I am wrong anywhere. Also let me know if you feel that the question should be asked in some other forum.