Can I have two different theme for two different language?

I have to develop a multilanguage website using WordPress (Italian and English) and I want to know if I can have a theme for the Italian version and a differen theme for the English version. Can I do this thing? Tnx Andrea


problem loading stylesheets to wp_head dynamically

I'm trying to create a wrapper shortcut function to register and load stylesheets in the header. currently, the function loads this css file src:               http://my.test/wp-content/theme/css/.css      I, obviously want it to pass the parameter given. The problem is, the new function definition within the new function definition doesn't seem to be taking the parameter even though my #4th argument for add_action was 1 (parameter passable to function). What am I doing wrong?? Please help :)               <?php //Registering stylesheets          load_stylesheet_like_a_boss('my-style.css');          function load_stylesheet_like_a_boss($filename){         echo 'parent:'.$filename; //should return 'parent: my-style.css'             add_action('wp_head', 'stylesheet_registration', 5, 1);                   function stylesheet_registration($filename){             echo ' / child:'.$filename.'<br>'; //should return ' / child: my-style.css'             $name = str_replace('.css','', $filename);                  wp_register_style($name, get_bloginfo('template_directory').'/css/'.$name.'.css');             wp_enqueue_style($name, 10);         }     } ?>


TinyMCE in a div / textarea on frontend?

I have a post on my frontpage and I want to add the TinyMCE editor to it and could not make it work. **I've tried these guides without any luck**   * http://stackoverflow.com/questions/2855890/add-tinymce-to-wordpress-plugin   * http://keighl.com/2010/01/tinymce-in-wordpress-plugins/ The guides are for making it work on backend. **I guess I need to find out how to do these things...**   1. Add some Javascript with wp_enqueue_script.   2. Add some inline Javascript settings within script-tags.   3. Add a textarea or a div with a specific name, class or ID. Help me in any way, code, links to guides, advice, anything.


Wordpress plugin archive

I need to find an archive of some Wordpress plugins. Previous webmaster of the site installed some plugins and then made modifications to some of them. He did not document these modifications in any way, so I have no idea what was changed and where. There's also no contact with him. And now I need to upgrade Wordpress and its plugins - there's a security update released. I could compare installed plugins to originals but I can't find an archive of old versions of these plugins anywhere. Is there any?


Application form plugin with payment gateway

I'm working on a site for a small business academy. We're trying to create an application for potential students to fill out to apply for the school. The form needs to be able to have multiple long-form questions, (paginated would be nice for each), and before the application is submitted, the students would have to pay an application fee. Does anyone know of any application form plugins that support these features: paginated questionnaire and payment gateway for application fee? TIA


Best way to execute custom page-specific mysql queries

I would like to query a secondary mysql database (not the Wordpress mysql database) with page-specific queries. I've seen many answers / tutorials on setting up a secondary mysql database, like:               $newdb = new wpdb('my_user_name', 'my_password', 'my_database', 'my_host');     $newdb->show_errors();      But I haven't seen tutorials on how to execute individual page-specific (not template, so varies from page to page) queries to that database. What is the best way to achieve this?


javascript is not working on Event Submission?

I am using Events Manager Plugin Javascript is not working on **Submit Events** Page . I found the reason behind this , that was, I have written a line of code in functions.php to call jquery file. `wp_enqueue_script('jquery-1.7.2',get_template_directory_uri().'/js/jquery-1.7.2.min.js');` When I remove this line of code then javascripts start working fine on Event Submission Page but this file is important for me because I am using this file at many places too so I can not remove this. For Example I have a line of code which generates error.Line is : `var p_option = $('input[@name="p_option"]:checked').val();` . This line is written in **'wordpress_1/wp-content/themes/my- theme/sidebar.php'** I also asked this question on plugin support but no reply from there. Thanks in advance!!!


Index page and random posts needs a forced refresh in order to show new content

I have this weird problem with both on desktop and mobile, which requires a manual refresh in order for the index-page to show new posts. It also appears as if the user is not logged in. Basically, I have a custom login function with wp_signon. The user logs in and get redirected to their "account" page. Here they are shown as logged with the appropriate menu for logged in users. If I click that "Star" menu-button, which take me back to the homepage, the user suddenly appears to be logged out. When I press a post, the user is logged in again. But on some posts, they appear to be offline. Even if I change the custom login function to redirect to the homepage instead of the account page, it's the exact same problem. Even on the homepage the user is now shown as logged in, but if you press start or type in the website url: www.blabla.com, the user is suddenly shown to be logged out. When I refresh the homepage everything is as it should. This is an extremely annoying problem. Can it be some sort of a database problem?


Difference Between Filter and Action Hooks?

I have been looking at the plugin API a bit more in depth recently and I was wondering **what real differences there were between action and filter hooks**. They both are events that receive data as a parameter and they seem to both be able to do the same things. Obviously I see that actions are called when actions take place and filters are called when data is manipulated, but it seems to just be a semantic naming difference. Besides semantics and what they are used for, what real differences are there between them?


Problems with autoloading classes via sp_autoload_register / maybe interfering WP-specific autoloader

I'm working on a plugin in which I do the following for autoloading classes:               function TFSLAutoload($class) {         $classfile = dirname(__FILE__).'/includes/'.strtolower($class).'.php';         include $classfile;     } // function TFSLAutoload     spl_autoload_register('TFSLAutoload');      In the plugin (classes) I can instantiate classes (e.g., use `$myClassXYZ = new MyClassXYZ();`) as well as use static functions (e.g., `MyClassXYZ::my_static_func();`) without including/requiring the file defining the very class. In short, everything is working as expected. However, when having `WP_DEBUG` set to true, I do get the following warnings:               Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/wp_atom_server.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/wp_atom_server.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/Recursive_ArrayAccess.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/Recursive_ArrayAccess.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31     Warning: include(/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/WP_Session.php): failed to open stream: No such file or directory in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      Warning: include(): Failed opening '/var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/includes/WP_Session.php' for inclusion (include_path='.:') in /var/www/vhosts/MY-DOMAIN.TLD/wp-content/plugins/tf-song-list/tf-song-list.php on line 31      I then changed my autoload function to check first if the file exists:               function TFSLAutoload($class) {         $classfile = dirname(__FILE__).'/includes/'.strtolower($class).'.php';         if (file_exists($classfile)) include $classfile;         else echo "File »$classfile« does not exist.".PHP_EOL;     } // function TFSLAutoload     spl_autoload_register('TFSLAutoload');      Now, only my own plugin class files are loaded by the autoloader, as they are the only files loacted in the pre-defined folder. However, if the three mentioned WordPress classes are still being 'sent' through my autolaoder class, are they even(tually) loaded correctly by WP? Or is my autoloader competing with the built-in autoloader of WP? How can I check that? Or: Am I doing the whole autoloading stuff the wrong way? And why are these three classes sent to my autoloader? Are they the only ones to be load after the plugins are loaded?


Posts not working on windows after changing permalinks

I recently started learning wordpress. Out to curiosity of changing settings, I changed permalinks to Month and Name. After that all my posts and pages have stopped working and show me a 404 Error. I am not being able to figure out why is it happening.   I even tried posting new posts and even they doesnt work.   Please suggest any solution. I am using WP 3.7 on windows machine with wamp.


List posts in a category grouped by other categories?

I have posts of stores and restaurants in my area. Each post is marked by category of type (e.g. Restaurant, store) and town. What I am trying to do is create a page for each town (with intro text and photos enter into the page ui) and then a loop of Posts in that town's category grouped by the other categories. Ideally, I'd like to get the current page's slug, or last part of the url to use for the post query: as in "http://mysite.com/towns/mayberry" would display all posts in the mayberry category grouped by the other tags. So my page is Mayberry some content Listings: Restaurants (in mayberry only) - item - item Hotels (in mayberry only) - item - item Is this possible?


Custom Structure permalinks error 404

i have changed the wordpress custom structure permalink to `/%post_id%/%postname%/` and get this error : **404 Not Found The requested URL /mysite/blog/1/hello-world/ was not found on this server.**   * wordpress version **_3.1.7_**   * site address: **localhost/mysite/blog** i'v changed this function in **misc.php** and saw the error again!               function got_mod_rewrite() {         //$got_rewrite = apache_mod_loaded('mod_rewrite', true); //old line with false negative;         $got_rewrite = true;//force the response to true as we know mod_rewite is installed;         return apply_filters('got_rewrite', $got_rewrite);     }


What can be the reasons that breadcrumb in a site is malfunctioning?

A WordPress site is using **Breadcrumb NavXT** plugin to show the site's navigation flow. But in some pages it's malfunctioning -- showing wrong post title to the breadcrumb. I tried disabling the plugin and used a custom function: **Adding WordPress breadcrumbs without a plugin** to show breadcrumb. But it's still showing the wrong title on some posts. I checked the malfunctioning post ID, slug, title, excerpt, URL -- everything seems to OK, but the breadcrumb's post title. I drafted (unpublished) the particular post, that's displaying into the breadcrumb's post title - then found that, the breadcrumb is still malfunctioning but this time it's taking another post title of the same category. I ...   refreshed the browser cache -- not worked.   refreshed the permalink -- not worked.   changed to permalink from `/%post_name%/` to `/%post_id%/%post_name%/` -- not worked. I can't figure out what other possibilities there might be that can malfunction the breadcrumb-- only the breadcrumb.


MS Access to manage WordPress Database

Now I don't believe this is practical or possible without a large amount of development. My client's old site used MS Access to manage the user's profiles on his old website. His new site uses BuddyPress to manage user profiles, his old site was a bespoke WordPress members system. I'm just trying to get a concrete answer from someone who knows - is it practical or possible to manage users from MS Access or is it more hassle then it's worth. Cheers!


Getting a user role from the user login name

The question might be simple. Since I need to fix it soon I had to ask. Currently I am modifying a free plugin. In that I am having the _user login_ string. How can I get the role for that login? I'm using WordPress 3.8.


How to serve different thumbnails/images depending on users browser/platform

This is a general question to discuss approaches to filtering WordPress image sizes based on the browser/platform (such as a smart phone or netbook or desktop). The idea being that on a mobile we don't want to force people to download a 100kb image when a 20kb one would be big enough for their screen, thus saving them and yourself, bandwidth. The outcome would be to make using CSS media queries a viable alternative to a separate theme for a mobile version of a site. There are a few points to consider: ## User Interface What would be the best way to allow a user to control the thumbnail and medium image sizes etc... for different platforms or indeed just for different screen sizes? ## Device Detection What would the best way to detect the device/UA's screen capabilities on the server side. Are there any plugins that do this already? ## Implementation How would you go about writing the code to create the different thumbnails, and then to alter WPs output according to the device / screen size? Ideally this would be theme agnostic so a call to `the_post_thumbnail('medium')` would return the appropriate size of image for the device/platform.


Wordpress overriding actual subdirectories

I have a site driven by Wordpress and a few custom directories that I've got at the top level. Some of these top-level directories work and the content inside of them are being read as expected. However, I've just created a new folder directory with an index.html inside and when I try to visit it, Wordpress is overriding it and displaying a 404 error (since that directory structure doesn't exist in the Wordpress database). I've disabled the W3 cache and I've checked the .htaccess file in the event that I put in a redirect in the past, but nothing that would indicate a redirect back to Wordpress.


Free paypal cart solution

Does someone some good & free paypal cart solution for wordpress? I was looking at phpurchase.com, that looks good but I don't want to buy it since it's for a test project.


Is there an easy way to get a list of Category IDs?

I'm working with a couple of plugins that ask for a list of category IDs to include/exclude. When I go to the categories section and select "Edit" I don't see an ID field listed on the page, though I see all the other details. Since I will be relaying this information onto other users, how can I find the category ID for them?


post_tag tanonomy with custom post type

I'm looking all over google but doesn't find the way to do it. i've declared a custom post type (let's say 'job') with a custom hierarchical taxonomy ('activities'). I would also like to assign "normal" tags to my custom post type (if i have a tag 'full employment' for my classic posts, i want to assign to my job posts also). how can i achieve that ? i managed to have a custom taxonomy on several post types, but i don't know how to target post_tag and add him a post type. for example :               register_taxonomy( 'seasons', array('job', 'post'), $args );        make seasons appear on classic posts and also on job posts. I would like to have 'tags' available for my job posts. am i clear ? thanks,


Index page of posts tagged with two separate taxonomies

I have a custom post type `Book` which has three custom taxonomies:   * Genre      * Fiction     * Non-fiction   * Media Type      * Book     * eBook     * Audiobook   * Audience      * Kid     * Teen     * Adult My goal is to create index (aka archive) pages of many of the different combinations of two or all three taxonomies. For example, I want a "Kids Fiction" page and an "Adult eBook" page. If at all possible, I want to do this without any PHP because custom PHP tends to have lots of hardcoded properties that make the template hard to maintain. How do I create index pages with different combinations of multiple taxonomies?


Fresh Multisite Install - Can't Log In

I just installed a fresh copy of 3.0.4, went through the steps to create a multisite and everything looked good. Then, I attempted to sign in to one of the newly created Sites and the login page simply repeats itself. No errors, not even in the log. The main install works fine, this seems to be isolated just to new sites. I've tried logging in using the Super Admin user and the Site Admin user, both do the same thing. Anyone seen this before?


Copy widget settings from one blog to another

I am trying to hook 'wpmu_new_blog' in a plugin so I can copy the widget settings from one blog to the new blog that is being created. Does anyone know if there are WordPress functions to accomplish this, or should I just use straight SQL? Thanks, Dave


Trying to put a search page on site

i'm trying to put a search page on my site. I thought it would be simple, but I am having no success. I have put a form in my header.php (which I call in my search.php page (include "header.php")) that looks like that:               <form action="<?php bloginfo("template_directory") ?>/search.php" method="get">                     <input type="text" value="Votre recherche pour:" />                      <input type="submit" value="soumettre" />                 </form>      But when I submit the search, I get this fatal error and I don't know what to do. Hopefully, you will be able to help. Thanks! Fatal error: Call to undefined function add_action() in C:\wamp\www\wordpress-3.5-fr_FR\wordpress\wp- content\themes\electrobangers\functions.php on line 2 Relevant code: add_action("init", "register_my_menus");


Plugin problem. Question is not appearing.

I have installed a plugin DW Q & A and I have posted some questions on it too. But when I click on the questions it is not available. why? The questions on the page: ![enter image description here](http://i.stack.imgur.com/JeOU4.png) after clicking on a question ![enter image description here](http://i.stack.imgur.com/D5gyX.png) **What is need to set up to view the questions?**


disabling emails received by admins every time a new user signs up (function not working)

I have the following function in my functions.php. I am trying to disable the admin from receiving emails every time a new user joins the site. However, the admin is still receiving emails. Is there something wrong with the function? And is this part of the WP options by any chance? I couldn't find the option anywhere.               // Disable New User Reg Emails     if ( ! function_exists( 'wp_new_user_notification' ) ) :         function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {                  /** Return early if no password is set */             if ( empty( $plaintext_pass ) )                 return;                  $user       = get_userdata( $user_id );             $user_login = stripslashes( $user->user_login );             $user_email = stripslashes( $user->user_email );                  // The blogname option is escaped with esc_html on the way into the database in sanitize_option             // we want to reverse this for the plain text arena of emails.             $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );                  $message  = sprintf( __( 'Username: %s' ), $user_login) . "\r\n";             $message .= sprintf( __( 'Password: %s' ), $plaintext_pass) . "\r\n";             $message .= wp_login_url() . "\r\n";                  wp_mail( $user_email, sprintf( __( '[%s] Your username and password' ), $blogname ), $message );              }     endif;


Theme of codinghorror.com

I liked theme of codinghorror.com . It's Typepad theme but i need wordpress theme of this. Where i can find it ? Best regards, Dreamer


Altering the appearance of custom taxonomy inputs

I'm working on a site that will make use of a few custom taxonomies (for custom post types). I've chosen to make some of the taxonomies hierarchical because the method of inputting values (checking boxes) is more desirable for this site than the free-form input of non-hierarchical taxonomies. However, what I would **really** like is to be able to use radio button inputs instead of check boxes. Additionally, I'd like to remove the dropdown that is used to choose the parent item in the taxonomy. ![screenshot](http://i.stack.imgur.com/txNOI.jpg) Am I going about this the wrong way? Should I start with non-hierarchical taxonomies and modify the input methods on those instead? I'm completely open to input and will gladly answer any questions or supply more information if I can.


Comment entry screen shows even though "Allow Comments" is unchecked

On my single.php and index.php I'm including the comment entry routine with this code...               <?php if(get_option('allow_comments_posts')){comments_template();} ?>      However, when the specific post being viewed in single.php has "Allow Comments" unchecked, I don't want the comment template to appear. I was under the impression that the comments_template() routine automatically managed this, but apparently I need to wrap it or pass a paramater?


Post types disappeared

I have the following in functions.php of my custom theme:               <?php     add_theme_support( 'post-thumbnails' );     add_image_size( "main-slider", 671, 252, true );          add_action( 'init', 'create_main_slider_post_type' );     add_action( 'init', 'create_external_link_post_type' );          function create_main_slider_post_type() {         register_post_type( 'main_slider_item',             array(                 'labels' => array(                                       'name' => __( 'Main Slider Items' ),                                       'singular_name' => __( 'Main Slider Item' ),                                       'menu_name' => __( 'Main Slider' )                             ),                             'description' => "A banner with a text and button",                             'public' => false,                             'show_ui' => true,                             'exclude_from_search' => true,                             'show_in_nav_menus' => false,                             'map_meta_cap' => false,                             'supports' => array('title', 'thumbnail'),                             'has_archive' => false,                             'show_in_nav_menus' => false,             )         );     }          function create_external_link_post_type() {         register_post_type( 'external_link',             array(                 'labels' => array(                                       'name' => __( 'External Links' ),                                       'singular_name' => __( 'External Link' ),                             ),                             'description' => "A link with image for site footer",                             'public' => false,                             'show_ui' => true,                             'exclude_from_search' => true,                             'show_in_nav_menus' => false,                             'map_meta_cap' => false,                             'supports' => array('title', 'thumbnail'),                             'has_archive' => false,                             'show_in_nav_menus' => false,             )         );     }     ?>      This code works, as this is confirmed by seeing "Main Slider" and "External Links" in the dashboard. In config of "Advanced Custom Fields" there disappeared main_slider_item as a possible value for "Post Type". (It shows only "post" and "page" post content types.) It was there earlier. Where to dig? I tried to disable every active plugin, but this hasn't helped.


Meta Boxes in Front End Post Submission Form

How can I **add meta boxes** to the **front end post submission form**? Similar to front end post submission that creates new posts, the form replies should go directly into the post meta boxes. **Meta Boxes Code Example for post** from back-end to front-end               <?php           function admin_init(){         add_meta_box("mia_post_meta", "Information", "mia_post_meta", "post", "normal", "high");     }     add_action("admin_init", "admin_init");          function mia_post_meta($callback_args) {         global $post;              $post_type = $callback_args->post_type;         $temp_array = array();              $temp_array = maybe_unserialize(get_post_meta($post->ID,'mia_ev_settings',true));              $mia_ev_bday = isset( $temp_array['mia_ev_bday'] ) ? $temp_array['mia_ev_bday'] : '';            echo '';          ?>

                      Birthday:                      <input type="text" class="small-text" value="<?php echo $mia_ev_bday; ?>" id="mia_ev_bday" name="mia_ev_bday" size="67" />
                     ex: 13 Jan, 2011

              <?php     }          add_action('save_post', 'save_details');     function save_details($post_id){         global $post;              $temp_array = array();              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )              return $post_id;              $temp_array['mia_ev_bday'] = isset($_POST["mia_ev_bday"]) ? $_POST["mia_ev_bday"] : '';              update_post_meta( $post->ID, "mia_ev_settings", $temp_array );     }          function mia_bday_scripts(){         wp_register_script('datepicker', get_bloginfo('template_directory').'/js/date/datepicker.js', array('jquery'));         wp_enqueue_script('datepicker');     }          function mia_style_css(){         wp_register_style( 'datepicker', get_bloginfo('template_directory').'/js/date/datepicker.css');         wp_enqueue_style('datepicker');     }          add_action('admin_print_scripts', 'mia_date_scripts');     add_action('admin_print_styles', 'mia_style_css');          ?>      The mia_ev_bday should be filled out by users on the front-end as well. **FORM EXAMPLE on Front-end** see Image The information added by users in the form should be displayed in the post and appear in the back-end meta box in the custom meta boxes.


Display password protected posts to logged in users

In a WPMU & BuddyPress installation, I want to directly **show the password protected posts to logged in users** without asking them for posts passwords... and still be accessible to guests (non-members) by entering the posts protected passwords! Real-World Use Case. I need this for one of my blog/site: **apply-for- membership**.mysite.com   1. Any visitor (guests/non-members) can apply for a membership by entering they Application (Guests will have a form so they can add new post with visibility: password protected)    2. MySite Members can view all the Guests Applications (without entering the passwords) and comment on them, making ratings, investigate, adding questions, etc.   3. Guests come back to site - enter they post password - and comment on they application, answering the questions of MySite members. PS: _The all idea is to keep applications only visible to site members and certainly for each applicant, by entering they own password._ **Any other solution will do** : plugin, function...


Redirect loop in /wp-admin/

A site I manage has just become inaccessible to the admin today. I just updated apache on the server to enable mod_deflate and also to upgrade PHP from 5.3 to 5.4. Since doing that every time I attempt to access /wp-admin/ I receive the redirect loop error. I tried all the usual suspects, i.e:   * cleared cookies and cache   * tried different browsers   * disabled theme   * disabled cookies   * deleted .htaccess   * checked site_url etc in wp_options  But no luck. I can access wp-login.php fine but not /wp-admin/ Any help would be greatly appreciated as I am totally stumped.


How to specify image width and/or height attributes for images uploaded using Wordpress uploader

When I check my website speed using GTMatrix for many images uploaded using WordPress uploader that image(s) are missing width and/or height attributes. Wordpress by default provides width & height of images. then how and where can I specify the dimensions again.


PHP code rendered in HTML

I'm trying to find out why any template different than index.php doesn't work. I've created a category-news.php file (also tried with category-4.php and mostly all alternatives), but when opening this url, I see a white page and checking the source code, I see the php code as HTML ~~comments~~. Any idea to what could cause that? I've checked the functions.php (that has been written by me) and there are no places that does that. As for plugins, disabling all of them doesn't help. **UPDATE - More information about the template page, as per request in comments** You can find the category-news.php source code here. You were right: I was only checking with Google's developer tools and there I see the php code changed as HTML comments. When looking at the actual HTML code, I only see the original php code. Either way, this shouldn't happen and since the rest of the theme works as expected, I think there must be something wrong with the file itself. As for the encoding, I always use phpStorm and never changed a single setting on it (at least for what concerns file encoding). Actually I don't even now how to check/change the encoding from phpStorm and any text editor I'm using (TextWrangler, Espresso, or TextEdit) doesn't have this option (I'm on a Mac).


cross-host benchmarking with wordpress

I am doing some cross-host benchmarking with wordpress, and rather than going to the huge trouble of setting up an identical install of wordpress on each host, a huge investment of time, etc., I want to create a single php file that would simulate the php demands of wordpress and use that file to gauge each host's relative wordpress efficiency. What might such a file look like? Or does it matter? Would a standard php benchmark file suffice? Note: for my purposes, I'm ignoring database calls from my calculations.


how to design change in woocommerce cart page and all other page also by theme?

I want to change all woocommerce pages design change as per my theme template so what can i do .


Add categories to custom post type

I am using this plugin called Rotating Testimonials by wpbeginner and I have customised to suit my needs, however I need to add the option to add each testimonial to a category and then show the categories on a page and when you click on the category it will take you to a page listing testimonials from that category. This is the code so far - http://pastebin.com/4mKRqcpu I am new to this and would like some guidance! Thanks


How to use WordPress 3.8 back-end CSS in front-end? I want to use the back-end button CSS, button icons CSS etc. onto the front- end side. Is there any way, I can just call the CSS class in front-end to use them directly?


Suppress the_content filter in a nested loop

I have some layout changes that are being applied to `the_content`. I need to do one of two things, but neither is working as expected... either:   1. Pass data to the filter so that it knows if it is a "loop inside a loop" (this pertains to a special post type `events` that are outputting multiple events on a given page). The problem is that the `$post` object inside the filter is returning the `$post` for the **PAGE** , and not the specific item where the filter is about to be applied, so using `post_type` will not work. I wonder if this is bad implementation on the part of the plugin author (calling `$post->post_content` in a non-standard way that is preventing me from accessing it).   2. The other possibility would be to somehow detect "nested" loops, but the issue I have with this is that the main call to `the_content()` seems to be the last one firing, and I'm not sure there's a way to track number of times a loop has fired when I don't have public access to the length of that private `wp_query()` the plugin is executing for it's own post type. Any thoughts on something to fix this... the issue is very significant since it's trying to embed HTML layout intended only for the main page, inside the inner-loop for events.


How to show particular category all post in custom single file

Let me tell details about what I am trying to do, I have one category call **Members** this category show in custom category file. and in category page show featured images with `<?php the_permalink(); ?>` so when I click thumbnail image it go to `single.php` file this is WordPress system for this **Members** category post I have one custom template also. which define in **single.php** bellow is code               <?php     get_header(); ?>     <div class="contentarea cf">       <?php while ( have_posts() ) : the_post(); ?>       <h3>         <?php the_title(); ?>       </h3>       <?php         if ( in_category( 'members' ) ) {              get_template_part( 'content', 'members' );         }               else {             get_template_part( 'content', 'common' );         }      ?>       <?php endwhile;  ?>     </div>     <?php get_footer(); ?>      so when **Members** post open its go to content-members.php file and show post. but now I want in this page will show all **Members** post not only one post. I can't figure out yet how to do that.


How to Add Font Awesome Icons to WordPress Menus?


Why do generated passwords start/end with spaces?

When new passwords are generated for new users, some users are reporting that the passwords include spaces at the beginning and end of the passwords. Has anyone ran into this before or have any idea why this would be happening? What are the potential problems with this, and how can they be avoided?


How to find attachment by it's name?

Is it possible to get attachment id by its name? And at once may be it's possible to get parent post, to which this attachment is assigned?


Buddypress & Nginx x configuration

I am interested in finding out if anyone would be kind enough to post a working BuddyPress and Nginx vhost file configuration. I have a tried a version that does not seem to work. Thank You


Is it possible to use `wp_schedule_event` with real cronjobs?

I hate the way Wordpress Cron Jobs run, so I disabled them:               define('DISABLE_WP_CRON', true);      and want to run a real cron job instead:               wget http://www.myserver.com/wp-cron.php > /dev/null 2>&1      * * * Question: can I then use `wp_schedule_event` to schedule my own stuff? Will they be triggered by the cron job? * * * Also, can I trigger the cronjob without wget?


How to exclude a widget from showing up on a page?

I have a widget that appears on my sidebar throughout my website. I have a page where I don't want this widget to show. How would I go about doing this without installing a plugin and instead doing via hooks or something like that? Below is code I have modified from another post's answer:               function remove_the_scribitwidget ( $regions ) {     if(is_page('sign-up')) {         $key = array_search("scribit-widget", $regions['sidebar']);         if($key !== FALSE) {             unset($regions['sidebar'][$key]);         }     }     return $regions;     }          add_filter('sidebars_widgets', 'remove_the_scribitwidget');      I'm getting the following error: > Warning: array_search() expects parameter 2 to be array, null given in > functions.php What am I missing or doing wrong?


How to completely hide a Wordpress/BuddyPress Install?

I want to make a bbPress application hide the fact that it is WordPress or bbPress for that matter. Please do not get me wrong. I am very proud of WordPress however I just do not want to make it easy for someone to snoop on my assets and version numbers etc for security purposes. I have looked at some plugins that seem to do it for classic wordpress but was looking for a recommendation when it came to buddypress. Also I thought about renaming the theme folder etc. Any tips?


where can I see my custom post type archive template?

I am working with wordpress 3.1 and have custom post type of whitepaper. My single-whitepaper template seems to be working. But the archive template (archive-whitepaper.php) is not. And this after I have added the new 'has_archive' parameter to my register post type function. I have tried setting it to true and I have tried setting it to a slug of 'whitepaper' But when I hit the url example.com/whitepaper, I get a white screen. Here's my code:               register_post_type( 'whitepaper', array(                    'labels' => array(                    'name' => __( 'Whitepapers' ),                    'singular_name' => __( 'Whitepaper' ),                    'add_new' => __( 'Add New' ),                    'add_new_item' => __( 'Add New Whitepaper' ),                    'edit' => __( 'Edit' ),                    'edit_item' => __( 'Edit Whitepaper' ),                    'new_item' => __( 'New Whitepaper' ),                    'view' => __( 'View Whitepaper' ),                    'view_item' => __( 'View Whitepaper' ),                    'search_items' => __( 'Search Whitepapers' ),                    'not_found' => __( 'No whitepapers found' ),                    'not_found_in_trash' => __( 'No whitepapers found in Trash' ),                    'description' => __( 'Whitepaper type is used to post recommended viewing content for our users.' )                                         ),                       'public' => true,                       'show_ui' => true,                       'publicly_queryable' => true,                       'exclude_from_search' => false,               'menu_position' => 5,               'menu_icon' => get_stylesheet_directory_uri() . '/images/whitepaper.png',               'query_var' => true,               'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),               'can_export' => true,               'has_archive' => 'whitepaper'      )     );      What am I doing wrong?


Compare post levels and user levels wishlist member

I'm using Wishlist Member plugin and I'm building a function which compares user_levels and post_levels, but I can't get my function to work:               check_user_access($userid, $postid){               // get user_levels          $user_levels = WLMAPI::GetUserLevels($userid);               // get the post levels          $post_levels = WLMAPI::GetPostLevels($postid);               // Compare user_levels with post_level          $result = array_search($user_levels, $post_levels);               if ($result === false) {              return false;          }          else {              return true;          }           }


How can I show posts only if meta_value is not empty

Three people have already tried to solve this, and we're coming up nil. I want to show only posts that have a value in the meta_key 'featured_image'. So... if 'featured_image' is not empty, show the post. Here's the code:
           <?php           $args = array(             'showposts' => 5,             'meta_query' => array(               array(                 'key' => 'featured_image',                 'value' => '',                 'compare' => '!='                 )               )           );           $ft_pagination = new WP_Query( $args );           ?>           <?php while ($ft_pagination->have_posts()) : $ft_pagination->the_post(); ?>             <?php $ftimage = get_post_meta(get_the_id(), 'featured_image', TRUE); ?>

                                  <?php if ($ftimage): ?>                   <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $ftimage; ?>&w=84&h=60" alt="" />                 <?php else: ?>                   <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=/wp-content/themes/ssv/images/review-default.gif&w=84&h=60" alt="" />                 <?php endif; ?>

           <?php           endwhile;                wp_reset_query();           ?>
      We have tried literally every combination we can think of, the deprecated meta_* options, query_posts, get_posts, instead of WP_Query... Nothing. Printed the select statement, no meta value field is showing. It exists - for the posts (for every post) and it exists in the db. We've seen every post out there on the topic right now, including these: query_posts and only show results if a custom field is not empty http://scribu.net/wordpress/advanced-metadata-queries.html Zilch. Please help...


Custom post type archive organized by category

I'm trying to display a custom post type archive page which displays all the articles of a a custom post type in columns. The columns organize them in their assigned category. On the main page, I do this successfully with regular posts. I loop thru each category, generate a column, and then loop thru each post within than category to populate the column:               get_header(); ?>

                 <?php                 $cats = get_categories();                      foreach ( $cats as $cat ) {                     $cat_id = $cat->term_id; ?>

<?php echo $cat->name; ?>
                          <?php query_posts( "cat=$cat_id&posts_per_page=100" );                          if ( have_posts() ) {                         while ( have_posts() ) {                             the_post();                             the_title();                         }                              wp_reset_postdata();                     ?>
                           <?php } //post                 } ?>

       * * * But within the custom post type I use this code and it generates and displays all the categories, but only displays 1 post per category.               get_header();          if(have_posts()) { ?>

                 <?php                 $args = array (                     'orderby'    => 'name',                     'order'      => 'ASC',                     'hide_empty' => true,                     //'number'    => '4'                 );                      $terms = get_terms( 'bookmark_categories', $args );                 foreach ( $terms as $term ) { ?>

<?php echo $term->slug ?>

                             <?php                             $items = get_posts( array (                                 'post_type'   => 'bookmarks',                                 'numberposts' => - 1,                                 'taxonomy'    => 'bookmark_categories',                                 'term'        => $term->name                             ) );                                  $count = count( $items );                             echo $count;                             ?>

                          <?php                     $post_args = array (                         'post_type'           => 'bookmarks',                         'bookmark_categories' => $term->name                     );                     $query     = new WP_Query( $post_args );                          while ( $query->have_posts() ) {                         $query->the_post();                         $url = get_post_meta($post->ID,'link_url',true); ?>
                                                           <a href="<?php echo $url; ?>" target="_blank" title="">                                 <?php the_post_thumbnail();?>
                          <?php } // while                          wp_reset_postdata(); ?>
                  <?php } ?>

           <?php } else { // if posts         get_template_part( 'content', 'none' );     }          get_footer();


Better post meta efficiency?

I work with websites which require using Post Meta for Post Objects within a particular Post Type. I often add a Meta Box to a particular Post Type, to provide additional settings for the new Post Object being created. You can imagine by now, I have created a few classes which make Post Meta management easier for my every day needs. I have come to common practice of always prefixing all of my Custom Field keys. I have decided to always use my initials, and then a quick reference for what the fields are about. So for example, if I were to add Visibility Settings to all Post Objects in a particular Post Type. A Custom Field key prefix might look like: `mbe_visibility_`. So If I had a 'Global' Custom Field for the Post Object. It might look like: `mbe_visibility_global`. I currently have a function that grabs all Custom Fields for the Post Object, then iterates through the fields returned, filtering out only the fields which have my field key prefix (`mbe_visibility_`). So if I had three Custom Fields: `Global`, `Post Types`, and `Posts`, I would have three keys (each containing a value, specified when saving the Post Object): `mbe_visibility_global`, `mbe_visibility_post_types`, and `mbe_visibility_posts`. Now here is where my questions begin to formulate. I feel like it's a little over-kill, fetching/filtering ALL Custom Fields assigned by WordPress core and other miscellaneous plugins on the website. I was thinking about just changing the way Post Meta is stored/referenced for my Custom Fields. Instead of saving a new Post Meta key for each of the Custom Fields, save all of the Custom Fields in ONE Post Meta key for that Post Object. My approach was to just stick all of your `$_POST` data into one array. So an input field in a Meta Box might look like: `<input type="checkbox" name="mbe_visibility[general][global_visibility]" value="'.$value.'" />` So now when you hook into `save_post` you only need to check if ONE key is available. `if(isset($_POST['mbe_visibility']))` and just save that entire array into one Post Meta key. `update_post_meta($post_id, 'mbe_visibility', $_POST['mbe_visibility'])` should probably sanitize / validate the data before save, but this is just for example. Now all I have to do, to reference ANY of my Custom Fields from the Post Object's Post Meta, all I have to do is: `get_post_meta($post_id, 'mbe_visibility', true)` and I will have specifically what I want for this Post Object, and not have to fetch and filter through all sorts of other unneeded Post Meta from WordPress core or other miscellaneous plugins. If you made it through my long-winded explanation, the question is: **Is it a bad idea to store all of your custom fields into one post meta key, for easier data management? VS. Storing each of your custom fields in individual post meta keys for each custom field.** Of course I would like to see a valid explanation with reasoning supporting your answer.


Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer

When you hover over my drop-down menu using IE8 or IE9, the menu div will display behind the YouTube embedment. It works fine on all other browsers. Upon research, I found out that many others have the same problem and the solution is to set the `wmode` attribute to `transparent`. So for instance `<iframe width="578" height="325" src="http://www.youtube.com/embed/XXXX?wmode=transparent"></iframe>` or `<param name="wmode" value="transparent" />`. My question is, how do I adjust the Wordpress `[embed]` shortcode to set the `wmode` attribute to `transparent`?


No line breaks in tags in tag cloud

I use the tag cloud widget on my site. I have some tags which consist of more than one word, like 'free will'. In the tag cloud, there sometimes comes a line break _in_ those tags, between the words: ![enter image description here](http://i.stack.imgur.com/nJJQB.png) How can I make that this doesn't happen? I thought of adding `display:inline- block;` to the style of the tags, but there is no general `tag` class or something like that. Can I add a class to all tags (and if so how?) or is there an other way to do this (and if so what way?)


An other permalink problem - 404 Error

I know there are already a lots of post about this question, but not a single one helped me to solve this issue. I moved my page to an other server and afterwards I was facing the problem that the permalinks stopped working. I use the following permalink: `/%postname%/` The `.htaccess` file is set properly see the following:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      When I set the permlinks back to standard it seems to work. mod_rewrite is loaded, but I'm not sure if `AllowOverride` is set to "All", how can I check this without having access to the `httpd.conf` file. I'm on a shared host. Does anyone have an idea how to solve this?


how to add weight field on checkout page in Jigoshop Plugin

Presently when order received e-mail is mail contains following   Subtotal: $3,075.00 Total: $3,075.00 Now i want something like Subtotal: $3,075.00 Total: $3,075.00 Total Weight: 122kg Can someone give me idea that where or in which files I do edit to get the desired output plugin URL is : http://wordpress.org/plugins/jigoshop/


How to check whether post contains pingback/trackback or not

I want to check whether post contain pings and then display the pings. I used the following code and it does not work for me.               <?php if ( !empty($comments_by_type['pings']) ) :  ?>

Trackbacks

                 <?php wp_list_comments('type=pings&page=1&per_page=9999');?>

     <?php endif; ?>      Actually i want to show pings separately. How can i check whether the post contains ping or not by using if statement.


Changing WP location and wp-content folder name witouth loosing SEO

I'm trying to make my site the most efficient way as possible, and I find out thant changing lot of things in permalinks , security folders , etc, works pretty well. But what happen if the WP, is already 5 years old , with a great Rank, and the WP is located in:               http://the5yearsblog.wow/sites       and you want to change it to:               http://the5yearsblog.wow/      and changing `wp-content` to `resources` or whatever. That all obviously will affect greatly the SEO , but how can we prevent that and maintain `the5yearsblog.wow` as great as ever for search engines?, is there any trick to solve this completely fancy, secure and whimsy petition? thanks guys


WordPress not performing direct update

I recently modified my server configuration and then I noticed Wordpress would no longer upgrade automatically and I was asking for FTP information to perform the upgrade.Irony is that I don't have standard FTP access, it's all SFTP. I reverified the file/directory permissions and group. I am really stuck, please help me guys.


Could not create directory

I have followed the instructions from   * https://help.ubuntu.com/community/WordPress   * https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu Every time I try to update or install a new plugin, I get the following error:               Downloading update from https://downloads.wordpress.org/plugin/akismet.3.0.1.zip…     Unpacking the update…     An error occurred while updating Akismet: Could not create directory.     All updates have been completed.      I have set up `/var/www/html` with               sudo ln -s /usr/share/wordpress /var/www/html     sudo chown wp-user:www-data -RL /var/www     sudo chmod g+w -R /var/www      I have tried   * Adding `define('WP_CONTENT_DIR', '/var/www/html/wp-content');` to `/etc/wordpress/config-my.host.php`   * `sudo chmod o+w -R /var/www/html/wp-content`   * `sudo -u wp-user touch /var/www/html/wp-content/test` succeeds   * `sudo -u www-data touch /var/www/html/wp-content/test` succeeds System info:               $ cat /etc/*-release     DISTRIB_ID=Ubuntu     DISTRIB_RELEASE=14.04     DISTRIB_CODENAME=trusty     DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"     NAME="Ubuntu"     VERSION="14.04, Trusty Tahr"     ID=ubuntu     ID_LIKE=debian     PRETTY_NAME="Ubuntu 14.04 LTS"     VERSION_ID="14.04"     HOME_URL="http://www.ubuntu.com/"     SUPPORT_URL="http://help.ubuntu.com/"     BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"                    $ apt-show-versions wordpress apache2 php5 mysql-server     apache2:amd64/trusty 2.4.7-1ubuntu4 uptodate     mysql-server:all/trusty-security 5.5.37-0ubuntu0.14.04.1 uptodate     php5:all/trusty-security 5.5.9+dfsg-1ubuntu4.3 uptodate     wordpress:all/trusty 3.8.2+dfsg-1 uptodate


Appearance editor not showing up on any section of multisite installation

Wordpress 4.0. Tried disabling all plugins. Tried different themes including 2014 theme. Sent ticket to hosting provider but wp-config.php file doesn't have define('DISALLOW_FILE_EDIT', true);. Checked for it at all levels of the install. Both on the site dashboard itself and the network dashboard. It isn't there. It would be nice to have it since a lot of bugs I'm encountering suggest fixes through that very same editor.


wpquery properties last_query and last_result : should these be public or private?

I've come across the following lines of code in `wp-includes/wp-db.php`:               /**      * Last query made      *      * @since 0.71      * @access private      * @var array      */     var $last_query;          /**      * Results of the last query made      *      * @since 0.71      * @access private      * @var array|null      */     var $last_result;      I wonder whether, since variables declared with var are public by default, as can be seen here, whether there is an error in the documentation, and whether var in this code snipped should be changed to private or public. Thanks.


Using the 'init' hook in the WordPress testing environment

I am trying to add an action to the `init` hook in the constructor of a class that is called from my main plugin class. The action is never being called.               class Custom_Post_Type_Plugin {              protected static $instance = null;              public static function get_instance() {             null === self::$instance && self::$instance = new self;                  return self::$instance;         }              // Calls the constructor of class $registrar_class with the         // $type parameter.         public function register_new_type( $registrar_class, $post_type ) {                  return new $registrar_class( $post_type );         }     }          // class Register is a wrapper around the WordPress function     // register_post_type()     class Registrar {              protected $post_type;              // Constructor adds register_type() action to init         public function __construct( $post_type ) {                  $this->post_type = $post_type;                  add_action( 'init', array( $this, 'register_type' ) );         }              // --- This action is never called ---         public function register_type() {                  register_post_type( $this->post_type );          }     }          // Instantiate the plugin and call the register_new_type() method     $plugin = Custom_Post_Type_Plugin::get_instance();          $plugin->register_new_type( 'Registrar', 'service' );      The constructor of class `Registrar` is being called. When I check the $wp_filter['init'][10] variable the `register_post_type` method show up (prefixed by a long id) but the method is not being called. My guess is that WordPress can't find it, but that is just a guess. Any suggestions or hints would be appreciated. Edit: The code works in the WordPress development environment, but not in the testing environment. In the testing environment the `register_type()` method is successfully added as a subscriber to the `init` action hook, but it is never run. The test using `post_type_exists()` to test that a post type has been registered fails. I am not clear about when the `init` action is fired during a series of tests. It seems that it is only fired once after the 'installing' phase of `phpunit`. Attempting to run `do_action( 'init' )` in the `WP_UnitTestCase::setUp()` function produces errors. Is this a know problem, or am I doing something wrong? Is there a way to somehow 'mock' the `init` event?


random characters on links

Just recently i have noticed same set of stings appended to all my links on pages, where did this come from. if you look on the following page http://www.spectrumasa.com/services/si-time hover over the links and you will notice `?phpMyAdmin=JeyfrRdOidtd1oqamYTFrESz6u2&phpMyAdmin=c93d0493be3f8db1c43d215d9955edc9` which should not be there. The parameters seem to only appear on page content and not posts or widgets or menu items. what more information can i give as i am not aware of any changes made.


How to restore: Database intact but folders deleted

I never thought I'd come to having to ask this question -- one trusts web hosting companies to keep our data intact, but somehow they have deleted my entire Wordpress installation while leaving the database intact. I've also lost the backups as they were on the web server. How can I restore the wordpress installation?


How to upload video using media uploader?

I have followed and learned how to upload image using wordpress uploader. But I did not find how to upload video. All I found is about image uploader.As               jQuery('#upload_logo_button').click(function() {         formfield = jQuery('#upload_image').attr('name');         tb_show('', 'media-upload.php?type=image&TB_iframe=true');              return false;     });      Any ideas? This upload may be in setting field, metabox..etc


WP_USE_EXT_MYSQL

Here is the constructor for the wpdb class as found in the source code. According to a google search this has been recently renamed from USE_EXT_MYSQL. However I cannot find anywhere in the source code where either constant is defined.               function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {         register_shutdown_function( array( $this, '__destruct' ) );              if ( WP_DEBUG && WP_DEBUG_DISPLAY )             $this->show_errors();              /* Use ext/mysqli if it exists and:          *  - WP_USE_EXT_MYSQL is defined as false, or          *  - We are a development version of WordPress, or          *  - We are running PHP 5.5 or greater, or          *  - ext/mysql is not loaded.          */         if ( function_exists( 'mysqli_connect' ) ) {             if ( defined( 'WP_USE_EXT_MYSQL' ) ) {                 $this->use_mysqli = ! WP_USE_EXT_MYSQL;             } elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {                 $this->use_mysqli = true;             } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {                 $this->use_mysqli = true;             }         }      Can someone please explain to me what the code does and whether there has been an omission somewhere? Thanks.


Multiple RSS feeds scroller in one sidebar

How can i have multiple RSS feeds scroller in one sidebar. I want the RSS feeds of CNN, BBC, google news, USA today etc, all at the same time, is it possible to duplicate an RSS scrolling widget?


How to tell if Jetpack's Photon is active?

There are multiple ways to identify if a plugin is active (here's one) but how can we identify if a specific JetPack component is active, for example Photon?


Increase number of posts in archive page

Currently my website archive page is showing 5 post per page. I need to set it to 100 post per page. (My home page showing 5 post per page and I don't want change it) Here is my archive.php                   <?php get_header(); ?>         <?php do_atomic( 'before_content' ); // my-life_before_content ?>
         <?php if (have_posts()) : ?>                <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>           <?php /* If this is a category archive */ if (is_category()) { ?>
Archive for the ‘<?php single_cat_title(); ?>’ Category
           <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
Posts Tagged ‘<?php single_tag_title(); ?>’
           <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
Archive for <?php the_time('F jS, Y'); ?>
           <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
Archive for <?php the_time('F, Y'); ?>
           <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
Archive for <?php the_time('Y'); ?>
           <?php /* If this is an author archive */ } elseif (is_author()) { ?>
Author Archive
           <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
Blog Archives
           <?php } ?>                  <?php if ( is_paged() || count($posts) >= get_option('posts_per_page') ) : ?>

<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>

                  <?php else : ?>

                  <?php endif;?>                        <?php while (have_posts()) : the_post(); ?>

<?php the_time('j') ?>

<?php echo strtoupper(get_the_time('M')); ?>

                     <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

Posted in:
<?php the_category(', ') ?>
 |
<?php the_tags(' '); ?>

                  <?php endwhile; ?>                  <?php if ( is_paged() || count($posts) >= get_option('posts_per_page') ) : ?>

<?php next_posts_link('« Older Entries') ?>

<?php previous_posts_link('Newer Entries »') ?>

                  <?php endif;?>              <?php else : ?>
No posts found.
              <?php endif; ?>         <?php do_atomic( 'close_content' ); // my-life_close_content ?>                  <?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
              <?php do_atomic( 'after_content' ); // my-life_after_content ?>          <?php get_footer(); // Loads the footer.php template. ?>      I've created the archive page via two themes "Omega" + Quietude


How can I have different langauges in wp-admin on a multisite installation?

Changing the admin language for a single installation is easy. But I'm wondering, how can this be done for a multisite installation? By default it's English, but a customer would like to have it in Norweigan. I found this post, but doesn't help my case. Suggestions anyone?


How to get specific records from table using multiple parameter

Bellow is my table structure `wp_woocommerce_order_itemmeta`               meta_id order_item_id  meta_key        VALUE         1     2            Dining Date      2014-10-22         2     2            Booking Time     3:00 - 5:00         3     2            _qty             1         4     2            _product_id      226         5     2            pa_gender        male         6     2            Dining Date      2014-10-22         7     2            Booking Time     3:00 - 5:00         8     2            _qty             1         9     2            _product_id      226         10    2              pa_gender       female      I am using bellow query but i am getting only column names. But not getting specific record.of meta_key and meta_values.               SELECT t1.*     FROM wp_woocommerce_order_itemmeta t1     INNER JOIN wp_woocommerce_order_itemmeta t2 ON t1.meta_key='_product_id'=t2.meta_key='_product_id'       WHERE t1.meta_key = 'Dining Date' AND t1.meta_value = '2014-10-22'       AND t1.meta_key = 'Booking Time' AND t2.meta_value = '3:00 - 5:00'       AND t1.meta_key = '_product_id' AND t2.meta_value = '226'       AND t1.meta_key = 'pa_gender' AND t2.meta_value = 'female'       AND t1.meta_key = 'pa_gender' AND t2.meta_value = 'male';


setting up a wp cron job

I am a bit new to wp-cron job. I think i understand the concept but lack the implementation. i read a lot of tutorials on how to implement including this post: Run function at specific time but still cant figure where (in which files) is best practice. The above link describes kind of well my issue. i want each day on a specific hour to run test.php file which is in my root folder of wordpress(where the wp-content and include and etc). i am well aware for the disadvantages of wp-cron (no traffic no cron) and i am fine with it. i dont want to workaround with unix cron. I want the test.php file to be called not earlier then a specific time each day. please help and specify the file in which the implementation should be made. thanks


Stop guest from viewing entire media library

When you select an image on my website, the user can scroll through the entire Library. How can I limit that. Really don't want to change my theme but it seems to be part if the problem.


Retrieving post ID from current page

I am following the tutorial here. Wordpress Ajax is a bit complicated but this tutorial helped me out a bit. The only question I have is, when I view any page, I want to be able to get the current post ID. There is a function called whatever. Now For some reason I can't get the `$post->ID` of that current page.                // The function that handles the AJAX request      function my_action_callback() {       check_ajax_referer( 'my-special-string', 'security' );       global $post;            $whatever = intval( $_POST['whatever'] );       echo $post->ID;       die(); // this is required to return a proper result      }


How to allow logged in users to post anonymously

I've been searching and searching for a while now to see if there's a way to allow people who are logged into my BuddyPress site to make a post on the activity section as "anonymous" or as their screen name, an ideal additional option would allow comments on that post to be made as anonymous or their screen name as well. Why would someone want this? I have no idea, but my client wants it one way or another. How can I do that?


How to center oEmbedded content

I understand you have to paste the link that you're embedding without any code wrapping around it, but how do I force the embedded content to be centered? Currently, the default is aligning to the left. I could modify the core file, but it's highly discouraged, so I'm asking to see if there's any hook or filter to get around this. Thanks!


Advanced searching form

I am trying to create an advanced searching page on front-end page for users. I have been trying to find but it's not easy to find some tutorial or sample source. I have found that It is possible to put some filters on admin panel. I am looking for just like this for front-end for users. See this tutorial for admin panel I need to create like this on front-end for users. this is custom post-type searching. Any tips? tutorial, sample codes? Thanks for your time and good weekend ;)


Limit number of uploaded attachments of specific context

I am assigning a custom `_wp_attachment_context` meta to attachments with specific usage. In my case - favicons. I also took advantage of the WP Customizer so my users could upload icons using extended `WP_Customize_Image_Control` control class. Next thing I was hoping to figure out is how to limit those uploads per context and keep the control's library clean with a max number of uploads allowed. Ultimately I planned old attachments(unless currently used) to be removed or trashed on new attachment upload if limit is exceeded. Since I am using a customize control to upload/set favicons both added and removed items should be reflected in the "Uploaded" control tab.                 api.bind('ready', function() {         api.control( 'store_favicon', function(control) {           control.uploader.success = function( attachment ) {               ...               api.ImageControl.prototype.success.call( control, attachment );               ...         });       });      `ImageControl`'s success is already doing the adding. But I can't figure how to supply my custom `success` method the data if it has to remove items.


Moving wordpress out of the public directory

Is there a way to move wordpress out of the public html directory? The PHP files responsible for generating html output should be hosted but the php files responsible for database connections and other logic should not be hosted. They can be included by the hosted files in the following way: `../../NotPublic/wp-admin/...` Symfony does this and actually has only one hosted php. For more explanation as to why this would be a good idea you can check out this video. I've tried to find instructions on how to do this but cannot find it. Worpress seems to have trouble making a distinction of php files generating output that need to be in the public directory and those that do stuff and should not be able to be requested through the web server (only as includes). Currently I can use .htaccess to not list the directories or host any of the wp-content directories except wp-content/uploads


Replacing Thumbnails with View All Photos

When I make a post with over 20 attachments, I want the post on the index page to have just 10 thumbnails (these link to `image.php` which eventually links to all 20 photos), with a link that says "View All 20 Photos". I have searched for weeks now I haven't been able to figure out how this is done. I'm not sure what better way to frame this question but JustJared.com, LaineyGossip.com are good examples of what I have in mind, any ideas?


Can we load "load_theme_textdomain" multiple times with different domains?

Supposing that I have two domains in my theme named "basic" and "advance". Is it possible to load two different domains in my theme?               load_theme_textdomain( 'basic', TEMPLATEPATH.'/languages' );     load_theme_textdomain( 'advance', TEMPLATEPATH.'/languages' );


Show all galleries in a single page with post title

I am wondering how to display one photo from every gallery, with a title of the post its from, as well as a link to view the rest of the photos in the gallery. This is exactly what I mean: http://www.celebuzz.com/kourtney- kardashian/photos/ I hope someone can help me out, Thanks in advance x


WXR import problem — not including categories

I’m trying to import into Wordpress a WXR file with many hundreds of Posts. It works fine and during the import process it seems to understand the categories, but the imported Posts are eventually just given the Uncategorized category. I’m using the WordPress Importer plugin. Does anyone have any ideas on this? Thanks!


Show private pages in public when you logged in as admin?

Is there any way to show private pages at the public website section when you logged in as admin? Today, they only shows in admin.


Rewriting URLs with query strings and preserving them

straight to the issue - I MUST preserve link structure as follows, otherwise the baby squirrels die:               website.com/blog.html?comments=%id%      where the `%id%` stands for ID of post basicaly, that corresponds with the post IDs in my WordPress installation. So, is it possible to somehow get to the `%id%` thing and use it as a variable to pass to `somewordpresssite.com/?p=%id%` either through .htaccess or the Rewrite API itself, I don't really care. Today I went through a lot of tutorials, forums, hints, tried to write code in .htaccess (basic rules with `${QUERYSTRING}` work, but WordPress overrides them with it own ones, and it looks mixed) and nothing worked. I got to               add_rewrite_rule( '^blog.html[^/]comments=([0-9]{4})$', 'index.php?&p=$matches[1]', 'top');      which would accepte even               website.com/blog.htmlDcomments=%id%      and that'll do perfectly! But when there is a query (basicaly question mark), everything breaks. I'd be really glad if anyone could help. Thank you.


Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs

I have a pair of Portfolio Slideshows inside of jQuery UI Tabs. One per tab with each pulling in a different page's gallery. When I switch between tabs the slideshows behave oddly. The main image is shrinking down to about 10% of its width, but keeping its height. When the page first loads, it seems to be working correctly, and this only happens when the second tab is selected. Once the second tab is selected it will then affect the first tab as well. This can be seen here: wwnumc.org/2012-nehawka-christmas-program/. I've tried several different approaches to try and rule things out. First being placing the Portfolio Slideshows on the page outside of the jQuery UI Tabs. Both work correctly when not in Tabs. I see no errors on the page using the console. I've also checked Chrome, Firefox, and Safari. All three show the same problem.   * WordPress Version: 3.5   * Portfolio Slideshow Version: 1.5.0   * jQuery Version: 1.7.1   * jQuery UI Version: 1.9.2 Any ideas would be greatly appreciated.


How can I run code in functions.php when switch_theme() is called?

I've got some code inside functions.php which is designed to execute only when the theme is first activated:               if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) {     //this code only runs when the theme is first activated     }      However, I'm pretty sure this code is not running if the theme is activated outside the normal activation process. For example, if a switch_theme() statement is called from a plugin. In that case, how might I alter my code above to execute on switch_theme()?               if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php') OR (switch_theme_called() ) ) {     //this code only runs when the theme is first activated     }


Multi-level page hierarchy

Most of my WordPress sites to date have been blog content, along with a 1 or 2 level page hierarchy. I'm now looking at developing a site with the customer site map suggests that a hierarchy of 4 levels of page content is required. In terms of WordPress the hierarchy is easy to create, but I'm looking at the ways of providing navigation in the theme for this page hierarchy. One thing I've seen is the Fold page list plug-in, but can't find much else on the subject. I was wondering if anyone has any examples or experiences they can suggest for how best to provide the navigation in the theme for a deep page hierarchy like this? EDIT - To clarify, I haven't currently selected a navigation type, this is part of the question. In a 2 level page hierarchy I normally use a top nav for the 1st level, with dropdown showing the 2nd level of navigation This isn't easily going to extend to 4 levels of navigation (unless we go for multiple menus opening similar to the Windows start button type menus, or the menumatic example in this article). So I am considering what alternate approaches are available e.g. top level navigation on a top bar, and then a sidebar showing 2nd level navigation headings, with expandable subsections as you drill down to the 3rd and 4th level. E.g. see the 'in action' section at the bottom right of the fold page list plugin webpage However there may well be other good approaches to this, hence the question, to try and understand how other people approach providing navigation within WordPress to a deep hierarchy of page content


Loading scripts only if a particular shortcode or widget is present

I needed a way to filter a page/posts content before it was loaded so I could add scripts to the header if a specific shortcode was present. After much searching I came across this on http://wpengineer.com               function has_my_shortcode($posts) {         if ( empty($posts) )             return $posts;              $found = false;              foreach ($posts as $post) {             if ( stripos($post->post_content, '[my_shortcode') )                 $found = true;                 break;             }              if ($found){             $urljs = get_bloginfo( 'template_directory' ).IMP_JS;              wp_register_script('my_script', $urljs.'myscript.js' );              wp_print_scripts('my_script');     }         return $posts;     }     add_action('the_posts', 'has_my_shortcode');      which is absolutely brilliant and did exactly what I needed. Now I need to extend it a bit further and do the same for sidebars. It can be by a particular widget type, shortcode, code snippet or anything else that would work to identify when the script needs to be loaded. The problem is I can't figure out how to access the sidebars content before the sidebar is loaded (the theme in question will have several sidebars)


display custom taxonomies limited to custom post type?

i have a stupid situation, where i somehow can't find a solution and would really need some help! So... i'm working on a project, where i have in addition to Post and Pages two Custom post types: Photos and Events. I have created a custom taxonomy named "Tags". This taxonomy is applied to Post, Pages, Photos and Events... so basically you can give everything a Tag and you can chose everywhere from tags, that are being used elsewhere (example: if you give some tags in the Events, then you can later chose the same Tags in Photos). The Idear is to show everywhere related stuff. So if you are on a Event, you will see in the sidebar related news, photos, even page entries...and so on... NOW i want to display in the Photo - section only the tags, that were already used in the Custom post type Photos. Not all of them (there are some tags in Events, that have never been used in photos). So one could chose to see only photos base on a Tag... I don't have any code yet... although i'm not a newbi in wordpress, a this point i don't even know where to start. how can one display a list of tags, that are a custom taxonomy, limited by a custom post type?! Any suggestion would be really nice!


How to highlight the right item in the navbar

In my site i have a navbar which is created by using the new feature of wordpress 3 - "the menus ".In my site this navbar conatins both categories and pages. When I'm in a single post / sub-page , the navbar doesn't give the parent category /page the class of "current-menu-item" and therefore that item in the navbar is not highlighted. I found this but it really doesn't help me because the menu is not built on category_ID like a regualr navbar created by wp_categories_list(), but on item_ID , which I don't understand how is generated. I would like to know either how the item_ID is generated, and/or how to highlight the right item in the navbar Here is a printscreen of my navbar's HTML ![alt text](http://i.stack.imgur.com/0JR8v.jpg) and here is a printscreen of navbar created by wp_categories_list() ![alt text](http://i.stack.imgur.com/APpuN.jpg) thanks!!


How can I create a multisite global tag cloud?

I have a WordPress multisite installation. I need to create a sitewide tagcloud on the main blog. How can I do that ?


How do I list all child categories that apply to current post?

On my site, I am working on categorizing pictures based on what is in them and am having trouble listing the categories that apply to the post. For instance: A post might include a picture of an ice cream cone with three flavors of ice cream. My category hierarchy for this post might be: Flavors ->Vanilla, Mint Chip, Chocolate Style ->Cone However, I cannot seem to get a list that includes just children of 'flavors' or 'style', without listing all checked categories. Essentially I am hoping to have two, nicely organized lists, where one lists the flavors and the other lists the style. Just I don't want them both in the same list. Is this possible? -get_categories seems to have the proper arguments, but I have not been able to work it out.   -the_category seems like it is close, but it doesn't allow for excluding a particular category from a list


How can I combine this php statement to get the results of multiple variable inputs?

This is my query, it shows the posts that have meta_key as extra1 and meta_value as test               <?php $customkey1 = 'extra1'; ?>     <?php $customvalue1 = 'test'; ?>     <?php query_posts('meta_key=' . $customkey1 . '&meta_value=' . $customvalue1);  ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>          <?php the_title(); ?>          <?php endwhile; ?>     <?php endif; ?>      My question is how can I still show the posts that have extra1 as metakey and test as metavalue but also the posts that have extra2 as metakey and test2 as metavalue in the same query. A combination of two or more variables.


Transferring from "Populate" CMS to WordPress

Okay, apologies up front for being such a coding novice. I am transferring a web site (not a blog) from a CMS called Populate over to WordPress, from one hosting to a different hosting. I don't have access to the source files on the current host. (Long story short, I'm not a code/site thief: the owner of the site business and its domain is locked out by her former admin. She asked me to help her transfer her site.) So... I'm looking at a lot of copying and pasting -- field by field! -- of the content from Populate over to WordPress. QUESTION: Is there a more efficient way to do this? I can grab source code from View Source, of course, but what good is that for plugging wholesale into Word Press? And I don't write PHP (shame on me, eh?) Or is there a way to do that? (Fingers crossed!) Thanks a ton! C


Extra filed under "About the user" user profile

I use the following to add Phone number,linked id etc Under the "Contact Info" in user profile. Now I have to add a filed under the "About the user". How can i do that?               function my_new_contactmethods( $contactmethods ) {     $contactmethods['designation'] = 'Designation';     $contactmethods['linked_in'] = 'Linked In';     $contactmethods['phone'] = 'Phone Number';     return $contactmethods;     }     add_filter('user_contactmethods','my_new_contactmethods',10,1);      **UPDATE** The above code adds 3 fields to under the section "Contact Info " in the user profile I don't want to create a new heading called "About the user" and give the required fields. A section with "About the user " is already there in the profile which includes biographical info and password changing option. I want to add a new field there along with those two


Problem on displaying the results on my query

Hello this is my query. I want to show the titles of posts that have fullfil the following but it doesn't show anything, I don't know. Thank you! Also, is there another way to show the results, more wordpress-like?               <?php           $theposts = $wpdb->get_results("SELECT post_title FROM $wpdb->posts         WHERE ID IN     (        SELECT DISTINCT post_id        FROM $wpdb->postmeta        WHERE meta_key = 'extra1' AND meta_value = 'test'     )");          foreach ($theposts as $thepost) {     echo $thepost->post_title;          }     ?>


Plugin that lets visitors Like a post (not facebook) and stores likes in custom meta?

Does anyone know of a plugin that has a like feature or thumbs up down etc which stores these likes as custom meta data? Not a facebook like. I'm currently using WTI Likes which stores the data in a new database table. I need a way to sort posts by these likes and it seems the easiest right now is to find a plugin which stores likes in custom meta as there are plugins to sort by custom meta. Thanks in advance


Preview Changes button missing on custom post type page since updating to 3.4

Any idea why when I'm on post.php of my custom post type page I no longer see the Preview Changes button? I have checked on an old installation and it shows on WordPress version 3.3 but not 3.4. The custom post page has this HTML: ![enter image description here](http://i.stack.imgur.com/skrqs.png) A normal post page has: ![enter image description here](http://i.stack.imgur.com/RQoUU.png) Why is my custom post page missing the div preview-action in the latest version of WordPress?


About Wordpress capabilities

I know WordPress is best for blog engine and with some plugin like Advance Custom Field, WP can become a great CMS. But it still good for publisher to push content to user. Now I have quite a situation. My friend want to use WP as a engine where user can contribute their post and others can review it. Is it possible to do with WP I can create a custom theme & plugin to do the trick, but is it good for performance when user put a lot of things (pages and post) on it?


WP E-Commerce creating categories programmaticaly

I was searching WP Ecommerce documentation, trying to find what function to use to add category to WPEC, but no luck. Is there some function or piece of code that can do this?


Finding WordPress sites using my plugins

I've now developed two WordPress plugins and would like to see some sites that use it. I'm looking for a way to find sites that use a WordPress plugin I built. However, the official guidelines, don't allow me to log the hostnames of blogs that install my plugin, for example. Point 7: > No "phoning home" without user's informed consent. So, are there ways to find sites using my plugins? The plugins I'm talking about are NaNo Stats and Snake. I have thought about adding some HTML comments or a specific meta-tag to the HTML body of the site and then searching with Google. Would that work and be allowed by WordPress?


Add Media + Quick Edit buttons not working

I just upgraded to Wordpress 3.6.1 and I have an issue, for the default twenty-twelve theme the add media and quick edit buttons work okay but when I created my own custom theme those buttons stopped working. I have not yet installed any plugins into my site and I have been searching for a solution for a while now, I need some help on this. These are the scripts I'm currently using in the `header.php` file:               <script src="<?php bloginfo('template_url'); ?>/js/jquery-1.10.2.min.js"></script>     <script src="<?php bloginfo('template_url') ?>/slider/anythingfader.js"></script>     <script type="text/javascript" src="<?php bloginfo('template_url') ?>/js/jquery.simplyscroll.min.js"></script>


Copy post taxonomy?

I'm rather new at Wordpress and I the thing I want to do is this: Create a taxonomy (courses) that works as exactly as POST _but with the difference_ : I need some fields to be added for course (like cost of course, age-span, which day of week the course is held etc.). I guess I could just add custom fields to the POST-taxonomy, but I want to separate "normal posts" with "courses". I have a lot of experience in PHP-programming but Wordpress is new for me. I understand the concept of taxonomies and hooks and have an understanding how WP works with themes, child themes, plugins etc. I've installed a plugin called Simple Taxonomy at `https://github.com/herewithme/simple-taxonomy` and I created a taxonomy called Courses. The thing is that I want to associate a course with a category. When I choose hierachical to true for that specific plugin, then it's only hierachrical within it's own taxonomy but I want the course to have same relation-type as the post-taxonomy. I've read this How to link categories to custom taxonomy terms? which is similar but I want want to able to select one or more categories to this categories (exactly as you could chose categories for a post-taxonomy) _**I bascially want to copy the post-taxonomy and use it as another taxonomy with some other fields._** Is it possible? Or would I have to add fields to the post-taxonomy? I just understand that there is something called Custom post types http://codex.wordpress.org/Post_Types. Is that the way to go for this issue?


Switch a single site to a multi-site

A client of mine wants to switch their single site installation and make it a multi-site one so that they can run an online store on a sub-domain while keeping their existing site on the primary domain. I've Googled all morning but all I can find is ways to import a single site into an already existing multi-site installation whereas what I need to do is convert a single to a multi. Is this possible?


Wordpress Comments jQuery Doesn't submit

I am trying to check if the commentform is filled in after submition, and only submit it when it is filled in. I am using:               $('form').submit(function (e) {         e.preventDefault();         // Handle Checks         $(this).submit();     });      But it's not submitting at all, any idea why this isn't working? Works on regular contact form in wordpress btw. Thanks!


Modify custom Users Manage page

I'm trying to create a **submenu page** under ' **Users** ' which is like the 'All Users' page but **for listing users of specific roles only**. Let's just call this submenu page **'Customer'**. So far I managed to create one with its own columns, but there are still some things that I haven't managed to modify **to make the contents more relevant** : > ![Custom User Page](http://i.stack.imgur.com/TsSP0.jpg) ## Here's what I need to do:   1. How do I **change the page title** to reflect the submenu name, in this case 'Customer'?   2. (a) How do I change the **filter links above the list to show ONLY 'All', 'Subscriber', & 'Pending'**? (b) And also the **'Change role to..' dropdown menu**?   3. How do I change the filter link **'All' to direct to the 'Customer' page** (which is the custom users page)?   4. How do I make the **'Customer' submenu link to hilite** to indicate the current page viewed? > **NOTE:**   >  The default ' **All Users** ' page should therefore be **the opposite** of > this page in terms of the **filter links**. ## Here's roughly how I created the above page:               /* Create new user submenu with custom parameter in slug */     add_action('admin_menu', 'my_custom_user_submenu');     function my_custom_user_submenu() {         add_users_page(             'Customer',             'Customer',             list_users,             'users.php?user=custom'         );     }          /* Filter users according to the users list page */     add_action('pre_user_query','my_user_customer_list');     function my_user_customer_list($user_search) {              $user = $_GET['custom'];         $role = $_GET['role'];              if ( $user == 'custom' OR $role == 'subscriber' OR $role == 'pending' ) {                  global $wpdb;                  /* For Customers Page:              * Get only 'Subscriber' & 'Pending' users              * */             $user_search->query_where =              str_replace('WHERE 1=1',                      "WHERE 1=1 AND {$wpdb->users}.ID IN (                         SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta                              WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}user_level'                              AND {$wpdb->usermeta}.meta_value = 0)",                      $user_search->query_where             );              } else {                  global $wpdb;                  /* For User Admin Page:              * Get all apart from 'Subscriber' & 'Pending' users              * */             $user_search->query_where =              str_replace('WHERE 1=1',                      "WHERE 1=1 AND {$wpdb->users}.ID IN (                         SELECT {$wpdb->usermeta}.user_id FROM $wpdb->usermeta                              WHERE {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}user_level'                              AND {$wpdb->usermeta}.meta_value >= 1)",                      $user_search->query_where             );              }     }


Getting list of top 10 users and sort on last name

I would like to display a list of the top 10 authors based on the amount of posts that they have, and then sort them on last name. To my knowledge, this is not trivial since the last name of a user resides in the user meta table. I have been succesful in writing the code to achieve what I'm looking for, please see the code below. I am however wondering if it is possible to optimize this code, so it uses less db queries. Anyone have any suggestions?                       <?php /* 1. Get list of 10 users with the most posts, sorted by post count. */ ?>             <?php $blogusers = get_users('exclude=1,2&order=DESC&orderby=post_count&number=10'); ?>                  <?php /* 2. Set up array with author ID's and user last names from the user meta table */ ?>             <?php foreach($blogusers as $t){                 $user_info = get_userdata($t->ID);                      // Sanitises connecting words in last names to enable proper sorting                 $lastname = $user_info->user_lastname;                 $patterns = array();                 $patterns[0] = '/van /';                 $patterns[1] = '/het /';                 $patterns[2] = '/de /';                 $patterns[3] = '/der /';                 $patterns[4] = '/\'t /';                 $replacements = array();                 $replacements[0] = '';                 $replacements[1] = '';                 $replacements[2] = '';                 $replacements[3] = '';                 $replacements[4] = '';                 $cleaned_lastname = preg_replace($patterns, $replacements, $lastname);                      // Store cleaned last name with author ID key in array                 $poep[$t->ID] = $cleaned_lastname;             } ?>                  <?php /* 4. Sort array based on last name */ ?>             <?php asort($poep); ?>                  <?php /* 5. Display tiles */ ?>             <?php $count =1;?>                            <?php foreach ( $poep as $key => $val ) : ?>             <?php $user = get_user_meta($key); ?>                  <a href="<?php echo get_author_posts_url($key); ?>" class="tile author_tile_link author_tile<?php if ($count % 5 == 0) { echo ' last'; } ?>">                 <?php echo get_wp_user_avatar($key, 'thumbnail'); ?>

<?php echo get_the_author_meta('first_name',$key).' '.get_the_author_meta('last_name',$key); ?>
                     Zie alle artikelen
                          <?php $count++; ?>             <?php endforeach; ?>


resend user login & password with custom button

How would you resend the login & password to a user who has forgotten his password? In this case they don't want to go to the "password" forgotten page. Additional Q: Mass re-sending of passwords. I understand that it's nearly impossible to resend the password, so reset is also ok. but i need a way to click select some users and then send them the reset link mail. Current Solution: I list my users (ordered by role) in a table & simply added a little lost password form with a button. It works but is the opposite of ... nice. If you want to resend a password, you click the button and open a blank tab/window. This saves me from going back all time, but re-sending 200 password mails still is a pain. Plus: It's impossible to resend the password. The user just receives a link to click to reset the password.               <td id="<?php echo $user->ID; ?>;user_pass;<?php echo $wpdb->users;?>">         <form name="lostpasswordform" id="lostpasswordform" action="<?php echo site_url('wp-login.php?action=lostpassword'); ?>" method="post" target="_blank">                 <input type="text" name="user_login" id="user_login" class="input hide" value="<?php echo $curuser->user_login; ?>" size="15" tabindex="10" />                 <input type="submit" name="wp-submit" id="reset-pass" class="margin-null" value="send" tabindex="100" />         </form>     </td>      Thank you!


Convert user passwords to MD5?

I am in the process of migrating my site out of Wordpress and I need to filter the registration and/or login process so there is a separate database field that holds the user password in a hash that can be easily used on a non-WP site. How can I go about this?


How can I limit page parent dropdown to show only author's own pages?

I'm trying to get the page parent dropdown (in page attributes) to show only pages that have been published by the author of the current page. This doesn't seem to work :               add_filter( 'page_attributes_dropdown_pages_args', 'mwm_show_only_author_pages_in_attributes' );     add_filter( 'quick_edit_dropdown_pages_args', 'mwm_show_only_author_pages_in_attributes' );          function mwm_show_only_author_pages_in_attributes( $args ) {              global $post;              $args['author'] = $post -> post_author;              return $args;     }      What am I doing wrong here ?