title: XML Sitemap : broken XML file

text: I use WP SEO by Yoast to generate sitemaps and the sitemap generated for custom types has a short hexa string at the beginning that invalidate the whole XML file :               148e2     <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//cabouge.tv5monde.com/main-sitemap.xsl"?>     <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">      ~~You can see the live file here~~ (problem solved on the live file). The characters at the beginning of the files seams to be linked to the content, because they are different for another custom type. I use WPSEO v1.5.2.5, but the bug was present with version 1.4.6. It seams to be linked to my server configuration, because I cannot reproduce it on a testing server with the same Wordpress code installed on it. The production server runs PHP 5.3.8. I tried to disable all other plugins, but the issue is still present. Any idea about where I could find the issue ?


title: Custom User Roles Added When Plugin Network Activated and not on Individual Site

text: I wrote a quick plugin which creates a list of custom user roles and capabilities for each user role. The user roles are checked and added if not found upon plugin activation. When I network activate this plugin in WordPress Multisite, the roles appear fine when adding users to each site via the network administration. However, when going to an individual site within the network, the user roles aren't added. Is there something I'm missing?   * register_activation_hook();   * add_role(); Ideally, I would like this plugin to be activated network wide, but if it has to be activated on each individual site... I suppose I can settle for that. **Recap:**   * Hooked into plugin activation. Added user role.    * Plugin is activated network wide.   * Custom user roles are available via network admin, but not on individual site admin.


title: Remove "wp-" and .php from URLs in WP Multisite

text: I tried searching for the solution on here but couldn't find any answers. What I'm looking to do is remove "wp-" from all URLs in my Multisite setup.         Current URLs:               http://www.domain.com/wp-login.php     http://www.domain.com/wp-content/themes/name     http://www.domain.com/wp-admin     etc. etc.            Preferred URLs:               http://www.domain.com/**login**     http://www.domain.com/**content**/themes/name     http://www.domain.com/**admin**     etc. etc.            Any help?


title: server-moving causes funny issues in template

text: while moved from with a beta install of wp from a subfolder of mydomain to mydomain main folder i get funny things a. the template looks a bit buggy and when i want to login - with i subsequently get forwarded to a page with the hint that this site does not exist. question: why is this so? what causes the issues? what causes the forward? cf - look at the site http://www.literaturen.org \- which is the moved site. ps - wil lget leadet forward to a page with the following content:               Not Found The requested URL http://www.literaturen.org/ten/wp-admin/plugins.php was not found on this server       note - this "ten-folder" whas were the test page residet!


title: how to manage Session in Wordpress using custom login?

text: I am new to WordPress, i want to implement custom Login functionality using WordPress. I am using the following Code to create custom login, In wp.config file               if( !session_id() )     {        session_start();     }      In header.php i am using the following code:               <?php     ob_start();      and after fetching data to create session used the below code:                session_start();      $_SESSION['myKey'] = $row['ID'];       header("location: http://localhost/newwordpress/?page_id=2");      in function.php i have created logout function as below:               function example_logout() {          if (session_id() ) {         session_destroy();      }     }     add_action( 'wp_logout', 'example_logout' );      everything is working, when i refresh the page or move to any other page, session gets destroyed, please help me how can i maintain session using WordPress. I have asked the same question on stackoverflow then someone tell me to ask here.. so i am just copying my question here.... please help me.. **UPDATE :** I have tried the php_wordpress_and_session, but still i am not able to maintain session on the page.


title: Wordpress plugin for mail subscriptions

text: I'm working on a news site built with Wordpress, and I now want to add a page for subscriptions. This will be paid subscriptions for the **printed paper that people can get delivered to their home**. My question is: is there a Wordpress plugin already created for this (free or paid)? I wouldn't really want to re-invent the wheel. Maybe I could somehow use one of the many Wordpress shopping cart solutions? If not (which I suspect to be the case) how would I go about doing it on my own? I have no problem coding this up as a standalone application. I'm just not sure of how exactly to integrate it into the Wordpress admin area.


title: File input returns null in theme options array

text:
Trying to work out a rather complex array situation with a theme options page. While working with file upload I can't seem to get it to work. Any idea what I might be missing? Simplified example               add_action( 'admin_menu', 'rd_settings_menu' );     function rd_settings_menu() {         add_options_page( 'Settings', 'Settings', 'manage_options', 'rd-settings', 'rd_settings_page' );     }          function rd_settings_page() {         ?>

<?php _e( 'Settings', 'site' ); ?>
             <form enctype="multipart/form-data" action="options.php" method="POST">                 <?php settings_fields( 'rd-settings-group' ); ?>                 <?php do_settings_sections( 'rd-settings' ); ?>                 <?php submit_button(); ?>             </form>
         <?php     }          register_setting( 'rd-settings-group', 'rd_fashion_list', 'rd_sanitize_section' );          add_settings_field(         'rd_fashion_list',         __( 'Fashion Blogs', 'site' ),         'rd_fashion_list_callback_function',         'rd-settings',         'rd_blog_info_section'     );          function rd_fashion_list_callback_function() { ?>              <input type="file" name="rd_fashion_list[0][img]">          <?php }          function rd_sanitize_section( $input ) {         $input['0']['img'] = ( isset( $_FILES['rd_fashion_list']['0']['img'] ) ? section_image_upload( 'rd_fashion_list[0][img]', $input ) : 'nope' );         return $input;     }      This will just return "nope". A `var_dump($_FILES)` gives this:               Array(         [rd_blog_img] => Array(             [name] => [type] => [tmp_name] => [error] => 4[size] => 0         ) [rd_logo_img] => Array(             [name] => [type] => [tmp_name] => [error] => 4[size] => 0         ) [rd_fashion_list] => Array(             [name] => Array(                 [0] => Array(                     [img] => 1447272171.jpg                 )             ) [type] => Array(                 [0] => Array(                     [img] => image / jpeg                 )             ) [tmp_name] => Array(                 [0] => Array(                     [img] => / private / var /tmp / phplm0x7u                 )             ) [error] => Array(                 [0] => Array(                     [img] => 0                 )             ) [size] => Array(                 [0] => Array(                     [img] => 21033                 )             )         )     )


title: after renaming my wp-content folder, how do I upgrade my wordpress version?

text: I renamed my wp-content folder in an earlier version of WordPress. Now, I've upgraded my WordPress to the new version, but after the upgrad, I could not access the my active theme and plugin sub-folders of the wp-content anymore. What should I do? (I have forgotten how i did the customization - it is over 9 months now) I want to revert back to the default WordPress folders so I can upgrade to the new version of WordPress successfully.


title: how to invoke mail with additional parameters

text: My mailserver doesn't send me WordPress notifications. My hoster says that to have the php function `mail(,,,,)` working I need to set the fifth parameter (additional parameter) equal to `-f myaddress@mysite.ext`. How can I set up this for WordPress?


title: sortable columns on a custom post type won't work

text: I have picked through Scribu's post very carefully and cannot determine where the issue is. Here is the code:               // Register the column     function event_date_column_register( $columns ) {     $columns['event-date'] = __( 'Event Date', 'my-plugin' );          return $columns;     }     add_filter( 'manage_edit-event_columns', 'event_date_column_register' );          // Display the column content     function event_date_column_display( $column_name, $post_id ) {     if ( 'event-date' != $column_name )         return;          $event_date = get_post_meta($post_id, 'event-date', true);     if ( !$event_date )         $event_date = '<em>' . __( 'undefined', 'my-plugin' ) . '</em>';          echo $event_date;     }     add_action( 'manage_event_custom_column', 'event_date_column_display', 10, 2 );          // Register the column as sortable     function event_date_column_register_sortable( $columns ) {     $columns['event-date'] = 'event-date';          return $columns;     }     add_filter( 'manage_edit-event_sortable_columns', 'event_date_column_register_sortable' );               function event_date_column_orderby( $vars ) {     if ( isset( $vars['orderby'] ) && 'event-date' == $vars['orderby'] ) {         $vars = array_merge( $vars, array(             'meta_key' => 'event-date',             'orderby' => 'meta_value',             'order'     => 'asc'         ) );     }          return $vars;     }     add_filter( 'request', 'event_date_column_orderby' );      I have a custom post type for Event with a custom field: event-date dates are entered: 2011/06/21 Is this something stupid I have missed or this won't do what I want? It does put the heading up at the top of the admin events list but nothing shows in each line item.


title: Relationship between performance and database size

text: What's the relationship between performance and database size in WordPress? Does a bigger DB mean that my site will be slower? My DB size is currently 360mb. I also noticed that I have some tables left over from old plugins I have now deleted, do those empty or semi-empty tables influence performance?


title: What's a good tool for speed benchmarking?

text: I am doing some optimisation on my site and would like to take some readings on page load speed in order to determine what works and what not. Since my internet connection is unreliable I cannot just test on how long it takes to download the page to my laptop, but I need an external reliable source to test. Any good tools/websites that do this?


title: When to add_filter() to Custom Query

text: I have complicated query where I need to join multiple tables. I'm doing that via `add_filter('posts_join')` \- my question is, when and where do I add the filter so that it only applies to the custom query? My Custom Query               $test = new WP_Query(array('post_type' => 'artcpt', 'posts_per_page' => 10, 'tax_query' => array(array('taxonomy' => 'arttax', 'field' => 'id', 'terms' => array(20,41,16)))));      Should I physically add the filter above the query or after? Do I need to put it into a separate file (function.php) and attach it another way? Do I need to do something with `query_vars`?


title: Should $found_posts be returned as string in 'found_posts' filter hook?

text: In general a function that hooks into the `found_posts` filter looks like this:               add_filter( 'found_posts', 'adjust_offset_pagination', 10, 2 );     function adjust_offset_pagination( $found_posts, $query ) {         $offset = 10;              if ( $query->is_posts_page ) {                  return( $found_posts - $offset );              }     }      I noticed that when I did a `var_dump` of `$found_posts` like this in a template (that's accessible publicly):               <?php global $wp_query; var_dump( $wp_query->found_posts ); ?>      Without the function in place, the output (below) said `$found_posts` returns a string.               string(2) "19"      But with the function in place, `$found_posts` returned an integer.               int(9)      Since by default `$found_posts` returns a string, should it it be returned as a string in our functions too? I mean, should our function look like this instead?               add_filter( 'found_posts', 'adjust_offset_pagination', 10, 2 );     function adjust_offset_pagination( $found_posts, $query ) {         $offset = 10;              if ( $query->is_posts_page ) {                  $found_posts = $found_posts - $offset;             return "$found_posts";              }     }      **PS:** The function works either way though.


title: Plugin getting Cannot modify header information errors

text: I am trying to build my first plugin but am receiving the following error: > Warning: Cannot modify header information - headers already sent by (output > started at `/wp-admin/includes/template.php:1642`) in `/wp- > includes/pluggable.php` on line 876 But here's the thing: template.php isn't 1600 lines long and pluggable doesn't have any whitespace at that point. My plugin code is as follows:               <?php       /*      Plugin Name: Test      Plugin URI: http://www.Test.com     Description: Test     Author: Test     Version: 1.0      Author URI: http://www.Test.com     */            function Test_admin() {           include('admin.php');       }     function Test_admin_actions() {          $icon_url = "";         add_menu_page( "Test", "Test", "switch_themes", "Test", "Test_admin", $icon_url, 58 );     }     add_action('admin_menu', 'Test_admin_actions');     ?>      The admin.php file is currently empty. The plugin adds a Test menu option in the admin page just before the Appearance option. When you click on it, you should theoretically get a white page but instead, you get the error. So I'm pretty dumbfounded by this. I've disabled, deleted, and reinstalled my plugin to no avail. Any ideas?


title: How do I use CSS or PHP to customize Wordpress Form Manager Plugin Table?

text:
I'm using **Wordpress Form Manager Plugin** to design a table to display race winners for an athletic event.

     7	     124	     Person Two	     USA	     11.20	     11.03

      I would like to use the 3-letter country code together with some CSS and or PHP to dynamically display the country flag after the 3-letter code. For more info on the limitations and functions of the plugin: Form Manager's documentation Any Suggestions?


title: Combining CSS files into a single cached one

text: I'm creating a theme where i want it to have different widgets and plugins. Each plugin would ideally have it's own css file. However, this approach is not so good because i can end up having multiple files included in my header. Is there an approach where i can sort of cache all different css files in a single one upon the first user request and then just use that ?


title: Wordpress stripping html and script tags from some admin users on save

text:
When I add content to a page as the original admin user, I can past in the following code and it saves fine (old google search set up by another user):               <form action="http://www.google.com/cse" enctype="application/x-www-form-urlencoded" id="searchbox_001294947689528032268:0gmklvjoyzm" method="get">         <input name="cx" type="hidden" value="001294947689528032268:0gmklvjoyzm" />         <input name="q" size="40" type="text" /> <input name="sa" type="submit" value="Search" />         <input name="cof" type="hidden" value="FORID:0" />     </form>

      Unfortunately other users that I created on the same site, set as administrators can paste in the same code on a page, but as soon as they hit update, wordpress strips the above code and only inserts:               <form action="http://www.google.com/cse" enctype="application/x-www-form-urlencoded" method="get">     </form>

      Why is it stripping content from other users with the administrator role, but not the original admin user?


title: The effect of x() family of functions

text: So I know that _x() and it's wrappers allow a developer to specify the context of a translated string. I'm pretty clear on "how" to use this function as well as "why" it should be used. I am wondering how this function is helpful to people who perform translations. Poedit does not seem to treat it any differently. Does use of this function aid in translation? Is there a way for translators to somehow see the context during the translation process?


title: Action after saving/publishing a post

text: I want to create a small newsletter plugin, which can send mails out of the edit post page. I will add a metabox, and don't know how to create a button in this metabox which will start my function. Maybe it can be a checkbox which will be checked. But I don't know how to check it. I think its easy but I couldn't find the right example.


title: Bootstrap 3 - how to to highlight the parent background when hovering over the child menu

text: Hello Wordpress Guru's. I would be delighted for some assistance with a simple issue. I am using the wordpress-bootsrtap-master theme. I would like the parent of the menu item to remain highlighted when accessing the sub menu in the default navigation menu. The same way that the navigation works for the default 2014 theme. The function add_active_class makes the active page highlighted in the navigation menu, I would like to keep this behaviour, but when hovering (desktop) or clicking with tablet/phone I would like the parent of the drop down menu to have a highlighted background when accessing the child menu.                   // Add Twitter Bootstrap's standard 'active' class name to the active nav link item     add_filter('nav_menu_css_class', 'add_active_class', 10, 2 );          function add_active_class($classes, $item) {         if( $item->menu_item_parent == 0 && in_array('current-menu-item', $classes) ) {         $classes[] = "active";         }            return $classes;     }      I have got the menu to highlight the background on the navigation by changing the css property for the background from transparent to #000000, so the hovering over the parents in the menu changes the background. I would like it to stay in that state when I hover over the child menu items in the navigation. I would also like to extend the active class to the parent menu item of submenu pages in the navigation, so that subnav pages still show the chapter that they are part of. Any ideas would be most welcome. Many thanks in anticipation of your responses.


title: Thumbnails on next/previous links in custom post type single.php

text:
I've been successful in using the following code to display thumbnails for next & previous links for normal posts but this does not work at all for custom post types.
                     <?php $prevPost = get_previous_post(true);                     if($prevPost) {?>
                         <?php $prevthumbnail = get_the_post_thumbnail($prevPost->ID, 'tiny_thumb' );?>                         <?php previous_post_link('%link',"$prevthumbnail
%title
", TRUE); ?>
                          <?php } $nextPost = get_next_post(true);                     if($nextPost) { ?>
                         <?php $nextthumbnail = get_the_post_thumbnail($nextPost->ID, 'tiny_thumb' ); } ?>                         <?php next_post_link('%link',"$nextthumbnail
%title
", TRUE); ?>
                     <?php  ?>
      I'm guessing it must be a special query to look for my custom post type "portfolio" Any help would be greatly appreciated EDIT                                         <?php if( $prev_post = get_previous_post() ): ?>                         <?php echo $prev_post->ID ?>
                         <?php $prevthumbnail = get_the_post_thumbnail($prev_post->ID, 'tiny_thumb' );?>                         <?php previous_post_link('%link',"$prevthumbnail
%title
", TRUE); ?>
                     <?php endif; ?>                          <?php if( $next_post = get_next_post() ): ?>                         <?php echo $next_post->ID ?>
                             <?php $nextthumbnail = get_the_post_thumbnail($next_post->ID, 'tiny_thumb' );  ?>                             <?php next_post_link('%link',"$nextthumbnail
%title
", TRUE); ?>
                     <?php endif; ?>                            Other loop not working (I am getting thumbnails & links but no exclusion of current post or randomizing of order)               <?php                            $t_args = array (                            'tax_query' => array (                               array (                                 'orderby' => 'rand',                                 'post_type' => 'portfolio',                                 'taxonomy' => 'service',                                 'field' => 'slug',                                 'terms' => $service_type,                                 'post__not_in' => array($post->ID)                                    )                            )                         );                              $query = new WP_Query( $t_args );                              if( $query->have_posts() ) {                            while ( $query->have_posts() ) : $query->the_post();                                    // output your stuff                               echo '
';                               the_post_thumbnail();                               echo '
';                            endwhile;                            wp_reset_query();                         } ?>


title: Moving wp-admin to a different to a subdomain

text: I am trying to move just the wp-admin side of things to a different server, in order to not have admin traffic impact end-user activity. Any best practices for handling this. I've actually done this already, I just want to see if someone has a better way to do this.


title: How do I retrieve menu items from one level only?

text: The WordPress function wp_get_nav_menu_items returns my whole site's navigation nested and all. Now if i want to get the nav menu for one "level" of that nested navigation only, how do I do that?


title: Woocommerce product categories order

text: Is it possible to sort product categories? I have a category with a lot of subcategories. On the category page all the subcategories is listed. Right now I can only change the order by drag and drop in the admin panel. But that is very time consuming with a lot of categories. Any way to change the order without using drag and drop?


title: get_terms orderby name as numbers

text: I have a custom taxonomy filled with terms such as 'volume 1', 'volume 2', 'issue 1', 'issue 2', 'issue 10' and get_terms orderby name returns list as: issue 1, issue 10, issue 2 though I need it to be issue 1, issue 2, issue 10 I tried searching wp.stackexchange and using my google-fu to no avail. Any help would be greatly appreciated.


title: How to create a dashboard widget for one user

text: I will start by warning you that my programming skill is limited. I need to create a dashboard widget that will display in the WP dashboard for the users with the user_id=21. So far I have tried the following code, but it isn't working:               function my_catdb() {     echo 'View the Problem Problem Database.';     }     /**      * add Dashboard Widget via function wp_add_dashboard_widget()      */     function my_catdb_setup() {         wp_add_dashboard_widget( 'my_catdb', __( 'Cataloging Problem Database' ), 'my_catdb'         );     }     /**      * use hook, to integrate new widget      */     $user_id = get_current_user_id();     if ( is_user_logged_in() ) {       if ( $user_id = 21 ) {     add_action('wp_dashboard_setup', 'my_wp_dashboard_setup');     }      }      Any help is appreciated. Thanks


title: List categories with descriptions via plugin

text:
The code below creates a plugin that appends the contents of $content to "the_content" on the hompage. It works fine when I set $content to a static value. However, I'm trying to set it to draw out the site's active categories as a list. However, nothing happens when I set $content to wp_list_categories() Ultimately, I want to hack into the wp_list_categories function and display the thumbnail image that's been assigned to the category (still have to enable the code to do that as well). This is the first evolution of the plugin and I'm just attempting to get it to list the categories and descriptions before I build in the thumbnail support.               <?php     /*     Plugin Name: List Categories with Thumbnail Images     */          add_filter( 'the_content', 'cb_category_listing' );          function cb_category_listing( $content )     {         if ( is_home() ) {     //      $content .= '
Hello World!
';             $cat_args['title_li'] = '';             $myContent = wp_list_categories(apply_filters('widget_categories_args', $cat_args));              $content .= $myContent;         }         return $content;     }          add_action( 'init','cb_category_listing');


title: Fetching posts from wordpress function in ajax

text: I'm trying to fetch posts in ajax. Everything is working but It is showing only one post. Please check my code and tell me if something is wrong               function ag_get_posts() {         global $post;         $args = array(           'post_type' => 'post',           'posts_per_page' => 12,           'post_status' => 'publish',         );          query_posts( $args );               while ( have_posts() ) : the_post();      locate_template( 'post.php', TRUE, TRUE );      endwhile;          wp_reset_query();         exit;     }          add_action('wp_ajax_ag_get_posts', 'ag_get_posts');      **jQuery:**               var data = {         action: 'ag_get_posts',     };          jQuery.post(AjaxPath.ajaxurl, data, function(response) {     var result = $(response)         Content.html(result);     });


title: Only Showing Upcoming Events

text:
In the sidebar of this page: http://lifebridgecypress.org/our-people, I have a list of upcoming events using this code...
     <?php         $latestPosts = new WP_Query();         $latestPosts->query('cat=3&showposts=10');     ?>     <?php while ($latestPosts->have_posts()) : $latestPosts->the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?>
     <?php endwhile; ?>
      The only problem is that these events have already past... ha ha. I'd like to configure the code where it only shows upcoming events in the future, and then 24 hours after the event, it would disappear from this upcoming events list in the sidebar. **Does anyone know how to do this by modifying this code?**


title: Bug: Trying to open jQuery accordeon with category-ID

text: I created this little code here to open a category-list-accordeon when a specific post is opened. This is the code I made for it: http://pastebin.com/vskC7Hsi This works well. Every accordeon-tab has its category ID! And also the javascript generates the right category-ID out of the currently viewed post but the javascript doesnt work. It just dont want to open the tab. Can you help me to find a solution?


title: Active Directory (AD) group authentication to view wordpress posts?

text: I'm trying to set up a wordpress site using active directory authentication. One question that has come up is the ability to limit category/post/blog reading to specific AD groups. I've never seen this done and I haven't been able to find any plugins that seem to promise this functionality. It would seem that the best option is to just give a bunch of users a role with the read_private_posts capability, but I'm not sure this will do the trick.


title: Add image size if page template

text: I'm building a members website with WordPress Multisite. Is it possible to restrict how many images are being generated depending on the selected template? I have tried the following lines of code to generate certain images on the gallery template:               // Generate on all uploads     add_theme_support('post-thumbnails');     set_post_thumbnail_size( 1440, 350, true );      add_image_size( 'standard_box', 450, 215, true );     add_image_size( 'default_image', 691, 9999 );          // Generate on gallery template only     if ( is_page_template('page-gallery.php') ) {     add_image_size( 'gallery', 900, 9999 );     add_image_size( 'gallery_thumb', 450, 450, true );     }      This hasn't worked. I've done some research and can't seem to find anything on the subject. If you could point me in the right direction, I'd really appreciate it.


title: Limiting where feature images are used

text: I would like to switch to a magazine theme that uses featured images, but I would like to limit where they are used. For the post page, I want to use a different lead image or the feature image but in a larger size. I would like to used the smaller sized featured image (whose size does seem adjustable) on the home page, archive pages and the rotating slider at the top of the home page. Is that possible? Does it involve coding?


title: After plugin options changed hook

text: i am looking for a hook that fires after the options for my plugin have changed. I have an option named "interval", it basically registers a cron schedule. Now, id like the change to take effect, right after the option is changed. What hook can i hook in to for that? This is my settings page               add_action( 'admin_menu', 'apd_create_menu' );          function apd_create_menu() {              add_menu_page('APD Plugin Settings', 'APD Settings', 'administrator', __FILE__, 'apd_settings_page',plugins_url('/images/icon.png', __FILE__));         add_action( 'admin_init', 'register_apd_settings' );     }          function register_apd_settings() {         //register our settings         register_setting( 'apd-settings-group', 'directory' );         register_setting( 'apd-settings-group', 'interval_time' );         register_setting( 'apd-settings-group', 'interval_posts' );     }      **EDIT:**               add_filter( 'update_option_apd-settings-group', 'run_after_change', 10, 2 );          function run_after_change( $old_value, $new_value )     {         echo $new_value . '<br>';         echo $old_value;         die();     }      Does not seem to have any effect when added


title: How to load another page file of my custom plugin file

text:
I'm creating my own plugin for medical purpose. in the site front end using shortcode i created a login form. so after logged in the doctor can see list of patients with and edit link to each row. i did the same in wp-admin plugin backend functionality which is did using add_submenu. but i need to provide the same in front end also. **My Issue:** on clicking the edit link i have to load another form with filled conetent from db. but when i give header(location: ...) it shows **header already sent error**. Code is too long so i'm giving the structure of the code that working till now.               <?php if(isset($_POST['login'])|| isset($_POST['Save'])){        <form id="patientadd"...>        Form for adding new patients. this must be visible only after logged in        <input type="submit" id="Save" value="Add"/>        </form>
        Table Listing out the patients id,email,mobile,name         Edit     Delete
           }           else{ ?>php      <form id="loginform" ...>       Login form with username and password       <input type="submit" id="login" value="Login"/>       </form>      <?php } ?>      So these are all written in one file "patient_reg.php". When `edit` link is clicked another form with that patient's details must be displayed. i'm confused about how i should attain this. What i tried to solve this issue is: Onclicking the edit link i call a javascript function "showedit()" which do:               function showedit(){     document.patientadd.style.display="none";        }      But this gives me the login form.


title: Custom Forget Password page

text:
I am trying to create a custom Reset password page. I got this code from a tutorial:               <?php       /*      Template Name: Reset Page     */          get_header()     ?>
              <?php             global $wpdb;                  $error = '';             $success = '';                  // check if we're in reset form             if( isset( $_POST['action'] ) && 'reset' == $_POST['action'] )              {                 $email = $wpdb->escape(trim($_POST['email']));                      if( empty( $email ) ) {                     $error = 'Enter a username or e-mail address..';                 } else if( ! is_email( $email )) {                     $error = 'Invalid username or e-mail address.';                 } else if( ! email_exists( $email ) ) {                     $error = 'There is no user registered with that email address.';                 } else {                          $random_password = wp_generate_password( 12, false );                     $user = get_user_by( 'email', $email );                          $update_user = wp_update_user( array (                             'ID' => $user->ID,                              'user_pass' => $random_password                         )                     );                          // if  update user return true then lets send user an email containing the new password                     if( $update_user ) {                         $to = $email;                         $subject = 'Your new password';                         $sender = get_option('name');                              $message = 'Your new password is: '.$random_password;                              $headers[] = 'MIME-Version: 1.0' . "\r\n";                         $headers[] = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";                         $headers[] = "X-Mailer: PHP \r\n";                         $headers[] = 'From: '.$sender.' <'.$email.'>' . "\r\n";                              $mail = wp_mail( $to, $subject, $message, $headers );                         if( $mail )                             $success = 'Check your email address for you new password.';                          } else {                         $error = 'Oops something went wrong updaing your account.';                     }                      }                      if( ! empty( $error ) )                     echo '

ERROR: '. $error .'

';                      if( ! empty( $success ) )                     echo '

'. $success .'

';             }         ?>                       <form method="post">             <fieldset>
Please enter your username or email address. You will receive a link to create a new password via email.

Username or E-mail:                     <input type="text" name="user_login" id="user_login"  value="" />

                     <input type="hidden" name="action" value="reset" />                     <input type="submit" value="Get New Password" class="button" id="submit" />
             </fieldset>          </form>
          <?php get_footer() ?>      ## Log: Upon submitting my username or email address I am getting an Error and a warning:               => Error: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead.          -- Debug: Undefined index: email on line 41 of C:\xampp2\htdocs\nbmwp\wp-content\themes\mytheme\page-forgotpass.php      Any Help would be appreciated. Thanks. **Source:** http://www.sutanaryan.com/how-to-create-custom-reset-or-forget- password-in-wordpress/


title: How do I change/modify the_post_thumbnail(); html output?

text: I'm working on building out a custom theme and have been struggling with this one for a bit. I am trying to modify the HTML output of `the_post_thumbnail();` function. I need to do this because I am trying to support retina images on my site and would rather bake the functionality into my theme than load a plugin on the backend. By default, `the_post_thumbnail();` merely calls `get_the_post_thumbnail();` which I found here. My first thought was to plug into the **'post_thumbnail_html** ' filter, but I can't seem to get it working. So... This is how I'm calling my post thumbnails in the loop:               <?php the_post_thumbnail('custom-thumbnail-size', array('class' => 'unique-class-here', 'title' => 'unique-title-here')); ?>      This is the code I need output when I call `the_post_thumbnail();`...                     And the below code is what I currently have in my functions.php file:               <?php     function modify_post_thumbnail_html($html, $post_id, $post_thumbnail_id, $size, $attr) {         $src = wp_get_attachment_image_src(get_post_thumbnail_id(), $size);         $html = '';         return $html;     }     add_filter('post_thumbnail_html', 'modify_post_thumbnail_html', 99, 5);     ?>      A couple things to note. I am not sure how to pass in the appropriate metadata text in the 'data-alt' attribute. Also, I need to be able to pass the specific post_thumbnail size I need since I use custom post_thumbnail sizes throughout my theme. Lastly, you can see the attribute array needs to pass in classes in addition to the default 'retina' class as well as any other attributes in that array. Thanks in advance for any help. There's really not much online about this topic and I figured my question was different enough to warrant an additional post to this community. Please let me know if you have any thoughts, solutions and/or need any clarifications.


title: unable to join tables and display correct result

text:
I'm using multisite for a real estate agent association and I have a plugin that will get all listings within the network and post to main site as a post, plugin is working great; the plugin used to create the listings is not a multisite plugin so that plugin create its own table with the blog id prefix. When the multisite plugin calls for each listing, it only displays the thumb, title and metainfo, which is fine, but I want it to display certain details of the listing also, I create a bit of code to pull the required info, it works to a point where it pulls all the info from the table instead of just getting the result per post. can some one please help the code is below and you can see it in action at the following link. http://apit.gruposanoja.com/inmuebles/                // Switch to the blog      switch_to_blog($all_blogkeys[$field->guid]);      global $wpdb;      $prefix = $wpdb->prefix;//get current site table prefix      $table_listings = 'rex_listings'; // name to attach to prefix      tablename = $prefix.''.$table_listings; // combine prefix and name      $table_posts = 'posts'; // name to attach to prefix      $table = $prefix.''.$table_posts; // combine prefix and name      //start the query and echo results      $result = $wpdb->get_results("SELECT listing_id, price, bedrooms, baths, floor_space FROM $tablename, $table WHERE $tablename.listing_id = $table.id");      foreach($result as $row ){      echo "
 Lisitn ID:  $row->listing_id
 Price: $       $row->price
 Bedrooms: $row->bedrooms
 Baths: $row->baths
 Floor Space: $row->floor_space sqm

";      }


title: WordPress Visual Editor Filter for Visual View

text:
I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below:               add_filter('get_image_tag', 'add_image_frames', 10, 6);          function add_image_frames($html, $id, $alt, $title, $align, $size) {         $html = '

';              return $html;     }      This works fine if you are working in the "Text" mode but when I move to the "Visual" mode it displays the same HTML, is there a filter I can use to change the output of the visual mode to something that can be seen by the user during the creation of the page? Thanks


title: How can I run multiple unique WordPress sites off of one VPS

text: Is it possible to run multiple WordPress sites off of a single VPS? These sites would be completely separate as far as users and content, but I don't know if it's possible to have this for two different URLs. Looking at the Network documentation, it appears that is used for different sub-domains, but I want to be able to run **example.com** and **test.com** as two separate sites but hosted on the same server. Is this possible?


title: How to default/force the user's display_name to their nickname?

text: I'm creating a simple directory from the user accounts and want to simplify it as much as possible for the users. I changed the label on nickname to Lastname, Firstname so that the users can be alphabetized by the nickname field, but I want the display_name to default, or even force, to the nickname field. I haven't seen a plugin, so I'm looking for something I can add to the functions to do this. Any ideas?


title: Theme Options Doesn't Work On WP Multisite

text: I'm developing Wordpress themes and I'm having an issue with Theme Options on Wordpress Multisite (WPMS). My theme works like a charm on classic Wordpress (WP) installation but when I try to use it with WPMS it returns a blank page instead of a form with theme's settings. Here what I use to initiate the theme options page:               function setup_theme_admin_menus() {         add_theme_page( "Theme Options", "Theme Options", "read", "th_op", "th_op" );         function th_op() {             get_template_part("content", "options");         }     }     add_action("admin_menu", "setup_theme_admin_menus");      As I mentioned it works as expected on WP but it refuses to render options page on WPMS.      **Yes** I am aware of http://wpmututorials.com/known-issues/did-your-users- theme-options-and-widgets-page-disappear/ which is practically everywhere and in fact does not solve the problem in a lot of cases. As you can see I use the lowest capability ever which is **"read"**.      **Yes** I tried to use theme options as SuperAdmin, JustAdmin and any user type that is possible. Nothing helps. Please help!


title: What PNG Fix script do you recommend for IE6?

text: I saw this post on SO but the selected solution got a couple of really unflattering comments... I need to add a png fix script to my theme to handle issues with PNG support on IE6 predominantly. I have customers who say that IE6 is upwards of 1/3rd of their traffic if you can believe that. I know that Google is completely abandoning IE6 in Google apps, including Gmail this year, which will hopefully put the nail in the coffin, but until then... What's the best PNG fix for use with WP? Ideally, I want something that works but is very concise in code footprint.


title: Multiple Conditions for Child Page Title

text:
I've been trying to work with Conditional Tags and cannot wrap my head around this problem. PHP novice here. On sub-pages I need to display the parent page title as well as the page title. I have it working with this:
<?php echo get_the_title($post->post_parent);?>

<?php the_title(); ?>
      But the problem I have now is that on the parent pages the page title is displayed twice, as the parent page title and the page title. Instead, when on a parent page, I need the `h2` to display "Select a sub-page", if there are child pages...or display nothing, if there are no child pages. Something like this is what I'm thinking is possible:
<?php echo get_the_title($post->post_parent);?>

       <?php          if is_parent_page_without_children() {echo '';} ;         elseif is_parent_page_with_children() {echo 'select a sub-page';} ;         else the_title();       ?>


title: Pagination linking to first page

text: I have created a query which work correctly and displays the pagination correctly. However when clicking the links /products/category/application- range/page/2 the page will load and go back to /products/category/application- range/ rather than page 2, is there any reason why?               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $args = array(       'connected_type'      => 'product_to_category',       'connected_items'     => $post,       'posts_per_page'  => 10,       'paged'           => $paged,       'post_parent'     => 0,       'orderby'         => 'menu_order',       'order'           => 'ASC'     );          $products = query_posts($args);


title: template_redirect for single posts w/ custom fields

text: Is there any way I can use `is_single()` inside of my plugin's functions.php file? Currently, this is what my code looks like:               if(is_single()) :         function my_template() {             include(PLUGINDIR . '/supersqueeze/all.php');             exit;         }         add_action('template_redirect', 'my_template');     endif;      But for some reason, it is not working at all. If I remove `if(is_single())`, it works but is for all pages. And then once I get that working, I'll need to filter it once more to see if the post has a certain custom field value, lets say the name will be `Design` and the value will be `Custom`. Thanks in advance for anyone who can help me out.


title: wp_list_categories : how do I sort by ID when IDs are not sequential

text: Trying to display a category by an odd sequence and have the following:               <?php wp_list_categories('orderby=id&include=4,5,6,7,8,9,10,72,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41'); ?>      notice after ID #10 it jumps to ID #72. How can I code this better? Note: Names are not alphabetical and numbers are not sequential, so just need to display IDs #4 to #10, #72, #11 to #41 listed in that order. Respectfully, jw


title: Why could my comment_form variable not be working?

text:
I'm working on a custom theme that is based off of _Starkers html5 3.0_ and use that theme's comment system. I have followed custom_form tutorials by Otto, Soapbox Dave, forlogos, and Deluxe Blog Tips. All of my code seems to be functioning properly except that I cannot get any of the fields outside of comment_form_default_fields to display. This theme is setup as a child theme but there is no comment code in the parent yet. Can you help me find the issue? **Related functions.php code:**               //   Custom Callback - Comments     if ( ! function_exists( 'starkers_comment' ) ) :     /**      * Template for comments and pingbacks.      *      * @since Starkers HTML5 3.0      */     function starkers_comment( $comment, $args, $depth ) {         $GLOBALS['comment'] = $comment;         switch ( $comment->comment_type ) :             case '' :         ?>                   <article <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">                  <?php comment_author_link() ?> <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">              <?php echo time_ago(); ?> ... <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
                  <?php if ( $comment->comment_approved == '0' ) : _e( 'Your comment is awaiting moderation.', 'starkers' ); ?>
             <?php endif;                   comment_text(); ?>                   <?php                 break;             case 'pingback'  :             case 'trackback' :         ?>         <article <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
<?php _e( 'Pingback:', 'starkers' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'starkers'), ' ' ); ?>
         <?php                 break;         endswitch;     }     endif;          /**      * Closes comments and pingbacks with
 instead of
.      *      * @since Starkers HTML5 3.0      */     function starkers_comment_close() {         echo '
';     }          /**      * Adjusts the comment_form() input types for HTML5.      *      * @since Starkers HTML5 3.0      */     function starkers_fields($fields) {     $commenter = wp_get_current_commenter();     $req = get_option( 'require_name_email' );     $aria_req = ( $req ? " aria-required='true'" : '' );     $fields =  array(         'author' => '
' . __( 'Name' ) . ' ' . ( $req ? '*' : '' ) .             '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />
',         'email'  => '
' . __( 'Email' ) . ' ' . ( $req ? '*' : '' ) .             '<input id="email" name="email" type="email" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />
',         'url'    => '
' . __( 'Website' ) . '' .             '<input id="url" name="url" type="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />
',     );     return $fields;     }     add_filter('comment_form_default_fields','starkers_fields');          function my_fields($fields) {     $fields['new'] = '
red rover 1
';     return $fields;     }     add_filter('comment_form_top','my_fields');      **comments.php code:**               <?php if ( post_password_required() ) : ?>
<?php _e( 'This post is password protected. Enter the password to view any comments.', 'starkers' ); ?>
     <?php return; endif; ?>          <?php // You can start editing here -- including this comment! ?>          <?php if ( have_comments() ) : ?>

Activities

                   <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>                      <?php previous_comments_link( __( '← Older Comments', 'starkers' ) ); ?>             <?php next_comments_link( __( 'Newer Comments →', 'starkers' ) ); ?>                  <?php endif; // check for comment navigation              wp_list_comments( array( 'style' => 'div', 'callback' => 'starkers_comment', 'end-callback' => 'starkers_comment_close' ) );              if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>                      <?php previous_comments_link( __( '← Older Comments', 'starkers' ) ); ?>             <?php next_comments_link( __( 'Newer Comments →', 'starkers' ) ); ?>                       <?php endif; // check for comment navigation                else : // or, if we don't have comments:                 if ( ! comments_open() ) : ?>
<?php _e( 'Comments are closed.', 'starkers' ); ?>
         <?php endif; // end ! comments_open()                endif; // end have_comments()                ?>

          <?php comment_form(); ?>     Is there anybody out there?     <input type="hidden" name="my_user_id" value="<?php echo $myid; ?>" />


title: Exclude one specific slug from rewrite rule

text: I use the following rewrite rules to show a specific post of a custom post type in a category and all posts of a custom post type within a category:               add_filter('rewrite_rules_array', 'rewrite_rules');          function rewrite_rules($rules) {       $newRules  = array();       $newRules['locations/(.+)/(.+)/?$'] = 'index.php?category_name=$matches[1]&post_type=location&location=$matches[2]';       $newRules['locations/(.+)/?$']      = 'index.php?category_name=$matches[1]&post_type=location';       $newRules['locations/map/?$']       = 'index.php?p=138';      return array_merge($newRules, $rules);     }      The last rule in the array is supposed to point to a specific page with a map. This page is a child of the page called "locations" and has the permalink `locations/map/`. Unfortunately this does not work, a 404 appears. I also tried to change the order within the array, but it did not help. What of course works is to make page 138/"locations" a top level page, but this is not what I want.


title: Add new user and user bio at same time

text: Note this is not referring to any type of author bio _display_ but rather how it's entered via the Admin. As it stands now, the new user screen doesn't have any author bio field. It's only after you create the user and then go back and _edit_ them that you see the author bio and other meta data. Is there any way to add some user meta (like the bio) at the same time? Maybe there's a reason why this isn't already present on the add new user screen, but my situation is calling for a user role EDITOR to be able to add the user meta (bio) at the same time they are adding the user since editors do not have the permissions to then go back and edit. I've tried adding the capability of edit_users to editors, but that allows for too much a security risk.


title: Add newly created "genre" taxonomy to front end page

text: I have extremely limited web development knowledge so please be cool, and sorry if my questions are low level...I do not mean to be rude in any way... I am creating a website (http://slapmybeat.maxalien.com/) from the "I Love it" template containing most of the much needed functions already (http://themeforest.net/item/i-love-it-content-sharing-wordpress- theme/698475), however I still need to adapt it a minimum to my requirements. 1st, I need to add subcategories (music genres like House, Techno etc) to the main ones (post types like DJ Mixes or Trax). For this I have followed a thread of this site,Grouping categories by genre, but am getting stuck to list the categories by list:   * How do I use the function to get all categories "within" a genre? Do I add it to the same taxonomy-genre.php file along with the next code "to call it"? As well as the next code to "loop over this"? Once this is done:   * how do I add the "genre" subcategory to my "post-an-item" front page (as a drop down) so that users can add the genre after having selected the main category? Thank you for your help! David


title: How do I export WordPress galleries?

text: I am trying to export the WordPress galleries but can't seem to find any functions that do that. I want the data and attachments of the galleries in a WRX Format.


title: Switch site language to en_ZA

text: I've translated my site to English/South Africa - there's different translation for regular English - but I cannot figure out how to switch the site to `en_ZA`. I have multisite install, and the domain I need to switch the language for is domain.com/za. How to do this, any suggestions?


title: posts_per_page doesnt work

text:
Here is the my custom query ;                           <?php                     $Poz = new WP_Query(array(                         'posts_per_page' => 3,                         'orderby' => 'date',                         'order' => 'DESC',                         'no_found_rows' => true,                         'update_post_term_cache' => false,                         'update_post_meta_cache' => false,                     ));                 // The Query                 $the_query = new WP_Query( $Poz );                      // The Loop                 while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?> yazısını oku."><?php the_title(); ?>
                 <?php endwhile; wp_reset_postdata(); ?>      I start trying to minimize my queries. Found some articles about this. This method mean making just two queries. You can check it here also. The question is about posts_per_page arg. Why it doesnt work ? I think its about               'no_found_rows' => true,      this arg. That mean is no pagination for querie. But how we can limit post number ? or what we can use instead of posts per page in this query. Let talk about this. \-- Updated -- I Changed the querie method query_posts instead of new WP_Query;               <?php          # Cached Wordpress queries     # SE Disq : http://wordpress.stackexchange.com/questions/70424/posts-per-page-doesnt-work/70425              $Poz = array(         'posts_per_page' => 5,          'orderby' => 'date',          'order' => 'DESC',          'no_found_rows' => true,         'update_post_term_cache' => false,          'update_post_meta_cache' => false,          );              query_posts( $Poz ); while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?> yazısını oku."><?php the_title(); ?>
     <?php  endwhile;  wp_reset_query(); ?>


title: Short link to read complete post

text: I am just a newbie to the WordPress. I was just going through the demo sites and I found a website. Here you can see there are couple of posts in a home page and just below the every post there is a link.Here I want to know how all the posts are rendered in the home page and when someone clicks on the continue button how someone can read the complete post. So can some one kindly tell me that can be achieved. It may be a simple thing but as I am newbie to WordPress I really want to know how to do that. Thanks in advance.


title: Retrieving custom taxonomy in order, but excluding specific tax IDs

text: I have a function set up and working based off the discussion in this thread: Custom taxonomy, get_the_terms, listing in order of parent > child. My version includes term links and allows me to display the term information in single.php in a fashion that looks like a breadcrumb. However, I have a custom term set up that I never want displayed to users, as it's a hook used for the content editors so they can display posts at the top of specific loops in other areas of the site. Previously I've had an exclude get_the_term_list function working, but it was not displayed in order. How can I fix my function so that the terms are displayed in order, but X term is excluded from being showed. My current function (with exclude currently not working correctly) is as follows:               function terms_by_order( $terms, $taxonomy, $exclude = array() ) {          // check input     if ( empty( $terms ) || is_wp_error( $terms ) || ! is_array( $terms ) )         return;          // set id variables to 0 for easy check      $grandparent_id = $parent_id = $term_id = 0;          // get grandparent      foreach ( $terms as $term ) {          if ( $grandparent_id || $term->parent && !($exclude) )             continue;         $grandparent_id = $term->term_id;         $grandparent_slug    = $term->slug;         $grandparent_url = ''.$term->name.'';     }           // get parent     foreach ( $terms as $term ) {          if ( $parent_id || $grandparent_id != $term->parent && !($exclude) )              continue;         $parent_id = $term->term_id;         $parent_slug    = $term->slug;         $parent_url = ''.$term->name.'';     }          // get child     foreach ( $terms as $term ) {          if ( $parent_id || $parent_id != $term->parent && !($exclude) )              continue;         $term_id =  $term->term_id;         $term_slug = $term->slug;         $term_url = ''.$term->name.'';     }              echo "$grandparent_url / $parent_url / $term_url";     }      This is the tag I use on my single.php to call this into action               terms_by_order( get_the_terms( $post->ID, 'news_category' ),'news_category',array(3623) );      An example of how this is supposed to look when executing correctly is: _Music / Interview /_


title: Remove space when post title is blank

text:
I want my custom post type title leave no spaces when there is no title in the post. I tried to use following code but is removed h1 and other tag. Please help.               <?php if (the_title() != '') { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                   <?php } else { } ?>      ![enter image description here](http://i.stack.imgur.com/bXjMU.png)


title: Dropdown filter by custom field

text:
I have a problem: I need to add a filter associated to a Custom Field. I installed the plugin "Advanced Custom Fields" and I created a field type _"date picker"_ with key _"Fecha-de-Estreno"_ , until here everything ok. Now I want to add in my theme a new filter associated with this new field and do not know how I can do. I have a template called "dropdown-filter.php" with this code:               <?php     global $gp_settings;          // Dropdown Filter URLs     $page_url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];     $short_page_url = $_SERVER["REQUEST_URI"];     $cat_id = get_query_var('cat');     $category_url = get_category_link($cat_id);          if( is_search() ) {            $category_url = $category_url.'?s='.esc_html($s).'&';           } else {            $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));       $tax_name = get_taxonomy(get_query_var('taxonomy'));            if( $tax_name && ! $tax_name->hierarchical ) {              if( $tax_name->name == 'release_date' ) {           $cat_slug = $theme_review_tag_1_slug;         } elseif( $tax_name->name == 'genre' ) {           $cat_slug = $theme_review_tag_2_slug;                  } elseif( $tax_name->name == 'rating' ) {           $cat_slug = $theme_review_tag_3_slug;         } elseif( $tax_name->name == 'director' ) {           $cat_slug = $theme_review_tag_4_slug;         } elseif( $tax_name->name == 'producer' ) {           $cat_slug = $theme_review_tag_5_slug;         } elseif( $tax_name->name == 'screenwriter' ) {           $cat_slug = $theme_review_tag_6_slug;         } elseif( $tax_name->name == 'studio' ) {           $cat_slug = $theme_review_tag_7_slug;         } elseif( $tax_name->name == 'starring' ) {           $cat_slug = $theme_review_tag_8_slug;         } else {           $cat_slug = $tax_name->name;         }            } else {         if( get_option("permalink_structure") ) {           $cat_slug = $theme_review_cat_slug;         } else {           $cat_slug = "review_categories";         }       }           if( get_option("permalink_structure") ) {         $category_url = home_url() . '/'. $cat_slug . '/' . $term->slug . '/?';       } else {          $category_url = home_url() . '?' . $cat_slug . '=' . $term->slug . '&';        }          }          ?>

<?php _e('Sory By', 'gp_lang'); ?>:
       <form class="order-by-form">         <select>           <option value="<?php echo $category_url; ?>orderby=date"<?php if(preg_match('/orderby=date/', $page_url)) { ?> selected<?php } ?>><?php _e('Date', 'gp_lang'); ?></option>                   <option value="<?php echo $category_url; ?>orderby=title"<?php if(preg_match('/orderby=title/', $page_url)) { ?> selected<?php } ?>><?php _e('Title', 'gp_lang'); ?></option>                                        <?php if($gp_settings['orderby_site_rating'] == true) { ?><option value="<?php echo $category_url; ?>gdsr_sort=review&gdsr_multi=<?php echo $theme_site_multi_rating_id; ?>"<?php if(preg_match('/gdsr_sort=review/', $page_url)) { ?> selected<?php } ?>><?php _e('Site Rating', 'gp_lang'); ?></option><?php } ?>              <?php if($gp_settings['orderby_user_rating'] == true) { ?><option value="<?php echo $category_url; ?>gdsr_sort=rating&gdsr_multi=<?php echo $theme_user_multi_rating_id; ?>"<?php if(preg_match('/gdsr_sort=rating/', $page_url)) { ?> selected<?php } ?>><?php _e('User Rating', 'gp_lang'); ?></option><?php } ?>                                        </select>       </form>
<?php _e('Order', 'gp_lang'); ?>:
       <form class="order-form">         <select>           <option value="<?php if(preg_match('/orderby=/', $page_url) OR preg_match('/gdsr_sort=/', $page_url) OR !get_option("permalink_structure")) { ?><?php echo $short_page_url; ?>&order=desc&gdsr_order=desc<?php } else { ?><?php echo $short_page_url; ?>?order=desc<?php } ?>"<?php if(preg_match('/order=desc/', $page_url)) { ?> selected<?php } ?>><?php _e('Descending', 'gp_lang'); ?></option>                                     <option value="<?php if(preg_match('/orderby=/', $page_url) OR preg_match('/gdsr_sort=/', $page_url) OR !get_option("permalink_structure")) { ?><?php echo $short_page_url; ?>&order=asc&gdsr_order=asc<?php } else { ?><?php echo $short_page_url; ?>?order=asc<?php } ?>" <?php if(preg_match('/order=asc/', $page_url)) { ?> selected<?php } ?>><?php _e('Ascending', 'gp_lang'); ?></option>                       </select>       </form>
      The plugin (Advanced Custom Fields) support tells me I have to add **this** but not that I have to do.


title: bootstrap nav menu drop down is not working

text:
i'm trying to develop a responsive theme in wordpress with twitter Bootstrap v3.0.2. and in order to integrate bootstrap menu with my theme i use the below code in my function.php               class Bootstrap_Walker extends Walker_Nav_Menu     {          function start_lvl(&$output, $depth = 0, $args = array()) {       $output .= "\n
\n";      }                 function start_el(&$output, $item, $depth, $args) {        $item_html = '';        parent::start_el($item_html, $item, $depth, $args);                  if ( $item->is_dropdown && $depth === 0 ) {                 $item_html = str_replace( '<a', '<a class="dropdown-toggle " data-toggle="dropdown"', $item_html );            $item_html = str_replace( '', ' ', $item_html );        }             $output .= $item_html;     }          function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output) {         if ( $element->current )         $element->classes[] = 'active';             $element->is_dropdown = !empty( $children_elements[$element->ID] );       //$element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);        if ( $element->is_dropdown ) {             if ( $element->has_children) {                 $element->classes[] = 'open';             } else{                      $element->classes[] = 'dropdown';             }         }            return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);         }            }      **my problem:** this code creates an arrow near to the parent menu item. but when i clicked on that the drop down list is not displaying. **output code**
     Lorem Ipsum

test

      **I would really appreciate a solution to this problem..**


title: Automatic redirect on change of permalink not working if child page

text: When changing the name of a permalink on a per post basis wordpress will automatically redirect the old URL to the new URL, but **not** if the page is a child page. e.g: Changing > http://www.exmaple.com.au/example1/ too > http://www.exmaple.com.au/example2/ will result in a 301 redirect. However, changing > http://www.exmaple.com.au/example/example1/ too > http://www.exmaple.com.au/example/example2/ Will result in a 404 if clicking the old page. I've seen this issue on more than one site, is it a known issue in wordpress?


title: Pagination on Custom Loop

text:
I want to style the latest post differently than all the other posts in a category on a custom page. So far I have this code below which does exactly that:               <?php if (have_posts()) : ?>      <?php query_posts("cat=4&showposts=1"); ?>       <?php while (have_posts()) : the_post(); ?>          (Style1)<?php the_title(); ?>
            <?php endwhile; ?>      <?php query_posts("cat=4&showposts=4&offset=1"); // show 4 latests posts excluding the latest ?>       <?php while (have_posts()) : the_post(); ?>          (Style2)<?php the_title(); ?>
           <?php endwhile; ?>     <?php else: ?>     No Posts Found     <?php endif; ?>

<?php previous_posts_link('« Previous') ?>

<?php next_posts_link('Next »') ?>

      My question is, how would I then get the pagination to work correctly? Right now clicking Next/Previous loads a different page, but the posts stay the same. I would like to be able to click Previous or Next, and it only load the style2 posts. Style 1 post would only show when on the front page of the custom page


title: 403 forbidden issue in wordpress

text: i have corner advertisement plugin in my wordpress website, this plugin used to convert given image into swf file and display it in any one of corner with peel effect. this plugin only not working in my server, for that i got 403 forbidden issue. i have checked my file and folder permission also, it have 644 and 755 respectively. i need help for fix this issue. plugin url > http://wordpress.org/plugins/corner-ad/


title: Is it safe to hand over the admin rights?

text: I have a shared web hosting account where I have several different websites running on WordPress. I want to hand over the admin rights for one of my WordPress installs to someone and I am wondering how secure this is. Can this person having admin rights for one WordPress installation alter or do anything to harm any of the other WordPress installs on this shared hosting account? I want them to be able to download plugins etc and do anything they need to that particular WordPress install but I don't want them to be able to run any scripts etc that can mess with any of the other WordPress installs.


title: Update the value of a constant

text: I have a file containing all the constants used in the plugin. For example, I have a variable in one of my file `define('APPOINTMENTS_DEFAULT_ENABLE_PAYPAL', 1);` I have a checkbox in admin area where user can enable or disable the paypal feature. This is the checkbox code: `<input type="checkbox" name="enable_paypal" size="40" value=""/>` **Issue:** Can anybody please tell me how can I write code to modify the `define()` so that when checkbox is clicked then make the value to 1 and otherwise value should be 0?


How to hook a filter to catch get_post_meta when alternate a custom field output? I have fill a custom field(meta data) in a post, just like this:               <!--:de-->Nominale spanning<!--:--><!--:zh/cn-->额定电压<!--:--><!--:en-->Arrester Accessories<!--:-->      I need to get this output translated,so I wondering how to hook into "get_post_meta" before the meta data output. Here is what I've tried for a few days, but no luck.               function getqtlangcustomfieldvalue($metadata, $object_id, $meta_key, $single){         $fieldtitle="fields_titles";         if($meta_key==$fieldtitle&& isset($meta_key)){              //here is the catch, but no value has been passed         }     }     //Specify 4 arguments for this filter in the last parameter.     add_filter('get_post_metadata', 'getqtlangcustomfieldvalue', 10, 4);


title: Changing wordpress default language

text: I'm trying to change the wordpress default language from english to swedish. I uploaded the language directory to wp-content with the swedish .mo file. I've defined language in the config.php file but it won't update, when I'm logged in and under updates I can see an option that says restore core files with swedish, so I know its working, but when I update it is still is english. Also under settings --> general there is no language option. I have tried wp native dashboard but it crashed my website. Any help is much appreciated.


title: wp_query not returning my custom post

text: I am using these helper classes to create a custom post but wp_query does not return any instances. Checked the source and as far as I can see the public has been set to true. The query is the following:                 $numFetch=$multiple?100:1;       $args = array( 'posts_per_page' => $numFetch,           'search_post_title' => $data_source_name,           'post-type' => 'any',           'orderby' => 'title', 'order' => 'ASC'           );       $args['search_post_title'] = $multiple?         '.post_title LIKE \'' . esc_sql(like_escape($data_source_name)) . '%\'':         '.post_title = \'' . esc_sql(like_escape($data_source_name)) . '\'';       add_filter('posts_where', 'title_filter', 10, 2);       $loop = new WP_Query($args);       while ($loop->have_posts()) : $loop->the_post();         var_dump($post);       endwhile;      In funcitons.php I have               function title_filter($where, &$wp_query) {       global $wpdb;       if ($search_term = $wp_query->get('search_post_title')) {         $where .= ' AND ' . $wpdb->posts . $search_term;       }       return $where;     }      When I add a post with the same title it does show up. I will try to manually create a custom post and see if that shows up (leaving default public to true) but not sure if that is the problem. I'd like it to not show up in searches anyway unless I specify it but could not find a way to do this either (like `'exclude_from_search'=>true`) **[UPDATE]**               Added the following code in functions.php:     function codex_custom_init() {         $args = array(           'public' => true,           'label'  => 'Books'         );         register_post_type( 'book', $args );     }     add_action( 'init', 'codex_custom_init' );      Then added a Book with the title: "a book", then changed the query code to:               $args['search_post_title'] = '.post_title LIKE \'%a book%\'';      But no items are returned. If I add a post with the title "a book" then it does show up. Looks like 'post-type' => 'any' isn't doing what it's supposed to do.


title: wp-login.php not returning error messages / or gives 404

text: I have several WP sites that were logging in fine last week. Now today thay are all failing to login using the native wp-login.php. The strange thing is some of the sites have the "Woocommerce" plugin installed, using the plugin login form I can access the dashboard. But not using wp-login.php I have already tried:   * adding this to wp-config.php              /** wp-admin login fix */     define('ADMIN_COOKIE_PATH', '/');        * re-uploading all wp files apart from wp-content   * Changing file permissions of wp-login.php   * permalinks on and off   * removed .htaccess   * Disabled Plugins   * 100% fresh install of WP 3.6.1 on a new DB The thing that is confusing me is that I can still login using woocommerce on sites that have it. And the native login was working last week. Could this be a hosting issue? Any help / suggestions would be very much appreciated. Thanks in advance Joe


title: Wordpress thumbnail settings change

text: I have a very large Wordpress image bank (over 600 images, all in use...!) and a new development will mean that i would like to change some of the thumbnail settings. I have at the moment               set_post_thumbnail_size( 75, 75, true );      In the functions, which of course means that the thumbnail is cropped to fit. I would like to change this so that the thumbnail is scaled, rather than cropped               set_post_thumbnail_size( 75, 75);      But will this change the current images i have? If not, is there a way of doing this? Thanks!


title: Custom field when adding new site to multisite networked WordPress

text: I have a multisite setup in WordPress. Is there a way for me to implement a custom field when I create a new site in Admin > Sites > Add New. My current options are Site Address, Site Title, Admin Email. I'd like to add another field that I could fill in to be associated with these new sites.


title: Is there a WP function to get taxonomy name from taxonomy_term_id?

text: I need to get the taxonomy name from the taxonomy_term_id. I am currently using the following to get it:               global $wpdb;     $term_taxonomy_table = $wpdb->prefix . "term_taxonomy";     $taxonomy = $wpdb->get_var($wpdb->prepare("SELECT taxonomy FROM $term_taxonomy_table WHERE term_taxonomy_id = $tt_id"));      I was wondering if there is wordpress function that replaces that SQL query? I like to avoid using SQL queries. If there isnt, please tell me if the SQL query I am using is correct and safe. Thank you.


title: how to restrict upload media for specific admin pages

text: I'm using the wordpress media uploader for uploading images in the theme that I created. But I want to restrict it to only images. I found out that there's this upload_mimes filter which can be used to restrict the media uploader to only specific types of files. But the problem with this approach is that its limiting all of the pages even when creating new posts to just images:               function mytheme_restrict_mime($mimes){            $screen = get_current_screen();       $current_page = $screen->base;                   $mimes = array(           'jpg|jpeg|jpe' => 'image/jpeg',           'gif' => 'image/gif',           'png' => 'image/png'         );                 return $mimes;     }          add_filter('upload_mimes', 'mytheme_restrict_mime');      So I tried getting the name of the current page:               function mytheme_restrict_mime($mimes){            $screen = get_current_screen();       $current_page = $screen->base;            if($current_page == 'toplevel_page_mytheme-settings'){         $mimes = array(           'jpg|jpeg|jpe' => 'image/jpeg',           'gif' => 'image/gif',           'png' => 'image/png'         );       }            return $mimes;     }      But this doesn't work. It allows me to upload any file type. Any ideas?


title: Way to extract wordpress data from folder backup

text: Before my HDD crashed, I backed up the C:\wamp folder. Can I extract the wordpress posts/pages using another localhost on a different pc?


title: Add class to <li> based on content of link in <li>

text: I've added a custom JavaScript file to my header via `functions.php` and the file is linked fine when I check the source code (listed well below the main call to jQuery). Within the custom JavaScript file I have added the following:               $(document).ready(function(){         $('li.bawmrp_manual > a:contains[href*="/project/"]').addClass('bawmrp_gallery');     });      I've tried numerous variations. What I'm trying to do is add the class `bawmrp_gallery` to the `<li>` if the link within it contains the text `project`. Can anyone help?


title: How can i display only 4 images from a galerry using NextGen Galley

text: Hy, im using NextGen gallery for my gallery images, i want to display in archive page first 4 images from the galley atached to the post. Ex: i have this code that retrive me the galery..               <?php         foreach ( get_field ( 'galerie_seriale' ) as $nextgen_gallery_id ) :             if ( $nextgen_gallery_id['ngg_form'] == 'album' ) {                 echo nggShowAlbum( $nextgen_gallery_id['ngg_id'] ); //NextGEN Gallery album             } elseif ( $nextgen_gallery_id['ngg_form'] == 'gallery' ) {                  echo nggShowGallery( $nextgen_gallery_id['ngg_id'] ); //NextGEN Gallery gallery             }         endforeach;     ?>      Please see the picture http://i49.tinypic.com/wwdkd0.jpg I want to be able to get in archive page only 4 picture, first 4 pictures, last.., something like this http://www.tvblog.ro/seriale-tv/ I search


title: why does wordpress ignore the post args?

text:
I dont get it. Straight outa the Codex,                <?php     // my code              $cat = get_the_category();          $catName = $category[0]->cat_name;          //straight outa the codex            // The Query       query_posts( array ( 'category' => $catName, 'posts_per_page' => -1 ) );            // The Loop      while ( have_posts() ) : the_post(); ?>
         <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
            <?php endwhile;            // Reset Query       wp_reset_query();            ?>      The results are every post in the entire blog, not every post in the category $catName. Whats up with that?


title: Loop being strainge

text: So I hacked together a function that does the following:               protected function _query_post($query){         $original = $this->_wp_query;         $wp_query = new WP_Query($query);              if($wp_query->have_posts()){             while($wp_query->have_posts()){                 $wp_query->the_post();                      $this->_title($this->_options);                      the_excerpt();             }                  next_posts_link('« Older Entries');             previous_posts_link('Newer Entries »');         }              $wp_query = $original;       }      So it's not hard to tell what's going on - all were doing is displaying a list of posts that are queried. The query used here is:               'posts_per_page' => 20      This then created the following page (scroll down) with a a pagination at the bottom. The problem is, try going through pages 1 - 5. The posts are all the same....At the bottom of the post I do a reset of the query..... Any ideas?


title: How do I access the media settings

text: I have been trying to find a way to access the the maximum width of a large image as set on the media settings page? In my theme I am grabbing images from a server and have the ability to specify the size when I grab them. I want to grab the image with the width set for the large image size on the media settings page.


title: How can I set my RSS feed time to update feed quicker

text: I'm using WordPress RSS Widget for one of my site. But found it's a bit lazy, it's not taking latest updates into the feed. How can I make it quick in loading new updates?


title: Display Pointer only once?

text: I am using following code to display a pointer on the post edit page. It displays the pointer everytime the page is load. Is there way to stop it displaying everytime? (eg. display only when the page is loaded first time?, not everytime when the post is saved or page is reloaded etc)?               $('#some-button').pointer({         content: '<?php echo $pointer_content; ?>',         position: {             edge: 'left',             align: 'center'         },         close: function() {             // Once the close button is hit         }     }).pointer('open');


title: WC Google Merchant Shopping

text: What is the easiest way to produce a data feed from WooCommerce for Google Merchant besides the Google Product Feed $79 plugin? Only people with direct experience who have successfully uploaded Data Feeds to Google please reply.


title: loginout function customization

text: I want to make `login / logout` function inside my header to display when the user is logged in **Logged in as,{user name}** where **{user name}** should be wrapped inside an anchor tag with a custom permalink inside the `href` attribute. I've found this function `<?php wp_loginout( $redirect, $echo ); ?>` but I do not know if it's possible to modify this function to do what I need. Does anyone have any suggestions on how can I do this ? Thank you !


title: How to use global category code

text: can any one explain me that how to use global category code. Where we have to write this code?               function __add_global_categories( $term_id )     {         if ( get_current_blog_id() !== BLOG_ID_CURRENT_SITE || ( !$term = get_term( $term_id, 'category' ) ) )             return $term_id; // bail              if ( !$term->parent || ( !$parent = get_term( $term->parent, 'category' ) ) )             $parent = null;              global $wpdb;              $blogs = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}'" );         foreach ( $blogs as $blog ) {             $wpdb->set_blog_id( $blog );                  if ( $parent && ( $_parent = get_term_by( 'slug', $parent->slug, 'category' ) ) )                 $_parent_ID = $_parent->term_id;             else                 $_parent_ID = 0;                  wp_insert_term( $term->name, 'category',  array(                 'slug' => $term->slug,                 'parent' => $_parent_ID,                 'description' => $term->description             ));         }              $wpdb->set_blog_id( BLOG_ID_CURRENT_SITE );     }     add_action( 'created_category', '__add_global_categories' );


title: How to restrict plugin's sub-menu pages to admin/subscribers?

text: I am working on a plugin with 6 submenu pages. I want 5 of them to be accessible by Administrators only and 1 of them to be accessible by Subscribers only. Both user roles will have different features available on their respective pages. Is it possible to do that? If yes, how? If no, what are the alternatives? Thanks for your time!


title: can members have multiple registration using the same password?

text: I have two membership levels e.g MYE 1 and MYE II. I am using wishlish plugin. When a person enrolls in MYE I and then later enrolls in MYE II - they are currently blocked from using the same email address - most people only hve 1 email address that they like doing business in - Can we PLEASE allow them to use the same UN and email address and just a different PW for the 2 different programs? How can i achieve this? Thanks


title: Showing registration errors on same user role registration page

text: I have a custom user role eg. `abc123` and I created a different registration page having few more fields than original one at `?action=register` which opens at `?action=register&role=abc123` like address, city etc. On submitting, inputs are validated and then saved into user meta. Problem is, when validation fails, page shows errors at `?action=register` rather than `?action=register&role=abc123`. The original registration page doesn't have all those fields as `?action=register&role=abc123` due to which I'm not able to register a user without extra information. Can anyone tell how to avoid that and shows validation errors only on `?action=register&role=abc123` so that a user can continue filling form? Thanks


title: Insert images into wordpress post with a query

text: I have a Wordpress installation with 2.000 posts. Also in a separate table of my database I have a set of image paths and the filenames of the images, each image is assigned to each post of my Wordpress installation based on the post id. eg of my images' table               id|image     --------     1 | img1.png     2 | secondimage.jpg     ...     2014| onemoreimage.gif      Is it possible to execute an SQL query or a Wordpress API call to insert each image as featured image of each post based on the ID? Also where should I upload the original image files? Thanks in advance


title: How can i count post from my post type taxonomy

text: How can i get the count for published post from my custom post type , from my taxonomy. I have Custom Post Type : trailers, Taxonomy : trailere-noi               <?php           $items = get_posts( array(         'post_type'   => 'trailers',         'numberposts' => -1,         'taxonomy'    => 'trailere-noi',         ));          $count =  count( $posts );     echo $count;               ?>      I use this code it conunt for how posts are display.. how can get the count for all posts in that taxonomy? * * * Response:               <?php      $related_posts = get_field( 'subtitrare_film' );     $count =  count( $related_posts );     echo $count;     ?>      Subtitrare_film - is the relathionship field (INFO :http://www.advancedcustomfields.com/docs/field-types/relationship/) This code Retrive me the field counting number, but the problem is: if there is nothing atached to that Custom Field ( Relationship fild) it retrive me number 1 , i want to display 0 ( if there is nothing atachhed.)


title: Too many get_template_parts?

text: For a lot of my site I'm using `get_template_part` mostly because I had coded most of it in html/css first and it just seemed easier to call each part as I saw fit. My question is, basically, will this have a noticeable impact on performance? If I'm calling in say 3 or 4 template parts. How many would you say is too many, if I was only bringing in little snippets. Help appreciated.


title: How to add feature image url in my template file and content as well?

text: I am making a template page name new_template.php,here i want to add a feature image source. how to add featured image source on this blank page. and when i add featured image then the description content is not displaying. thanks


title: Event with multiple dates, display events chronologically

text: I've been breaking my head over this for days now and can't seem to figure it out (with the limited knowledge I have). I want to achieve the following: I have a custom post type 'Events'. Each event can take place multiple times per year, so I have custom fields for the dates, let's say 'dateA', 'dateB', 'dateC'. I want to display all the event-date combinations on a page chronologically after checking if the date is in the future. There are a couple of easy ways to do this, but they have major flaws:   1. Create separate events for each date, but this would be a nightmare to maintain.   2. Loop through the events multiple times, first loop displaying the events with dateA, second loop displaying events with dateB etc. This requires all dateB's to be after the last dateA. So basically what I need to (somehow) do is:   1. Create unique date event combinations   2. Compare the dates to the currentdate   3. Display the future events chronologically by the event date. Can this be done, and if so, how would I approach it. Any pointers would be greatly appreciated!


title: WP Oembed not passing through the "autoplay=1" variable

text: I'm having a problem here: I am passing this through a custom field: `http://www.youtube.com/watch?v=E6P1Q-UycHA&autoplay=1` (notice the `autoplay=1`) But when I load the video on my theme using wp_oembed_get... it displays the video fine, but it does not listen to the `autoplay=1` variable I am passing through. I need the videos to play on the load of the page. Any ideas? Thanks, Alain Fontaine


title: When I try to de-activate any plugin it gives error "Warning: call_user_func_array() [function.call-user-func-array]"

text: When I try to de-activate any plugin it gives error. How to solve this? Plugin is getting de-activated but on clicking button "Deactivate" I get this error. > Warning: call_user_func_array() [function.call-user-func-array]: First > argument is expected to be a valid callback, 'youtuber_uninstall' was given > in /home/username/public_html/wp-includes/plugin.php on line 395**


title: Associating an "author" with a custom taxonomy

text: I have a custom role, "Ministry Representative", which is able to log in and create and manage their own "Opportunities" and "Events", which is each a custom post type. On the front end of the site, you can filter opportunities or events by "Ministry", which is a custom taxonomy associated with both the "Opportunities" and "Events" custom post type. On the backend, I create an account for a "Ministry Representative" to manage what appears on their profile as well as within the filtered results on the "Opportunities" and "Events" index pages. **The Challenge** When a "Ministry Representative" goes to create a new "Event", they enter the details, and, from the custom taxonomy, they have to choose:   * Location (a hierarchal custom taxonomy)   * Presenter (a non-hierarchal custom taxonomy)   * Ministry (a non-hierarchal custom taxonomy) So, in essence, they have to choose themselves. John Doe, who is a "Ministry Representative" for "Ministry A", has to choose his own ministry from a dropdown (a custom meta box via WP Alchemy). **The Ideal Solution** Ideally, when a new "Event" or "Opportunity" is created by John Doe of "Ministry A", the association is made without any input required on the interface level by the end-user. So, what I _think_ I'm looking for is a way to associate a user account with a specific term within a custom taxonomy. Does that make sense? Is there, perhaps, another way to look at the problem? As I'm imagining, I could see other applications which could make this useful. An account is created and when X user contributes a given type of content, pre-selected terms are automatically associated to their contributed content. Any thoughts or ideas are greatly appreciated. Thank you!


title: How can I create a separate blog that is private?

text: I am very new at all this and not a programmer. I want to know how to set up a private blog that requires a member login to view it. Is there a widget that one may suggest that does this. I am using the Unite theme and the site I am trying to put together is at tmpfire.com. I would appreciate all the help I can get.


title: Relative Time On Posts

text: I am looking for a way that I could add some code to my wordpress template to display the time of a post in relative terms. So if, for example, I posted something 5 minutes ago it would say something along the lines of Posted 6 minutes ago or 2 days ago, or 1 week ago. You get the idea. Could anyone give me some guidance on how I could go about doing this?


title: add_menu_page does not seem to work in a class

text:
Here is some of my code:               class proposal {          function __construct() {         add_menu_page('Topic Proposal', 'Topic Proposal', 'read', 'topic_proposal', array(&$this, 'writer_page'), 'dashicons-welcome-add-page');     }          public function load_menu() {         echo 'EHY';     }          public function writer_page() {         ?>
Topic Proposal
         <?php     }          public function editor_page() {         ?>
Topic Proposal
         <?php     }          }          add_action( 'admin_init', function(){return new proposal();});      The "Topic Proposal" shows of on the menu but when I click on it I get this:               You do not have sufficient permissions to access this page.      What am I doing wrong?


title: Unexpected script loading order

text: I'm trying to make scripts load in a certain order, and am getting unexpected results. I'm using this script:               function tallulah_scripts() {       wp_enqueue_script( 'header-js', get_template_directory_uri() . '/js/header.min.js', null, '1.0', false );       wp_deregister_script('jquery');       wp_enqueue_script( 'footer-js', get_template_directory_uri() . '/js/footer.min.js', null, '1.0', true );       wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', null, '2.1.0', true );     }     add_action( 'wp_enqueue_scripts', 'tallulah_scripts');      ...and when I load the page the scripts appear like this:                   <script type='text/javascript' src='http://tallulah/wp-content/themes/tallulah/js/jquery.min.js?ver=2.1.0'></script>         <script type='text/javascript' src='http://tallulah/wp-content/themes/tallulah/js/footer.min.js?ver=1.0'></script>       </body>     </html>      odd right? How would I FORCE footer.min.js to load first? I've tried setting the dependency like so:               wp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', 'footer-js', '2.1.0', true );      ..but it seems to have no effect. Any pointers please?


title: Custom taxonomy template for categories

text: I have just been reading up alot about custom taxonomy template files, I have a category within a custom taxonomy that needs its own template. I understand about the template heirarchy etc.. and seen other posts relating to this. I think that my file should be named taxonomy-{taxonomy-slug}-{category- slug}.php, is that right? Though I have already tried taxonomy-ait-dir-item-category-events.php where ait-dir-item-category is the name of the taxonomy and events is the name of the category, changed the page title to make it stand out and it didn't affect anything. Could someone please advise? Thanks


title: How should I build a custom menu walker for this setup?

text:
I have a menu structure I built in HTML+CSS that I would like to incorporate into a WordPress menu, but I am new to extending the Walker class and was wondering if someone could show me an example of how it might work. The code I would like to output is below:

Current Page

Top Level Menu

Child Link

Another Link No Children

                The nav and ul tags wrap the entire menu and do not need repeating. The li for a single page without any child pages just needs an anchor tag inside of a bare li, except if the page is current, and add the appropriate id to the a tag. If there is a parent item with children, display the parent link first with a "sf-with-ul" class on the a tag, then make another ul group with its li children have the same class as well. Could anyone point me in the right direction here on how to accomplish this? Thank you.


title: Convert jQuery Datepicker Format to SQL Date Format

text: I set the jQuery Datepicker format to **D d.m.** displayed as **Th 3.3.** for a custom meta field that I want to use to sort posts. In SQL, the custom meta field is saved as **D d.m.** I would like to display the **D d.m.** format on the front end and store it as mm-dd-yy or 03-03-2011 in my SQL database. Any ideas? My input field for the custom meta field cp_date:                <input name="<?php echo $result->field_name; ?>" id="<?php echo $result->field_name; ?>" type="text" minlength="2" value="<?php if(isset($_POST[$result->field_name])) echo $_POST[$result->field_name]; ?>" autocomplete="off" class="datepicker <?php if($result->field_req) echo 'required' ?>" />