title: Children Shortcodes?

text: I started creating WordPress plugins a few weeks ago, and I would like to know if it's possible to somehow "embed" shortcodes in some others. Basically what I want to do is create a table or a list, based on a set of items entered by the user of the plugin. Is it possible to have something like :                [data]         [item1] something [/item1]         [item2] something else[/item2]         [item3] something else[/item3]      [/data]      In short, I want to create something based on the elements contained in the _itemX_ "children" shortcodes. Is there any way to do something like that? Thanks


title: SEO images in Nextgen Galleries

text: I have a couple blogs / wordpress sites that I post pictures on. I have noticed that most of the pictures I post with the nextgen gallery plug in never show up in google images search. Is there a way to fix this?


title: Submitting form in wordpress plugin

text: I am new to wordpress and currently making a plugin. I am getting list of authors using               <?php wp_dropdown_users(array('name' => 'author'));?>      Now when submitting my form I want to retain the current value entered by the user but as soon I submit the form the values get back to the default ones. I have searched on net and tryed alot but somehow not able to do this task.


title: Is there a way to create a "copy post" link?

text: Much like the "edit" link when viewing a post, is here a "copy post" function I can include with my theme?


title: Adding html format on tinymce visual editor

text: Need to add more html format tag to TinyMCE Editor as visualized below ![tinymceeditor - highlighted **Format** dropdown](http://i.stack.imgur.com/Cc80R.jpg) Using Wordpress 3.6.1 Can't found any good example/guide for these modification. Another solution welcome. Thanks & Cheers :-)


title: wp_generate_attachment_metadata sizes lose directory prefix

text: I am trying to programmatically add image attachments. What I have done is put the images in the correct sub-directory (.../wp-content/uploads/2013/09/*.jpg) and then use the following code to insert attachments: (code almost entirely from `wp_insert_attachment()` \- Codex)               $filename = $image->filename; // where $filename = ABCD.jpg, in uploads/2013/09/          $wp_filetype = wp_check_filetype(basename($filename), null);     $wp_upload_dir = wp_upload_dir();     $attachment = array(         'guid' => $wp_upload_dir['url'] . '/' . basename($filename),         'post_mime_type' => $wp_filetype['type'],         'post_title' => preg_replace('/\.[^.]+$/', '', basename($filename)),         'post_content' => '',         'post_status' => 'inherit'     );     $attach_id = wp_insert_attachment($attachment, $filename, $post_id);          require_once(ABSPATH . 'wp-admin/includes/image.php');     $attach_data = wp_generate_attachment_metadata($attach_id, $wp_upload_dir['path'] . '/' . basename($filename));     wp_update_attachment_metadata($attach_id, $attach_data);      The problem is when I inspect `$attach_data` the `['sizes']` array is missing the /2013/09 prefix in `['file']`. I'm not quite sure what I'm doing wrong, I could go ahead and modify that before continuing, but was wondering if I'm doing something wrong? Any Ideas?


title: only display Pages which have children

text: Here is my website structure(wordpress pages)                - HOME -      - Tutorial -         + PHP Tutorial +         + Photoshop Tutorial +         + Css Tutorial +          + HTML Tutroial +         - news -         + November         + September         + May          + April      - about -      - contact -      How do I have the output just the pages which have children pages? so when I click tutorial page, the tutorial page has following list. (but pages list stays static when click subpages.   * Tutorial -      * PHP Tutorial +     * Photoshop Tutorial +     * Css Tutorial +      * HTML Tutroial +  I am using this code, but this only displays all children pages no parent.               <?php       if($post->post_parent)       $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=1");       else       $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");       if ($children) { ?>       <ul>       <?php echo $children; ?>       </ul>       <?php } ?>


title: file.php not loaded?

text: I feel like I'm being really stupid.   I want to make use of some functions in `wp-admin/includes/file.php` (like `download_url`), but it doesn't seem to be included, not in the dashboard/admin, or in the front end. I've put:               if (function_exists('download_url')) {         echo "YES!";     } else {         echo "NO!";     }      in my theme's `functions.php`, and it always prints "NO!". Do I need to do something to make these functions available?   I'm normally pretty expert with WP but I'm stumped by this very simple thing. Thanks in advance for help.


title: Wordpress rewrite question

text:
I am new here and have a question about URLs in WordPress. The very front- facing portion of my website uses WordPress just so I can use the CMSs and blog for my SEO. I have a real estate portion of the site written in basic PHP and I would like to see if there is a way to rewrite URLs so I can have a customer visit:               http://mysite.com/RepfirstnameReplastname      instead of               http://mysite.com/?rep=RepfirstnameReplastname      When a person now visits:               http://mysite.com/?rep=RepfirstnameReplastname      I have a header across the top float down and show the reps details. What I would like to do is just have a person go to a URL like this one instead:               http://mysite.com/RepfirstnameReplastname      I have put this code in my WordPress theme header file (`header.php`) and my homepage has id[10]               if(is_page(10)){                       $url = $_SERVER['REQUEST_URI'];                       $repurl2 = parse_url($url, PHP_URL_PATH);                       $repurl = $_GET['rep'];                            $config = array(                     'host'      => 'xxx',                     'username'  => 'xxxx',                     'password'  => 'xxxxx',                     'dbname'    => 'xxxxxx'                 );                      $db = new PDO('sqlsrv:Server=' . $config['host'] . ';Database=' . $config['dbname'], $config['username'], $config['password']);                 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);                 $getInfo = $db->prepare("SELECT * FROM representatives WHERE Website = ?");                 $getInfo->bindValue(1, $repurl);                 $getInfo->execute();                 $rep = $getInfo->fetch(PDO::FETCH_ASSOC);                 if(isset($rep['DisplayName'])){                     $_SESSION['repage'] = $_GET['rep'];                     $_SESSION['repphoto'] = $rep['PhotographURL'];                     $_SESSION['repname'] = $rep['DisplayName'];                     $_SESSION['reptext'] = $rep['WelcomeText'];                      }          }          if(isset($_SESSION['repage'])){             ?>

<img src="<?=$_SESSION['repphoto'];?>">

<? echo $_SESSION['repname']; ?>
<? echo $_SESSION['reptext']; ?>

         <?     }     ?>      The above grabs the info I need from an old SQL server for the rep and displays their info properly. I would just like to know how to remove `?rep=` out of the URL.


title: How to pass query string to page

text: How to pass query string to page Hi guys, I got a page which let's say page name is Actor the permalink is something like this               http://www.mywebsite.com/actor      I wanna be able to pass a query string let's say Albert Roberto and I would so something like               http://www.mywebsite.com/actor/Albert Roberto      Inside the page of actor, there a plugin I created which use shortcode e.g [actor] and it will display the data, as current I hardcode the actor in the plugin, I want able pass the parameter so my plugin can fetch the data by the query string from my database. I had done the fetching with a hardcode actor name, now wanna change the hardcode to query string base on user input. I want to be able to grab the query string that was pass in, and use it in my plugin, is it possible? How do I achieve it Thanks for all the help !! Sincerely


title: Get the blog page URL set in Options

text: I have set the blog to be a different page other than the home page. I want to have a link from single.php to this blog page. Is there any function that pulls out URL for the blog ?


title: How to Insert Self-Hosted Video in WordPress Post

text: Does WordPress have an easy way to insert video in a post? I am not referring to YouTube, Vimeo or other hosting sites, just video I upload myself on the server or through the Media manager. I have an mp4 video for example, and I'd like to have it play within the post, it's hosted on the same server as the website.


title: i want attachment.php to return the image

text: I use a lightbox to display images from posts in a website that is updated by differents authors. Or course, the lightbox only works if the author makes sure that he uses link to the image directly while uploading the file. 1/3 of the time, the author forgets and the lightbox shows the html of the attachment.php page. Is there possible to have a function, placed into attachments.php, that would return the image instead of the html page ? It would be simple to find the image itself, but I guess this would requires to change headers somewhere so the webserver returns the 'image/jpg' header. I would manage the details but I would need some help to start with. Thank you.


title: Like/Dislike Bar not working when updating

text:
I'm trying to integrate Like/Dislike Bar in a Wordpress plugin . It Works Properly when total page reload/refresh . But whentime Like/Dislike Bar refresh from ajax that time its not working . **This is my html code .**

      **And this is my code in ajax for update**               $('.bar .bar-success').css('width','80%');     $('.bar .bar-danger').css('width', '20%');      but my like/dislike bar not updated . Whats wrong in my code ?


title: Why do I lose all the slashes, i.e., " \ ", in my blogs when I import XML files by the WordPress Importer plug-in?

text: When I want to import the XML files with the aid of the WordPress Importer plugin, the blogs imported will lose all the slashes, i.e., "\", which are really contained in the XML files imported. Since I have to use the LaTeX plug-in (Latex for WordPress plug-in), it becomes terrible. In fact, maybe weeks ago, it worked well. There was no such problem at all. But from one day, I find that all changed. TT Is there any one who know what's happening? Thank you very much!


title: Varying the number of posts per page from the first one

text: I want to have the index page to have a different number of posts than the rest of the pages (page 2, page 3 of the index page, as well as the archive pages). In my case I want to limit the number of posts on the front page to 5, while the rest will follow the configuration parameter from wordpress admin (in my case 8). I followed the example on this page here, and hooked in the `pre_get_posts` filter as follows:               function limit_posts_per_home_page()      {         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;              if ( is_front_page() && ($paged == 1))             $limit = 5;         else             $limit = get_option('posts_per_page');              set_query_var('posts_per_archive_page', $limit);         set_query_var('posts_per_page', $limit);     }     add_filter('pre_get_posts', 'limit_posts_per_home_page');      This 'seems' to work fine. However in actual fact with the `posts_per_page` parameter set to 8, Page 2 of the index page shows item 9 to 16, rather than 6 to 13, thus missing 3 items. Is there to modify the offset in some way to make wordpress count from 6 rather than 8 from the 2nd page onwards?


title: What happens to the text in functions.php file outside of the php enclosure?

text: I have a very basic question. In the `functions.php` file of a theme, what happens to the text that is outside a function and outside the <?php ?> tags? Can I place notes before and after the functions without commenting it and without affecting the system? Or should I at least enclose the out-of-php text in html comments? For example:               comment/note/reference text     <?php     function my_function() {     code;     return results;     }     ?>     more comment/note/reference text     <?php     function my_function_2() {     code;     return results;     }     ?>     more comment/note/reference text      cheers,   Gregory


title: sortable custom column in media library

text: trying to make a custom column sortable in the media library. Found lots of examples for posts, and users but can't get them to work on the media library page.               function wpse_hook_isv_columns() {         add_action('manage_media_custom_column', 'isv_custom_media_column_content',10,2);         add_filter('manage_media_columns', 'isv_custom_media_column_headings');         add_filter('manage_media_imwidth_sortable_columns', 'imwidth_column_register_sortable' );     }     add_action( 'admin_init', 'wpse_hook_isv_columns' );               function isv_custom_media_column_headings($defaults) {        $defaults['isv_width'] = __( 'Width', 'imwidth' );        $defaults['isv_height']    = 'Height';        return $defaults;     }          function isv_custom_media_column_content($column_name,$id) {        $meta = wp_get_attachment_metadata($id);        switch ($column_name) {                    case 'isv_width':              $imWidth = get_post_meta($id, "_im_width", true);              if(  $imWidth ) :                       echo $imWidth .' ('.$meta['width'].')';              else : //  add meta value if not there...                      update_post_meta($id, '_im_width', $meta['width']);                 echo $meta['width'].' (updated)';              endif;                        break;                case 'isv_height':              $desc = get_the_content();              echo $meta['height'] ? $meta['height'] : $none;              break;        }     }          // Register the column as sortable ???     function imwidth_column_register_sortable( $columns ) {         $custom = array(               // meta column id => sortby value used in query               'imwidth'    => 'Width',         );         return wp_parse_args($custom, $columns);     }          // This example i found works!          function registerdate($columns) {         $columns['registerdate'] = __('Registered', 'registerdate');         return $columns;     }     add_filter('manage_users_columns', 'registerdate');          function registerdate_columns( $value, $column_name, $user_id ) {         if ( 'registerdate' != $column_name )            return $value;         $user = get_userdata( $user_id );         $registerdate = $user->user_registered;         return $registerdate;     }     add_action('manage_users_custom_column',  'registerdate_columns', 10, 3);          function registerdate_column_sortable($columns) {           $custom = array(           // meta column id => sortby value used in query           'registerdate'    => 'registered',           );       return wp_parse_args($custom, $columns);     }     add_filter( 'manage_users_sortable_columns', 'registerdate_column_sortable' );      how can i make isv_width sortable? Any help appreciated!


title: Widget header unique classes

text:
I have created the code below for one of my widget sections. Currently I am able to manipulate the title bar with (h3.home-widget-header) which is good. But obviously it will be for all widgets in that section. There is 1 or two widgets that I need to style the positioning of the title bar slightly different. My question is - is this possible and how would I go about writing a unique class so I can manipulate each widget in that section individually. Thanks ahead of time!   * Mike if ( function_exists('register_sidebar') ) {               register_sidebar(array(              'name' => 'Homepage Widget Area',              'before_widget' => '
',              'after_widget' => '
',              'before_title' => '
',              'after_title' => '
',          ));      }


title: Prevent save_post from running when preview button pressed?

text: I have a bug where my content gets saved twice (2 seperate rows in the posts table). This post creation is for a custom post type so the bug is to do with my code. To reproduce I:   * Create a new post.    * Press preview (this creates the first row in the posts table).   * Close the preview window.   * Press save (this creates the second row in the posts table). If I press preview/save again then the duplication no longer occurs. If I edit an already created post then the bug also does not occur. When you press preview, it passes &preview=true in the querystring. In my save_post function I have:                 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )            return;            if ($post->post_type=='gmc_recipe' && !$GET['preview']) {         //Save logic here       }      But the save logic still gets executed when the preview button is pressed! Any ideas on how to prevent saving when the preview button is pressed? I can't seem to capture the preview being in the querystring.


title: Create custom [sourcecode] shortcode, the right way?

text:
## What I want to do Sharing code in posts on WordPress is quite a pain with all the HTML escaping to take care of. So, I plan to enclose code in posts within a custom shortcode called `[sourcecode]`, as shown below, and let it automatically escape the special characters.               [sourcecode]     <?php              // Some code here.          ?>     [/sourcecode]      * * * ## The code And this is what the relevant function (in my theme's functions.php) looks like:               /**      * Functionality to set up custom shortcode correctly.      *      * This function is attached to the 'the_content' filter hook.      */     add_filter( 'the_content', 'run_bbcodes', 7 );     function run_bbcodes( $content ) {         global $shortcode_tags;              $orig_shortcode_tags = $shortcode_tags;         $shortcode_tags = array();              // New shortcodes below         add_shortcode( 'sourcecode', 'bbcode_code' );              $content = do_shortcode( $content );         $shortcode_tags = $orig_shortcode_tags;              return $content;     }          /**      * Add Custom shortcode functions below      *      * This function is attached to the 'sourcecode' shortcode hook.      */     function bbcode_code( $atts, $content = null ) {              // Ensure contents of a
...
 HTML block aren't converted into paragraphs or line-breaks         $content = clean_pre( $content );              $content = str_replace(                  // Replace these special characters...             array( '&', '\0', '<', '>', '\'', '"', '/', '[', ']' ),                  // ...with the HTML entities below, respectively             array( '&', '\0', '<', '>', ''', '"', '/', '[', ']' ),                  $content         );              return '
' . trim( $content ) . '
';     }          /**      * Related sourcecode worth reading:      *      * https://bitbucket.org/cbavota/syntax-highlighter-plugin/src      *      * https://github.com/mdawaffe/Highlight.js-for-WordPress/blob/master/highlight-js.php      *      * https://github.com/fracek/highlight-wp/blob/master/highlight.php      *      * http://plugins.svn.wordpress.org/syntaxhighlighter/trunk/      *      * http://blog.webspace.jp/235      *      * http://core.trac.wordpress.org/browser/trunk/src/wp-includes/shortcodes.php      */      * * * ## Question(s) Now that the explanation is out of the way...   1. Am I missing anything else? For example, until I read the source of SyntaxHighlighter Evolved plugin, I didn't know that `\0` also needs to be replaced with `\0` "to work around kses" (which wasn't clear enough for me).   2. And other than escaping the special characters, is there anything else that I could possibly be missing? Am I doing it the right way? (It would be great if anyone could take a look at this file (PHP source code of SyntaxHighlighter Evolved plugin) and see if you can find something that I need to implement. I already did try my best though.) * * * **PS:** Why not use the plugin itself? For one, I don't want the syntax highlighting that it does; and I want to know if what it does can be implemented easily.


title: What is the Multisite way to handle user_register when adding a new user from $SUBSITE/wp-admin/user-new.php? 3.9.1

text: I am integrating with an external authentication server using the `user_register` action. We manually create users via the admin panel and do not allow self registration. Now I need to handle a similar scenario but in a sub-site while using Multisite. I was running through a debugger and noticed that when posting a new user in multisite mode to `wp-admin/user-new.php`, there are no actions fired that work the same way as `user_register`. The closest I see is the `wpmu_validate_user_signup` filter but I know that is not the right place to do this. I log into the admin panel as a super admin, select the site via the My Sites menu, then go to `Users > Add New`. The function `wpmu_signup_user` does the insert and it does not contain any `do_action` calls Is this an oversight in WordPress core for not providing such an action or am I doing it wrong? If it is the former I will open a ticket about adding a new action. I am using 3.9.1


title: Exclude specific post from displaying

text:
I am trying to exclude a specific post ID from displaying. I've included the post ID as a `post__not_in` but being given an error I am unsure of, any obvious changes needed here?                                   <?php                         // Create a variable to hold our custom Loop results                         $frontpageposts = get_posts( array(                               'numberposts' => 1, // only the 3 latest posts                              'post__not_in' => '-4135'                         ) );                              // Create output only if we have results                         // Customize to suit your HTML markup                         if ( $frontpageposts ) {                                    foreach ( $frontpageposts as $fppost ) {                                    // setup postdata, so we can use template tags                                   setup_postdata($fppost);                                   ?>                                        <div <?php post_class(); ?>>
<a href="<?php the_permalink(); ?>"><?php //the_title(); ?>Latest News #1

                                             <?php the_post_thumbnail(); ?>                                             <?php //the_excerpt(); ?>

                              <?php }                         }                          ?>      **Error** > Warning: array_map(): Argument #2 should be an array in > /var/www/vhosts/testdomain.co.uk/faiauto/wp-includes/query.php on line 2451 > > Warning: implode(): Invalid arguments passed in > /var/www/vhosts/testdomain.co.uk/faiauto/wp-includes/query.php on line 2451


title: javascripts files not linking to my category slugs?

text: I have a wordpress custom theme set-up and what i want is to create separate category templates, now seeing the template hierarchy i created the category-{slug} file and now when i am linking my custom JavaScript files inside its header part the script inserted in header is -               <script type="text/javascript" src="../literature/js/head.min.js"></script>      And the scripts in the footer to be executed after my content loads are -               <script>             head.js(                 { jquery : "js/jquery.min.js" },                 { mousewheel : "js/jquery.mousewheel.js" },                 { mwheelIntent : "js/mwheelIntent.js" },                 { jScrollPane : "js/jquery.jscrollpane.min.js" },                 { history : "js/jquery.history.js" },                 { stringLib : "js/core.string.js" },                 { easing : "js/jquery.easing.1.3.js" },                 { smartresize : "js/jquery.smartresize.js" },                 { page : "js/jquery.page.js" }             );     </script>      Now i am getting a 404 error for all these files not present there , here's the firebug result :-               "NetworkError: 404 Not Found - http://localhost/deadman/wordpress/category/literature/wp-content/themes/testing/js/literature/core.string.js"      Now the things which i already tried are   * `"<?php bloginfo('template_url');/js/literature?>"`   * `"wp-content/themes/testing/js/literature"` Anyone got a possible solution for this, i think it is because of the javascript prototyping i am using in the footer part but still i ain't able to fix this.


title: Reading Wordpress sessions in Magento

text: I'm looking for a way to read a session set in Wordpress, in Magento. Reading Magento sessions in Wordpress proved to be no problem but the other way around seems nearly impossible. Here's my situation: I have a user area in Wordpress where people can login. I need to check in Magento if a user is logged in. IMPORTANT: I am not/ will not use Magento's customer model for this. Even if I retrieve a Magento session in WP and write to this session, I can not retrieve these changes in Magento. Hope anyone can shed some light on this.


title: Wordpress directing to Posts page (edit.php) instead of saving post

text: I have got a clean build ( **WordPress 3.9.1** running Twenty Fourteen theme). I've **installed WooCommerce** plugin and added one product. The product is a variable product with 65 variations. When I **link all variations** and save, there are no issues. But editing any information such as stock quantities or price etc and hitting Update will cause the problem below. Once I **click Update** , I am redirected to edit.php (the Posts page) and the **changes were not saved**. There is no error and everything seems to be running just fine. Upon removing variations one by one I realised that **once there's less than 50** , the post **updates perfectly**. I've tried increasing memory in PHP.ini, .htaccess, wp-config.php and nothing. Any ideas at all as I'm absolutely lost on this one. Many thanks in advance. Michael **EDIT** : In actual fact, you don't have to even attempt to change the properties of the new product. Even just trying to change this as it is will cause this issue.


title: Does code run faster in functions.php than in different theme templates?

text: For example I have this code which gets the post title:               function baracuda_sinlge_post_title(){ // Single Post Title             $post_title = single_post_title('','0');             return $post_title;         }      Where do you think it would run faster, in functions.php or direcly in the template I need it to be like this:               $post_title = single_post_title('','0');


title: Get declared variable in single.php to work in comments.php without re-declaring it

text: I have declared a variable in my single.php               $title  = 'myvar';      Can I get it in my comments.php without re-declaring it again? I use this code to get the comments.php templage:               <? comments_template( '', true );  ?>      Ty


title: Creative Clans Embed Script plug-in equivalent?

text: I need to add unique JavaScript snippets to several pages on a client's WordPress site. I used to use the above-mentioned plug-in until I encountered a nasty bug.* The thing I like(d) about Creative Clans Embed Script is that it doesn't require you to build a library of snippets in advance. You simply paste whatever code you want to append/prepend to a page into a dedicated field on the Edit Page ... page. Another advantage to this is that it completely isolates the snippet from the page content; you don't even have to reference a shortcode. Is there an alternative that's equally simple and flexible? * The WordPress page editor auto-saves a draft every few minutes, right? When this happens, Creative Clans Embed Script loses any snippets for that page. I've replicated the behavior in different browsers, on different computers, and on different websites. The plug-in hasn't been updated in two years.


title: Wordpress redirect to landing page if not logged in

text: I'm using the following code in my functions.php file to redirect users who are not logged in to a particular landing page                   <?php     if(!is_user_logged_in()) {         wp_redirect( 'http://www.mysite.com/landingpage', 301 ); exit;     }      The problem is I cannot access my wp-login or wp-admin anymore. Every url redirects to landingpage. Is there a way I can exclude certain urls from redirecting?


title: echo term name outside the loop, using term slug

text: I have a strange question... I have my term as a variable...               $mailer = 'may-2012-newsletter';      And I'm trying to echo on my page the Name of my term, using the variable above. But this is not in a loop. My term name is: **May 2012 Newsletter** But I'm trying to echo this from using my term slug: **may-2012-newsletter** This term is grouped in my taxonomy called: **mailers** I've tried this below but this doesn't work? I think I'm totally off track.               <title><?php echo get_term_by( 'name', $mailer, 'mailers'); ?></title>         Any help would be awesome thanks. Josh


title: sort posts by getPostViews in functions.php

text:
I have the following function in functions.php that allows sorting alphabetically or by recency. I want to change the alphabetic to sort by most viewed. This is the code I have for the sorter, which is a dropdown select menu:               function sorter($wp_query) {                  if(mysql_real_escape_string($_REQUEST["sorting"]) == "date"){                 usort($wp_query->posts, 'cmp_date');             }else if(mysql_real_escape_string($_REQUEST["sorting"]) == "title"){                 usort($wp_query->posts, 'cmp_alpha');             }     }      And this is the code for the sorter:               function custom_sort(){      // retrieve the sorting variables         $sort_selected = mysql_real_escape_string($_REQUEST["sorting"]); ?>     <form action="" method="post">
             Sorting:             <select name="sorting" onchange="this.form.submit();">             <?php switch($sort_selected){                 case "";                 case "date";                 ?>                     <option value="date">Recency</option>                     <option value="title">Alphabetic</option>                     <option value="views">Views</option>             <?php break;             case "title";?>                     <option value="title">Alphabetic</option>                     <option value="date">Recency</option>                     <option value="views">Views</option>             <?php break;             case "views";?>                     <option value="views">Views</option>                     <option value="title">Alphabetic</option>                     <option value="date">Recency</option>             <?php break;             } // end switch ?>             </select>
     </form>      <?php }      And I think I need to use something like this (which I saw in another question on this site):               <?php $args = array(           'post_status' => 'publish',           'meta_key' => 'post_views_count',           'orderby' => 'meta_value_num',           'order' => 'ASC'         );         $the_query = new WP_Query($args); //http://codex.wordpress.org/Class_Reference/WP_Query          //the loop     while ( $the_query->have_posts() ) : $the_query->the_post();          //do your magic     endwhile;      But I don't understand how I can translate the code above into code that will fit my current function. I'm using this to get post views:               function getPostViews($postID){         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');             return "0 View";         }         return $count.' Views';     }     function setPostViews($postID) {         $count_key = 'post_views_count';         $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');         }else{             $count++;             update_post_meta($postID, $count_key, $count);         }     }      I hope this makes sense, and thanks in advance.


title: Make WordPress process admin group comments using $allowedtags

text: WP uses `$allowedtags` to limit the set of allowable tags for comments.However, comments from administrators are unfiltered. What's the easiest way to ensure admin comments are also constrained to the tags contained in `$allowedtags`?


title: How can run the multiple website sites or domains into single wordpress intallation

text: I want to run multiple sites into wordpress 3.8.1, when the user access my website the url and language of my website is auto change to its country by it's ip address of user and website will also be translates into it's local language. if someone has the willingness to solve this issue.please resolve the issue. thanks in advance.


title: How to add the sidebar in all category page

text: I created custom post type. I created category called product-categories. I listed all categories in sidebar.php. How to show the sidebar in all the category pages listing all the categories. Sidebar.php code is, 'name', 'order' => 'ASC', 'hide_empty' => 0, 'use_desc_for_title' => 1, 'child_of' => 21, 'hierarchical' => 1, 'number' => null, 'echo' => 1, 'taxonomy' => 'product-categories', 'walker' => null, 'title_li' =>'' ); ?> I want to display this code visible in all the category pages. Please guide me


title: wp_nav_menu() customized

text:
Menu

sub-menu

sub-menu

sub-menu

Menu

sub-menu

sub-menu

sub-menu

      I'm trying to make a menu with wp_nav_menu() and I want to achieve a clean code like this. I'm trying to do it with a custom walker but I don't have experience with this. I think I have to overwrite a class but ... Coud you help me with the code?? Thanks for all


title: TInyMCE object Tag stripped

text: I need to add the following object tag to a page               <object id="myExperience" class="BrightcoveExperience">      <param name="bgcolor" value="#FFFFFF" />      <param name="width" value="648" />      <param name="height" value="630" />      <param name="playerID" value="801136430001" />      <param name="playerKey" value="**********" /><param name="isVid" value="true"/>      <param name="isUI" value="true" /><param name="dynamicStreaming" value="true" />     </object>      However Wordpress is stripping the object tag and everything inside and replacing it with non-breaking spaces. The editor I'm using in TinyMCE Advanced on WP .3.2.1, I tried installed TinyMCE config and adding the following to the extended_valid_elements               object[class|id|width|height|codebase|*],param[name|value|_value]      But it's had no effect, can anyone point me in the right direction?


title: Localize Plugin Description

text: Currently i'm working on a simple WordPress Plugin. I know within the Plugin i need to write my strings as `__()` or `_e()` and call `load_plugin_textdomain()` but i wonder how to localize the Plugin Description. Example:   ![example](http://i.stack.imgur.com/jleHL.png) _This is not the Plugin i'm working on. It's just an example to show what i mean._


title: Uploading avatar from the frontend

text: in the codepad link you can find what I am using to edit profile from the front-end. http://codepad.org/QJjDEA7p The code is working (which I got from How to edit a user profile on the front end? and change some things for me to work correctly). I have installed Simple Local Avatar plugin to allow avatar uploading, but how can I modify the code to have it also from the front-end ? I found these below, which I tested, showed the upload button, did not showed the current avatar and didn't let me to change it. Thank you for your help on this.               do_action('show_user_profile');     do_action('edit_user_profile');          do_action('personal_options_update');     do_action('edit_user_profile_update');      UPDATE There goes a 50 bounty for a working example. Unfortunately I can not get Bainternet's example to work that I tested with User Avatar plugin also, and I am really stuck with this issue can't finding the solution.


title: determine if specific page is in list?

text: It's not hard i think, but i run out of ideas... In template file I have code like this;               $current = $post->ID;     $parent = $post->post_parent;     $pages = get_pages('child_of='.$parent.'&parent='.$parent.'&sort_column=post_title&title_li&hierarchical=0');     $front_id = get_option('page_on_front');      I cant figure out how will statement to determine if `$front_id` is in `$pages` array look like ! thx for Your time!


title: Bulk Move Users from one site to another within a network ( Multisite )

text: I have a multisite install with 2 sites. I am working on site A, and I have a lot fo users on site B. I can individually move users from B to A, but there is a nontrivial number of users, and this could take days of repetitive work to do. How would I move assign all of the users at once to site A from site B?


what is the maximum number of post a wordpress loop can work with? how many post can i display with `'posts_per_page' => -1`? ive got 50,000+ pages and I want to sort through them, but I just get a blank page whenever I try and do anything to more than 10,000 pages (`'posts_per_page' => 10000`).


title: Admin WP List Table Columns Missing

text: The wordpress admin tables used on pages like www.example.com/wp- admin/edit.php uses a class class-wp-list-table.php In this class there are two functions that hide specific table columns with `{display: none;}` that can be seen at the following links: wordPress/wp-admin/includes/class-wp-list-table.php wordPress/wp-admin/includes/class-wp-list-table.php Recently, I had been trying to improve the wordpress tables, working on a plugin addming fixed table headers and live filtering. I was using Jquery FilterTable which works awesome, along with a sticky header script. Most sticky table header scripts clone the existing header when it reaches the top of the screen and fix it, while hiding the old one with css display:none or visibility:hidden. Everything can be seen here Jquery Filter Table uses display: none as well to do it's live filtering by hiding the results not found in the users search. For some reason these styles interfere with the class-wp-list-table when updating pages/posts. It causes display: none to become permanent. I thought it was a caching issue at first, however I disabled all my plugins and cleared my cache. I even went as far as reinstalling wordpress. I did first notice this after installing codepress-admin-columns but have deleted the plugin and it hasn't fixed anything. `display : none;` was embedded inline on several of the table headers and their relating columns It seems like wordpress stores the values of all the table columns html, not just the values. I know that it caches the tables for pagination, but I'm not really sure how this all occurs. I'm wondering why this happened, but more importantly how can I fix the tables as it seems like they're stored/cached somewhere in the database? I've deactivated every plugin, Reset to the twenty-fourteen, ran the allow_repair script, and cleared all orphans/transients. I've cleared my server cache as well as my computers browser cache. Image showing missing columns: ![Image showing missing columns](http://i.stack.imgur.com/wrYin.png) ![Image showing display:none added to title](http://i.stack.imgur.com/SsyN1.png) ![Display none also added to td columns](http://i.stack.imgur.com/V2Kpi.png) ![enter image description here](http://i.stack.imgur.com/Zvnxy.png)


title: How to hide post metadata from homepage and show only in post page?

text:
could anyone please tell me how to hide post metadata from home page? I would like to have them displayed only in post page. This is my website http://studyor.comuf.com and the theme was made with artisteer Thanks! ## Edit Code copied/pasted from below:                   <?php get_header(); ?>

             <?php get_sidebar('top'); ?>             <?php                  if(have_posts()) {                          /* Display navigation to next/previous pages when applicable */                     if ( theme_get_option('theme_' . (theme_is_home() ? 'home_' : '') . 'top_posts_navigation' ) ) {                         theme_page_navigation();                     }                          /* Start the Loop */                      while (have_posts()) {                         the_post();                         get_template_part('content', get_post_format());                     }                          /* Display navigation to next/previous pages when applicable */                     if (theme_get_option('theme_bottom_posts_navigation')) {                          theme_page_navigation();                     }                      } else {                           theme_404_content();                      }              ?>             <?php get_sidebar('bottom'); ?>

               <?php get_sidebar('default'); ?>

               <?php get_sidebar('secondary'); ?>


title: Retrieve Product category 'NAME' by product category ID - WooCommerce?

text: Can I retrieve woocommerce product category name by ID? Not thumbnail, not the URL, not the Sub-categories, just raw Category name.


title: Extracting Address from Custom Post via Javascript for Google Maps API

text: I am created a theme with custom posts which outputs to a Google Map with place markers. Users will create a custom post users and include street addresses which will be geocoded using Google's Map API v3 and a marker is placed on a Google Map. I am relatively new to coding and designing custom Wordpress themes, so I am trying to wrap my head around how to grab information from each custom post in javascript for the Google Maps API. Can someone please explain how this is done? Thanks, AME


title: cubepoints/buddypress show new rank on activity?

text: i wanted to display on each user's profile activity stream the rank they have unlocked and which will be shown in the activity streams for example on the activity   * user1 has unlocked level 2   * user4 has unlocked level 4   * user1 has changed there avatar ![img](http://i.stack.imgur.com/bBX00.jpg)


title: How to create a cumulative posts and members count

text: I need to show my users cumulative posts and members registered count by date. It has to be displayed in an array format like this **for posts**               array(array(2011,08,02), 500)     array(array(2011,08,03), 520)     array(array(2011,08,04), 540)     array(array(2011,08,05), 560)     array(array(2011,08,06), 580)      the same case for members iam using wordpress.com stats to for statistics, i cant figure out how to do this, could anyone help me...


title: Is it possible to use wordpress.com with a custom domain without switching nameservers?

text: I want to move my blog to wordpress.com but I do run my own nameservers and I need to do it. Is it possible to use wordpress.com pointing the IPs of the hostname to it but not switching the nameservers?


title: How to make that all posts with a category belong also to another

text: I'd like to make that all my posts in the category A belong also to category B (so after that they would belong both to A and B), is there any plugin or MySQL query that could allow me to do that easily?


title: How do I transfer my own domain name to Wordpress

text: I have had a Google blogger blog for several years and I have a domain name purchased through Go Daddy. The blog itself is hosted by Google, free. So my domain name is www.Wordchipper.com It's probably a re-direct from Go Daddy so that when a user types in the above address, it gets them to me without the "blogspot.com" What I want to know is if I switch to Wordpresses's free blog service, can I use my Go Daddy registered www.Wordchipper.com or do I have to pay Wordpress for that? I don't have to pay Google now. This is a stumbling block on moving to Wordpress. Need a clear answer to this..thank you...Larry


title: Is there a WordPress form plugin that can easily be configured for Google Analytics goals?

text: I don't want to have to make use of a destination url, so ideally I would like to be able to add the onclick="_gaq.push(['_trackPageview', '/G1/whatever']);" event to the submit button on the form.


title: Calling a plugin from a page template in TwentyEleven

text: I'm desperately trying to call a pretty simple-looking plugin (this one: http://wordpress.org/extend/plugins/wp-random-posts/ ) from a TwentyEleven page template. The goal being to get the thing to display not in the sidebar, but in the middle of a single page. Thing is, I just don't have the skills... can anybody help? I imagine this is an easy one... hopefully. Thanks, Brin


title: Add nav menu CSS class to body

text: I would like to add the CSS class of the current menu item (and the classes of its parents & ancestors) to the current page body classes. For example, if the current menu item has a CSS class "products" (as defined in Appearance | Menus), then the body for the corresponding page should also have the class "products". If that makes sense to anyone, any ideas how to do it? I've looked at "How to add current, parent, and ancestor menu item IDs to body_class()?" but can't get those ideas to work in my case.


title: Trying to override/intercept a PhotoMosaic gallery link in Wordpress using jQuery

text: The page in question is located at http://www.sandbarmedia.com/clients/va/gallery/. Basically, I'm trying to use jQuery to intercept a click on one of the photos in the mosaic so that it jumps to the corresponding picture in the gallery below. The bottom gallery will be hidden once all of this works, and the end effect should be that clicking on a mosaic photo jumps the user into the appropriate place in the lightbox photostream. I currently have some code that works with a text link (the "test" link below the mosaic), but when I try to apply the code to one of the mosaic photos, it doesn't work. I've inserted this little bit below the rest of the content in the page:               <script type="text/javascript">     $("a[href$='1GBanquette2.jpg']").click(function() {         $("a[title='2GDiningRoomPlaceSetting']").trigger('click');         return false;     });     </script>      The intent was to capture clicks on links that contain the filename of the first image in the mosaic and to activate a click on an image in the gallery. I assume that the shortcode is loading after the jQuery somehow, but I'm not sure if that's the problem, and if it is how I'd fix it. I'd really like to be able to keep this code inside of the Wordpress page editor so that it would be user-updateable without having to dig around in a file structure, but I understand if that's not possible. Thanks in advance!


title: Variable Product Price - Change Display Location

text: I've built a custom theme for a Woocommerce shop and changed the custom product price front its default location to another. This works well with single products, or variable products with the same price between variations. However, when viewing a variable price product, I get two price tags displayed, istead of just updating the existing one. Example ![enter image description here](http://i.stack.imgur.com/1uHc3.png) I've tried a jquery approach to update the upper field and hide the other, but it just doens't feel to be the right approach. Can anyone point me in the right direction?


title: header specific meta box result detect url

text:
I've got 3 header.php files and 1 detects whether their either on page 1 or page 2. I have a custom meta box thats outputting the results onto each header - that all works fine. However when I go a page deeper the meta box information isn't showing, I've tried various if statements but nothing shows up. Any help would be great. my header output looks like:               <?php     global $post;     $header_meta = get_post_meta($post->ID, 'page-header-meta', true);     if( isset( $header_meta ) ) {     echo '
' . $header_meta . '
';     }     else {         echo '
Knowledgebase
';     }          ?>


title: save_post hook not triggered in WP v3.6.1

text: I developed a plugin having a custom metabox that is using the `save_post` hook to store data. The plugin is 18 months old and is used by thousands of customers, so I'm pretty sure everything is good. Since I updated my testing platform to v3.6.1, I can't get that hook to run on previously created pages/posts. It only works on new ones. (I am the only WP user in the website. WP DEBUG is enabled) Has anyone experienced the same? Any clue? I missed some changes? **EDIT:** The code I'm using now to check the hook is this (I've deleted the inner code for privacy reasons):               function saving_metabox($post_id) {         die('test');              if(isset($_POST['plugin_noncename'])) {                    ... ...         }              return $post_id;     }     add_action('save_post', 'saving_metabox');


title: Is there a way to get the site_url in HTML code?

text: I have a WordPress website and it sends some transactional emails to the users. I create the template using HTML and I've been wondering if there's a way to add the `<?php echo site_url() ?>` in there so I don't have to change it manually every time I create a new website. I have already tried using the `<?php echo site_url() ?>` in there, but it won't work. Here's a sample of the code I am using               Deals	      Is there any way to achieve this? Thank you in advance for the help, Kat


title: Setting a taxonomy consisting of sites' name

text: Hi I am running a multisite and I would like to set the taxonomy as sites' name. so the category will have options of Group A, Group B etc. The problem I have now is that I do not know how to get a name for the site! Can anyone please tell me the way to achieve this?


title: Exclude a category from the filed under list

text: I have a site where I have a category that I'm using for some backend functionality. However, when I'm viewing a post that is in that category and other categories, I don't want to see that category in the list of categories that the post is "filed under" or "posted in" or whatever it's called. **To make it clearer** \- I have a category X that I'm using to do stuff for the theme. The post is categorized in A, B and X. On the post page, it says "Filed Under: A, B, X". I would like it to say "Filed Under: A, B" I was looking for a way to exclude that category id from the `get_terms` call, but I'm not sure how to go about it. Is that even the right way? I originally thought this was a `post_meta` issue, but it seems it's `get_terms` related. Can I add a filter on `get_terms` to always exclude a category? If it matters, I'm using the genesis framework, and this call happens in the `do_action('genesis_after_post_content')` call. But again, if I can add this as a global filter in my functions.php that'd be the best solution. I have tried the method mentioned in this post, but it did not work.


title: Exclude page by title for non admins

text: I have this snippet built from a couple of sources, it works great and if the user is not an admin it hides the page with an id of 243 from being seen in the edit pages section....               add_action( 'pre_get_posts' ,'exclude_pages' );     function exclude_pages( $query ) {         if( !is_admin() )             return $query;              global $pagenow;         if( 'edit.php' == $pagenow && ( get_query_var('post_type') && 'page' ==     get_query_var('post_type') ) )             $query->set( 'post__not_in', array(243) );         return $query;     }      I would really like to modify this so that it can work with page title instead of id, can anyone point me in the right direction?


title: wp_enqueue_scripts hangs

text: In the following snippet, when I add the `wp_enqueue_scripts call`, the page freezes. What am I doing wrong?               function my_enqueue_stuff() {       if ( is_front_page() ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/homepage.css', array(), null, 'all');       } else if ( is_page( 'corsi' ) ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/corsi.css', array(), null, 'all');       } else if ( is_page( 'dove-siamo' ) ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/dove-siamo.css', array(), null, 'all');         wp_enqueue_scripts('js', get_template_directory_uri() . '/lib/map/gmap.js')       } else if ( is_page( 'contatti' ) ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/contatti.css', array(), null, 'all');       } else if ( is_page( 'insegnanti' ) ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/insegnanti.css', array(), null, 'all');       } else if ( strpos($_SERVER['REQUEST_URI'], 'galleria') ) {         wp_enqueue_style('style', get_template_directory_uri() . '/css/galleria.css', array(), null, 'all');       } else {         /** do nothing */       }     }     add_action( 'wp_enqueue_scripts', 'my_enqueue_stuff' );


title: Troubleshoot "You do not have sufficient permissions to access this page."

text: I recently changed the database table prefix from wp_ to something else, for security reasons. Since then, I am unable to reach /wp-admin, instead receiving > You do not have sufficient permissions to access this page. I read this question, and I renamed `wp_user_roles` to `myprefix_user_roles`. This did not resolve the problem, even after clearing my browser cache and cookies. How do I resolve this?


title: Diagnosing a connection reset problem

text: A couple of weeks ago I purchased a theme from ThemeFuse and installed it in a new WordPress installation. From there, I've been having random errors when accessing or browsing the site. Some requests take too long and other just gives me "connection reset" error. I've been trying to get support from ThemeFuse and GoDaddy (since I don't really know where the problem lies), and both of them have answered me with not being able to replicate the error and to document it. Here's the url of the site: http://www.martinycarolina.com/wordpress/ How can I diagnose this error to know where is it coming from, and how can I fix it? My setup is as follow:   GoDaddy windows hosting plan   WordPress 3.5.1.   ThemeFuse Just Married Theme http://themefuse.com/wp-themes-shop/wedding- wordpress-theme/


title: Display all page numbers at the same time

text: WordPress only shows a few page numbers at a time and I have to keep clicking on the "right" arrow to advance one page at a time. I have 31 product pages, each with many products so it takes "forever" to advance through the pages to finally get where I need to do some editing work. Is there any way to show all of the page numbers at the same time so I can just click on the page I need?


title: Set Custom Date for Posts

text: I have a blog im working on in draft form. These blog posts are relevant to various days in the past few weeks but I would like to keep them hidden for the moment. When I publish one it gets todays date, is there a way to choose what date it has?


title: Is it possible to make Wordpress as a RESTful app?

text: I'm planning to create a Wordpress plugin that accepts data via cURL and sends a JSON reply. The plugin will save the data in the database upon receive so there has to be some authentication and will send JSON data back as a confirmation if data is successfully saved. Is it possible?


title: Woocommerce category description as subtitle

text: I'd love to place the category description just after the main title in a span, like a subtitle.               add_filter ('woocommerce_page_title', function ($title) {         // what should be here?              $title .= "{$description}";         return $title;     });      Thanks.


title: Adding data to options table

text: I am currently tweaking a plugin so that all "contributors" (here referred to as "players") are automatically subscribed to a forum. I basically want to subscribe everyone with the role of contributor and above (I've used user_level because the rest of the plugin does and I thought I should be consistent.)               function forum_subscribe_member_player()     {         $players= get_users();              foreach($players as $player){                  $playeremail = get_userdata($player->ID, 'user_email');             if(!empty($playeremail) && $player->user_level >= 1)             {                                    $list = get_option("mf_forum_subscribers_1", array());                           if( is_player_subscribed($player->ID)) //remove user if already exists (user clicked unsubscribe)                 {                     $key = array_search($playeremail, $list);                     unset($list[$key]);                 }                 else                     $list[] = $playeremail;                 update_option("mf_forum_subscribers_1", $list);             }         }            }      Its not working and I'm guessing there is a problem with `$player->is_player_subscribed()` which is here :                function is_player_subscribed($user_ID)     {           if($user_ID)           {             $useremail = get_userdata($user_ID, 'user_email');             $list = get_option("mf_forum_subscribers_1", array());             if(in_array($useremail, $list)){               return true;             }             return false;           }     }      Which uses the `global $user_ID` rather than `get_users()` I would love some help with this or even to be pointed in the right direction. EDIT: based on comment by @murdaugh


title: How to make a copy of a local wordpress build in MAMP?

text: I've been working on my site locally using MAMP and installing the wordpress folder in htdocs. However i wanted to make a copy of the site so that i can test another solution. I can't do a git init in my htdocs folder so i copied my build from my htdocs folder to my desktop and initiated git and all works well. However when i access the copy of my wordpress build (which is in another directory) and i start to click around the links don't respond to the new build but rather the original which is in my htdocs folder. This gives me the impression that:   * a) only the homepage is recognizing the new copy but my internal links, even though they are nothing more than /category/place..etc is generic,don't specify the domain.   * b) If i make changes to the new copy it will in fact be changing my original.   * c) on my next project i should start with a git repo and NOT work within the htdocs folder


title: Create Multiple File Upload Metabox in Wordpress

text:
I am trying to create a metabox to upload multiple files (can be images or files). Currently I have the upload field and its working file till the time we press upload and saving the data. The only problem is displaying the files. Below is my code, I am using to display the metabox:               case 'file_list':                         echo '<input class="cmb_upload_file" type="text" size="36" name="', $field['id'], '" value="" />';                         echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';                         echo '
', $field['desc'], '
';                             $args = array(                                     'post_type' => 'attachment',                                     'numberposts' => null,                                     'post_status' => null,                                     'post_parent' => $post->ID                                 );                                 $attachments = get_posts($args);                                 if ($attachments) {                                     echo '
';                                     foreach ($attachments as $attachment) {                                         echo '
'.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');                                         echo '';                                         echo apply_filters('the_title', ' '.$attachment->post_title);                                         echo '
';                                     }                                     echo '
';                                 }                             break;      1) Currently its displaying me all the files attached to post & I need to display only the files uploaded using this metabox. 2) Need a small thumbnail preview of the file. Regards.


title: Load code for custom fields only on admin pages?

text: Is this possible? I have big chunk of code for creating and saving custom meta fields, and I have a feeling that this has some impact on wordpress loading time ( **?** ). I tried with               add_action('init', 'admin_only');          function admin_only() {         if ( is_admin() ){             require_once('functions_admin.php');         }     }      but on **"add new post"** screen custom fields are missing.


title: How to create an Underconstruction message and Setting for a Wordpress website without using plugin

text: I am building up a website for C Programming Tutorial www.programminginc.net . Now I am using a plugin to show my site under construction. What is the code used to create a website under construction setup?


title: enqueue script if page is not equal to

text: I'm registering some js scripts in my function.php, I have 2 versions of one js file, one FOR the homepage, and one for every other page.   I've managed to get this to work to register the homepage script successfully:               function home_script_method() {         wp_register_script( 'homescript', '/wp-content/themes/template/js/menu-home-open.js' );         if( !is_page( 'home' ) ) // If it's not the given page, stop here         return;              wp_enqueue_script( 'homescript' );     }          add_action( 'wp_enqueue_scripts', 'home_script_method' );      But is it at all possible to register an alternative script for every other page, i.e. if on the homepage then register `menu-home-open.js`, if on any other page then register `menu-open.js`. Is that at all possible? Can't seem to get it to work, any suggestions would be greatly appreciated!


title: failed to load wp-admin/admin-ajax.php

text: I'm getting this strange issue. Everything was working fine last day. Now suddenly none of my ajax requests work. The problem is (i found that in firebug console): > failed to load resource : ....../wp-admin/admin-ajax.php So somehow the request to the `admin-ajax.php` file isn't successful. I have cross checked these things:   1. the url to `admin-ajax.php` is correct and no issues there   2. its not just 'my own scripts' which doesn't work, i've buddypress installed and all ajax requests from buddypress also give the same error   3. i directly typed in the url of `admin-ajax.php` into browser and instead of getting 0 (the expected output), google chrome says 'no data received'. Is it some configuration on server end?? If yes then what do i say to the hosting support guys? BTW, if it matters, the site is hosted on wpengine.. Any help is really appreciated **UPDATE :** the browser dev tools screenshot : ![enter image description here](http://i.stack.imgur.com/SQgEV.png)


title: Post Loop Category first show parent then child

text: Iam using this wp function to show category in my post I have certain post where i put the same post in two categories It is showing alphabetically, I want to show first parent then child category. EDIT:               <?php the_category(', ') ?>


title: How to update theme from localhost to online site

text: I am currently working on a project, actually we have an online site, we are thinking of revamping this. On this online site we have many blogs already. We have purchased a theme also and doing many customization on `localhost`. How is this possible to update the theme with customization and pages on `online server` from `localhost` without affecting the blog posts?


title: How to reduce Header at the top of the page

text: Using a new theme and wondered how I go about reducing the black space above the header as currently it is too deep. The site in question is here http://www.marqueehireauckland.net.nz/ The theme is twenty eleven Cheers


title: Printing out Category and all Category Children on category.php

text: A new site i'm making is going to use extensive use of the categories, so here's what i'm trying to accomplish: Main Category Name (Link) List of Sub Categories (All Links) When i'm on a sub-category page I want it to look like the Main Category page just with the sub-categories highlited. Is that possible?


title: Valid HTML in Template Part

text:
in a custom plugin I have a WPQuery, which looks like the following:               $sticky = get_option( 'sticky_posts' );         $args = array(             'post_type' => 'mission',             'ignore_sticky_posts' => 1,             'orderby' => 'date',             'post__not_in' => $sticky,             'posts_per_page' => $count         );              $latest_missions = new WP_Query( $args );         if ( $latest_missions->have_posts() ) {             while ( $latest_missions->have_posts() ) {                 $latest_missions->the_post();                 get_template_part( 'content-list', get_post_format() );             }                  wp_reset_postdata();         }      and the corresponding template part:               <li  id="post-<?php the_ID(); ?> " class="future-event"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
      The only problem I have is, that this will no produce semantic correct HTML, because the list is not sematically correct. Is there a way, how I can create an `<ul></ul>` which is wrapped around the list, when my loop is finished? BR, mybecks


title: Show HTML form before WordPress plugin deletion

text: I want to show interface to admin on plugin deletion, having choices (radio buttons) with a question - "Please let us know why are you deleting the plugin?" I know about `register_uninstall_hook` but I cannot use HTML code in it.


title: Custom Log In Screen - Disable password recovery

text: > **Possible Duplicate:**   >  Change login error messages I'm creating a custom log in page on a wordpress install and would like to remove the "Lost your password?" link from the "ERROR: Invalid username. Lost your password?" message that comes up if the user inserts the wrong password. I've been looking in the wp-login.php but must be missing something, can someone point me to the right file?


title: Search Everything plugin integration

text: The search on my wordpress site is resulting in a 404. When I hit the search button it tries to open a php file in a path that does not exist wordpress/wordpress/index.php. I dont know how that was configured or where to reset the search button action code. I assumed that installing "search everything plugin" will solve my search problems, it did. The test does a wonderful search. But I need to figure out how to fix the search button issue. I have just started work on wordpress and dont know php. Edit : I just did a "view source" for my home page and found               <form id="searchform" class="searchform" method="get" action="http://localhost/wordpress/wordpress/index.php">      I also did a               sudo grep -r "searchForm" .      To find the source of all my pain,               ./wp-content/themes/graphene/searchform.php:<form id="searchform" class="searchform" method="get" action="<?php echo get_home_url(), $_SERVER['PHP_SELF']; ?>">      Seems like the url is getting its value from PHP-SELF So I search where PHP-SELF is getting its value from               sudo grep --exclude-dir=.svn -r "SERVER\['PHP_SELF'\] = " .     ./wp-includes/load.php:     $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );     ./wp-login.php:     $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] );      Now, seems like REQUEST_URI is used to initialize PHP_SELF OR Its PATH_INFO and PHP_SELF As I dig further it gets more complex. My question is, **What is expected to be the value of PHP_SELF.**               sudo grep --exclude-dir=.svn -r "SERVER\['REQUEST_URI'\] = " .     ./wp-includes/load.php:         $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];     ./wp-includes/load.php:         $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];     ./wp-includes/load.php:                 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];     ./wp-includes/load.php:                 $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];     ./wp-admin/link-manager.php:    $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('deleted'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']);     ./wp-admin/upload.php:  $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);     ./wp-admin/plugins.php:$_SERVER['REQUEST_URI'] = remove_query_arg(array('error', 'deleted', 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', '_error_nonce'), $_SERVER['REQUEST_URI']);     ./wp-admin/edit-tags.php:<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);     ./wp-admin/network/themes.php:$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );     ./wp-admin/network/site-users.php:$_SERVER['REQUEST_URI'] = remove_query_arg( 'update', $_SERVER['REQUEST_URI'] );     ./wp-admin/network/site-themes.php:$_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] );     ./wp-admin/includes/class-wp-plugins-list-table.php:            $_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']) );     ./wp-admin/edit.php:$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );     ./wp-content/plugins/w3-total-cache/lib/W3/PgCacheFlush.php:        $_SERVER['REQUEST_URI'] = $url;     ./wp-content/plugins/w3-total-cache/lib/W3/PgCacheFlush.php:        $_SERVER['REQUEST_URI'] = $request_uri;


title: Hide Product detail page from non login user woocommerse

text: I have a situation in which all product are listed on a page. What I need is when someone click on product and if user is not login it should redirect on login page and if user is login it should take to product detail page.


title: Creating a function that sanitizes the custom metabox excerpt

text: I'm still getting to grips with functions and experimenting with different php functions. I've created a function what I want to use in sync with my custom metabox excerpt. It will basically sanitize the data and make sure its 150 characters long and the first word starts with a capital letter. My code is very loose at the minute as I'm testing the functionality out, But am kind of lost as to how I should go about this, Sorry for any simple mistakes. the $test_excerpt was just to test it, but at the moment it outputs nothing. Code is below.               <?php          //Function that trims any access spaces either side of the excerpt incase it fails the validation run          $text_excerpt = "test";          function vs_trim_excerpt($text_excerpt) {         if(isset($text_excerpt)) {         trim($text_excerpt);         ucfirst($text_excerpt);         wordwrap($text_excerpt, 150);         return $test_excerpt();         }      }          vs_trim_excerpt();     ?>          add_action('init', 'vs_trim_excerpt');


title: Divide the list into two columns (get_posts)

text:
The function below lists posts based on custom field. The result is involved in a list `<li></li>`. What I would like to do is count how many list items there are, then divide it into two ul's. Is there any way to split the result into two columns? ![](http://i.stack.imgur.com/NGTaE.png)               function article_series() {     global $post;     $series = get_post_meta($post->ID, 'Series', true);     if($series) :         $args = array(             'numberposts' => -1,             'meta_key' => 'Series',             'meta_value' => $series,         );         $series_posts = get_posts($args);         if($series_posts) :             $class = preg_replace("/[^a-z0-9\\040\\.\\-\\_\\\\]/i", "", $series);             $class = strtolower(str_replace(array(' ', ' '), '-', $class));             echo '

' . __('Articles in this series') . '

';             foreach($series_posts as $serial) :                 if($serial->ID == $post->ID)                     echo '
' . $serial->post_title . '
';                 else                     echo '
ID) . '" title="' . str_replace('"', '"', $serial->post_title) . '">' . str_replace('"', '"', $serial->post_title) . '
';             endforeach;             echo '

';         endif;     endif;      Function created by justintadlock.com Thanks for any help.


title: Customizing a walker menu class

text: Hey Folks I trying to customize a walker class to add custom classes to navigation level. Essentially there will be 3 levels of navigation.               <ul  *custom class*>       <li  *custom class*>        <ul *custom class*>         <li> </li>        <li> </li>       <ul>      </li>      <li> </li>     <ul>       When a level 1 (or 2,3) LI has a ul following it, how do I add a custom class to that li and the following ul? and essentially this pattern would repeat for every other level. Thanks!


title: wp_enqueue_script does not work

text:
I am developing a child theme based on the roots theme. I created a **front- page.php** and added the following. I test that the page is loaded because I see the I am loaded text. However, the scripts are not loaded. What is wrong with my setup?               <?php     function dd_register_scripts() {         wp_register_script(             'something',             get_template_directory_uri() . '/assets/js/something.min.js', array('jquery'), null, false         );     }               function dd_enqueue_scripts() {          wp_enqueue_script('something');      }          add_action('init', 'dd_register_scripts');     add_action('wp_enqueue_scripts', 'dd_enqueue_scripts');     ?>
I am loaded


title: Adding search form to header in huemen theme along with header background image

text: I want to add a search form to heumen header along with the header image. there is one more problem that i want to redirect the user to another website when he searches that form. example he searches for shoes in the form and then this search query should be posted to another url and the user should be redirected to the search result page of the other website. Thank you


title: Randomize Posts. Skip the first post in ascending order

text: I'd like to randomize a set of posts (custom post type), but ignore the first post all together. Here's the code I thought would work:               $featured_content_query = new WP_Query( array(       'post_type'       => 'feature',       'offset'          => 1,       'posts_per_page'  => 10,       'order'           => 'ASC',       'orderby'         => 'rand'     ) );      Without the `orderby` the post I want skipped over is ignored, but as soon as I add the random order it adds it back into the mix. Does anyone know what I'm doing wrong? I feel like I'm missing something really obvious here. Thnx!


title: How can I configure WP multisite to use /blog/ as part of the path structures?

text: I'm migrating an existing group of sites to multisite using subdirectories and need to match the url paths exactly, and am running into conflicts with the /blog/ path that gets inserted by default on the root install, among other things. I've combed all of the multiple posts on this, but haven't found an answer to my specific problem, so here goes. I'm trying to achieve the following:   * example.com/blog (english language blog)   * example.com/fr/blog (french)   * example.com/ja/blog (japanese) etc. Multisite restricts you from using /blog/ as it is inserted into the root install paths by default, and same goes for using it in a subpath, ie. /fr/blog. Any ideas? I'm completely stumped. Thanks


title: wp_get_attachment_image_src

text: When I use `wp_get_attachment_image_src()`, the medium sized image is returned on 3 out of 6 of my images. The other 3, the full size image is returned. I've checked and the medium sized image exists for all of the images, even the ones where the full size image is only being returned. The only thing I can think of is that the images that will only return as full size, were very large when uploaded. Here's my code:               $photos = get_post_custom( $photo_id );     for ( $i = 0; $i <= 12; $i++ ) {         if ( isset( $photos[ 'photo'.$i ][0] ) ) {             $image_attributes = $alt = '';             $image_attributes = wp_get_attachment_image_src( $photos['photo'.$i][0],  'medium' );             $photo .= '';         }     }


title: How Does One Create a Global Variable Repository

text: This may have a simple answer but I would like to store all the variables I've declared ( or cached ) across my theme in a central file and serve then this file globally ( Similar to how `get_header()`, `get_footer()` and `get_sidebar()` works ). I've tried creating a file called `variables.php` and serving it via `get_template_part` but without success. For this particular project, it would be more convenient if the multitude of variables I've created across my theme were housed in a central location in lieu of being scattered throughout various theme files. Is there a idiomatic way of accomplishing this in WordPress?


title: Displaying query with results using a custom post AND custom tax search

text: I'm trying to display the search query and taxonomy in the header of my results page. Normally this would be easy with I'm using the plugin Advanced Custom Post Search to conduct the search. It would normally be easy with the_search_query(); right? But that returns blank when conducting searches via this plugin. I was hoping that there is some clever way of pulling the values I need out of the query. Can anyone help me with this? Thanks


title: WP_Tax_Query with post_tag not working

text: Using the pre_get_posts hook, I'm trying to allow users to narrow down their search by limiting it to posts with certain (multiple) tags applied. This is my hook and function:               add_filter('pre_get_posts', array($this, 'pre_get_posts'), 0);          function pre_get_posts( $query ) {     if ( !is_admin() && $query->is_search ) {         $query->set( 'post_type', array( 'post', 'resource', 'initiative') );         if (isset($_GET['tags'])) {             $tax_query = array(                 array(                 'taxonomy' => 'post_tag',                 'field' => 'slug',                 'terms' => $_GET['tags'],                 'operator' => 'AND',                 )             );             $tax_query = new WP_Tax_Query($tax_query);             $query->set('tax_query', $tax_query);         }     }     return $query;      } As you can see, I'm also expanding the search to include two custom post types. In the results of a search, the custom post types are added correctly and I can see them in the query that's generated, so I know that the hook and function are being called correctly. The post_tag part of the query is not added though. The WP_Query Object's `query_vars` element correctly (I think) contains the `tax_query`, but the WP_Query Object contains its own `tax_query` which is empty, and the SQL in the `request` also doesn't have it. Here's a (slightly stripped-down) var_dump of the WP_Query Object:               WP_Query Object (     [query_vars] => Array         (             [s] => ecosystem                  [post_type] => Array                 (                     [0] => post                     [1] => resource                     [2] => initiative                 )                  [tax_query] => WP_Tax_Query Object                 (                     [queries] => Array                         (                             [0] => Array                                 (                                     [taxonomy] => post_tag                                     [terms] => Array                                         (                                             [0] => culture-change                                             [1] => peace                                         )                                          [include_children] => 1                                     [field] => slug                                     [operator] => AND                                 )                              )                          [relation] => AND                 )             [search_terms_count] => 1             [search_terms] => Array                 (                     [0] => ecosystem                 )                  [search_orderby_title] => Array                 (                     [0] => jcgy_posts.post_title LIKE '%ecosystem%'                 )                  [order] => DESC         )          [tax_query] => WP_Tax_Query Object         (             [queries] => Array                 (                 )                  [relation] => AND         )          [query] => Array         (             [s] => ecosystem         )          [request] => SELECT SQL_CALC_FOUND_ROWS DISTINCT jcgy_posts.* FROM jcgy_posts  LEFT JOIN jcgy_postmeta as jcgy_postmeta on jcgy_posts.ID = jcgy_postmeta.post_id AND jcgy_postmeta.meta_key = '_EventStartDate' WHERE 1=1  AND (((jcgy_posts.post_title LIKE '%ecosystem%') OR (jcgy_posts.post_content LIKE '%ecosystem%')))  AND jcgy_posts.post_type IN ('post', 'resource', 'initiative') AND (jcgy_posts.post_status = 'publish' OR jcgy_posts.post_author = 1 AND jcgy_posts.post_status = 'private')  ORDER BY jcgy_posts.post_title LIKE '%ecosystem%' DESC, post_date DESC LIMIT 0, 10      All the research I've done tells me that I've structured my addition to the query correctly, yet clearly something isn't working. I am tearing my hair out. Any ideas?


title: User function to return multiple get_post_meta()

text: I am trying pass a WP function to a user function, where I can pass a new func argument `$key` for each `post_meta` type here: functions.php                 function my_post_meta($key){           $meta = get_post_meta($post->ID, $key, true);            if ($meta) {            echo $meta . '<br />';                     }          }      page-template.php Edit: These functions will be inside a `foreach()` of `get_posts()`.               my_post_meta("Author");     my_post_meta("Date") .'customise this meta key';     my_post_meta("Address") .'customise this meta key';


title: Solution to render Shortcodes in Admin Editor

text: I have asked this question about a year ago and I am hoping there is some type of simple solution which will allow me achieve my objective. So here it goes: I often utilize shortcodes within the Admin Editor but when I turn this over to client they often don't understand how they work. What I am looking for is a solution which would simply automatically render the associating output of shortcodes within the admin WYSIWYG editor. From a visual perspective, I would like for this to display similar to when the "more" line show up or when an image is displayed within the editor. By this I mean that the user would see the output but would only be able to delete it but not edit the content of the rendered shortcode.


title: wp_editor on front end - JavaScripts not included

text: I am working on a BuddyPress plug-in for a client that requires users to be able to add content from the front end - they never see the back end for security reasons. I have the plug-in written and it works perfectly but it is missing one thing: a rich text editor so that users can customize their content (within reason, of course). Until now, I have ignored this request from the client and explained it as not being possible without a lot more work. Today, however, I upgraded to 3.3 and noticed the new `wp_editor` tag. I tried some of the examples shown here, but I cannot get any of them to work properly (a bare-bones call produces the editor but the tabs and media buttons don't work, a basic TinyMCE setting array yields nothing [just a plain textarea].) Inspection with Chrome's Developer Tools reveals that some JavaScript files are being included in the admin area that are not included on the front end. What is the best way to include these files and make this thing work? Thanks!


title: How to Better Control WordPress Cron Jobs?

text: I have a bunch of standalone WordPress sites, and WordPress Multisite Network of Sites on my server. There are times where there are too many sites all running cron jobs too soon in proximity. I am looking to better control when cron jobs are triggered on each WordPress website. Is it possible to disable WordPress cron jobs from being triggered anywhere, and limit it exclusively to `./wp-cron.php`? If so, how? I would like to setup cron jobs via Linux to target each domain's `./wp- cron.php` file at the times I specify. In theory, this should alleviate most of the server bogging I've been experiencing. Is this an ideal solution to better control the cron jobs on each of my WordPress sites? Is there something I should be doing within WordPress itself, which could better control the cron jobs, so that I don't get too many sites all running their cron jobs at the same time? Trying to conserve server resources, cron jobs are the culprit here.


title: replacing the_autor or make callback

text: I'm looking a way tho change the `the_author();` function in the loop, I have post meta data with the name of the user who posted. I need to do this:   * If the user is registered, show `the_author();`, but if isn't show the data from the post meta. Since `the_author()`, function doesn't have a callback function I'm a little lost, maybe making a function? The idea is replace `the_author()` in my theme.


title: meta_compare not comparing whole integer

text: I have submitted an integer data via a form to my custom search page. I can get values properly if the input is single char (e.g. 1 ) but if the input is multi char (e.g. 100) it still compares against "1". IF the user input is **1** I get all the posts with custom field value **More than 1**. but If the input is **100** the result is same. _Why is this happening??_ Here is my code::               $i_rate = $_GET["interest_rate"];                          $bc_args = array(                              'post_type' => 'data',                         'data-category'=>'insurance-rate',                         'order' => 'DESC',                         'meta_key' => 'interest_rate',                         'meta_value' =>$i_rate,                         'meta_compare' => '>=',                         'orderby' => 'meta_value_num',                          );                           $sortedPosts = new WP_Query($bc_args);


title: Instantiate TinyMCE via JS ( rather than PHP/wp_editor )

text: Once a page has loaded, how do I create a TinyMCE editor? Putting a `wp_editor` call in an AJAX request then displaying it gives this: ![enter image description here](http://i.stack.imgur.com/stnbS.png) Visual and text tabs are nonfunctional, no toolbar, no active TinyMCE instance, just the html markup. I need to instantiate the JS component of TinyMCE, but how? I've also tried making a call in my AJAX response PHP to `_WP_Editors::editor_js();`, and I can see the response in the console using console.log and I see the JS script there, but it is not inserted into the DOM and it is never executed


title: help on wp_editor via ajax load

text: So I have been spending hours trying to figure out how to make the wp_editor() work on an ajax generated content. I bumped into this post: Load tinyMCE / wp_editor() via AJAX and tried the solution of Mike Allen. His solution almost solves my problem but then there is a problem with my Text tab, I don't see any button: **screencast.com/t/Emd2Da3UyThO** My Visual tab on the other hand works fine: **screencast.com/t/JGWf4ivZfaGb** Inspected my Text tab, I can see that quicktags aren't there: **screencast.com/t/qyvwWDnuEPnb** But by checking on my window's QTags instances: **screencast.com/t/UAzIaZ7XOc5** The description instance (which is not ajax generated content) has the **theButtons** attribute, while the tabdescription35 (ajax generated) doesn't have one.


title: Remove pages from backend list *and* update counter accordingly

text: I hidden some pages using `'parse_query'` hook, but the count for 'Published' pages didn't changed... Where I should hook to change it? ![Update the page status count in admin](http://i.stack.imgur.com/dM7GU.jpg) My code so far:               $query->query_vars['post__not_in'] = array(4);


title: Adding Multiple Values to a Post Meta Key

text: I have a question about adding multiple post meta values to a post meta key. Here is a link to the WordPress `add_post_meta();` function in question. The `$unique` parameter is a little on the fuzzy side of clarity for me. > Whether or not you want the key to be unique. When set to true, this will > ensure that there is not already a custom field attached to the post with > $meta_key as its key, and, if such a field already exists, the key will not > be added. If this is set to true, will I be able to add multiple values to a single post meta key? I am looking to create ONE unique post meta key per post. This key is set as a hidden key. (Prefixed with an underscore - Example: `$meta_key = '_task- name';`) Is it possible to add multiple post meta values to this single unique post meta key, in array format? So when I fetch this post meta key from the post using `get_post_meta($post_id, $meta_key);` one post might have 3 or 4 tasks names assigned to it. Would I be better off just using Taxonomies and Terms?


title: How do I add an admin notice within javascript in the admin interface for posts?

text:
I want to use javascript to add a notice to the top of the wordpress page just like they do when auto-saving the page. But in looking at the DOM, I don't see any special div that I could find to add my notice to: **THIS IS THE DIV WHERE WORDPRESS's NOTICES ARE**

Edit Page Add New

                 The backup of this post in your browser is different from the version below. Restore the backup.

                 Post restored successfully.     Undo.

      Is there a javascript function wordpress has that I can use?


title: Hide comments and posts posted by other user

text: I've created a user with role Contributor, when i logged in as Contributor all the posts and comments are listed in the dashboard. How to disable this? I just want to see the post made by me/specific_user. How to do this?


title: Is it wise not to use only meta capabilities for certain basic post types?

text: I've been a WP developer for a couple of years now but only recently has the concept of meta vs. primitive capabilities really "clicked" with me. I'm building some tools right now to allow easy creation of new custom post types. Sometimes the sites I build can get pretty extensive - I think my record is something like 11 custom post types on a single site. My question is this: For certain basic custom post types where there is no strong need for security between users (for instance, the site's users are all trusted, or there is only 1 user), is there any issue with just mapping the seven default capabilities to their corresponding meta cap?   (e.g. `'edit_others_posts' => 'edit_post'`) The idea is that I would have 3 possible permission configurations for a custom post type depending on what is needed:   1. A basic one, mapping each of the 7 capabilities to one of the the 3 meta caps   2. An intermediate one, with each of the 7 standard capabilities mapped to a corresponding one for the post type (like posts and pages)   3. An advanced one, where `map_meta_cap` is true on the post type, containing ~14 mapped capabilities The main problem I am trying to solve is extreme clutter when using the role editor. As you can imagine, when you have 11 custom post types each with 7 capabilities, it gets pretty full - and maybe four out of five times, it's either "all on" or "all off" for a CPT on a role-by-role basis. I don't quite want to move to a single capability for those, but this gets me most of the way there.


title: Shortcode returning specific content of a post

text: I'm currently building a plugin to display specific part of post after accepting verification code. Can a shortcode return a part of a post? I mean: Bla bla bla [shortcode postID="100"] Special bla bla [/shortcode] Bla bla How to code a function to retrieve specific content of a post only when the plugin calls this shortcode?


title: Adding html elements to wp nav menu

text:
I know how to create wp menus using the functions.php and diaplay it in my sote wherever the menu is required (e.g top menu, footer menu) I even know how to style it using custom CSS. I would like to know if it's possible to add HTML elements to a dynamic custom menu. for example: I want to build a menu when each **li** item will look like this:
number here
post title
     ///
name of the author

      is there a way or function to output such menu? basically add some extra html inside **li** item? also inside the:               number here      I would like to add a counter which will display a number for each posts (1-5) Any help will be appreciated Thanks


title: Close the media-upload thickbox right after upload is finished?

text: I'm working on a front-end uploader using WP's own media-uploading functions. All is well, except that I just want to simplify some UI things, like removing tabs and unnecessary information for my users. Most importantly, I'd like to magically close the Upload Thickbox once the uploads are done and the files are crunched. I'm aware of the `add_attachment` hook and I'm already using it to do some ImageMagick handling, but it fires every time a file is uploaded, so this is kind of too much. Seaching through core, I got to wp-includes/js/swfupload/handlers.dev.js and around line 232 there's this:               function uploadComplete(fileObj) {         // If no more uploads queued, enable the submit button         if ( swfu.getStats().files_queued == 0 ) {             jQuery('#cancel-upload').prop('disabled', true);             jQuery('#insert-gallery').prop('disabled', false);         }     }      This is precisely where I want to hook so that, instead of enabling the submit button, I'd just fire `TB_close()`. Can this be done in any way?


title: Post in Multiple Categories to stay in current category (permalink, next previous post link)

text: I guess this has been mentioned before, but after 2 days of browsing i haven't find a complete solution. Maybe someone has come across this problem before? I'm building a designer portfolio where posts are assigned to more than one categories. Permalinks are set in the form of: > portfolio.com/category-name/post-name/ Example:   * Post 1   * Assigned to Category A and Category B When you visit the Category A page, Post 1 is shown there. When you visit the Category B page, Post 1 is shown there too. The problem: When you click Post 1 in the Category A page. It takes you normally to the Post 1 page staying in Category A that is the lower ID category, so permalink is: > portfolio.com/category-a/post-1/ and next previous post links work inside Category A ok. When you click Post 1 in the Category B page, it takes you normally to the Post 1 page but not staying in Category B, the permalink is still at Category A > portfolio.com/category-a/post-1/ and next previous post links work inside Category A again. How can i resolve this so when you are in a category page and you click a post that is assigned to multiple categories, the post page will stay in the category from which it was clicked, the permalink will show that category name and the previous and next post links will work inside that category and not the default lower ID category that WordPress is using by default? I'm really looking forward for a nice solution! Strange that WordPress awesomeness has no option by default on this, since it supports multiple categories. Thanks!