Web App mode leaves users stranded when following image links when using WPTouch with W3 Total Cache

In most of the posts on my site, embedded images link to the actual image file. I'm also using Web-App mode via WPTouch. In web-app mode images linked to their larger versions shouldn't open; since Web-App mode has no back button, a user can follow a link to a image and become "stranded" there. I'm also using W3 Total Cache, which appends the param string "?9d7bd4" to all my images. This makes sure that if you change your browser cache policies all users immediately see that change. However, apparently the the appended image string allows for the images to be clicked on and stranded. Interferes with whatever is stripping the image links. All BraveNewCode can tell me is try "disabling Browser Cache in W3TC" which I obviously I'm not interested in doing. Suggestions?


How to execute a simple php script in WP (I don't think wp_enque_script applies here)

I have a wordpress page where I want to include a budget calculation tool. This budget calculation tool is of course tied to a php script that executes the fields in the budget calculation tool. This php script lives in the file "view.php" My question is: how can I execute this php script in Wordpress Here is the script working in a simple HTML/CSS/Js form: I am so sure this is a beginner thing, but I just can't get my head around it! What am I missing here? Thanks so much! Best, Gabriela


Visually change theme via query string?

Ok, so I have an interesting situation here. I'm looking to have an option to "visually" change a theme via a query string. Basically over-riding the need to update the database and just temporarily change the look of the site (think sort of like the preview button in the Themes section?) Here's an example: Let's say I have a demo site that has the same content but I want to give people the option to see what the site will look like under different themes. Instead of creating multiple blogs (networked or not), I want to keep things maintainable for the content and dynamically change the theme without actually setting it in the database. That way, if I have multiple users viewing the same blog they instantly see the default and can change the theme without updating the site for everyone else. Is this possible??? I've tried thinking of alternatives and this is the only way I can think of. Any suggestions or answers would be great :) Thanks


Methods of Integrating Plugin Data with Themes

I would like to get some opinions regarding the best practices for developing WordPress plugins that provide theme integration. In order to make sense as I ask this question, let me start with an hypothetical example of a scenario that I am curious about. Imagine that I create a plugin called "Discography". Discography registers three custom post types: "Bands", "Albums", and "Tracks". The plugin also provides meta boxes that provide details for each post type, as well as, custom taxonomies to organize each post type. These post types are tied together with the Posts 2 Posts plugin. Within the admin, the user can add new bands, which can be associated with albums, which, in turn are associated with tracks, all which will have lots of other data added to them via meta boxes and taxonomies. Now, I don't want this plugin to simply set up an admin for users to enter this information; I would want it to provide some default displays for the data. A more advanced user/developer would be fine having only this admin. It would be easy enough for her to grab that data and use in the theme; however, without some default views, this plugin would be useless for most users. For this example, you could display anything like (parentheses show the ways the info could be displayed in order of the template hierarchy):   * Bands (single-prefix-band.php, single.php, index.php, shortcode)   * Albums (single-prefix-album.php, single.php, index.php, shortcode)   * Tracks (single-prefix-track.php, single.php, index.php, shortcode)   * Band Listing (template-band-list.php, page-band-listing.php, page-{id}.php, page.php, index.php, shortcode)    * Album Listing (template-album-list.php, page-album-listing.php, page-{id}.php, page.php, index.php, shortcode)   * Album Timeline (template-album-timeline.php, page-album-timeline.php, page-{id}.php, page.php, index.php, shortcode) It's important that there is some default presentation for these post types as the default template files would not display all of the information that is needed for each of the post types. For instance, the Twenty Eleven theme, by default, would just show the name, categories, description and post date for an album. Not very useful for an album. I would want to provide a single post template that pulls in the band, release date, record label, album versions, tracks, etc. As a plugin developer I would feel that that would be important to provide. I know the template wouldn't work out for every theme, but there should be some default that can be further integrated with the user's theme. Again, I'm curious about what is the best way to handle this situation? I think you could do any of the following. **Shortcodes** Shortcodes could be used as a very flexible and user friendly way to allow non-devs to add a bands, albums, tracks, band lists, etc. anywhere in the site. It would be helpful for featuring bands on specific pages or creating separate pages for each band (not very efficient, but some users approach things this way). The shortcode would generate HTML, which would be tied to a provided CSS file that would provide a nice default view of the desired data. Everything would be contained within the plugin files and nothing would need to be done with the theme. **Template Files** The plugin could also ship with template files. The template files could be marked up and styled for a nice default view. You could provide instructions for your user to move the files to the theme folder so that the theme will find the right templates when the post types are viewed. You could even go so far as providing an interface to allow the user to move the files with a single click (note: I would not create files in the user's theme folder on activation because adding files to their theme without them initiating it is evil). You can also use filters to utilize these files without moving them out of the plugin folder, keeping everything self contained. I've seen the "template_include" and the "{$type}_template" filters used for this purpose. In fact, you could use templates from the themes folder and if they are not present, you can fall back on these filters to provide the default views. **The Question** I like to know what others think are the best practices for these situations, if the presented ideas are problematic in any way, and any alternatives that I've not included. Thank you!


posts_groupby problem

On my search page I want to group the posts by post type. To do this I've got the following:               add_filter('posts_groupby', 'group_by_post_type' );     function group_by_post_type( $groupby ) {       global $wpdb;       if( is_search() ) {          return $wpdb->posts.'.post_type';       }          }      Before adding the filter I had 9 results, however after adding the filter I only have 3 results, one of each post type. What am I doing wrong?


Improve Custom Post Permalink Structure

I've created a custom post type, with an easy permalink structure. Now I want to enhance this permalink structure with some extra information.               public function custom_post_mission() {             $labels = array(                ...             );                  $args = array(                 'labels'        => $labels,                 'description'   => __( 'Holds our missions and specific data', TEXT_DOMAIN ),                 'public'        => true,                 'menu_position' => 5,                 'supports'      => array( 'title', 'author', 'editor' ),                 'has_archive'   => true,                 'menu_icon'     => plugin_dir_url( __FILE__ ).'img/mission.png',                 'register_meta_box_cb' => array( $this, 'add_custom_box' )             );             register_post_type( 'mission', $args );          }      With the above coding I got the following permalink structure: `http://localhost/wordpress/mission/<post-title>/` This structure I would like to improve to the following one: `http://localhost/wordpress/mission/<year>/<month>/<post-title>/` How can I do this? It would be nice if there is a way to transfer the old permalink structure to the new one, but it's not necessary. BR & Thanks, mybecks /E: enhanced my code with code example provided by ravi               public function custom_post_mission() {                 global $wp_rewrite;                 $labels = array(                    ...                 );                      $args = array(                     'labels'        => $labels,                     'description'   => __( 'Holds our missions and specific data', TEXT_DOMAIN ),                     'public'        => true,                     'menu_position' => 5,                     'supports'      => array( 'title', 'author', 'editor' ),                     'has_archive'   => true,                     'menu_icon'     => plugin_dir_url( __FILE__ ).'img/mission.png',                     'register_meta_box_cb' => array( $this, 'add_custom_box' )                 );                 register_post_type( 'mission', $args );                      $wp_rewrite->add_permastruct('mission', 'mission/%year%/%monthnum%/%mission%/', true, 1);                 add_rewrite_rule('mission/([0-9]{4})/(.+)/?$', 'index.php?mission=$matches[2]', 'top');                 $wp_rewrite->flush_rules(); // !!!              }      This creates the following permalink structure:               http://localhost/wordpress/mission/%year%/%monthnum%/<mission-title>/      But the `%year%` and `%monthnum%` placeholder couldn't be replaced with the corresponding values. /E2: I finally get it to work. I needed a filter which resolves the placeholders:               add_filter('post_type_link', 'mission_permalink', 10, 3);          function mission_permalink( $permalink, $post_id, $leavename ) {         $post = get_post($post_id);             $rewritecode = array(                 '%year%',                 '%monthnum%',                 '%day%',                 '%hour%',                 '%minute%',                 '%second%',                 $leavename? '' : '%postname%',                 '%post_id%',                 '%category%',                 '%author%',                 $leavename? '' : '%pagename%',             );                  if ( '' != $permalink && !in_array($post->post_status, array('draft', 'pending', 'auto-draft')) ) {                 $unixtime = strtotime($post->post_date);                      $category = '';                 if ( strpos($permalink, '%category%') !== false ) {                     $cats = get_the_category($post->ID);                     if ( $cats ) {                         usort($cats, '_usort_terms_by_ID'); // order by ID                         $category = $cats[0]->slug;                         if ( $parent = $cats[0]->parent )                             $category = get_category_parents($parent, false, '/', true) . $category;                     }                     // show default category in permalinks, without                     // having to assign it explicitly                     if ( empty($category) ) {                         $default_category = get_category( get_option( 'default_category' ) );                         $category = is_wp_error( $default_category ) ? '' : $default_category->slug;                     }                 }                      $author = '';                 if ( strpos($permalink, '%author%') !== false ) {                     $authordata = get_userdata($post->post_author);                     $author = $authordata->user_nicename;                 }                      $date = explode(" ",date('Y m d H i s', $unixtime));                 $rewritereplace =                 array(                     $date[0],                     $date[1],                     $date[2],                     $date[3],                     $date[4],                     $date[5],                     $post->post_name,                     $post->ID,                     $category,                     $author,                     $post->post_name,                 );                 $permalink = str_replace($rewritecode, $rewritereplace, $permalink);                      // wp_die($permalink );             } else { // if they're not using the fancy permalink option             }             return $permalink;         }      and I there was a small error in the add_rewrite_rule regexp. The correct one: `add_rewrite_rule('mission/([0-9]{4})/([0-9]{2})/(.+)/?$', 'index.php?mission=$matches[3]', 'top');`


Custom Search Query

I'd like to set up a custom search page that does the following: User checks off several items in a form that he'd like to see returned in his search (essentially choosing from a list of tags). Results are returned that match all of the tags he chose (using AND not OR). A specific example would be: Return all posts in the category of "Area" where tags = "elementary school" AND "park"   1. Do I need to name my search form anything in particular?   2. On the search results page, how do I code the custom query so that it grabs all posts within the category of Area, and that have tags of all the tags the user chose in the search form?


Creating Ajax backend for Specialised Page Template? Should admin-ajax.php be used?

We're scoping an upcoming project that will require the development of a large php web application within an existing wordpress site - this is for our use only and we've no intention of trying to package it for other users; so interoperability isn't really a concern as long as we can continue to apply WordPress updates as they're released without breaking our application. Our initial thought is to code the application as a single php file located within the theme folder as a 'Specialised Page Template'. The main reason for this is to make use of the Role, Capability & Authentication features already available within Wordpress. This will be a relatively large web application consisting of bespoke objects, classes & 1000's of lines of bespoke php, JQuery and TSQL code. Part of this web application will be a large back-end of ajax functions (120 approx.) - my question is related to this ajax backend file. We'd prefer to handle logged in vs logged out behaviour at the ajax level ourself as we'll be adding extra functionality & authentication on ajax requests based on role and capability restrictions. **Our Question:** If we write our own ajax.php file, which wp files do we need to `require_once()` to ensure access to wordpress core functions & objects (such as `is_user_logged_in()`, `current_user_can()` & `$current_user` etc) **Whats our problem with admin-ajax.php I hear you ask?** A typical example of an ajax request we'll be making is to update a single value in the database, that's going to consist of 3 simple steps:   * Check user is authenticated, if not, return a 403 header and exit();   * Initialise our applications database class & execute tsql statement   * return 200 header Very simple as you can see & could be done with a little clientside jquery and 3 lines of server side php, to do the same with admin-ajax we need to dig through wp_localize_script, add_action, wp_enqueue_script before we even get to writing the client-side JQuery (or have we misunderstood?) - it just seems a little "overkill"?


Is there a recover_post hook to go with trash_post hook?

I'm using the `trash_post` hook to set a flag in a custom table to indicate that this item is "deleted", but when the user chooses to restore that post, what hook can I use for that? I couldn't find anything on this page https://codex.wordpress.org/Plugin_API/Action_Reference, but maybe there's another way to solve the problem. Thanks!


How *not* to show the last post on the latest posts list

An image speaks for a thousand words so please bear with me: http://interativo.modateca-sc.com/ The last post appears twice. Once as the feature post and then again on the "main blog part" where the ten or so latest posts appear. Is there a way to make it not appear again? Thanks :)


How is WP Cron Locking implemented?

WordPress takes measures to ensure that a cron task doesn't run twice when it should run once, e.g. once every hour when an hourly schedule is given, rather than the occasional twice at the scheduled time. While it's not foolproof, what steps does WordPress take to make sure it happens at the scheduled times, and only once as specified?


When is it appropriate to put functions on page template vs. functions.php?

I'd like to improve my code and on a current theme, I've extended Wordpress with custom post types, metadata, customized user authentication, and a number of other items. Some of these functions exist in the functions.php file while I've put others directly on the template files that they relate to. I have little reason for doing this initially, other than it seemed appropriate because said template file was the only file using the specific function. But I'd like to know what is considered best practice for the sake of speed and security? What do you do?


WordPress Show Single Post on Home Page with previous/ Next Button

I am new to WordPress and recently doing some stuff with WordPress. I am using WordPress and want to make theme. I want to show a full post on the home page and at the bottom I want to show next and previous post links. There will only be one category in which I will post and only one post will display on the home page at a time.


show author avatar

I have modified the loop.php file to add some comment stuff in. I wanted to show a comment off a link which is working just fine. Now I went to make that comment show more detail by putting the author avatar. So my code looks like this. It does display the default avatar but is should display my image which it is not.                $comments = get_comments( array(         'post_id' => $post->ID,         'number'  => '1'       ) );     foreach ( $comments as $comment ) {         echo get_avatar( get_the_author_meta( 'ID'), 32 );         echo $comment->comment_author . ' says: ';         echo '<hr />';         echo $comment->comment_content;     }


Count within foreach loop

How can I echo out the count of within a foreach loop? I want to change the class of the div below so it's menu-button-1, menu-button-2 etc etc:                   <?php      $pages = get_children(array('orderby' => 'menu_order', 'order' => 'asc'));     foreach($pages as $post) {     setup_postdata($post);     $fields = get_fields();     ?>
             <a href="<?php echo get_page_link( $post->ID ); ?>"><?php echo $post->post_title; ?>
     <?php     }     wp_reset_query();     ?>      So I want it to output something like this - `<div class="menu-button-1">` then `<div class="menu-button-2">` and so on each time it goes through the loop.


wordpress admin plugin menu custom css

I have a plugin that has a top level menu and subsequent submenus. Each one of these pages are going to need their own css and javascript. My code at the moment is:               //main menu     add_menu_page( "My Business", "My Business", "contributor", "fbusiness", array($fmb_admin, "get_page"));     //sub menus     add_submenu_page("fatemagic-business", "Products", "Products", "contributor", "fbusiness-product", array($fmb_product, "get_page"));      What I need is for custom css and scripts for the page that is displayed when the submenu is clicked. I did do this before but have just spent 3hrs trying to find it online and can't. If my memory is correct it looked something like:               $page = add_submenu_page("fatemagic-business", "Products", "Products", "contributor", "fbusiness-product", array($fmb_product, "get_page"));     print_admin_script($page, "http://location/to/javascript");     print_admin_style($page, "http://location/to/css");      Maybe this technique is deprecated? It was about 3 or 4 years ago when I used this technique. cheers ;)


Need rewrite for URL with specific string

I need help with one redirect, unfortunately I don't have idea how to write this for Wordpress. Should be .htaccess redirect or function in functions.php? Noob I am, so please help :) OK, I have post, for example `mysite.com/post1/` now, i have plugin that adding image to post as `mysite.com/post1/thumb_image1.jpg` but for some reason this plugin also adding page `mysite.com/post1/mysite.com/post1/image1.jpgTHUMB` that does not exist, so giving me 404 I need to sort. Now I can not remove this plugin, but how can I say to google not to crawl link `mysite.com/post1/mysite.com/post1thumb_image1.jpgTHUMB` and if it does (or someone accidentally find it) than do 301 on that link and redirect it to parent post, so example `mysite.com/post1/` so something like Redirect 301 `mysite.com/ABC/**.jpgTHUMB` to `mysite/com?ABC` There are a lot of posts so this should apply to any post in my website. I think that above is possible through some kind of redirect, but I read like 60 pages and tried so many options and nothing works. now got headache of all this code, so please help.


Is it possible to have instead mypage.com/?page_id=81 to have mypage.com/cool/?

Is it possible to have instead mypage.com/?page_id=81 (this is just an example, I am talking about all these pages with long custom links) to have mypage.com/cool/ ? Are there any plugins to achieve this? I used a plugin page links to, but it just links whatever to somewhere else.


Wordpress $wpdb get posts from category and sort by custom meta

I have a custom post type of 'events' which has a meta key 'event_date' Im using the following to retrieve those posts and arrange them by 'event_date'                       global $wpdb;             $today = date('Y/m/d', strtotime("now"));             $events = $wpdb->get_results("SELECT                                                  posts.id, posts.post_title, meta.meta_value                                              FROM                                                  {$wpdb->prefix}postmeta as meta                                             LEFT JOIN                                                  {$wpdb->prefix}posts as posts                                              ON                                                  (meta.post_id = posts.id)                                              WHERE                                                 (meta.meta_key = 'event_date'                                              AND                                                 meta.meta_value >= '{$today}'                                             AND                                                 posts.post_status='publish' and posts.post_date < NOW())                                             ORDER BY                                                  meta.meta_value                                         ");      The above works fine however i would like to show 'events' from only certain categories (say category id '5'). How can i modify the query to achive this? Any help would be appreciated :)


change video icons to selected thumbnail?

added custom fields for the media edit form so users can select a thumbnail for video. All that's working fine but how can i get the default video icon on this page and in the media library to use this thumb instead of the default video icon? default is http://sandbox.modernactivity.co.uk/waspface_wp/wp- includes/images/crystal/video.png **update** got part of the way but not sure how i grab a custom field in this situation...               function change_mime_icon($icon, $mime = null, $post){              $thumb = get_post_meta($post->ID,'_videoThumb', true); // needs to be attachment id?              if($thumb){ //  videoThumb                  $icon = str_replace(get_bloginfo('wpurl').'/wp-includes/images/crystal/', WP_CONTENT_URL . '/uploads/'.$thumb, $icon);             return $icon;              }else{             //leave as is...         }     }


How to speed up my site

> **Possible Duplicate:**   >  Steps to Optimize WordPress in Regard to Server Load? I've got a WordPress site with a few plugins installed, and it takes a long time to load. I'm concerned about this; I don't want visitors just giving up and leaving, also Google takes page speed into account in its Page Rank. Is there a way I can speed up my site without removing any of my plugins?


Adding more text to a post, after it was published

I'm trying to build a wp plugin, which will basically add some text for every post, in the post itself, I'm afraid that the codex is too large for me to even know what to look for, so I'd appreciate if someone could point me in the right direction. Edit: As per request, the info should be added to the post's text on the database, at the end of the post, it's not static, it's a random embed from a tube site, based on a query I run on the tubesite.


.current-menu-item class on custom post type children pages - again?

There is the situation. I have created the custom post type - products withfuncionality like pages - I have to create hierarchy. f.e:   1. Chairs:      * Oak Chair     * Nice Chair The weird thing happens with wp_nav_menu(). When I open the first level page Chairs and display all the Chairs childrens in theme, the nav menu for the li item Products, gets the .current-menu-item class, but when I open the child page f.e. Oak Chair, the class disapears. Why is that and how to set .current-menu-item class also when child page is opened? This same problem happens again :( WP Version 3.2.1 the ancestor-class .current-products-ancestor is not setted up :(


Why do Trackbacks/Pingbacks not appear below my posts/pages?

My wordpress required me to check some Trackbacks and I checked and accepted them. They are listed in the comment administration and I activated "allow Trackbacks/Pingbacks on this page" on the relevant articles and pages. But they do not appear below the relevant posts and pages. Comments are displayed, but not Trackbacks. Does this maybe result from me using the "SimpleX" Theme? Can I somehow modify it to display them? Or did I just miss a checkbox?


Have custom number of blog posts on homepage with working pagination

> **Possible Duplicate:**   >  How to show a single post on the front page but have normal paging? My question is similar to How to show a single post on the front page but have normal paging?. The author of that question seems to have figured out how to do this and even posted the solution. Unfortunately, I simply can't figure out how/where he implemented the code he suggests as solution. Is it possible to include this offset he's referring to in the functions.php? My theme doesn't have a specific archive.php file. Could anyone clarify this for me? Thank you!


Searching for a better Twitter widget

I'm using the "FriendFeed Activity" widget to show the latest 7 enties of my friend feed. However, FriendFeed just aggregates my Twitter, Blog (via RSS) and YouTube activities. That are things Twitter couldn't handle at the beginning, but now can. So I'm thinking of removing my FriendFeed and switch completely to Twitter (and a Twitter widget). But the "FriendFeed Activity" widget shows an Icon in front of every post (YouTube symbol, RSS symbol, Twitter symbol) and it displays a thumbnail if there's a YouTube link in the post. Is there a Twitter widget, that has this functionality, too? Maybe even recognizes more / resolves bit.ly Links ...?


Get random custom posts from a custom post type

I created a custom post type named `predic`, I’m trying to get within one of this post other four random posts from the same custom post type. I used this code, but I keep getting the same post I’m in 4 times.
     <?php     $rand_posts = get_posts('numberposts=4&orderby=rand');     foreach( $rand_posts as $post ) :     ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endforeach; ?>


Preferred Wordpress video format?

I'm developing a Wordpress blog for a client who needs to embed their own video files. Flash video was our format of choice until recently, but is there a preferred format for Wordpress? One that easily integrates?


Link a lightbox thumbnail to a post instead of opening the lightbox

On my website portfolio I use a heavily modified version of the Swatch theme from Woo Themes. The theme makes the thumbnails for my portfolio pieces link to the lightbox. I want the thumbnails to link to the post they belong to. (if you click the title below the thumbnail I cannot find how to fix the coding so that this can occur. I found the element that is the problem:

      So I know I want to change it to follow a template like

      I'm not a coder... but I sort of understand it. How can this be accomplished? What file (CSS, etc) do I have to modify to fix this and where is that file? I cannot find it. I use a Wordpress.org installation for my site. I have access to the entire server for my website hosting. What folder would I find to edit a file that changes the style template? Is there a style template? Do I need to edit a certain file every time I make a new portfolio entry?


Querying post from a multisite network

I am working on a multisite blog network where I have to display recent post on my home page, 10 post per page navigation. I did implement it using wpdb object with one complex sql statement.   * I got blog ids us `get_blog_list` function   * looped through each blog id list and generated a one single sql query to get post from all sites   * Used `wpdb->get_result` to get list of posts from all subsites I have recently started working on PHP and WordPress and am still learning it. Is use of `wpdb` object is the right way in this situation? I have read in many articles which uses `WP_Query` object. I don't know how to use `WP_Query` object in this situation? Help me implement this in right/better way.


Capability to edit own post, but not create new one

i can't find anywhere how can i forbid to create new item, but allow editing of posts which was assigned to user. Lets say in my system there is admin who creates some posts, then assigns some specific user as author of this post, but i cant make that user could only edit, it ether can edit and create new, or nothing. PS. i dont want to use ANY plugin for this. Because this is my plugin.


Custom rewrite_rules - only pass numbers and not alphabetic characters

I'm trying to add a rewrite rule to pass a var to a custom page template. For some weird reason it only excepts numbers in the variables, when I type in characters other then number it directs to `404`. ### For example This works: `http://example.com/reco/9080` But this doesn't: `http://example.com/reco/abcd` (redirects to `404`) This is my code:               function add_rewrite_rules($wp_rewrite) {             add_rewrite_rule('reco/([^/]*)/?', 'index.php/reco/?b=$1', 'top');     }     add_action('generate_rewrite_rules', 'add_rewrite_rules');               function query_vars($public_query_vars) {         $public_query_vars[] = "b";         return $public_query_vars;     }     add_filter('query_vars', 'query_vars');


yoast-seo-plugin - issue with the title and description template variables

I have set my post's descriptions and titles to be automatically created with yoast's seo plugin's template variables which are pulled from custom-field- values. I run the very latest wordpress 3.8.1 and the latest seo plugins version 1.5.2.5. **ISSUE** - After the recent update of the seo plugin it has stopped rendering the variables to their values. Example - This variable `%%cf_gender%%` is supposed to output/render the custom field value **male** for the auto-title on the screen but instead it displays the variable itself as `%%cf_gender%%` !! This is happening on the single post editor screen as well as the manage posts editor screen. Again, this happened only after the recent update. So it may not be a major issue but it would definitely be more sensible and faster to work in the backend with the custom-field values rendered. To rule out other possibilities I disabled all other plugins to check if any other plugin has triggered for such behavior but it isn't so. Given below is a clear visual reference of what is happening. Any feedback, suggestions or solutions ? * * * ![enter image description here](http://i.stack.imgur.com/Jz2Nt.png) * * * Strangely, this does not cause the issue in the front-end. In the front-end the titles and descriptions are rendered as expected, means the variable template `%%cf_gender%%` is rendered as the custom field value **male**. I checked looking at the view-source for several posts, so no issues in the front-end. * * * **UPDATE** : I am downloading WAMP and will be setting up a local environment to be absolute sure, nothing else is causing this. Will be back with an update. **SECOND UPDATE** : YES, Now I am absolutely sure that the plugin itself is causing this since I have tested for this thing in a brand new wp-install ( with the latest wp 3.8.1 and latest plugin version 1.5.2.5) with only this plugin. Any pointers or I am missing something basic ? > **FINAL UPDATE** : Found that this is a bug that has already been reported > to the developers.


Echo the custom field value from the latest post from the 'video' post format?

I am trying to create a 'latest video' section. Basically, what I'm trying to do is get the custom field value (video url) from the last post in the 'video' post format. Then, I'm trying to insert that url into the YouTube embed code and echoing the entire embed code with the url included. Below is a code that I managed to put together. I'm sure there are some things wrong with it and was wondering if someone could help me make sense of this. ![enter image description here](http://i.stack.imgur.com/Hog9Z.jpg)               <?php            $args = array( 'numberposts' => '1', 'tax_query' => array(                 array(                     'taxonomy' => 'post_format',                     'field' => 'slug',                     'terms' => 'post-format-video'                 )         ) );         $latest_video = wp_get_recent_posts($args); // Get latest video in 'video' post format         $latest_video_id = $latest_video['0']['ID']; // Get latest video ID         $video_url = htmlspecialchars(get_post_meta(get_the_ID($latest_video_id), 'dt_video', true));         echo '<iframe width="180" height="101" src="'.$video_url.'?rel=0" frameborder="0" allowfullscreen></iframe>';     ?>      Edit: $video_url is returning an empty string.


Siteurl code for links

I'm working on a wordpress website for my friends bussines and I'm working on it on my personal server to then export it and import it on his server when it's done. And one some of the pages I've added som buttons that links to other pages on this website. It's basially using the code: [button link="". However my problem is when it's moved to my friends server it's going to be under a different URL than the one I'm working one, which menas that the current link of the button won't work. Is there any type of code that I could use to use the siteurl? So basically when the site is hosted on a other URL it will use that URL instead. Hope this made sense! Cheers thanks! :)


How to Create a Custom Slug for Tags and Categories with a prefix or suffix?

I wanted to rename the slug to use a custom rewrite with a prefix or suffix that I choose. For example, if the tag name is "product" I want to use a rewrite with a slug that says "product-powerpint-ppt" so the final URL will look like /tag/product-powerpoint-ppt instead of /tag/product I was looking for a solution to this problem from time ago, without relying on htaccess rules, just tweaking WordPress or using a plugin. Anyone had the same question or can advice on a possible solution?


How do I Create Forums with bbpress Plugin that can only be Viewed by Logged in Users

I'm trying to configure forums using the bbpress plugin that can only be viewed by logged in users. I attempted creating them as private but found that sub-forums don't show up on my root /forums page. Another forum suggested using is_user_logged_in() to determine whether or not forums are displayed. What is the best place to put a check for is_user_logged_in() that will hide all forum related pages and posts from non-logged in users. I am up for other suggestions as well if there is a better way to do it, but I am not finding much documentation.


Retrive post by tags PHP code

For example, i am building a cinema site.. For movies - I am using post - The movies are post there.. For actors - I am using post_type : persoane , Taxonomy : lista. How can i retrive the movies play by bruce willis in http://cinema.trancelevel.com/persoane/bruce-willis/ For example, i have : http://cinema.trancelevel.com/the-cold-light-of- day-2012-2/ This movie have Bruce Willis Tag....( this is a regolar post in wp) In Bruce Willis page i want to retrive the movie.... that have Bruce Willis Tag In conclusion i want to display the movies that actor play in I anny body know please help. Thanks in advance I try this but no sucess               <?php $args = array(       'tax_query' => array(         array(           'taxonomy' => 'post',           'field' => 'slug',           'terms' => get_query_var('term')              )       )     );     query_posts( $args );     if ( have_posts() ) : while ( have_posts() ) : the_post();            echo get_post_format();     endwhile; else:       echo 'No movie found';     endif;     wp_reset_query();           ?>


Display posts by tag on page

I'm trying to create an advanced WordPress page that shows the regular content, plus a second section on the same page that shows the latest posts from X tag. For example, a page is created about "cats", has pictures, content, etc. Afterwords, I'd like to display the last X posts tagged with "cats". Is that possible without using plugins, and without creating a custom page template for every page? Perhaps it's doable with the custom fields feature and multiple loops. E.g. get X amount of posts from a custom field with the value "cats". I've been struggling with it for a while now, can can't seem to find a solution that doesn't involve create a template for every single page. Thanks!


Looking for a home page carousel

I'm looking for a plug in for a carousel similar to this one http://www.worldrowing.com/ Essentially it's a carousel with a navigation to the side. When you scroll over the navigation the carousel changes. It's important that the content of the carousel (nav, images and text over the images) is editable within WordPress by editors, and not only editable by a programmer. I haven't been able to find anything similar to this. Has anyone got any pointers?


allow html characters on eshop data entry boxes

I'm trying to make a change on the core eshop plugins, since on their forum they don't support core changes I'm posting my question in here. Maybe is kind of simple however I cannot find the solution, basically I need the product description support html characters. Right now looks like this:                <label for="eshop_product_description"><?php _e('Product Description (For Checkout)','eshop'); ?></label>      <input id="eshop_product_description" name="eshop_product_description" value="<?php if (isset($eshop_product['description'])) echo $eshop_product['description']; ?>" type="text" size="30"/>      Any chances to allow this change on this line w/o touching any other information? Thanks in advanced. **UPDATE** * * * Reading a little... (cause that is the problem, we don't read) I found the solution for my problem, "htmlspecialchars_decode" function would do the trick, now I wonder how to close or erase a post in here ^^.                <?php if (isset($eshop_product['details'])) echo htmlspecialchars_decode($eshop_product['details']); ?>      Regards


Comment section not appearing on posts with no comments

Recently I bought a theme at Themeforest called Ravage for my writing-blog. Yesterday I found out that its not showing the "pretty" comments-section (which has a stylish newsletter sign up form and social share links implemented) when there are no comments to a post. I have been scanning through the comments.php, but I can't seem to figure out where this "problem" lies. I tried contact the support of Icy Pixels (the creators) but then they showed me a page buried somewhere within the theme demo which also shows this strange behavior. So for them it's: "The comes as is, we're not going to change anything about it". I can't imagine one blogger on this planet that would want to wait for people to share his work until the first comment is placed, so I hope someone here can help me out. Here's a post with comments: http://www.ifkknrokk.com/rants/psychology/478/7-steps-dysthymia/ Here's a post without comments: http://www.ifkknrokk.com/writing/poetry/86/poem-honesty/ As you can see on the page with comments at the bottom a pretty grey boxed area appears with share links, subscribe form and everything! At the page without comments, it doesn't show anywhere. Here's my comments.php:               <?php $template_directory =  get_template_directory_uri(); ?>     <?php          // Do not delete these lines or the sky will fall over your head     if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))     die ('Please do not load this page directly. Thanks!');          if ( post_password_required() ) { ?>
<?php _e('This post is password protected. Enter the password to view comments.', 'framework') ?>
     <?php     return;     }          /*-----------------------------------------------------------------------------------*/     /*  Display the comments + Pings     /*-----------------------------------------------------------------------------------*/          if ( have_comments() ) : // if there are comments ?>     <?php if ( ! empty($comments_by_type['comment']) ) : // if there are normal comments ?>

     <?php if( function_exists('zilla_likes') ) : ?> <?php zilla_likes(); ?> / <?php endif; ?><a class="facebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" target="blank"> <?php _e('Like', 'framework'); ?> / <a href="http://twitter.com/home?status=<?php the_title(); ?> - <?php the_permalink();?>" target="blank" class="twitter"> <?php _e('Tweet', 'framework'); ?>

Receive free daily updates.
     <form action='http://feedburner.google.com/fb/a/mailverify' class='feedburner' method='post' onsubmit='window.open('http://feedburner.google.com/fb/a/mailverify?uri=ifkknrokk', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true' style='margin: 0pt;' target='popupwindow'>     <input name='uri' type='hidden' value='ifkknrokk'/>     <input name='loc' type='hidden' value='en_US'/>     <input style="width: 250px;" class='dcstyle' name='email' onblur='if (this.value == "") {this.value = "Enter your email…";}' onfocus='if (this.value == "Enter your email…") {this.value = ""}' type='text' value='Enter your email…'/>           <input style="width: 90px;" alt='' class='dcsubmit' title='' type='submit' value='Submit'/>
     Or add this feed to your RSS-reader.          </form>
Connect with me.

     <?php if(get_option('icy_comments_message') == '') : ?>     <?php _e('Write us your thoughts about this post. Be kind & Play nice.', 'framework'); ?>     <?php else : ?>     <?php echo get_option('icy_comments_message'); ?>     <?php endif; ?>

          <?php wp_list_comments('type=comment&avatar_size=48&callback=icy_comment'); ?>
          <?php endif; ?>          <?php if ( ! empty($comments_by_type['pings']) ) : // if there are pings ?>
<?php _e('Trackbacks for this post', 'framework') ?>

          <?php wp_list_comments('type=pings&callback=icy_list_pings'); ?>
                         <?php endif; ?>

<?php next_comments_link(); ?>

<?php previous_comments_link(); ?>

          <?php          /*-----------------------------------------------------------------------------------*/     /*  Dealing with no comments or closed comments     /*-----------------------------------------------------------------------------------*/          if ('closed' == $post->comment_status ) : // if the post has comments but comments are now closed ?>
<?php _e('Comments are closed now.', 'framework') ?>
          <?php endif; ?>          <?php else :  ?>          <?php if ('open' == $post->comment_status) : // if comments are open but no comments so far ?>          <?php else : // if comments are closed ?>          <?php if (is_single()) { ?>
<?php _e('Comments are closed.', 'framework') ?>
<?php } ?>          <?php endif; ?>          <?php endif;          /*-----------------------------------------------------------------------------------*/     /*  Comment Form     /*-----------------------------------------------------------------------------------*/          if ( comments_open() ) : ?>

<?php comment_form_title( __('Leave a reply.', 'framework'), __('Reply to %s', 'framework') ); ?>

            <?php cancel_comment_reply_link(); ?>
          <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'framework'), '', '') ?>
      <?php else : ?>          <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" class="span12" id="comments-form" style="margin-left: 0">          <?php if ( is_user_logged_in() ) : ?>
<?php printf(__('Logged in as %1$s. %2$sLog out »%3$s', 'framework'), ''.$user_identity.'', '', '') ?>
             <?php else : ?>
     <input type="text" name="author" value="Name (required)" id="author" value="<?php echo esc_attr($comment_author); ?>" size="20" tabindex="1" onfocus="if (this.value == 'Name (required)') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Name (required)';}"/>

     <input type="text" name="email" value="Email (required)"  id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="20" tabindex="2" onfocus="if (this.value == 'Email (required)') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Email (required)';}"/>

     <input type="text" name="url" id="url" value="Your Website" size="20" tabindex="3"onfocus="if (this.value == 'Your Website') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Your Website';}"/>
          <?php endif; ?>
     <textarea name="comment" id="comment" cols="55" rows="10" tabindex="4" value="Write your comment here" onfocus="if (this.value == 'Write your comment here') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Write your comment here';}"></textarea>

     <input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit Comment', 'framework') ?>" />     <?php comment_id_fields(); ?>
     <?php do_action('comment_form', $post->ID); ?>          </form>          <?php endif; // If registration required and not logged in ?>
     <?php endif; // if you delete this the sky will fall on your head ?>      I really hope on of you guys can find the fix because this is frustrating as hell (especially because the designer doesn't want to help me - he just sent me an e-mail that as soon as he comes home he will look into it to see if it's possible (!) of course it's possible! Everyone else is doing it! Anyway, sorry for complaining, any help is appreciated. Regards, Daan van den Bergh


XML to Json code issue

I've written a script to display all WordPress posts organized by category in XML format. Code was               // get all the categories from the database     $cats = get_categories();     header('Content-type: text/xml');     echo '<categories>';          // loop through the categries     foreach ($cats as $cat) {     // setup the cateogory ID     $cat_id= $cat->term_id;     echo '<category>';     ?>              <cat_id><?php echo $cat_id; ?></cat_id>         <cat_name><?php echo $cat->name; ?></cat_name>         <posts>             <?php             query_posts("cat=$cat_id&post_per_page=2");             if (have_posts()) : while (have_posts()) : the_post();             ?>     <post>                     <name><?php the_title(); ?></name>                     <url><?php echo get_post_meta($post->ID, 'apls_video_url', true); ?></url>             </post>             <?php             endwhile;             endif;             ?>              </posts>          </category>     <?php }      echo '</categories>';      I need the output as JSON format also. I've tried with **json_encode** and output was               {"categories":{"cat_id":["555","15","14","554","13","23","26","25","27","33","17","30","29","18","28","20","9","22"],"cat_name":["Articles","Crank","Escapes","Grappling Videos","Guard Breaks","Half Guard","Japanese Jujutsu","Leg Locks","MMA","MMA Videos","Mount","North South Position","Self Defense","Side Control","Strikes","Theory & Discussions","Throws","Wrist Locks"],"posts":[{"post":[{"name":"Jiu Jitsu Instruction \u2013 Time To Teach","url":[]},{"name":"How to deal with the Bystander Effect: Taming a Hostile Crowd","url":[]},{"name":.......      But I need output in the following format               {"categories":[     { "cat_id": "16",      "cat_name": "Arm Lock",        "posts": [          {"name": "title1", "url": "www.title1.com"},          {"name": "title2", "url": "www.title2.com"},          {"name": "title3", "url": "www.title3.com"}        ]     }          { "cat_id": "12",      "cat_name": "Punch face",        "posts": [          {"name": "title11", "url": "www.title11.com"},          {"name": "title12", "url": "www.title12.com"},          {"name": "title13", "url": "www.title13.com"}        ]     }     }}      How can I fix the output to my desired format?


Adding a gallery to my first theme

I have been spending a lot of time the past few months researching on how to create my first theme. That said most tutorials/books only discuss static sites and I want to go about this well prepared. I would like to add a gallery only on my home page. I have already created an HTML5 mockup of the gallery using jQuery so a plugin right now is not an option.   1. I wanted to know if the best way to execute this is to create a custom page and only code my gallery into it?   2. Is there a better alternative?


The Loop won't display page or post content

I can't get the page content to appear in my custom wordpress theme. I have an extremely simple version of The Loop, which should just display the title and the content of the current page or posts. It doesn't use a query, or any modification, but the only page it works on is the Homepage. I set up the settings correctly (Front page displays: a static page). _(Edit: if I change the page selected as the home page, it shows the correct content, but no other pages show their content regardless)_ My static front page is the only page that works. The Posts page I selected doesn't work, and neither do any of the other pages. The navigation is a proper wordpress nav, so the links must are correct, but every time the loop just fails and I get my 'else' text _(Sorry no posts to list)_. I'm really at my wits end here, i've been fighting this all day and still have no solution. I feared I was doing something wrong so began copy-pasting different versions of the loop in, none of which will show my content!? Am I just missing something really stupid here? I'm going crazy! Any help will be hugely appreciated, Thanks! _index.php_               <?php     get_header();     do_action('hook_content_before');     get_template_part('content');     do_action('hook_content_after');     get_template_part('template', 'twitter');     get_footer();     ?>      _content.php_
         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_title() ;?>
             <?php the_content(); ?>         <?php endwhile; else: ?>
Sorry, no posts to list
         <?php endif; ?>
      _( **Some background for anyone thats interested:** I was setting up a Slider looping through my Custom Post Type BEFORE my proper content loop. Content loop worked fine, added slider, content loop starts only showing 'Home' on every single page. So now i've disabled the slider in the hope of getting my main loop working, but now it won't load any page!)_ _**Clarification: The slider IS now removed, but below is the code for it anyway_**               <?php $customquery = new WP_Query('post_type=slideshow'); ?>
     <?php while($customquery->have_posts()) : $customquery->the_post(); ?>
         <?php if(has_post_thumbnail()) { ?>             <?php $imgurl = wp_get_attachment_image_src( get_post_thumbnail_id(), 'slider-large'); ?>             <li style="background-image:url(<?php echo $imgurl[0]; ?>);"><?php the_content(); ?>
         <?php } else { ?>
<?php the_content(); ?>
         <?php } ?>
     <?php endwhile; ?>
     <?php wp_reset_postdata(); ?>     <?php wp_reset_query(); ?>


How do i create a list-posts-page?

I'm trying to create the actual "blog" page that lists all the posts. It seems like such a basic thing, but i can't find out how to do it. Do i create a page and assign it a special template? If i do that, wouldn't the loop just grab the page content? I have a loop in a file called loop.php, which i want to use to display the posts. I tried doing something like this:   * Create a page   * Assign "blog" template to page   * From the blog template, run `get_posts();` which gets all posts.   * Right after that, run `setup_postdata()`   * Then just `require('loop.php');` to list all posts. Unfortunately, that just grabs the first post; not what i want. Any suggestions? **EDIT** A dummy solution would be to do something like:                   $posts = get_posts();              foreach($posts as $post) {             setup_postdata($posts);             require('loop.php');         }         wp_reset_postdata();      The only problem is adding pagination, which i will need.


How to create wordpress widget that is fixed position on the home page

I want to create a video plugin which is fixed on the home page when user scrolls. I know there is a wp_float plugin . But I want to try build new plugin


Media Library filter returns undefined function get_current_screen

Hello I am following Filter by post category in Media Library I copied the code answer into my functions.php file at the bottom and got this error:               Fatal error: Call to undefined function get_current_screen()       Running Wordpress V3.7   Plugins that may conflict:   - Regenerate thumbs   - Unattach


how to enable plugin menu on subsite of wordpress MU

My problem is I already have one MU site and I want to give my user access to enable or disable there network enable plugin. Like the default appearance menu. Please guide me


Unable to convert all css and js features to WP theme

I am trying to convert a HTML and CSS template that uses `.js` files as well, into a WP theme on my localhost. The `index.html` has the following:               <head>     <title>Home</title>     <meta charset="utf-8">          <link rel="icon" href="img/favicon.ico" type="image/x-icon">     <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon"/>     <meta name="description" content="Your description">     <meta name="keywords" content="Your keywords">     <meta name="author" content="Your name">     <link rel="stylesheet" href="css/bootstrap.css">     <link rel="stylesheet" href="css/responsive.css">     <link rel="stylesheet" href="css/style.css">     <link rel="stylesheet" href="css/camera.css">     <link rel="stylesheet" href="css/touchTouch.css">     <script src="js/jquery.js"></script>     <script src="js/jquery.easing.1.3.js"></script>     <script src="js/jquery-migrate-1.1.1.js"></script>     <script src="js/superfish.js"></script>     <script src="js/jquery.mobilemenu.js"></script>     <script src="js/jquery.cookie.js"></script>     <script src="js/camera.js"></script>     <!--[if (gt IE 9)|!(IE)]><!-->     <script src="js/jquery.mobile.customized.min.js"></script>     <!--<![endif]-->     <script src="js/jquery.equalheights.js"></script>     <script src="js/touchTouch.jquery.js"></script>     <script src="js/jquery.carouFredSel-6.1.0-packed.js"></script>     <script src="js/jquery.mousewheel.min.js"></script>     <script src="js/jquery.touchSwipe.min.js"></script>     <script src="js/sForm.js"></script>      For this I have written the following in header.php:               <head>     <!--<?php bloginfo('name'); ?> <?php wp_title(); ?></title> -->     <title>Home</title>     <meta charset="utf-8">          <link rel="icon" href="<?php bloginfo('template_directory'); ?>/img/favicon.ico" type="image/x-icon">     <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/img/favicon.ico" type="image/x-icon"/>     <meta name="description" content="Your description">     <meta name="keywords" content="Your keywords">     <meta name="author" content="Your name">     <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/bootstrap.css" type="text/css">      <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/camera.css" type="text/css">      <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/responsive.css" type="text/css">      <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/touchTouch.css" type="text/css">     <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css">     <script src="<?php bloginfo('template_url'); ?>/js/jquery.js"></script>     <!--<script src="<?php bloginfo('template_url'); ?>/js/jquery1.js"></script>-->     <script src="<?php bloginfo('template_url'); ?>/js/jquery.easing.1.3.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery-migrate-1.1.1.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/superfish.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery.mobilemenu.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery.cookie.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/camera.js"></script>     <!--[if (gt IE 9)|!(IE)]><!-->     <script src="<?php bloginfo('template_url'); ?>/js/jquery.mobile.customized.min.js"></script>     <!--<![endif]-->     <script src="<?php bloginfo('template_url'); ?>/js/jquery.equalheights.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/touchTouch.jquery.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery.carouFredSel-6.1.0-packed.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery.mousewheel.min.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/jquery.touchSwipe.min.js"></script>     <script src="<?php bloginfo('template_url'); ?>/js/sForm.js"></script>      All the `CSS` and `.js` files are therefore linked. But yet some minor CSS and probably some js features are not being converted. Also the WP dashboard toolbar isn't appearing. once I visit the site from the dashboard, I have to click the back button of the browser to go to the WP dashboard. I have been suggested to use the the `wp_head()` and `wp_footer()` functions but after reading from codex.wordpress.org, can't figure out how to use them. Also the HTML for the menu bar is as follows: * About Us * Artists __ Works __   * Dolore ipsu Consecte     * Dolore ipsu     * Consecte     * Elit Conseq   * Elit Conseq * Blog __ * Contacts __ * * * I have written `functions.php` as:               <?php     function register_my_menus() {       register_nav_menus(         array(           'header-menu' => __( 'Header Menu' ),           'extra-menu' => __( 'Extra Menu' )         )       );     }     add_action( 'init', 'register_my_menus' );     ?>      and written the following in my `header.php`:               <?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'container_class' => 'nav-collapse nav-collapse_ collapse',  'menu_class' => 'nav sf-menu clearfix')); ?>      But the WP menu is displaying as a vertical list. I want it to be horizontal with the CSS as in the HTML template.


I am trying to use the Theme Customization API but I keep getting an error

This is the error: > Call to a member function check_capabilities() on a non-object in > /home/content/54/11786754/html/wp-includes/class-wp-customize-control.php on > line 161 and this is my code in the functions.php               function lmao_customizer_register($wp_customize) {          $wp_customize->add_section('lmao_colors',  array(              'title' => __('colors', 'lmao'),         'description' => 'modify the theme colors'          ));                    $wp_customize->add_setting('background_color',  array(              'default' => '#fff',         'type' => 'option'           ));          $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'background_color',  array(              'label' => __('Edit Background Color', 'lmao'),         'section' => 'lmao_colors',         'settings' => 'background_color'          ) ));          $wp_customize->add_setting('link_color',  array(              'default' => '#fff',         'type' => 'option'           ));          $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_color',  array(              'label' => __('Edit link Color', 'lmao'),         'section' => 'lmao_colors',         'settings' => 'link_color'          ) ));          $wp_customize->add_setting('link_background_color',  array(              'default' => '#fff',         'type' => 'option'           ));          $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_background_color',  array(              'label' => __('Edit link background Color', 'lmao'),         'section' => 'lmao_colors',         'settings' => 'link_background_color'          ) ));          $wp_customize->add_setting('link_background_color_hover',  array(              'default' => '#fff',         'type' => 'option'           ));          $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'link_background_color_hover',  array(              'label' => __('Edit link background hover Color', 'lmao'),         'section' => 'lmao_colors',         'settings' => 'link_background_color_hover'          ) ));          //start image settings     $wp_customize->add_section('lmao_images',  array(              'title' => __('Images', 'lmao'),         'description' => 'modify the theme images'               ));          $wp_customize->add_setting('main_image',  array(              'default' => 'http://hottraxstudioproductions.com/rawr/wp-content/uploads/2014/04/radio-logo.jpg',         'type' => 'option'           ));          $wp_customize->add_control( new WP_Customize_image_Control($wp_customize, 'main_image',  array(              'label' => __('Edit main image', 'lmao'),         'section' => 'lmao_images',         'settings' => 'main_image'          ) ));                   //start copyright settings     $wp_customize->add_section('lmao_copyright',  array(              'title' => __('Copyright_Details', 'lmao'),         'description' => 'Edit copyright info'          ));          $wp_customize->add_setting('Copyright_Details',  array(              'default' => 'Copyright',         'type' => 'option'           ));          $wp_customize->add_control('Copyright_Details',  array(              'label' => __('Edit copyright info', 'lmao'),         'section' => 'lmao_copyright',         'settings' => 'copyright_details'          ));                    }                    function lmao_css_customizer() {     ?>          <style type="text/css">              body { background-color: #<?php echo get_theme_mod('background_color'); ?    >;}              nav ul li a {                  color: <?php echo get_theme_mod('link_color'); ?>;             background-color: <?php echo get_theme_mod('link_background_color'); ?>;                   }              nav ul li a:hover {                  background-color: <?php echo get_theme_mod('link_background_color_hover'); ?>;                   }               </style>          <?php                    }                    add_action('wp_head', 'lmao_css_customizer');     add_action('customize_register', 'LMAO_customizer_register');      Please let me know if you need any more information...


Second wordpress installation on subdirectory

I currently have a blog setup as a subdomain on my website as, to my knowledge, it's the only way to use a different WordPress theme. Am I able to setup another WordPress installation on my current WordPress site ex. `www.mydomain.com/blog`, and use a different theme in this subdirectory? Or does the theme of the subdirectory have to inherit directly from my current WP theme on the main site? Right now I have it setup as:   * www.mainsite.com   * blog.mainsite.com This seems to be the only way to have separate themes, however the SEO is killing me.


Get child taxonomies in loop

Here is the structure of taxonomies what I want to display: ![enter image description here](http://i.stack.imgur.com/pDWAa.png) Here is my HTML code loop:
         TAXONMOY 1

TAXONMY CHILD 1

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

TAXONMY CHILD 2

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

TAXONMY CHILD 3

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

         TAXONMOY 2

TAXONMY CHILD 1

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

TAXONMY CHILD 2

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

TAXONMY CHILD 3

TAXONMY CHILD CHILD 1

TAXONMY CHILD CHILD 2

TAXONMY CHILD CHILD 3

TAXONMY CHILD CHILD 4

        * Just update my code:                      <?php             $terms = get_terms( 'product_cat', array(                     'hide_empty' => false,                     'parent'     => 0                 ));             foreach ($terms as $term) {         ?>
             <a href="<?php get_term_link( $term, 'product_cat' );?>" style="padding: 5px 20px"><?php echo $term->name; ?>             <?php                 $childs = get_terms('product_cat',array(                         'hide_empty' => false,                         'parent'     => $term->term_id                     ));                 if(!empty($childs)){             ?>
                 <?php                      foreach ($childs as $child) {                 ?>

<?php echo $child->name ?>
                     <?php                         $c_childs = get_terms('product_cat',array(                                 'hide_empty' => false,                                 'child_of'   => $child->term_id                             ));                         if(!empty($c_childs)){                     ?>
                         <?php                              foreach ($c_childs as $c_child) {                         ?>
                             <a href="<?php echo get_term_link( $c_child, 'product_cat' );?>" title="<?php echo $c_child->name ?>"><?php echo $c_child->name ?>
                         <?php                              }//end child of child loop                         ?>
                     <?php                          }                     ?>
                 <?php                      }                 ?>
             <?php                  }             ?>
         <?php } ?>        * I'm note sure if there is another ways reduce the foreach loop!?


Menu Link Redirect Based on Username or User ID

I am building a client portal where my clients can log in and see all their pending projects, completed projects and create new projects. Though I'm stuck at the start. The dropdown menu is called "My Projects"   If "User 1" is logged in and they click on "My Projects" then I need that link to link to:   `mysite.com/client-portal/my-projects/(USERID or USERNAME)/` This will be their dedicated page so if user 1's username is `johndoe` the link will be `my-projects/johndoe/` If user 2 (janedoe) is logged in. when they click "My Projects" they will be taken `my-projects/janedoe/` and so on, so fourth. So basically I need a `%username%` permalink I can put into a custom menu link that will change `%username%` with the current logged in user's username. Can this be done?


Wordpress Theme Validator?

I'm looking for a Wordpress theme Validator. Not necessarily something that validates the HTML but more along the lines of adhering to the Wordpress Coding Standards for Theme Development.


The "Child Pages Shortcode" plugin, block template

So I have decided on using the Child Pages Shortcode plugin, a plugin that pulls the ID, tittle, thumbnail, excerpt, etc of the child pages. The plugins author explains that he encourages customization of his plugin. The templates author describes that you should be able to build your own template, something that I don´t understand to 100%, but I have been able to change the existing template so that it generates `<li>` of the individual children. Now I need to add a container for all of my list items, it would look something like

      EDIT: I added the suggested changes, but it gives me the following error: `Warning: call_user_func_array()` expects parameter 1 to be a valid callback, function `'wpse_113253_child_pages_shortcode_template'` not found or invalid function name.... Source code of the Child Pages Shortcode plugin with my customizations and the suggested fix:               <?php     /*     Plugin Name: Child Pages Shortcode     Author: Takayuki Miyauchi     Plugin URI: http://wpist.me/wp/child-pages-shortcode/     Description: You can use shortcode for display child pages from the page.     Version: 1.7.0     Author URI: http://wpist.me/     Domain Path: /languages     Text Domain: child-pages-shortcode     */          new childPagesShortcode();          class childPagesShortcode {          private $ver = '1.1.4';          function __construct()     {         add_shortcode("child_pages", array(&$this, "shortcode"));         add_action("init", array(&$this, "init"));         add_action("wp_enqueue_scripts", array(&$this, "wp_enqueue_scripts"));         add_filter("plugin_row_meta", array(&$this, "plugin_row_meta"), 10, 2);         // Wrap
 tags around each template item.         add_filter( 'child-pages-shortcode-template', 'wpse_113253_child_pages_shortcode_template' );         // Wrap
 and
 tags around everything.         add_filter( 'child-pages-shortcode-output','wpse_113253_child_pages_shortcode_output' );     }          public function init()     {         add_post_type_support('page', 'excerpt');     }          public function wp_enqueue_scripts()     {         $css = apply_filters(             "child-pages-shortcode-stylesheet",             plugins_url("style.css", __FILE__)         );     wp_register_style(         'child-pages-shortcode-css',         $css,         array(),         $this->ver,         'all'     );     wp_enqueue_style('child-pages-shortcode-css');          $js = apply_filters(         "child-pages-shortcode-js",         plugins_url("script.js", __FILE__)     );     wp_register_script(         'child-pages-shortcode',         $js,         array('jquery'),         $this->ver,         false     );     wp_enqueue_script('child-pages-shortcode');     }          public function shortcode($p, $template = null)     {     if( !isset($p['id']) || !intval($p['id']) ){         $p['id'] = get_the_ID();     }     if (!isset($p['size']) || !$p['size']) {         $p['size'] = 'thumbnail';     }     if (!isset($p['width']) || !intval($p['width'])) {         $p['width'] = "50%";     }     if (!isset($p['disable_shortcode']) || !$p['disable_shortcode']) {         add_filter("child-pages-shortcode-output", "do_shortcode");     }     return $this->display($p, $template);     }          private function display($p, $block_template)     {     global $post;          $html = '';          if ($block_template) {         $template = $block_template;         $template = str_replace('
', '', $template);         $template = str_replace('
', '', $template);         $template = apply_filters(             'child-pages-shortcode-template',             $template,             $p         );     } else {         $template = apply_filters(             'child-pages-shortcode-template',             $this->get_template(),             $p         );         $html = sprintf(             '
'         );     }          $args = array(         'post_status' => 'publish',         'post_type' => 'page',         'post_parent' => $p['id'],         'orderby' => 'menu_order',         'order' => 'ASC',         'nopaging' => true,     );     $args = apply_filters('child-pages-shortcode-query', $args, $p);          $pages = get_posts($args);     foreach ($pages as $post) {         setup_postdata($post);         $post = apply_filters('child_pages_shortcode_post', $post);         $url = get_permalink($post->ID);         $img = get_the_post_thumbnail($post->ID, $p['size']);         $img = preg_replace( '/(width|height)="\d*"\s/', "", $img);         $tpl = $template;         $tpl = str_replace('%width%', esc_attr($p['width']), $tpl);         $tpl = str_replace('%post_id%', intval($post->ID), $tpl);         $tpl = str_replace('%post_title%', $post->post_title, $tpl);         $tpl = str_replace('%post_url%', esc_url($url), $tpl);         $tpl = str_replace('%post_thumb%', $img, $tpl);         if (isset($p['disabled_excerpt_filters']) && $p['disabled_excerpt_filters']) {             $tpl = str_replace('%post_excerpt%', $post->post_excerpt, $tpl);         } else {             $tpl = str_replace('%post_excerpt%', get_the_excerpt(), $tpl);         }         $html .= $tpl;     }          wp_reset_postdata();          if (!$block_template) {         $html .= '
';     }          return apply_filters("child-pages-shortcode-output", $html);     }          private function get_template()     {     $html = "\n";     $html .= '
';     $html .= '
';     $html .= '
%post_thumb%
';     $html .= '
';     $html .= '
%post_title%
';     $html .= '
%post_excerpt%
';     $html .= '
';     $html .= '
';     $html .= '
';     $html .= "\n";          if ($tpl = get_post_meta(get_the_ID(), 'child-pages-template', true)) {         $html = $tpl;     }          return $html;     }     /**      * Wrap
 tags around each template item.      */     function wpse_113253_child_pages_shortcode_template( $template ) {     return "
$template
\n";     }          /**     * Wrap a
 and
 tags around everything.     */     function wpse_113253_child_pages_shortcode_output( $html ) {     return "

         $html

     ";     }          public function plugin_row_meta($links, $file)     {     $pname = plugin_basename(__FILE__);     if ($pname === $file) {         $links[] = sprintf(             'Donate',             'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=8RADH554RPKDU'         );     }     return $links;     }          } // end childPagesShortcode()          // eof


Spammers are bypassing BuddyPress registration form

When people legitimately register as members on my BuddyPress site: http://www.holistichealthforall.com/community/register/ their Site Role becomes "Subscriber" and their Forum Role becomes "Participant" (in Users). However, I am noticing a bunch of spam registrations that are not given the Forum Role "Participant". They are Subscribers but not Participants, which tells me they are using some other page/method to register on the site. How is this possible, given that the Theme My Login plugin redirects all registration URLs to the URL above?


Adding wp_enqueue_media(); causes problem

I want to add the media uploader in the theme options page. If I add following code in the options page, the media uploader works fine there, but it creates problem in the standard posts featured image. It does not let me select any image from there. Would it be because I'm adding it in wrong way?               if ( ! did_action( 'wp_enqueue_media' ) ){         wp_enqueue_media();     }      Here's the uploading function I'm using:               $('#upload_img').click(function(){         wp.media.editor.send.attachment = function(props, attachment){                       $('#theme_options\\[img_url\\]').val(attachment.url);         }         wp.media.editor.open(this);         return false;     });


Developer plugin to echo template names/filepaths

I am looking for a Wordpress plugin that prints file template names, maybe with a designating border. Magento has "template hints", as you can see in this screenshot: ![magento](http://alanstorm.com/2013/images/posts/find_magento_block_name/hints- template.png) If there is not such a plugin and someone would like to develop it with me, let's do that, too!


Saving metadata of related post on save_post

here is the scenario:   * Custom Post Type "shows"   * Custom Post Type "reviews" Reviews are "child" of shows so that every review has a custom field with the ID of the parent "show". Since a review has also a custom field with a rating value I'd like upon save to create/update a custom field for the parent post (show) with the average rating. I create a function which returns a numeric value for the average rating. I'm trying to use save_post action hook without success. Here is my code:               function save_show_rating( $post_id ) {              /*          * In production code, $slug should be set only once in the plugin,          * preferably as a class property, rather than in each function that needs it.          */         $slug = 'reviews';              // If this isn't a 'book' post, don't update it.         if ( $slug != $_POST['post_type'] ) {             return;         }              // Retrieving parent ID          $parent_id = get_post_meta( $post_id, '_wpcf_belongs_fulldome-shows_id', true );              // Saving average rating         $average = average_rating_num_func();              // Check if the field already exists         $custom_field = get_post_meta( $parent_id, 'average_rating', TRUE );              // Update parent's metadata.         if ( $custom_field != '') {             update_post_meta( $parent_id, 'average_rating', $average );         } else {             add_post_meta($parent_id, 'average_rating', $average, true);         }     }     add_action( 'save_post', 'save_show_rating' );      Hope you can help. Thank you guys Best regards Carlo


No wp-config.php file on local install of wordpress - site still displays

I've installed Wordpress locally using XAMPP and this step by step guide by Sunny Johal(Fifth post down on that page). The first time I used the step by step and ran all 3 of the SQL codes(UPDATE wp_options/wp_posts), and then deleted the wp_config file(the author of the guide suggested this as the easiest way to configure the file) the page displayed it's header correctly but all text and images were displayed in a way that it looked like there was no sylesheet. Thinking I had messed something up I deleted the SQL database and started over. Now to my knowledge I'm following the same steps the same way, but I'm getting two explicit problems:   1. Wordpress is displaying an old, 2013 version of the site. It's nearly identical to the 2014 version and the posts themselves are updated but I can tell from the header that it is definitely the 2013 version.    2. I've gotten to the 'delete wp_config' part of the steps but the site _continues to run_. I don't understand how this is possible, but looking at my localhost filesystem I can see that wp-config.php is indeed not there. This seems to be happening each time I try now, so I'm thinking I might have picked up a bad habit that I can't seem to pinpoint. I've tried to be as detailed as possible.. If there's any more helpful information I can give please let me know


Understanding with this Wordpress code

I'm new to wordpress and tried to Google and looked up codex but it didn't help. I downloaded a free theme from Github and I'm trying to learn how to make a theme by looking at its code. In the header.php I found this piece               <nav class="mainnav" role="navigation">         <?php wp_nav_menu( array('menu' => 'Main Menu', 'container' => 'false' )); ?>       </nav>      I couldn't get this part " `array('menu' => 'Main Menu', 'container' => 'false' ));`" Also I couldn't find the navigation markup anywhere in the theme.


Post show up as post and pages

I am having a weird issue lately, in the WP Admin panel, all my Post show up under Post and under Pages, they all link to the same article. If I create a new Post it shows up under Pages as well. I am running the newest stable version of WP, I have tried all my themes even the twentyten and twentyeleven themse, it still happens. I have never had anything like this happen, any ideas? * * * **UPDATE** Ok I have no idea what the actual cause is but I did install a fresh version of WP and then made a post and it worked as normal, only showed up under post and not under pages. I then installed the theme I am working on and made a post, it showed up under post and pages so it has to be an issue somewhere in my theme...pretty weird issue though, because even with my theme not in use, it still makes it happen just by being there


How can I show/add/save custom metaboxes as an Array of values?

What I am trying to do is create a custom post type, custom meta box that inserts the values of it into an array of 'colors' or, 'p_clrs'. I have a jQuery script which works, allowing you to click a link to "Add Another Color", which adds another input field below the one which shows always by default (must show at least 1 colors metabox). The jQuery added input fields should store the values of each one that gets added, as another 'color' in the array of 'colors' which I'm trying to create. When on the newpost page or edit page for existing posts, the colors metabox needs to run a foreach loop to create a metabox foreach 'color' that exists in the 'p_clrs' variable. I am not good at all with arrays, and multi-arrays, and especially foreach loops. I hate foreach loops lol. I've gotten it all so close to working, I don't want to do it all over using taxonomies, and once I get this to foreach loop over each color of the array which I am trying to create here, I will be able to handle anything else I need to with this stuff. I just can't get over the array/foreach hump I'm stuck on here. This is my Product Class for my custom post type. This is what I have all the values for the posts info (including my other metaboxes which the codes aren't included here for them).               class TypeProducts {              public $prod_meta_fields = array(          'title', 'description', 'product_type', 'post_tag',         'p_sku', 'p_price', 'p_discnt_price',          'p_weight', 'p_size_w', 'p_size_h',          'p_clrs'     );      Here is the method which also has my register_post_type() and register_taxonomy() codes but that isn't really needed for this so I left it out. After the register_ptype and _tax() functions are called, I add the actions for things that need to be added to the init and stuffs.               public function TypeProducts() {         add_action( 'admin_init', array( &$this, 'product_meta_boxes' ));         add_action( 'wp_insert_post', array( &$this, 'wp_insert_post' ), 10, 2 );     }      This method is what does all the inserting of information for each of the post form fields. It works for all my custom metaboxes too, *Except for the additional input fields that jQuery adds when you click the "Add Another Color" link/button.               public function wp_insert_post($post_id, $post = null) {         if ($post->post_type == 'product') { // my custom post type is 'product'             foreach ($this->prod_meta_fields as $key) { // loops over the $prod_meta_fields                 $value = @$_POST[$key];                 if (empty($value)) {                     delete_post_meta($post_id, $key);                     continue;                 }                 if (!is_array($value)) {                     if (!update_post_meta($post_id, $key, $value)) {                         add_post_meta($post_id, $key, $value);                     }                 } else {                     delete_post_meta($post_id, $key);                     foreach ($value as $entry) add_post_meta($post_id, $key, $entry);                 }             }         }     }      Here's the method for adding my metabox(es). Not sure whether I could/should do the foreach within this, looping over the array of $p_clrs values to add a metabox foreach color that exists, if there are more than one. Otherwise, there should just be one metabox displayed (at all times there should be at least 1).                   function product_meta_boxes() {         add_meta_box( 'products-price', 'Product SKU# & Price', array( &$this, 'prod_price_box' ), 'product', 'side', 'high' );         add_meta_box( 'products-colors', 'Product Colors', array( &$this, 'prod_colors_box' ), 'product', 'normal', 'high' );         }      Here's my method for outputting the metabox(es) itself, and also the jQuery script that adds and removes additional input fields which "could" potentially become metaboxes upon saving the post if the added boxes arent empty. Here's a picture of what I mean to give you an idea of what I'm talking about. ![metabox](http://i.stack.imgur.com/101XL.jpg) Currently the first input shows on page load with any value which is stored if any. When clicking the Add Another link, it adds another input with the same value, but when saving a different value in any input field, it saves the value of the last input that has a value. And only shows one input upon reloading the page when you save it too. I need to show inputs for each added value that was there, which needs to also be inserted to the 'p_clrs' variable/array in order to do that foreach 'p_clrs' value that exists. Lost yet?                   public function prod_colors_box() {                 global $post, $p_clr;         $p_clr = array();                 $p_clrs = get_post_meta( $post->ID, 'p_clr', true );         ?>

                                  Color: <input id="p_clr_1" name="p_clr" value="<?php echo $p_clrs; ?>" />

Add Another Color
                                 <?php     }      `} // end of TypeProducts{} Class` Thanks for any help anyone can give me, and sorry if this is a little crazy of a post. I had a hard time cutting/pasting the code into this textarea. It was being wonky for me. Let me know if my explanation of what I'm trying/need to do isn't entirely clear too. It's kind of difficult to easily describe without some sort of visual of it first.


query related posts in a custom post type by a custom taxonomy

I'm trying to display related posts by a custom taxonomy and only have the solution for related posts using a category.                   $orig_post = $post;         global $post;         $categories = get_the_category($post->ID);         if ($categories) {         $category_ids = array();         foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;              $args=array(         'category__in' => $category_ids,         'post__not_in' => array($post->ID),         'posts_per_page'=> 4, // Number of related posts that will be shown.         'caller_get_posts'=>1         );               $my_query = new wp_query($args);           if( $my_query->have_posts() ) {           echo '

Related Posts

';           while ($my_query->have_posts()) {           $my_query->the_post();           ?>                <?php           if ( has_post_thumbnail() ) { ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">         <?php echo the_post_thumbnail(); ?>         <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?>

          <?php }           ?>            <?     }     echo '

';     }     }     $post = $orig_post;     wp_reset_query();      The following code only works for post types with registered category not custom taxonomy types.


change wordpress gallery shortcode to slider

Hi I wanted to change the default WordPress gallery short-code and make it a slider.                  remove_shortcode( 'gallery' );     function gallery_filter( $atts, $content = null ) {            extract(shortcode_atts(array('gallery_name' => ''), $args));         $args = array(             'post_type'   => 'attachment',             'numberposts' => 3,             'post_parent' => $post->ID,             'order' => 'ASC',             'orderby' => 'menu_order',             'post_mime_type' => 'image'                  );             $output .= '                    <link rel="stylesheet" href="'. get_bloginfo( 'template_directory' ) .'/css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />     ';             $output .= '             ';          $output .= "

";            $attachments = get_posts( $args );              if ( $attachments )         {             foreach ( $attachments as $attachment )             {                                     $output .= "
";                 $output .= "ID )."' title='". get_the_title()."'>";                 $output .= "ID )."' />";                 $output .= "";                  $output .= "
";                                 }                  $output .= "

";       }       return $output;            }     add_shortcode( 'gallery' , 'gallery_filter' );


How do I work with the SlideDeck plug-in?

I added the SlideDeck plug-in to my site. I added it into the main index template. I am using the Arthemia theme. I really like the look of it but the only problem is that now I can't see all the options on my drop-down menu as the slider seems to overlap. I would also like to remove the word "Headline" from the box. Any suggestions welcome.


How to edit wp-signup.php content using plugin

I need your help as I got some issue with `wp-signup.php` page which I try to resolve but I am not able to do it. Issue is as follows,   1. I want to replace the text 'Get your own %s account in seconds'   with 'Fields with an asterisk will be shown on your website for the world to see'. I know that i can do it by going to the `wp-signup.php` page and hardcode the text in `signup_user()` but i want it to be handle with the help of a plugin so that even if wordpress upgrade then this will not affect the text.   2. I want to remove radio button with label (Just a username, please.) from the `signup_user()` Any help will be appriciated, I am waiting for you reply.


FancyBox JS stopped working on multiple sites. Custom plugin responsible. Urgent help needed

First post here so let me know if I'm doing something wrong. The company I work for uses a custom FancyBox Wordpress plugin that allows us to use fancy box on images easily. Basically, when you click on the image it expands to fill the center of the screen. Standard stuff, however we're having a problem. Since last week or so it has stopped working and the images just link to themselves (takes you to a new page with he image on a white background). This isn't ideal for obvious reasons, and the developer isn't in the country for the foreseeable future so I can't ask him to fix it. I've looked through the plugin files and the source code for the pages that are output, and the javascript isn't being called properly. It looks like this in the page source:               <script type="text/javascript">jQuery.wpxFancybox();</script>      The main plugin file responsible for this output appears to be this (paste bin link). I'm alright with PHP but this is beyond me. I would really appreciate your help with this problem. Let me know if you require the code from any other files in the plugin. I'll be happy to supply them. Thanks in advance guys.


How to configure Wordpress to be able to use <script> tag inside posts?

I'm looking for a solution that would allow me to write tags inside posts and be sure that the visual editor or wordpress will not alter them. The same problem can apply for other specific HTML code that I may want to use. Disabling the visual editor is not an option, because in will render most edit operation too hard to use.


Adding categories to all blogs at once

I am using WordPress mu 2.9.2 and have the same category structure on all my blogs. How do I add categories to all my blogs simultaneously? Is there a plugin that does this effectively?


Is it possible to rename a customizer control heading?

So far I couldn't figure out how to rename a customizer control. I can rename sections, but cannot find a way to controls. I would like to rename the default **Tagline** control to **Site Description**. Any idea?


spacebar is not working in input and textarea

i have displayed comments box with `<?php comments_template(); ?>` and now when i am styling the `input` and `textarea`. Surprisingly both are not allowing spacebar. That means when i type something in `input` and `textarea` and hit spacebar it doesn't reflect the space in there.! Can someone help me out in the issue?


Custom post.php

Is there any way to define a post.php for a Custom Content Type? I am trying to remove the Permalink, the Slug and the Preview Changes Button from the edit/creation page of an item in my custom content type.


SELECT from wp_users, get Displayname too

SELECT   post_author, count(ID) as amount     FROM     dbold_posts     WHERE    WEEKOFYEAR( post_date ) = WEEKOFYEAR( NOW() )         AND post_status = 'publish'         AND post_type = 'post'     GROUP BY post_author      I can't figure out how I'll get the Display name, instead of "post_author" in this query. It fetches the info as I want it - I just want the displayname instead of the authors ID. Any ideas?


Buddypress export Profile Fields

I am looking for some help in building a sql to export specific data from the DB. In BuddyPress, I have a profile field set up called _Newsletter_. I need to export a list of user from the db who have ticked the _Yes_ (subscribe to newsletter). I have identified the tables/fields in use in my DB.               SELECT `user_id` FROM `wp_bp_xprofile_data` WHERE `field_id` = 8 AND `value` LIKE 'yes'      Where user_id is the Registered user iD Where field_id 8 is my Newsletter value. Now I need to link this with wp_user on user_id but don't know how to use 1 SQL on both table (sorry not my stuff). Second table is wp_user where the Value of User_id should be "linked" to ID. will appreciate some expert help thx RESOLVED AS `SELECT wp_users.ID , wp_users.user_email FROM wp_users LEFT JOIN wp_bp_xprofile_data ON wp_bp_xprofile_data.user_id = wp_users.ID , WHERE wp_bp_xprofile_data.field_id =8 AND wp_bp_xprofile_data.value = 'yes'` Field ID = 8 being the Field you want to get (in my example, newsletter) wp_bp_xprofile_data.value = Yes, being the value of my checkbox (ie Yes)


wordpress plugin error handling

I am looking for a way to handle errors for a custom post type with its own custom fields. This is all part of a plugin I'm writing, however, after extensive research the only way I found is through sessions (or similar) and show it on the next page, (in which case it would save the changes). Is there any other way of handling errors and preventing WordPress from saving the post type if something is wrong? If so how? I figured WP_Error class would work, but without luck. If anyone can help, that would be great! Thanks!


Is there any way to assign stylesheets to whole sets of pages using is_page( )

The code below allow me to use a different CSS style to any page I declare               <body<?php if ( is_page(array('page1', 'page2', 'page3'))) {     echo ' class="myclass" '; } ?>>      for example I can use this css to page1 , page2 and page3:               .myclass #content { background-color: #123456; }     .myclass #content p { color: #987654; }      However I don't know how to use this with every page in one certain path e.g. path /products . Let's say I have have about 30 pages under the path: mysite.com/products/somepage1 --> somepage2, somepage3, ... somepage30 So I have to include every page in the code above and even worst, any time I add a new page I have to include it to the code. Any chance to have a simple way to add all the pages(and new pages) in one certain path?


( Woocommerce) How to get the user belonging to an order?

I am making a function which needs to be called after an order is completed within WooCommerce. For this I'm using the *'woocommerce_order_status_completed'* hook. I want to check if the order has a product belonging to a specific product category. If this is the case, the user will be added to a group within Wordpress. To handle the group logic, I'm making use of another plugin's API. This method needs the *group_id* and the *user_id*. The only thing I'm missing is getting the *user_id*. **How can I get the user (in detail: the id), from my WooCommerce Order?** code:               function isa_set_isa_member_group_after_order_completed($order_id) {         $order = new WC_Order( $order_id );         $items = $order->get_items();              foreach($items as $item) {             $product = $order->get_product_from_item($item);             $has_membership_product = has_term('Lidmaatschap','product_cat',$product->post);                  if($has_membership_product) {                 break;             }         }              $group = Groups_Group::read_by_name('ISA Leden');              if(!group) {             return; // TODO: Add error message + email?         }              $user_id = 0 // TODO: Get user id from order.              $user_group = array(             "user_id" => $user_id,             "group_id" => $group->group_id         );              $result = Groups_User_Group::create($user_group);              if(!result) {             return; // TODO: Add error message + email?         }          }      Technical details: WordPress version: 3.8 WooCommerce version: 2.1


woocommerce_order_status_completed action hook not working

I am developing woocommerce extension wher i need to perform some task after order is successfully completed. For that I started coding. I used following code in constructor of my class.               add_action(‘woocommerce_order_status_completed’,array(&$this,’insert_points’));      Then I defined function as follows:               public function insert_points($order_id)     {        global $woocommerce, $table_prefix;        $order = new WC_Order($order_id);        var_dump($order);     }      But it is not working. Can anybody please help me using code sample.