title: Display the Content of a Post with qTip2

text: How would/should I use qTip2 to display the `the_content();` of a WordPress post? I've been trying to accomplish this for a month now. I got it working once, but it wouldn't display the content that was placed after a `<br>`. I no longer have the code, unfortunately. I found the code, which worked before, but sadly, couldn't handle line breaks, `<br>`: http://jsfiddle.net/jv8WN/7/


title: use Wordpress theme / plugin editor in my plugin

text: Is there a way to use the wordpress theme / plugin editor inside my plugin to give the user the ability to edit the css file of my plugin ? Im building a plugin that gives the user an option to add some CSS. First i was going to use just a textarea but then i thought it would be pretty could if i can use the Wordpress editor that will open my style.css file. I could put just a link to http://www.xxxxxx.com/wp-admin/plugin-editor.php but it would be great if i can integrate it into my plugin. Regards


title: Repeatable WordPress custom fields in a metabox

text: I would like to create a meta box where the user can add or remove a simple input field that holds an image url on posts.


title: Customizing the 3.5 "Add Media" popup (Backbone.js)

text: Here's yet another question in regard to the new(ish) 3.5 "Add Media" popup and how to customize it! **What I'm trying to do** I'm attempting to do four main things: 1) Create a custom tab titled "Flickr Uploads"; 2) Customize the text that is displayed in the upload `button`; 3) Populate the `select` dropdown with external `API` sorting options (in other words `unset` the default options and `set` my own... only for the custom tab); 4) change the photos that are displayed to ones from an external `API` and still be able to add tags, descriptions, etc... in the right-side-bar. **What I've managed to do** With the use of the gist by @Fabien Quatravaux I have completed steps `1) and 2)` in the list above ... but, I'm having some trouble figuring this stuff out. This is what is being displayed: ![Good start but not done!](http://i.stack.imgur.com/RCp4S.png) **Where I need help to finish** As you can see I still need to figure out how to customize the `select` dropdown options, display the `meta-data` inputs in the right-side-bar, as well as make the images select the right way and get the button to interact the same as on the "Insert Media" tab. I have barely messed with `jQuery` let-alone `Backbone` ... so, needless to say I am quite lost in what to do. I don't know where to start. Thank you for any help!


title: $current_screen if condition for a specific page in admin

text: Right now I have this code to add some changes in my WYSIWYG editor in admin:               add_filter( 'default_content', 'custom_editor_content' );     function custom_editor_content( $content ) {              global $current_screen;              if ( $current_screen->post_type == 'page') {            $content = '                 // TEMPLATE FOR MY PAGE                 ';         }              return $content;     }      But it's for all pages. I want it only for a page with id = 28. How to do that? I guess I need to change my if condition to something like:               if ( $current_screen->post_type == 'page' && ??? post_id == '28' ??? )      However, I need to figure out the code between the question marks.


title: How to show 3 most recent/viewed posts in a special tiles on home page using wordpress?

text:
I have these tile elements on the top of my homepage:

Just Some Title

2013/2/25

Title 1

2013/5/15

Title 2

2013/6/17

Title 3

Another Title

       and I want to show 3 most recent/viewed posts in tile 2, 3 and 4; just the title, date and an image of that post that it gets the url from custom fields that I defined, I tried using :               .     .     .         <?php query_posts("post_per_page=3"); the_post(); ?>
                 <img class="post-image" src="<?php echo get_post_meta($post->ID, 'post_image', true) ?>"/>
                     <img src="<?php echo get_post_meta($post->ID, 'post_icon', true) ?>" >
<?php the_time('F jS, Y') ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                 <img class="post-image" src="<?php echo get_post_meta($post->ID, 'post_image', true) ?>"/>
                     <img src="<?php echo get_post_meta($post->ID, 'post_icon', true) ?>" >
<?php the_time('F jS, Y') ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                 <img class="post-image" src="<?php echo get_post_meta($post->ID, 'post_image', true) ?>"/>
                     <img src="<?php echo get_post_meta($post->ID, 'post_icon', true) ?>" >
<?php the_time('F jS, Y') ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

     <?php wp_reset_query(); ?>      .     .     .      Actually these are just some place to show 3 most recent/viewed post with an image, I mean there will be a list of recent posts beneath them with an excerpt (just for the record). the problem is that it just gets one post and shows it there, what's wrong? what did I missed? please help, I'm new in the world of wordpress!


title: Server Path Information

text: I have a plugin that uses server paths to define the location of an Image Folder, however, I have decided to have a CDM or a new separate server to host my images. Currently all the paths look like this: `$upload_dir = '/home/www/original_domain.com/media/downloads/encrypted';` I have tried to search the web for answers but I do not know that search queries to type in to get the answers. The new server has a different domain and I have tried doing this: `$upload_dir = 'http://new_domain.com/media/downloads/encrypted';` But that does not work, is there a way to define the folder location? I believe this script can only read server paths.


title: Change language by clicking a button

text: The goal is to offer a button/select drop-down or similar to switch the _public interface 1)_ language on the fly. What I'm searching for   * Plugin _or_ Theme Code...   * ... _or_ Ideas   * Using a work-around with `load_textdomain()` would be appreciated to leave translation to .po/.mo files   * Ideas on how to parse the strings into the interface (ex. ajax/plain php/ini, json, xml files) when not relying on some textdomain function * * * Note: **1)** It's not about publishing in different languages. **2)** I don't need code to make the actual drop-down/button/whatever. It's only about the code/system delivering the strings for the UI. Thanks!


title: get_the_post_thumbnail ignores my default thumbnail size

text: My default thumbnail size is 150x150. Therefore, if I use a custom thumbnail size, such as 75x75 it should use the thumbnail of 150x150 and shrink to fit to my size:               get_the_post_thumbnail( $item->ID, array(75,75))      However, it is basing the image off of a thumbnail size of 149x100. The 150x150 image exists, but it refuses to use it. I figured heck with that, I'll just create a custom 75x75 thumbnail and that will solve the problem:               functions.php     add_image_size( 'listp-thumb', 75, 75, true ); // thumbnails located in list posts      Now to call the new thumbnail:               get_the_post_thumbnail( $item->ID, 'listp-thumb')      The same thing happens. :( Do I need to clear a custom query that may be interfering with this?


title: Migrate DB Plugin: Error "The directory needs to be writable"

text: I'm using the migrate db plugin to do some find and replaces to the database after it's been exported. It continues to pester me with the directory isn't writeable error. I've went and chmod'd the whole /wp-content folder with the following command: `chmod -R 777` which i know you're not suppoose to do; but it's driving me nuts. it still has the same silly error. Does anyone know which folder it's asking to give the correct permissions?


title: Do you know a video plugin that allows embedding in the home.php file?

text: I've been looking for a video plugin in the plugin depository but couldn't find one that I'm looking for. Basically, I want visitors to be able to play the video in the home page but the issue here is that the home page is displaying post excerpts. So if I would just post the video as normal, it would be cut in the home page. So I think I would need to hard code the video code of the plugin inside the loop in the home template file, like where $video is the the video file in the post. Does anybody know a video plugin like this? Or is there a work around here, like how to show video in the home page having post excepts. Thanks.


title: Using global $post; with custom post types

text: I'm working on creating a notification that will indicate when a post is less than a few days old. This is specifically for a custom post type called "news". Is there a way to use `global $post;` with custom post types? This is my original code.               <?php global $post;         $postdate = str_replace("-", " ",substr($post->post_date, 0,10));         $postd = explode(" ", $postdate);         $ageunix = get_the_time('U');         $days_old_in_seconds = ((time() - $ageunix));         $days_old = (($days_old_in_seconds/86400));         if ($days_old < 3) { ?>         <script type="text/javascript">             jQuery(document).ready(function($){                 $("#notification").addClass("notification-highlight");              });         </script>     <?php } ?>      I tried               <?php      $post_type = get_post_type();     if (($days_old < 3) && ($post_type == "news")) { ?>         <script type="text/javascript">             jQuery(document).ready(function($){                 $("#notification").addClass("notification-highlight");              });         </script>     <?php } ?>


title: Removing Image and Caption Dimension Attributes

text: This question is an offshoot from the this discussion on removing dimension attributes from images. The solution code provided on that thread works very well except that it has the unfortunate side effect that any `[caption]` shortcodes are striped from the image. After several hours of digging through the core code, I found the cause of this. The wpeditimage TinyMCE plugin that's responsible for adding the `[caption]` shortcode checks for width attributes in the shortcode and the `img` tag. If it doesn't find them, it simply remove the caption. Since, this is done 'on the fly' with javascript in the TinyMCE editor, I can't think of any type of WordPress filter that would address this issue. I would be very happy to be proven wrong however. :) As a final note, my temporary solution has been to use the following jQuery to strip all of the offending tags client side. This, in conjunction with a filter on `img_caption_shortcode` to prevent a width style from being used there, seems to do the job. It's not pretty, but it's a band-aid for now. Anyone have a better idea?               // Strip width and height attributes from img, video, and object in the main article so we can have fluid images     var $fluid_items = $('.main-article-wrapper').find('img,video,object');     $fluid_items.removeAttr('width');     $fluid_items.removeAttr('height');


title: How can I increase the post count for custom post types only?

text: I have the page count set to the default 10 in my reading settings menu. ![screenshot-with- shadow.jpg](http://img257.imageshack.us/img257/5788/screenshotwithshadow.jpg) However, I use my template `archive.php` file for all post types, including `posts` and `books` How can I change the loop so that when searching `books` it will show 30 books in the archive page instead of showing the default 10?


title: wp_list_categories, Add class to all list items with children

text: I'm using `wp_list_categories();` to show a list of all the terms within a custom taxonomy but I need to style list items that have children differently to those that don't. Is there a way, PHP or jQuery, that I can give all parent elements a special class?


title: Serving Cookies From A Different Domain or Sub-Domain

text: The WordPress Codex clearly states that if your website is served from `example.com`, for the sake of performance, you can have the cookies served from `www.example.com` by adding this to your wp-config.php:               define('COOKIE_DOMAIN', 'www.example.com');      **Problem:**   * The cookies are still being served from `example.com` and not `www.example.com`. What's wrong? or does this no longer work? _**PS:** Edited to be precise._


title: Error establishing a database connection when migrating site to localhost

text: I'm wanting to make a version of my blog on my home computer that I can work on offline. I set up LAMP on my computer (running Ubuntu) and copied all of my files from my server (000 Webhost) with FileZilla. But when I try to access my site on my localhost, I get "Error establishing a database connection." I think I've figured out that it has something to do with MySQL, but I'm really new to all this and could be way off. Any help would be greatly appreciated. Thanks in advance.


title: Geolocate Custom Post Type on Save

text: I was wondering what hook i would use to geo-locate a custom post type when it is saved? I have a Custom post type of Restaurant and I want to geolocate the address using googles api and then save it into another field(s)


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

text: 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?


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

text: 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


title: Visually change theme via query string?

text: 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


title: Methods of Integrating Plugin Data with Themes

text: 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!


title: posts_groupby problem

text: 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?


title: Improve Custom Post Permalink Structure

text: 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');`


title: Custom Search Query

text: 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?


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

text: 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"?


title: Is there a recover_post hook to go with trash_post hook?

text: 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!


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

text: 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 :)


title: How is WP Cron Locking implemented?

text: 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?


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

text: 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?


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

text: 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.


title: show author avatar

text: 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;     }


title: Count within foreach loop

text:
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.


title: wordpress admin plugin menu custom css

text: 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 ;)


title: Need rewrite for URL with specific string

text: 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.


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

text: 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.


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

text: 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 :)


title: change video icons to selected thumbnail?

text: 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...         }     }


title: How to speed up my site

text: > **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?


title: Adding more text to a post, after it was published

text: 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.


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

text: 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 :(


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

text: 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?


title: Have custom number of blog posts on homepage with working pagination

text: > **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!


title: Searching for a better Twitter widget

text: 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 ...?


title: Get random custom posts from a custom post type

text:
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; ?>


title: Preferred Wordpress video format?

text: 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?


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

text:
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?


title: Querying post from a multisite network

text: 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.


title: Capability to edit own post, but not create new one

text: 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.


title: Custom rewrite_rules - only pass numbers and not alphabetic characters

text: 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');


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

text: 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.


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

text: 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.


title: Siteurl code for links

text: 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! :)


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

text: 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?


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

text: 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.


title: Retrive post by tags PHP code

text: 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();           ?>


title: Display posts by tag on page

text: 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!


title: Looking for a home page carousel

text: 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?


title: allow html characters on eshop data entry boxes

text: 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


title: Comment section not appearing on posts with no comments

text:
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


title: XML to Json code issue

text: 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?


title: Adding a gallery to my first theme

text: 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?


title: The Loop won't display page or post content

text:
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(); ?>


title: How do i create a list-posts-page?

text: 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.


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

text: 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


title: Media Library filter returns undefined function get_current_screen

text: 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


title: how to enable plugin menu on subsite of wordpress MU

text: 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


title: Unable to convert all css and js features to WP theme

text: 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.


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

text: 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...


title: Second wordpress installation on subdirectory

text: 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.


title: Get child taxonomies in loop

text:
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!?


title: Menu Link Redirect Based on Username or User ID

text: 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?


title: Wordpress Theme Validator?

text: 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.


title: The "Child Pages Shortcode" plugin, block template

text:
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


title: Spammers are bypassing BuddyPress registration form

text: 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?


title: Adding wp_enqueue_media(); causes problem

text: 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;     });


title: Developer plugin to echo template names/filepaths

text: 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!


title: Saving metadata of related post on save_post

text: 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


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

text: 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


title: Understanding with this Wordpress code

text: 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.


title: Post show up as post and pages

text: 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