Text editor has problem with having '<html>' in a post

I'm trying to create a post on a WP 3.8 blog using the text editor that includes a `<pre>` tag with some JavaScript inside it. This JavaScript code happens to have a comment line that contains the string `<html>`. For some reason when I save a draft of the post, WP is adding `</html>` to the end of the code block right before the `</pre>`, right in the text editor. I have the Crayon syntax highlighter installed, but it shouldn't come into play while I'm editing the post. It's almost like WP sees an open `<html>` tag and is proactively trying to close it. I also tried escaping the angle brackets but the preview of the post showed the actual `<` and `>`. I even tried putting the `<html>` string inside a `<code>` block inside the `<pre>`, but the extra `</html>` was still added. Any idea why this is happening?


Convert function for single to multisite adding wp_capabilities

The following works well on a single site installation. It will obviously fail on a multisite because the wp_blogid_capabilities are not being updated. How can I loop this so that the capabilities are added to wp_2_capabilities, wp_3_capabilities, etc .. all through to the last blog?                       $user = new WP_User( $user_id );                      $get_role = get_user_meta( $user_id );                   if ( empty( $get_role ) ) {                   global $wpdb;                   $capabilities = array ( $new_roles => true );                   $nickname = $XF->visitor->get('username');                   $description = do_shortcode($XF->visitor->get('about'));                        $meta_key_cap = $wpdb->prefix . $blog_id . 'capabilities';                       update_user_meta( $user_id, $meta_key_cap, $capabilities );                  update_user_meta( $user_id, 'nickname', $nickname );                  update_user_meta( $user_id, 'description', $description );                  update_user_meta( $user_id, 'user_email', $email );                  break;                  }      Should I use an incremental counter or is there a WordPress way to call each blog_id that would be easier?


Return the name of the post type

I have this in the archive.php file of my theme:               <?php else : ?>
<?php printf( __( get_post_type() ) ); ?>
     <?php endif; ?>      And it returns the slug for the post type. I'd like it to return the plural name of the post type instead. What should I use to replace get_post_type()?


woocommerce - products by category slug?

good morning, I need to display the shop base page in a category layout,meaning first show all the products from category A and beneath it all the products from category B and so on.. I trying to use the built-in woocommerce shortcode -"products by category slug" but instead it displays products by products slug,what is the solution? here is the shortcode [product_category category="" per_page="12" columns="4" orderby="date" order="desc"] thank you


Pull Custom /wp-admin/css for Non-Admin in Multisite

Here's a problem I'm sure many would like to find an answer to... In a multi-site install, sometimes I would like blog owners to have their dashboard display differently style-wise. These styles are largely controlled by the /wp-admin/css/ folder. The problem is that if we edit /wp-admin/css/, it impacts everybody - the MultiSite administrator included. Is there a way to pull a custom /wp-admin/css/ folder for all site users other than the site owner? Thus allowing the site owner to still see the traditional panel and everybody else with a site inside the network to see a custom designed one controlled by stylesheets in /wp-admin/css/.


Filter out some plugin action in wp head / wp_footer

I am using a plugin called "syntaxhighlighter". **I know not to ask for plugin specific questions** but rather how to filter out action added to the wp_head / wp_footer conditionally... **This is a part of the plugin script:**               // Outputting SyntaxHighlighter's JS and CSS     add_action( 'wp_head', array( $this, 'output_header_placeholder' ), 15 );     add_action( 'wp_footer', array( $this, 'maybe_output_scripts' ), 15 );      **Now, i would like to add a filter that says:**               if(is_home() || is_category()) {        // REMOVE THOSE SCRIPS     }      .   I dont want to change that plugin code becouse i would have   to remmember to do it again when it updates... How can i filter those actions out when needed?


Exclude featured image from attachment loop

For my jigoshop theme I'm able to retrieve the images attached to my product post. However it pulls all images from both the featured image and my metabox images. What I'm trying to do is make it so that it excludes the featured image, but it's not working. It also seems to be including other post featured images as well for some reason. I tried this suggestion with no luck. Here's what I have so far:                   global $_product, $post;          $thumb_id = get_post_thumbnail_id($post->ID);              $args = array(         'post_type' => 'attachment',         'post_mime_type' => 'image',         'numberposts' => -1,         'post_status' => null,         'post_parent' => $post->ID,         'orderby' => 'menu_order',         'exclude' => $thumb_id,         'order' => 'asc'         );              $attachments = get_posts($args);         if ($attachments) :             $loop = 0;                  foreach ( $attachments as $attachment ) :                      if ($thumb_id==$attachment->ID) continue;                      $loop++;                      $_post =  get_post( $attachment->ID );                 $url = wp_get_attachment_url($_post->ID);                 $post_title = esc_attr($_post->post_title);                 $image = wp_get_attachment_image_src($attachment->ID, 'full');                 $image = $image[0];                 $image_path =  thumbGen($image,500,0,"crop=1&halign=center&valign=center&return=1");                 $image_all = get_bloginfo('url').$image_path;                 $my_image = array_values(getimagesize($image_all));                 list($width, $height, $type, $attr) = $my_image;                                  if ( ! $image || $url == get_post_meta($post->ID, 'file_path', true) )                     continue;                      echo '';                  endforeach;              endif;      Any ideas?


My website's wp-admin redirects to another website's wp-admin after pointing the site url to a subdirectiory

*** DETAILS THAT LEAD UP TO MY PROBLEM *** I'm familiar with WP's Giving WordPress its own Directory in codex. I am experimenting on my personal website, erons-expressions.com with redirecting to different sub-directories. Originally I loaded WordPress files into its own /wordpress sub-directory and was successful with redirecting my site to it. I'm working on a redesign for a non-profit (wecareabilene.org) and will be using WP. They are a separate hosted account with their own wp-admin and I will need to use this method of redirecting for their site to different sub- directories through out the year. As their website is currently live, I was experimenting with my own personal website to make sure I could redirect to multiple sub-directories successfully. Since their site is already WP based, I placed all the non-profit's WP files into its own sub-directory (/CCC_Site) in my website's root folder. I copied and pasted that sub-directory's .htaccess and index.php pages into my root. I updated the index.php page with the update: require('./CCC_Site/wp-blog- header.php'); I changed my personal wp-admin site address to the /CCC_Site sub-directory. Now if you go to my site, you will see that my website url is showing the contents of what is on the CCC_Site sub-directory, which is exactly what I'd hoped for. *** MY PROBLEM *** When I try to go to my website's wp-admin by typing erons-expressions.com/wp- admin I am redirected to wecareabilene.org/wp-admin. Since I now apparently don't have access to my personal website's wp-admin, I can't change its site url setting to get back to my site's original files. Any ideas or thoughts or troubleshooting would be greatly appreciated.


Unable to send upload url

I have created an image uploader, when I click the submit button the media uploader pop-up box appears but the image path is not being sent to the input field. Display code:                   <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>     <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo stripslashes(get_settings( $value['id'])  ); } else { echo $value['std']; } ?>" />         My image uploader class:               array( "name" => "Logo URL",     "desc" => "Enter the link to your logo image",     "id" => $shortname."_logo",     "type" => "upload",     "std" => ""),


How to display value of custom fields in page

I have a custom post type called 'software', contained within are various custom fields such as subtitle, price, screenshots, download link, etc. I created a function to allow use of the tinyMCE edit window for some of these custom fields. I have been trying to display these fields on the page but with no success. The method I'm using is this:
<?php the_title();?>

<?php echo get_post_meta(get_the_ID(), 'subtitle', TRUE); ?>
      Here is a link to the page. Below the `<hr/>` on the page is a list of all the meta created. The ONLY one of the fields which will display is 'price' for some strange reason. Anyone have any idea what I'm missing?


Show child pages by menu order using Superfish Dropdown menu?

I'm using the superfish dropdown menu to create a drop down menu. It's created the menu fine showing all the parent pages with the child pages in drop down's below. The only problem I have is that the parent pages are by `menu_order` which is what I want but the child pages are not by `menu_order`. How can I make it show the child pages by `menu_order` so it mirrors the backend?


Unable to Find Space in Custom Function

As you can see in my next/previous link I have an extra space before the word "Previous" and I can't seem to find it. Any help is greatly appreciated: http://themeforward.com/demo2/?p=1813&page=2 Custom function:               // Custom Next/Previous Page     add_filter('wp_link_pages_args', 'wp_link_pages_args_prevnext_add');     /**      * Add prev and next links to a numbered link list      */     function wp_link_pages_args_prevnext_add($args)     {         global $page, $numpages, $more, $pagenow;              if (!$args['next_or_number'] == 'next_and_number')              return $args; # exit early              $args['next_or_number'] = 'number'; # keep numbering for the main part         if (!$more)             return $args; # exit early              if($page-1) # there is a previous page             $args['before'] .= _wp_link_page($page-1)                 . $args['link_before']. $args['previouspagelink'] . $args['link_after'] . ''             ;              if ($page<$numpages) # there is a next page             $args['after'] = _wp_link_page($page+1)                 . $args['link_before'] . $args['nextpagelink'] . $args['link_after'] . ''                 . $args['after']             ;              return $args;     }      Calling it:               <?php          wp_link_pages(array(         'before' => '
' . __(''),         'after' => '
',         'next_or_number' => 'next_and_number', # activate parameter overloading         'nextpagelink' => __('Next'),         'previouspagelink' => __('Previous'),         'pagelink' => '%',         'echo' => 1 )     );          ?>


How to show custom post template from single page?

We know that in WordPress the default post template file is `single.php`. Now, I have one category name "members" and want _members_ posts to show a custom template, like `content-members.php`. I can do that via custom post template plugins. but is there a way to make that without plugins? Maybe we can do that like this:               <?php         if ( is_category( 'members' ) ) {                   get_template_part( 'content', 'members' );              } else {                  get_template_part( 'content', 'common' );              }      ?>      I tried this already, but it's not working and I think category is not triggering here.


TinyMCE in ajax modal window

I'm trying to use TinyMCE editor in fancybox ajax loaded (lightbox like modal window). I have managed to load it but i can't type in it and Text tab there are no quicktags buttons.. It respond on every button in Visual tab and adds content in Text tab (HTML) but nothing in Visual, i also can't focus in Visual tab content so i can't type. I'm using this code to printout editor in ajax response:               ob_start();     wp_editor($content,'editor_content', array(         'textarea_name' => 'editor_content',         'textarea_rows' => '10',         'media_buttons' => false,         'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close')     ));     $editor_contents = ob_get_clean();     $return .= '
Content	'.$editor_contents.'
';      And this to reinitialize editor in .load() success function:               quicktags({id : 'editor_content'});     tinymce.init({         mode : "exact",         elements : "editor_content",         theme: "advanced",         skin : "wp_theme",         theme_advanced_buttons1 : 'bold, italic, underline,charmap'     });      What am I missing?


taxonomy_template filter do not loads custom taxonomy template properly

I'm using taxonomy_template filter in my **plugin** to load a template file for **custom user taxonomies**. This is the code I'm using                add_filter( 'taxonomy_template', 'get_custom_taxonomy_template' );      function get_custom_taxonomy_template($template) {             $taxonomy = get_query_var('taxonomy');             if (strpos($taxonomy,'rcm_user_') !== false) {           $taxonomy_template = UT_TEMPLATES_URL ."user-taxonomy-template.php";           $file_headers = @get_headers($taxonomy_template);           if( $file_headers[0] != 'HTTP/1.0 404 Not Found'){              return $taxonomy_template;           }        }        return $template;      }      It loads the file but I get fatal error for wordpress functions like               get_header(), _e()      I've tried using default theme, saving permalink structures.


Header image is overlapping sidebar?

I just changed my header from a background to an image, as that seemed to be the easiest way to link the entire header to my main page (after a whole lot of trial and error with other methods). The one problem is that the image is now overlapping my sidebar instead of the other way around. It's also overlapping some of my menu bar, but it's a part that I can live with or possibly fix myself. Here's my site with the header going over the sidebar. How do I get it back under the sidebar like it was before? And now that I think of it, is the whoe header being linked going to cause problems with the various links and buttons in the area where the sidebar overlaps it?


Wrap More Link in Div

I would like to put the "more" link in it's own div and am having some trouble... my current code looks like: `the_content("<div class='more'>More >></div>");` But the problem is that the output is not cross-browser compatible...Safari and Firefox render this fine, placing the `div` around the more link...but IE8 renders the `div` in the `a` tag of the link, making it look funny. Is there a function I can add to my theme that would allow me to wrap a `div` around the more link so I don't have to worry about how different browsers interpret my original code? Thanks,   Josh


Unwanted redirect in admin area

I have a strange behaviour on my backend. This is possible due to the way my WordPress is located. I installed it in a VirtualBox, using Ubuntu from the standard repository (i.e., apt-get install wordpress). It is located in `/var/www/` as per default. The virtual mashine is mapped to a subfolder of my institution's web page. Let's call it `www.institution.com/stuff/wordpress`. Most works fine, I can log in to the backend, create pages, etc. But, if I make changes in Settings/General and click on the "Save changes" button I get an "Error: NotFound". The changes are saved, but WordPress tries to send me to               www.institution.com/wp-admin/options-general.php?settings-updated=true      but this has to be               www.institution.com/stuff/wordpress/wp-admin/options-general.php?settings-updated=true      (`/stuff/wordpress` is missing) Both, the "WordPress Address URL" and "Site URL" are set to "www.institution.com/stuff/wordpress". But obviously, this is not enough. Has anybody an idea what wrong with my WordPress?


Arrange Combined List of Pages and Categories

I'm using the code below to display both top-level pages and categories in my menu. (If this is the incorrect way to do so, please let me know). I would like to arrange the items alphabetically. The problem being that if I add the argument to each set of parentheses, I end up with two separate lists arranged alphabetically - I would like to combine the items in each list and arrange alphabetically from there. I'm not sure where I go from here and would appreciate any help!               <?php wp_list_pages('title_li&depth=1'); wp_list_categories('title_li&depth=1'); ?>


Infinite scroll loads new posts several times

I've added infinite scroll support of the Jetpack plugin to my own theme with:               add_theme_support( 'infinite-scroll', array(         'container'  => 'content',         'footer' => false,         'render' => 'vividflow_infscroll_render',         'wrapper' => false,         'posts_per_page' => 12     ) );      The `vividflow_infscroll_render` just loads The Loop. However, I'm experiencing some trouble with the infinite scroll: new posts are loaded **multiple times** , so that I get **double posts** on the archive page. My archive page looks like this: ![enter image description here](http://i.stack.imgur.com/iVOSE.png) I think new posts are loaded several times because I have several posts on the bottom line: 3. When I place all the post summaries beneath each other, there is no problem. How can I resolve this issue?


Wordpress address URL and bloginfo

I have updated my Wordpress Address (URL) and Site Address (URL) to be https:// in the General Settings of Wordpress as I have added a secruity certificate to the hosting. Should the css url automatically update to reflect the new address if I'm using                       <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />       in the header code. The url is now https:// but the css url is still pointint to http://


how to move a widget from theme 1 to theme 2?

I bought two themes for two websites but now I can't buy the domain name and host for both and decided to run just one web I try my two theme 1-metro mag 2-Glider I decided to run Glider at least but by other hand metro mag has two really nice widget I want to move these two nice widget from metro mag theme into Glider theme but I really don't know how to do it ? Please help me by Explain me how to move widget from theme 1 and insert theme into theme 2 ? I'll be really thanksful if any body can help me and full Explain me which file must be Edit and which code must be copy from theme 1 and pase into which file and where in theme 2 ? Great thanks Best Regards : Raha


Ordering by meta_value AND date NOT WORKING with wp_query

I want to select posts and custom post type with a specific meta value (mb_home!=0), of last week and ORDER them by mb_home. If they have the same mb_home value, I want them to be ordered by date. Both order have to be DESC. I am using this query but it just does not work:               $query = new WP_Query( array(                 'post_type' => array ('post', 'aggregato'),                 'posts_per_page' => 13,                 'post__not_in' => $linked_posts,                 'meta_key' => 'mb_home',                 'orderby' => 'meta_value_num date',                 'order' => 'DESC',                 'meta_query' => array(                                     array(                                             'key' => 'mb_home',                                             'value' => '0',                                             'compare' => '>',                                         )                                 ),                 'date_query' => array(                                         'after' => '1 week ago',                                 )                 ));      If I drop `date` and use `'order by' => 'meta_value_num'` the query gives me back the results correctly ordered by mb_home DESC. But if they have the same mb_home value, they are ordered by date ASC. If I try to change the way I order stuff, using this syntax:               'orderby' => array( 'meta_value_num' => 'DESC', 'date' => 'DESC' ),      instead of the above orderby and order statements, it just falls back to date DESC ignoring completely the mb_home value. All these results are the same with `meta_value` instead of `meta_value_num`. Nothing changes. Please, give me some pointers, because I've been over this for almost a month, trying everything but not succeeding. Oh masters of wordpress! I invoke your help!!


Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts

I use WyPiekacz to set various conditions for authors when creating posts, for example checking if the post has a featured image or how many tags that are being used. It works fine. However, these conditions are checked every time the post is submitted for review, updated or published. I want WyPiekacz to only check the conditions **if the post is in Draft status**. How can I do that? The problem that I am experiencing currently is that for instance an editor changes the amount of tags and updates the pending post which then fails the tag rules set in WyPiekacz and thus the post gets changed back to draft status and the editor cannot access it again. Editors are only allowed to edit pending posts.


How to add a prefix to existing custom fields over MYSQL query?

I've got the problem that after a plugin update I can make the `custom fields` on our directory site searchable, but only `custom fields` which get the prefix `booking_` to them. Now there are some pages (up to thirty already) each with dozens of custom fields. I would like to make a custom field, that is called `testfield` to become `booking_testfield`... So, all custom fields should get the prefix but it shouldn't break the site. The theme framework I am working with will create new custom fields on entering a page, but those new fields get the prefix can be managed over the theme framework.


Default widgets assignment - isn't working

The question is regarding, calling the default widgets into the sidebar[s]: So, despite the solution given in **THIS THREAD** , I tried a different way - Ian Stewart's borrowed solution given **HERE**. It's like, declaring the following lines into `functions.php`, suppose I have two different sidebars in my theme:               // Preset Widgets     $preset_widgets = array (             'primary_widget_area'  => array( 'search', 'pages', 'categories', 'archives' ),             'secondary_widget_area'  => array( 'links', 'meta' )     );          if ( isset( $_GET['activated'] ) ) {             update_option( 'sidebars_widgets', $preset_widgets );     }          //update_option( 'sidebars_widgets', NULL );                         // Check for static widgets in widget-ready areas     function is_sidebar_active( $index ){            global $wp_registered_sidebars;            $widgetcolums = wp_get_sidebars_widgets();            if ($widgetcolums[$index]) return true;                  return false;          } // end is_sidebar_active      The problem is, my theme is NOT calling the default widgets in absence of any widgets at the beginning. I can't fix it, because I can't understand the code above and obviously the process explained by Ian Stewart. And also, can't understand the explanation regarding `//update_option( 'sidebars_widgets', NULL );`. How can I fix this?


Enqueue stylesheets with the same name

Ok, maybe i'm thinking too difficult, but I have 2 stylesheets with the same name. One is from the parent theme folder, and one from the child theme folder. I want to enqueue the style from the child theme folder AFTER the parent theme style has loaded, so I can overrule some classes. This is the enqueue script from the parent theme:               // Register Styles :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::     wp_register_style( 'prettyPhoto', get_template_directory_uri() . '/stylesheets/prettyPhoto.css', array(), '1.0', 'all' );     wp_register_style( 'shortcodes', get_template_directory_uri() . '/stylesheets/shortcodes.css', array(), '1.0', 'all' );     wp_register_style( 'retina', get_template_directory_uri() . '/stylesheets/retina.css', array(), '1.0', 'only screen and (-webkit-min-device-pixel-ratio: 2)' );     wp_register_style( 'responsive', get_template_directory_uri() . '/stylesheets/responsive.css', array(), '1.0', 'all' );     wp_register_style( 'rtl', get_template_directory_uri() . '/stylesheets/rtl.css', array(), '1.0', 'all' );     wp_register_style( 'fontello', get_template_directory_uri() . '/stylesheets/fontello.css', array(), '1.0', 'all' );     wp_register_style( 'fontello-ie7', get_template_directory_uri() . '/stylesheets/fontello-ie7.css', array(), '1.0', 'all' );          // Enqueue ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::     wp_enqueue_style( 'shortcodes' );      wp_enqueue_style( 'stylesheet', get_stylesheet_uri(), array(), '1.1', 'all' );     wp_enqueue_style( 'prettyPhoto' );     wp_enqueue_style( 'fontello' );       I want to add another 'shortcodes.css' from the child theme dir, that is loaded after the shortcodes.css from the parent theme dir. How can I do this?


Change order that the menu is generated with wp_list_pages

I am trying to order the output of one of my menus to be based off of the way they are setup in the `Appearance->Menus` pane, however it seems to only want to do it alphabetically. For example I have setup in the `Menus` pane the following hierarchy:               Weekly Outlook     - Webinars     - Calendar      However it displays like so:               Weekly Outlook     - Calendar     - Webinars      I the menu is generated by the following code. Note, the content is dependant on the page visited.                <div id="dep-menu">      <?php global $post;      if (!is_front_page() && !is_404()) {          if($post->post_parent) {              $children = wp_list_pages("title_li=&include=".$post->post_parent."&echo=0&sort_column=menu_order'");              $children.= wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&sort_column=menu_order'");          } else {              $children = wp_list_pages("title_li=&include=".$post->ID."&echo=0&sort_column=menu_order'");              $children.= wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&sort_column=menu_order'");          }          if ($children) { ?>              <ul>                  <?php echo $children; ?>              </ul>          <?php }      }      ?>      </div>      **EDIT** Here it is in action: http://dailywealthreport.com.au/ The menu I am referring to is the one that comes up when you click on an item in the main menu.


How to create thumbnails in wordpress with jwplayer

I can't seem to get a good answer on their site. What's the best way to create thumbnails for videos uploaded to my wordpress site? Users upload videos from the front end and I started doing this with only youtube videos which was great because I could just pull the thumbs from youtube. So how can I can auto create them now and store them in a way that's not complicated. I tries using a the "video thumbnails" plugin but that doesn't work.


Adding Categories across posts, and custom post types

I currently have a list of categories that go with my 'posts' I want the same categories to go with my custom post types 'services' and 'work' The following code, adds the tags and categories to the work and services custom posts.               add_action('init', 'demo_add_default_boxes');          function demo_add_default_boxes() {         register_taxonomy_for_object_type('category', 'work');         register_taxonomy_for_object_type('post_tag', 'work');         register_taxonomy_for_object_type('category', 'services');         register_taxonomy_for_object_type('post_tag', 'services');     }      But when I categorise a work/service post, it does not appear on the /category/ page, only the 'posts' from that category appear.


How we can get the author ID by its Name

How can i retrieve the author id if i have its name. I have fornt end form any user can enter the author name to filter the posts by author name so after that how can i get author id. Or there is any other way to write the query so that it return the posts which is posted by specific authors. Thanks


How to get the next and previous image title from attachment or gallery?

I'm trying to build a slider exactly like this in wordpress. I have managed to make the slider work except the next/prev button. I need to get the next image title and the previous image title for the next/prev button. my code is like this:


wordpress gallery plugin won't show gallery online

i have installed two different gallery plugins (Slideshow Gallery and Nextgen- gallery) i need both of them since they display photos in different ways and i need'em for different pages. I installed previously the "NextGen-gallery" and it works fine. Than i installed the "Slideshow Gallery" but when i put the short code into the page,it doesn't display anything! It's blank! i tried in a different website to leave just "Slideshow gallery" plugin and it did show up. Is there a problem to install 2 gallery plugins in a website?? What can i do to keep them both?? Thanks in advance!


Remove update messages for deactivated plugins

Is it possible to hide just update messages for deactivated plugins in WP 3.4+?


Possible to add meta box to edit.php pages?

I've been googling this for a while, and came across this link here: Can I limit this meta box to a particular page? What I am trying to achieve is adding a custom Meta Boxe I created onto a CPT Posts Screen (`edit.php?post_type=custom`). What I tried to use is this:               add_action("admin_init", "admin_init");     function admin_init() {        global $pagenow, $page;           if ( 'edit.php' == $pagenow ) {              add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );           }     }      When adding and saving this into my `functions.php`, the page turns blank. Is it even possible to add a meta box to `edit.php` pages? * * * **EDIT** OP wants to add the "QuickPress" functionality in this meta box. Screenshots from the comments to an answer. > ![enter image description here](http://i.stack.imgur.com/D49m5.jpg)


get_bloginfo prints IP instead of url

I just recently moved a site to another production environment and I seem to have missed some setting in the db config as a lot of the built-in functions prints the IP instead of the url. Ideas? Tried switching site_url and home under wp_options table from IP to http://project.dev (which is set to default to a specific IP where I manage my different local projects, running on Apache). Entering http://project.dev/wp-admin gives me               http://192.168.33.21/wp-login.php?redirect_to=http%3A%2F%2Fproject.dev%2Fwp-admin%2F&reauth=1      Htaccess is set to               <IfModule mod_rewrite.c>         RewriteEngine On         RewriteBase /         RewriteRule ^index\.php$ - [L]         RewriteCond %{REQUEST_FILENAME} !-f         RewriteCond %{REQUEST_FILENAME} !-d         RewriteRule . /index.php [L]     </IfModule>


Why is get_the_category() saying that I have two categories?

My post has only one category. The following code:               $categories = get_the_category();      gives me this result:               Array     (         [0] => stdClass Object             (                 [term_id] => 22                 [name] => Style Guide                 [slug] => style-guide                 [term_group] => 0                 [term_taxonomy_id] => 22                 [taxonomy] => category                 [description] =>                  [parent] => 0                 [count] => 2                 [object_id] => 391                 [cat_ID] => 22                 [category_count] => 2                 [category_description] =>                  [cat_name] => Style Guide                 [category_nicename] => style-guide                 [category_parent] => 0             )          )      Why is it double up?


Styleswitcher or themeswitcher to allow user to switch back to standard view from mobile device

I created a mobile version of my site with CSS, with all my styles in a single stylesheet (using `@media only screen and (max-width: 480px), only screen and (max-device-width: 480px)` to define mobile styles). When it's all in a single stylesheet, it works fine. But I want to allow users to switch back to standard view even if they view the site from a mobile device. I don't know of any way to allow the user to override the `@media`, so it seems I have two options: (1) separate stylesheets plus styleswitcher script, or (2) separate themes plus themeswitcher. Theoretically this should be possible with a styleswitcher, but I can't figure out how to get a styleswitcher to override the media declaration in the header, so even when I click "switch back to standard view," it still loads the mobile stylesheet. So then I started looking into themeswitchers. I want to detect mobile users and direct them to the mobile theme by default, but still allow them to switch back if they want. This is essentially what the WP Mobile Pack plugin does, but it has a lot of extra functionality that I don't need, and I've read some horror stories about the way it modifies the database. I also don't need all the pre-built mobile themes since I've already written the CSS I need for the mobile version. Can anybody recommend a more lightweight solution, like a simple themeswitcher script combined with a mobile-detection plugin that doesn't require me to define media queries in the header?


Do Plugins effect site loading time?

Is there any way to measure the time it takes for plugins to load and in which pages they load (without figuring out the entire code)? In addition, I would like to find out which plugins load files in which pages and find the ones that load on irrelevant ones.


older blog posts not showing in new theme

I have a new, custom theme that I've uploaded on a pre-existing site/blog. Everything seems to be working ok, with the exception of the older blog posts not showing up. Any ideas what I can do to fix?               <?php get_header();?>
         <?php get_sidebar( 'blog');?>
         <?php if(have_posts()) : while(have_posts()) : the_post(''); ?>

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

<?php the_tags('tags: ', ', ', '
'); ?> | <?php comments_number( 'no responses', 'one response', '% responses' ); ?> comments

                 <?php the_content('read more...'); ?>

SHARE THIS POST

         <?php endwhile; ?>         <?php else : ?>
I'm not sure what you're looking for.
         <?php endif; ?>
          <?php get_footer();?>      _**eta_ Finally got the posts to show by cleaning up the code, however they are now all jumbled.** How can I remedy this?


Is there a Filter that I can use to filter the tags before they are inserted in to the database?

I want to filter the tags before they are inserted into the database. I'm aware of the pre_insert_term filter. But what I need to do is to see all the tags at once. I need to limit the number of tags entered to the database per post. Is there a filter to do this? Or any other method? Thanks


How to get title tag of an external page with http api?

What is the best method to retrieve the title tag of an external page using the http api? The snippet below will get the body but I can't find the right documentation about how to just get the tag. :/               $url = 'http://wordpres.org';     $response = wp_remote_get( $url );     if( is_wp_error( $response ) ) {        echo 'Something went wrong!';     } else {     print wp_remote_retrieve_body( $response );     }      > **Edit:** This code snippet gets both the screenshot and title of an > external page (Thanks again @Bainternet). With a little editing this could > be an easy way to display the link post format.               <?php      $content = get_the_content();     $url = strip_tags($content); //assumes only a url is in the_content     $width = '150';     $cleanurl = urlencode(clean_url($url));     $fullurl = 'http://s.wordpress.com/mshots/v1/' . $cleanurl . '?w=' . $width;          // return title tag of an external page     // http://wordpress.stackexchange.com/questions/19424/how-to-get-title-tag-of-an-external-page-with-http-api     function get_page_title($url){         if( !class_exists( 'WP_Http' ) )             include_once( ABSPATH . WPINC. '/class-http.php' );         $request = new WP_Http;         $result = $request->request( $url );         if( is_wp_error( $result ) )             return false;              if( preg_match("#<title>(.+)<\/title>#iU", $result['body'], $t))  {             return trim($t[1]);         } else {      return false; }         }     $title = get_page_title($url);                echo '

';      echo '

'; if ($title !== false){ echo $title;} echo '

' . $content . '

';     echo '

';     ?>


Options for authenticated feeds

Client has a 3.1x-based site with paywall(using s2Member) which has a public feed that only provides excerpts. He wants to be able to give members full- content feeds, so we need something that can look at the member's role/level and cut them off at the appropriate time, etc. It's accepted this will probably require some templating. I've found a couple of options, like Feed Key(mostly functional, but not quite) but they've all seem to have been abandoned around 2008 for some reason and I don't have the capability or familiarity with the system to fix them. Are there more current options I'm not digging up, or is it that this somehow became possible with core and I'm just not seeing it?


Create a blank admin page from plugin

is there an opportunity to create a blank admin page in wordpress from a plugin or theme? I mean like the theme customizer without the admin bar or the sidebar menu. Jonathan


create relationship between posts from one category and posts from another category

What I'm trying to do is adding in a post admin page a meta box, dynamically listing all posts from another category in the for of a check box list. This way I can create relations between a post and other posts belonging to a different category. Any tips will be greatly appreciated.


css3-mediaqueries-js failing with child theme

Within my parent theme functions.php, I have the following snippet:               // Add mediaqueries-js     function footer_scripts(){         echo '<!--[if lt IE 9]><script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script><![endif]-->';     }     add_action( 'wp_footer', 'footer_scripts' );      This adds media query support to IE7 and IE8. The script runs perfectly in IE7/8 with the parent theme, but fails to work and ignores the media queries when activating the child theme. All other scripts are enqueued correctly and run as they should. The script is showing within the source code when the child theme is activated.


Remove image from post_content on save_post

I'm trying to setup a function in functions.php that removes an image from the post_content on save. Everything works up until the time I'm trying to save the content, the page just hangs and I get a '500 Internal Server' error.               function remove_post_image( $post_ID ){            // get the post       $the_post = get_post($post_ID);            // get the content of the post       $post_content = $the_post->post_content;            // replace any images       $content = preg_replace("/<img[^>]+\>/i", "", $post_content);            // save the post       $my_post = array();       $my_post['ID'] = $post_ID;       $my_post['post_content'] = $content;            // Update the post into the database       wp_update_post( $my_post );               return $post_ID;     }     add_action('save_post', 'remove_post_image');      I fear I'm missing something very basic. Can anyone spot something I'm doing wrong? * * * _edit_ Already I see how silly this was setup. I'm having success with the following, but still would like to know if this is the best way? I'm using content_save_pre action...               function remove_post_image( $content ){            // replace any images       $content = preg_replace("/<img[^>]+\>/i", "", $content);            return $content;     }     add_action('content_save_pre', 'remove_post_image');


how to change the permalink to a specific location?

I have this slider on my front page. Right now when I click on an image it goes directly to the permalink and the post. How do I make all the slides go to one specific page? this is the loop for the slider:
         <?php          $recent = new WP_Query( array(  "cat" => $tmcategory,                                          "posts_per_page" => $tm_totalpost,                                          "post_type" => "post",                                       )                                );          while($recent->have_posts()) : $recent->the_post();          ?>                  <?php if (has_post_thumbnail()) { ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">             <img src="<?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,"img737", true); echo $image_url[0]; ?>" alt="<?php echo get_the_title(); ?>" title="<?php echo get_the_title(); ?>">
                    <?php } else { ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">             <img src="<?php echo get_template_directory_uri(); ?>/images/nophoto515.png" alt="<?php echo get_the_title(); ?>" title="<?php echo get_the_title(); ?>">
             <?php } ?>              <?php endwhile; ?>
      I changed the code to this but still it dosent work?:               <?php if (has_post_thumbnail()) { ?>
<a href="<?php get_permalink(22); ?>" title="<?php the_title_attribute(); ?>">             <img src="<?php $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,"img737", true); echo $image_url[0]; ?>" alt="<?php echo get_the_title(); ?>" title="<?php echo get_the_title(); ?>">
                    <?php } else { ?>
<a href="<?php get_permalink(22); ?>" title="<?php the_title_attribute(); ?>">             <img src="<?php echo get_template_directory_uri(); ?>/images/nophoto515.png" alt="<?php echo get_the_title(); ?>" title="<?php echo get_the_title(); ?>">
             <?php } ?>              <?php endwhile; ?>


SQL query to remove first image in all posts

I've built a site up over a few years (3,500+ posts) where I've inserted images using the traditional method into the post content itself. I'm now moving to a different theme, and have made the first image for each post the featured image (which I want to keep), but I now would like to remove the first image from the_content. I have found that I can remove the first image (with or without captions) on the fly by instead of using the_content(), doing this: `echo preg_replace("/\\[caption .+?\\[\/caption\\]|\< *[img][^\>]*[.]*\>/i","",get_the_content(),1);` Is there some way I can run this command on the database to actually remove those images? Thanks for any pointers


How do I test PHP files in WordPress?

I've downloaded a Wordpress theme, but I want to edit it before uploading it to my live server. I read I need to run a server in order to test the PHP files, but I don't know what to use in order to do so. Or would it just be better to upload then edit it?


How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?

I am trying to retrieve all the images from the `Gallery` of a page in the order they are set in the backend. So far I have:                 $my_wp_query = new WP_Query();            $all_wp_pages = $my_wp_query->query(         array(           'post_type' => 'attachment',           'post_parent' => 54,             'post_mime_type' =>'image',           'post_status' => 'inherit',            'posts_per_page' => '20'            'orderby' => 'menu_order',           'order' => 'ASC'         )       );            var_dump( $all_wp_pages );      But this seems to return all the attachment images in the standard/default order rather than the order I have dragged and dropped the images in the backend edit gallery interface. I believe this might be due to the fact that I am querying all attachment images of my page rather than specifically the Gallery, and as such the sorting information for the gallery is not passed in the returned array. Can anyone tell me how I get all the gallery images of a certain page_id in the order they are set in the backend? There will only be one gallery per page if that helps. thanks


Removed plugin generating error message

I kinda did something stupid. To test something I created a couple of plugins and during testing I think I renamed the plugin. Now I deleted the plugins but I'm still getting an error message saying the plugin couldn't be found:               The plugin something else has been deactivated due to an error: Plugin file does not exist.      I searched the database and there's an activate_plugins entry in wp_options. It contains the following:               a:4:{i:0;s:23:"bandpress/bootstrap.php";i:3;s:56:"posts-from-single-category-widget/post_from_category.php";i:4;s:15:"something else ";i:5;s:68:"syntax-highlighter-with-add-button-in-editor/syntaxhighlighterpp.php";}      So, I think I need to remove the "something else " part of this field, but I don't know which parts I should (or shouldn't) remove. What part do I need to remove to get rid of the error message, without affecting the other plugins?


Access Shortcode in ajax code?

I have some data which is pulled over using `ajax`. Data works all fine, however, I have some `shortcode` been used in the same data which doesn't display as expected. It looks like `shortcode` function isn't available at the time of `ajax` call. Could anyone please help with how I can have access to `shortcode` within `ajax`? Unfortunately code isn't very straightforward to put here. I am using Calendar plugin to display Calendar. Then using Tippy shortcodes to display events within calendar to expand on mouseover. Shortcode to display event with Tippy popup doesn't work when the calendar is updated (on hitting next month or year) using ajax. Because somehow when content is pulled out using ajax at that particular time shortcodes API isn't available.


Stray closing paragraph tag when using shortcodes

I'm using a basic shortcode to wrap some text in an expandable div. What appears to be happening is that the wpautop is inserting a stray closing paragraph tag at the beginning and a stray opening paragraph tag at the end of the content being wrapped. Here's how it looks in the editor: > [expandable text="Show Content"] > > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras fermentum > facilisis malesuada. Suspendisse potenti. Aenean dui turpis, ornare in ipsum > eget, vestibulum egestas nulla. > > [/expandable] And the rendered HTML:
Show Content

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras fermentum facilisis malesuada. Suspendisse potenti. Aenean dui turpis, ornare in ipsum eget, vestibulum egestas nulla.

      This is the shortcode function:               function expandable_content_shortcode( $atts, $content = null ) {         $args = shortcode_atts( array(             'text' => __( 'View More', $this->plugin_slug ),             'linklocation' => 'top'         ), $atts, 'expandable' );              if ( $args['linklocation'] === 'top' ) {             $output = '
' . $args['text'] . '' . $content . '
';         } else {             $output = '
' . $content . '' . $args['text'] . '
';         }              return $output;     }


excerpt - don't use main content if empty

trying to stop get_the_excerpt() from defaulting to the_content() if its empty. this kinda works - well it seems to return 'xxx' so i think has_excerpt() isn't working?               function get_link_excerpt(){         if(has_excerpt()){             $LinkExcerpt = get_the_excerpt();             return $LinkExcerpt."...";         }         return 'no excerpt';      }     add_filter('get_the_excerpt', 'get_link_excerpt');      what's the best way to control this? best,Dc


Archive query not working correctly

I think I am missing something while trying to create an archive page for my post type I decided to put three levels of data in one post type and was going to separate it by templates depending on the value of a custom field. (collection, product, variant) I am going this route because my other method of having a taxonomy>CPT1>CPT2 relationship was not building the link structure I needed. Anyway. For my top level data, each post will be assigned the input_type=> collection. So when going to the archive page, The archive is listing all post which I don't need. I only want it to list post marked collection. I managed to get part of the code figured out, but it is not displaying in the grid format like I had it with the previous post type arrangement. And for some reason, it is displaying the same title on each post, yet having different descriptions. And it is displaying post without children and not displaying some of the post with children that I want it to do. What am I missing here? For each level of data, I am actually going need it to check to see if children are present under the given post type. Otherwise that post type will not be displayed. Each Collection must have at at least 1 Product, each product must have at least one variant. If a collection only had one product, but that product did not have a variant defined, then that collection will not display either. http://dev.unicriscreations.com/collection/               <?php           get_header();                $args=array(              'post_per_page'=> 12,         'post_type' => 'uc-collections',         'orderby' =>'ID',         'parent' => 0,         'post_status' => 'publish',         'meta_query' => array(             array( 'key'=>'input_type',             'value'=>'collection'))     );           $collections =  get_posts($args);           ?>
<?php echo "Product Collections";  ?>

          <?php             foreach ( $collections as $col )                       {                     setup_postdata( $col ); ?>

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

             <?php the_content();                               echo '

';             }                       ?>
     <?php          wp_reset_postdata();     ?>

          <?php get_footer(); ?>


Adding Pagination on a Custom Author Page

i have created a custom author's page that list the title of their posts. but the problem is i can't get the pagination to work if it's beyond the set post per page value. i have used get_posts() to it's custom loop.               <?php                          $ppp = 5; //set my custom number of post to appear                         $uid = $curauth->ID;                         $args = array(                                         'numberposts' => $ppp,                                         'author' => $uid                                          );                         $authorposts = get_posts($args);                         //print_r($authorposts);                         if ( count( $authorposts ) > 0 ) {                                                 foreach ( $authorposts as $post ):  setup_postdata($post)            ?>
                                               <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="authorpostlink"><?php the_title(); ?>                                     <?php the_excerpt(); ?>
                         <?php endforeach;  ?>

<?php previous_posts_link('‹ Previous Page') ?>

<?php next_posts_link('Next Page ›') ?>

                         <?php                         } else {                             echo '
No articles by this user
';                         }                                ?>      This should display 5 post with it's title and it's excerpt by the author,....but the rest of the author's posts isn't paginated what it paginates is the whole number of post on the blog.


Rewrite rule for a page to support pagination

I have a created a page and I want to use pagination in this page. I have added below rewrite rule but still I am getting 404 error, please help me to fix this issue,               function my_generate_rewrite_rules(){         $new_rules = array(                "tags/page/?([0-9]{1,})/?$" =>           "index.php?pagename=tags&paged=".$wp_rewrite->preg_index(1)         );              return $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;     }


What causes a theme to be inefficient?

Someone has asked me to analyze if his theme is 'good'. I've decided to analyze it in terms of   1. number of assets that the theme needs   2. compressing those assets   3. ensuring wp_enqueue_x is being used    4. ensure that loops are properly coded Am I missing anything important and obvious? I'd love to know what else you may think of, thanks!


get_posts from post x(offset=>x) to end

How can i get the posts using get_posts from let's say post 10 and beyond?So if i have 200 posts i will get from post 10 to post 200(190 posts)? Because as i see if i use               <?php $args = array(         'numberposts'     => -1,         'offset'          => 10         ); ?>      i just get all the posts Cheers


Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929

I'm writing a theme and almost everytime I reload a page, Wordpress is giving the following error `Warning: fopen(http://localhost/wordpress/wp- cron.php?doing_wp_cron=1373799734.2041289806365966796875): failed to open stream: HTTP request failed! in D:\wamp\www\wordpress\wp-includes\class- http.php on line 92` As can be seen I have enabled `WP_DEBUG`. Here is a screenshot of the warning window: http://oi44.tinypic.com/2qnrrd5.jpg I'd provide further information but I have to know what exactly as I have no idea where the problem may lay :\


How to call function that create table in database (plugin functionality)

I am trying to create a small plugin but it not creating table in database when i activate the plugin. please have a look the code given below there is function `function jal_install ()` it not called.                     <?php             /*             Plugin Name: My-Ads             Plugin URI: http://wordpress.org/#             Description: This is the most basic wordpress plugin, gets input from the user and displays it on every page.             Author: shalu                      */                 /*when plugin is activated*/                 register_activation_hook(_FILE_,'my_first_install');                /*when plugin is deactivated*/           register_deactivation_hook( __FILE__, 'my_first_remove' );                function my_first_install()            {              add_option("my_first_data", 'Testing !! My Plugin is Working Fine.', 'This is my first plugin panel data.', 'yes');                 }            function my_first_remove()                {             /* Deletes the database field */             delete_option('my_first_data');                     }                     /*Code-Add Admin Panel Menu Item*/                if(is_admin())             {                    add_action('admin_menu','my_first_admin_menu');                     function my_first_admin_menu()                 {                  add_options_page('My First', 'Ads', 'administrator','my-first',        'my_first_plugin_page');                  }                 }                             function my_first_plugin_page() {            ?>

Add your ads from here
               <form method="post" action="options.php" enctype="multipart/form-data">                  <?php wp_nonce_field('update-options'); ?>

             Name:	                               <input name="my_first_data" type="text" id="my_first_data" value="<?php echo get_option('my_first_data'); ?>" />

              Target Url:	                             <input name="Target_Url" type="text" id="Target_Url" value="<?php echo get_option('Target_Url'); ?>" />

              Ad image:	                            <input name="file" type="file" id="file"/>

           <input type="hidden" name="action" value="update" />           <input type="hidden" name="page_options" value="my_first_data" />
            <input type="submit" value="<?php _e('Save Changes') ?>" />
             </form>
                <?php                         }                    /* This calls my_first() function when wordpress initializes.*/             function my_first()            {                    echo get_option('my_first_data');                }                 function jal_install () {                global $wpdb;                   global $jal_db_version;                     $table_name = $wpdb->prefix . "liveshoutbox";                echo $table_name;                 if($wpdb->get_var("show tables like '$table_name'") != $table_name) {                     $sql = "CREATE TABLE " . $table_name . " (           id mediumint(9) NOT NULL AUTO_INCREMENT,       time bigint(11) DEFAULT '0' NOT NULL,       name tinytext NOT NULL,       text text NOT NULL,       url VARCHAR(55) NOT NULL,       UNIQUE KEY id (id)     );";            require_once(ABSPATH . 'wp-admin/includes/upgrade.php');       dbDelta($sql);            $rows_affected = $wpdb->insert( $table_name, array( 'time' => current_time('mysql'), 'name' => $welcome_name, 'text' => $welcome_text ) );            add_option("jal_db_version", $jal_db_version);                      }               }                  //calling the function             register_activation_hook(__FILE__,'jal_install');                   ?>       please help me where is the issue. I shall be very thankful you


javascript conflict

I am having a JavaScript which is used for marquee, I want to use this in my wordpress site. But this java script is conflicting with my wordpress, I am using this in footer, but just the `div` area is getting loaded, the marquee in it is not working. Here is my code:

      How can I integrate this with my wordpress site?


How to resolve "Failed to send your message" problem for Contact Form 7?

I am using `contact form 7` but when i m trying to send msg through contact form it gives error given below `Failed to send your message. Please try later or contact administrator by other way.` please help me


Prevent Editors from Editing/Deleting Admin Accounts

I need editors to be able to add/edit/delete other users. Giving them those capabilities is easy with code similar to this:               $editor = get_role('editor');     $editor->add_cap('edit_users');      The problem is that when they have the privileges they need to add/edit/delete other users, they can also do all of those things to admin users and/or promote themselves to the admin role. Is there a way to allow them to add/edit/delete only specified user roles (best case scenario)? Or as an alternative, prevent editors from doing anything at all to admin accounts, and possibly even hide those accounts from their list view altogether?


Archive by months with pretty url?

I wanted to able to get the archive months working, I tried this               http://codex.wordpress.org/Function_Reference/wp_get_archives#Last_Twelve_Months      but it only gets the last 12 months, what I wanted is to get the 12 months listed from Jan - Dec whenever the year is. Then is seem its not working without the year in url for example               with year                      |  somesite.com/01/13     without a year monthts //01-12 |  somesite.com/01/       My Query to get all posts of month January for example, the problem is I don't able to get the value of $month base from url               $args = array(         'orderby' => 'date',              'order' => 'DESC'         'date_query' => array(             array(                 'month' => $month,             ),         ),     );     $query = new WP_Query( $args );


How to callback custom field text

I have a plugin where the user can click a button to feature a post. I added a text field but i want the text field to call back whatever is posted in it Here is how it looks now http://ratedrnb.com/wp-content/uploads/2013/05/ffm2.jpg now the plugin grabs the thumbnail of the post but i also want it to grab whatever is in the "Artist/Song" field. Here is the code where the "Featured Music Options" is               <?php     /*     Plugin Name: Featured Music     Plugin URI: LittleLadyEnterprises.com     Description: This Plugin is used to show your featured Posts/Pages with thumbnails in a nice slider.     Version: 2.6     Author: Little Lady Enterprises     */            $m_slider_options_page = get_option('siteurl') . '/wp-admin/admin.php?page=rated-featured-music/options.php';           function m_slider_options_page() {          add_options_page('Featured Music Options', 'Featured Music', 10, 'rated-featured-music/options.php');           }           add_action('admin_menu', 'm_slider_options_page');           function m_slider_add_scripts() {              if ( !is_admin() ) {                      wp_register_script('jquery.cycle', get_bloginfo('url') . '/wp-content/plugins/rated-featured-music/scripts/jquery.cycle.all.2.72.js', array('jquery'), '1.3' );                 wp_enqueue_script('jquery.cycle');               }           }           add_action('wp_enqueue_scripts', 'm_slider_add_scripts');                function m_slider_cut_text($text, $chars, $points = "...") {          $content = $text;          $content = preg_replace('/\[.+\]/','', $content);     $content = apply_filters('the_content', $content);      $content = str_replace(']]>', ']]>', $content);     $content = strip_tags($content);          $length = strlen($content);          if($length <= $chars) {              return $content;           } else {              return mb_substr($content, 0, $chars)." ".$points;          }     }          add_action("admin_init", "m_slider_init");     add_action('save_post', 'm_slider_save');          function m_slider_init() {              add_meta_box("feat_music", "Featured Music Options", "m_slider_meta", "post", "normal", "high");         add_meta_box("feat_music", "Featured Music Options", "m_slider_meta", "page", "normal", "high");          }          function m_slider_meta() {              global $post;         $custom = get_post_custom($post->ID);         $feat_music = $custom["feat_music"][0];          ?>

                 Feature in Featured Music?    	                 <input type="checkbox" name="feat_music" value="1" <?php if($feat_music == 1) { echo "checked='checked'";} ?>	          Artist/Song	                     <input type="text" name="artist_title" value="Artist - Song">

          <?php          }           function m_slider_save() {              if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )          return $post_id;         global $post;              if($post->post_type == "post" || $post->post_type == "page") {                      update_post_meta($post->ID, "feat_music", $_POST["feat_music"]);              }          }          function m_slider_insert($atts, $content = null) {              include (ABSPATH . '/wp-content/plugins/rated-featured-music/content-slider.php');          }          add_shortcode("featslider", "m_slider_insert");          $m_slider_img_width = get_option('img_width');          if(empty($m_slider_img_width)) {              $m_slider_img_width = 320;          }          $m_slider_img_height = get_option('img_height');          if(empty($m_slider_img_height)) {              $m_slider_img_height = 200;          }          if (function_exists('add_image_size')) {          add_image_size( 'feat_music', $m_slider_img_width, $m_slider_img_height, true );          }          function m_slider_get_thumb($position) {          $thumb = get_the_post_thumbnail($post_id, $position);     $thumb = explode("\"", $thumb);     return $thumb[5];          }          //Check for Post Thumbnail Support          add_theme_support( 'post-thumbnails' );          function m_slider_get_dynamic_class() {              $class = explode("http://", get_bloginfo("url"));     $class = explode(".", $class[1]);         $class = $class[0];         return $class . "_slider";          }          ?>      **What is the callback code that I need to add to the Value Area?** **The code below is the styling of the plugin and callback codes, what is the callback code to call back whatever is placed in the textarea.**               <?php          $m_slider_direct_path =  get_bloginfo('wpurl')."/wp-content/plugins/rated-featured-music";          $m_slider_class = m_slider_get_dynamic_class();          ?>
     <?php              $m_slider_sort = get_option('sort'); if(empty($c_slider_sort))    {$c_slider_sort = "post_date";}         $m_slider_order = get_option('order'); if(empty($c_slider_order)){$c_slider_order = "DESC";}         $m_slider_post_limit = get_option('limit_posts');     if(empty($m_slider_limit_posts)){$m_slider_limit_posts = "-1";}              global $wpdb;              global $post;              $args = array( 'meta_key' => 'feat_music', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'orderby' => $m_slider_sort, 'order' => $m_slider_order, 'numberposts'=> $m_slider_post_limit);              $myposts = get_posts( $args );              foreach( $myposts as $post ) :  setup_postdata($post);                  $m_slider_custom = get_post_custom($post->ID);                  $m_slider_thumb = m_slider_get_thumb("featmusic");              ?>
<a href="<?php the_permalink();?>"><?php the_post_thumbnail('featmusic'); ?>

<a href="<?php the_permalink();?>">TEXT AREA TEXT HERE

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

     <?php endforeach; ?>


How to show author's avatar in the post meta data with plugin `user-avatar`

I'm using `user-avatar`, and I want to show user icon in the post meta data. http://wordpress.org/plugins/wp-user-avatar/ I'm writing like this. ` <?php the_author_posts_link(); ?> <?php echo get_avatar(); ?> ` It shows only default "nobody" avatar. If I write like `<?php echo get_avatar("myemail@example.com"); ?>`, then it shows my avatar through `user-avatar` plugin. So if I can get the author's emails, it works all fine. I tried to get the email by `<?php the_author_meta('user_email'); ?>`. But it doesn't return the email, but it outputs directly. I'm stuck now. How can I set user avatar in post meta area?


Wordspress add <p> into my javascripts

I use a slider called _revoslider_ and use it via shortcode. When i use the shortcode **and do not use visual editor for insert** and save, the slider does not work because WordPress adds `<p>` into javascript like this :

      Because of this, the code does not work and I don´t understand why WordPress adds these `<p>` for each line - it´s ridicoulus. I tried `add_filter` for content but it also does not work.


How do I get around "Sorry, this file type is not permitted for security reasons"?

I was wondering how I could allow .tiff files to be uploaded in my wordpress site. I get the message "Sorry this file type is not permitted for security reasons". This question has been asked in other places, but the solutions suggested aren't working for me. I have tried using the following snippet in my theme's functions.php file, I saw a lot of suggestions to use this or something similar to extend the allowed file types:               function my_wonderful_mime_types($mime_types){         $mime_types['tiff'] = 'image/tiff'; // Adding an extension, I tried 'tif' too         return $mime_types;     }     add_filter('upload_mimes', 'my_wonderful_mime_types', 1, 1);      but it doesn't do anything. I have tried adding this in the functions.php file too:               define('ALLOW_UNFILTERED_UPLOADS', true);      That actually works, (the image will not display, but I'm not worried about that part). However, this seems sub optimal because I only want to extend the allowed mime types to include .tiff files, not just any type of file. I've found a couple other solutions that rely on old/unmaintained plugins. I can't be using a plugin that isn't maintained! Does anyone know how to get around this security feature?


Tips for finding SPAM links injected into the_content

I'm working on a client's site and I noticed that posts have a hidden `<div>` filled to SPAM links to dick pills, etc. Hoping to get lucky, I searched for some of the keywords in the database tables, but found no matches. I also searched the code in all the files, and also found no matches. I know that Wordpress hacks can be very tricky to remove, and they go to great lengths to make them hard to find. But perhaps there are some "usual suspects" that I could check, or maybe some tell-tale signs I could look for. **I'm not asking for anyone to solve this specific hack.** I'm just looking for advice on where (in general) to look. In case it's useful, here's the unauthorized `<div>` which is injected right before the close of the first `<\p>`:
 At that requires looking for how you http://www.cialis.com want $745? visit our site. sign any of money. Visit our secure bad creditors that cialis levitra sales viagra viagra australia online payday lenders know otherwise. But the black you stay on discount price levitra what is impotence in men duty to their lives. Citizen at one online or after receiving their research viagra online www.viagra.com to just take just wait until monday. This specifically relates to shop every pay stubs get viagra without prescription cialis overnight delivery and only used or faxing required. We will turn double checked by some small business loans viagra for woman cialis india sites that works the business before approval. Living paycheck went out cash there would generate levitra viagra cialis levitra the scheduled maturity day method. Own a short application on when money also buy cialis online kamagra plenty of personal initial limits. Even those loans quick because lenders realize http://cialis-ca-online.com levitrafroaustraila you notice a payday advance. A loan applications are more common thanks http://www.cialis2au.com/ cialis to only apply online website. Third borrowers will use your paycheck to levitra online pharmacy viagra online purchase utilize these individuals can cover. Often there must also referred to ensure online pharmacy viagra usa viagra effectiveness you with financial expenses. Thanks to checking account also merchant cash loan wwwwviagracom.com levitra viagra cialis comparison to state or from there. At that they pay them in mere viagra cheapest generic viagra seconds and to comprehend. If a repossession or limited to see if approved www.cashadvances.com  | Apply for a cash advance online! cialis dosage the risks associated at your current address. Second borrowers should not start and struggle http://www.cashadvance.com levitra for sale at least a button. Thanks to send the benefits of everyday living cheapest viagra order online tadalafil from being foreclosed on its benefits. Finally you get help rebuild the original loan buy cialis viagra viagra without prescription can really only to surprises. Bank loans out you will take http://wviagracom.com/ erectile dysfunction supplements the conditions are a. Bills might provide an unexpected car cialis uk suppliers kamagra broke a repayment length. Third borrowers repay because payday industry has the results http://www.buy9levitra.com/ viagra recreational use by the middle man and check process. After verifying your question with dignity and credit cards www.levitra.com overnight viagra delivery or drive to secure loan online. Most people for dollars you between bad and free cialis http://viagra7au.com/ instead these applicants is available. Social security against your payday the larger sums buying viagra online direct lenders installment loans no credit check of gossip when working telephone calls. Face it provides hour payday industry levitra online buy viagra now has high credit score? Within minutes during your best score range from http://cashadvance8online.com viagra dosage instructions fees if there for them most. To avoid paperwork you in crisis arise from wwwpaydayloancom.com | Online Payday Loans application form! super active viagra online from paying the bank? Funds will know to throwing your cash advance no credit check viagara online finances there that purse. Companies realize that asks for which can become cialis online sublingual viagra eligible to paycheck some lenders. Medical bills that be much easier than actually need only online cash advance online cash advance your funds via the freedom you out.


404 for some custom taxonomy not ALL taxonomy

i created taxonomy and post type & Metabox using Easy Content Types some custom taxonomy work correctly, but i don't know why one of my custom taxonomy , each time i try to access it , i got 404 page not found but i can access single post page. my problem only with taxonomy term. my post type name is services and my taxonomy name is services also i have another taxonomy called location location working correctly, but services no. i tried to remove .htacess to rebuild it and i tried to update my permalink but nothing has been changed


Give subscribers the option to post anonymously

I'm looking for a way to allow subscribers to post or comment anonymously. Basically it would be a checkbox at the end of the comment form, exactly like beyond the shock. Any ideas?


Show Sub pages excerpt+thumbnail

I'm trying to show the excerpt+thumbnail of all subpages in a specific parent; I tried a bunch of plugin but no one actually works as I need; andy advice?


Pending Post review notification for contributors

I've been looking around at this for solutions but strangely I can't seem to find one that appears decent - maybe I haven't looked hard enough. What I want is a notification on my dashboard when posts are pending review. I can't believe this doesn't seem to be core behaviour for WP. I so far can't seem to find any recent plugins for this, maybe it's a setting I haven't noticed on WP. Any help gratefully appreciated. Jonathon


Trying to get logged-in user data inside php class

I am trying to get the current logged-in user data and use this in the parent class(I need it in several functions). In the example below I can get the userID in the first function but it will give no output inside the next function. This is my first wordpress plugin and the first time that I work with OOP, so who can help me out with this thing.               <?php          class WP_PM{              public $currentId;              public function __construct(){                  $this->addActions();             $this->showId();         }              private function addActions(){             add_action('wp_loaded', array(&$this, 'getId'));         }              public function getId(){             global $current_user;                  $this->currentId = $current_user->ID;                  //$this->currentId = 'hello';//we have an output                  echo $this->currentId;//we have an output                  return $this->currentId;         }              public function showId(){             echo $this->currentId;//no output                 echo $this->getId();//no output         }          }          register_activation_hook(__FILE__, array('WP_PM', 'activate'));     register_deactivation_hook(__FILE__, array('WP_PM', 'deactivate'));          $wp_pm = new WP_PM();     ?>      // new example based on G.M solution(still not working -> triggers wp error and no logged in text)               class WP_PM_Extend extends WP_User {              function getID() {             return $this->ID;         }          }          class WP_PM{              protected $user;              public function __construct(WP_PM_Extend $user = NULL){                  if (!is_null( $user ) && $user->exists()){                 $this->user = $user;             }                  $this->getUser();              }              public function getUser() {             return $this->user;         }          }               function getWPPM() {              if(!did_action('wp_loaded')){          $msg = 'Please call getCurrentUser after wp_loaded is fired.';         return new WP_Error('to_early_for_user', $msg);         }              static $wp_powertour_core = NULL;              if(is_null( $wp_powertour_core)){             $wp_pM = new WP_PM( new WP_PM_Extend( get_current_user_id() ) );         }              return $wp_powertour_core;     }          function getCurrentUser(){            $wppm = getWPPM();              if(is_wp_error($wppm)){             return $wppm;          }              $user = $wppm->getUser();              if($user instanceof WP_PM_Extend){              return $user;         }     }          add_action( 'wp_loaded', 'getCurrentUser');          $current_user = getCurrentUser();     if($current_user instanceof WP_PM_Extend){         echo 'Current user ID: ' . $current_user->getID();     }else{         echo 'No one logged in';     }


Unhook the comment form in Buddypress

Im trying unhook the comment form found in the functions.php of the deafault buddypress theme so I can change it a bit. I placed this piece of code into my child theme functions.php but it didn't change anything. What did I do wrong?               remove_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );     if ( !function_exists( 'my_dtheme_comment_form' ) ) :     function my_dtheme_comment_form( $default_labels ) {     global $user_identity;          $commenter = wp_get_current_commenter();     $req = get_option( 'require_name_email' );     $aria_req = ( $req ? " aria-required='true'" : '' );     $fields =  array(         'author' => '
' . '' . __( 'Name', 'buddypress' ) . ( $req ? ' *' : '' ) . ' ' .                     '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />
',         'email'  => '
' . __( 'Email', 'buddypress' ) . ( $req ? ' *' : '' ) . ' ' .                     '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />
',         'url'    => '
' . __( 'Website', 'buddypress' ) . '' .                     '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />
',     );          $new_labels = array(         'comment_field'  => '
<textarea name="comment" id="comment" cols="60" rows="10" aria-required="true"></textarea>
',         'fields'         => apply_filters( 'comment_form_default_fields', $fields ),         'logged_in_as'   => '',         'must_log_in'    => '
' . sprintf( __( 'You must be logged in to post a comment.', 'buddypress' ), wp_login_url( get_permalink() ) ) . '
',         'title_reply'    => __( '', 'buddypress' )     );          return apply_filters( 'my_dtheme_comment_form', array_merge( $default_labels, $new_labels ) );     }     add_filter( 'comment_form_defaults', 'my_dtheme_comment_form', 10 );     endif;      To test that nothing changed I removed the label text for 'title_reply'


Send email to Admin when user/member updates specific user/member data

I have previously asked about How to automatically send email to Admin when a user/member changes his/hers profile data. And got some very good answers. Send automatic mail to Admin when user/member changes/adds profile. Now a follow up: I only want to send/email the data (profiledata) that was updated/added.


Make thumbnail from uploaded image without plugin

When I add image in post, I need to make some thumbnails with several sizes. Maybe someone could tell action or filter to implement this?


Invoking Jquery in a Plugin

I am using the following code in my plugin :               <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>          <?php echo "<script src=".$plugins_url."/mistral/js/jquery.pajinate.js>  </script>";  ?>     <script>     $(document).ready(function(){     $('#paging_container1').pajinate();     });     </script>      Now it is breaking my other jquery plugins due to the re instantiating of the Jquery from the CDN . Any solution to use the default jquery with WordPress would be great.


Wordpress theme & site not loading after moving files

I was recently created a custom application for wordpress. So while doing so in my file manager (I use the one provided by godaddy(my webhost)), I moved all the files from the [DOCUMENT_ROOT] ... the webroot /public_html/ page to a seperate folder (that was 3 days ago)... 3 days later. When I moved them back, my wordpress site broke or something, and all my content (blog posts and site template) are gone, it doesn't even load my wp-login properly. This is my website: www.security-shell.com Before the change it looked perfectly fine, and everything was spectacular, but now it doesn't load at all, and looks like that. Can anyone tell me why? Thanks again, anyways, much appreciated Sincerly, D4RK_Phox


Menu Disappears on Category Pages

I have a site whose navigation disappears on category pages for posts in the ‘post’ post type, but not for posts in any of my custom post types. The ‘post’ post type and post of the custom post types use the same template file for theirs archives and headers – no differences. The menu is using the wp_nav_menu function. Example links below (again, same template files being used): **Menu:** http://politichicks.tv/column/ **No Menu:** http://politichicks.tv/category/videos


Select Custom Posts

I am developing a wordpress website. It has only posts.... I have define links according to categories and tags.... what I want to do...?   1. Login option in home page... with signup....    2. User signup and enter into admin panel..    3. In admin panel he is able to see only posts and pages... nothing else...    4. **the most important thing >** **In pages he should able to see only those pages which he has published...** **not all users pages...**   5. He add new page... in new page **he add selected posts.**.. and publish...  ---- Now In home page I have define many buttons.. 6. here I want to add one more button of **logged on user.**.. When user click on that... it recognize **which user is logged on**... and **shows pages which are published by current user....** plz help......


Only show metabox when date-value in other metabox is over?

probably a weird question. I'm using the custom MetaBox and CustomFields Class by jaredatch on Github. I have this "event-date" metabox:               $meta_boxes[] = array(             'id'         => 'event_date',             'title'      => 'Event Date',             'pages'      => array( 'wr_event', ),             'context'    => 'normal',             'priority'   => 'high',             'fields'     => array(                 array(                     'name' => 'Test Date Picker (UNIX timestamp)',                     'desc' => 'field description (optional)',                     'id'   => $prefix . 'event_date',                     'type' => 'text_date_timestamp',                 )             ),         );      I have a second metabox called "event-review"               $meta_boxes[] = array(         'id'         => 'wr_event_review',         'title'      => 'Event Review',         'pages'      => array( 'wr_event', ), // Post type         'context'    => 'normal',         'priority'   => 'high',         'show_names' => true, // Show field names on the left         'fields'     => array(             array(                 'name'    => 'Event Review',                 'id'      => $prefix . 'event_wysiwyg',                 'type'    => 'wysiwyg',                 'options' => array( 'textarea_rows' => 5, ),             )         ),     );      I wonder if it's possible to show the event-review metabox only when the date is over? Something like…               if ( date('U') > date('U', $_POST["_wr_event_date"] ) ) {          $meta_boxes[] = array(             'id'         => 'wr_event_review',             'title'      => 'Event Review',      However I have no idea if this is even possible or even how I can get the current `event_date` that is in the input. Any thoughts on this?


Deleting users from front-end with wp_delete_user()

I would like admins to be able to delete users from the frontend with the click of a button. How could I use the wp_delete_users() function to create such a button on the frontend if the user ID is provided?


How do I highlight the menu for a child page?

EDIT: This used to be > How do I force a page to be `is_archive == true`? I was trying to solve the wrong problem. Instead of forcing the post/page to have a particular attribute, I should have looked at the classes applied to the menu item. The 'Blog' menu-item has the `current-page-ancestor` class applied to it. I can style the menu based on this. ORIGINAL QUESTION: I have my own theme where I created an `archives.php` template in order to have a page that tries to list the different ways to view archives and to give a place for users to browse the archives if they want to. I created a page using the WP admin page and I made it's parent the 'Blog' page. The 'Blog' page is the page where all my posts get emitted. I have a menu at the top and right now, every sub-page under the 'Blog' page causes the menu to highlight 'Blog' (this is the correct behavior). Specifically, the menu item has the style `current_page_*` applied to it. This doesn't happen when you load `blog/archives` (the template/page I created in the first paragraph). So when I click on the date of a blog post, it brings me to an archived post page it looks like this (note that the Blog menu item is highlighted): ![Archived Date Posts](http://i.stack.imgur.com/II4St.jpg) When I go to my archives, it looks like this (note that the menu item is NOT highlighted): ![Archives Page](http://i.stack.imgur.com/mA9hx.jpg) I looked at `$wp_query` to see what the difference was. I saw that `is_archive` or `is_home` was true in the cases where the menu-item was correctly styled. How do I force my page to be `is_archive == true`? I tried to insert a `$wp_query->set('is_archive', 1);` before the call to `get_header();` in my template but that didn't work. I also looked in the WP admin dashboard to see if there was something I could click to force the page to be considered an archive. Edit: To be clear, I'm looking for a WP solution. I know that I can hard-code the CSS to get the menu item to appear the way I want it to be, but that doesn't seem to be the right thing to do.


Is this correct get_template_part() in WordPress?

I just want to show the slider structure if it has posts... is this correct?               <?php     if ( (have_posts() ) {       get_template_part('slider');     }     ?>      I think that works but I'm not sure if is the correct way to do that..


Displaying Current Page Number Conditionally

I want to display the current page number in the site. I want it to be conditional though so that it doesn't show up on the home/front page. Using the code below, the page number is being displayed at all.               <?php          $pageNumber = (get_query_var('paged')) ? get_query_var('paged') : 1;         if(!is_front_page()) {             echo "
<?php echo '– $pageNumber –'; ?>
";         }     ?>


How to control manual excerpt length?

I have a website in which I need to control the displayed excerpt length. Some of the posts might have manual excerpt so I can't use the `excerpt_length` filter. I can, of course, use some kind of `substr()`, but was looking for a more elegant solution (if such exists).


How to check if an admin (sub)menu already exists?

The title says it all. I'm using WP 3.0.4


How do I add a custom sublevel menu specified in one directory to a custom top level menu specified in another directory?

I'm working on a plugin that constructs a top level menu and resides within its own directory in /wp-content/plugins. For example, the plugin looks like this:               function main_menu() {       if(function_exists('add_menu_page')) {        add_menu_page('Main Menu Title', 'Main Menu', 'administrator', 'main-menu-handle', 'menu-display');       }      }     add_action('admin_menu', 'main_menu');      I would like to build out additional menu items as plugins in the future so that they may reside in their own directory within /wp-content/plugins but will add themselves to this particular custom menu. Ideally, these new plugins would register themselves like this:               function register_submenu() {       if(function_exists('add_submenu_page')) {         add_submenu_page('main-menu-handle', 'Widget Title', 'Widget', 'administrator', 'widget-handle', 'widget_display');       }     }     add_action('admin_menu', 'register_submenu');      But I can't seem to make this work mainly because of the way WordPress uses the admin.php and the page query string parameter to navigate custom menus. Any insight?


Change tags url to search different site

** UPDATED BELOW ** Original Question: Anyone know how to create a function that changes the url of the_tags so that when one is clicked on, the function searches another domain? ** UPDATE ** IT WORKS! Thanks a million. What a star. :-) ONE MORE Q: I have discovered that the search the link is being sent to is complicated. The search term below is "dish": `http://www.myweb.com/search?I_DSC=dish&I_DSC_AND=t&_ACT=search` So the `$replace_with = 'http://www.myweb.com/';` needs to be replaced with: `http://www.myweb.com/search?I_DSC=` then the $link followed by `&I_DSC_AND=t&_ACT=search` the line: `http://www.myweb.com/search?I_DSC=$link&I_DSC_AND=t&_ACT=search` won't work. Is there some alternative? Thanks again - it is really appreciated.


How to make the Newsletter plugin visible to users with author privileges?

I'm using the Newsletter plugin and would like to make it accessible to author users. Is it possible to do so? If there's no solution for this I'll edit the editor role to make it a new author role.


scrape data from a website and post it on the blog (wordpress)

This could be in DocType But I'm looking for a software or just a plugin for wordpress. I wanted to fetch those data from a website and automatically post it on my blog (Wordpress powered). It doesn't have rss or api to get those data, so I need to manually copy and paste it one-by-one and post it on wordpress. Do you know an alternative options on my process? or you know a software or a plugin that does the job? Thanks!


Admin Pointers on a custom post type

Is it possible to leverage the Admin Pointers code (core, non published API) to create pointers on a custom post type? I was trying to use a plugin called Easy Admin Pointers, but it does not support pointers on a custom post type and I can't find any examples on the web that will work with a custom post type. Any ideas or tips? Thanks!


posts_per_page is not working

I have a query to display custom post type categories' posts, but I want to limit the `posts_per_page` to 8, so I am using the code below.   Please tell me, if I'm doing something wrong.               <?php      $args = array(         'post_type' => 'cs_album',         'posts_per_page' => 8,         'tax_query' => array(             array(                 'taxonomy' => 'cs_album_categories_tax',                 'field' => 'slug',                 'terms' => 'bollywood-songs'             )         )     );     $query = new WP_Query($args);     if( $query->have_posts() ) {         while ($query->have_posts()) :             $query->the_post();             ?>

<a href="<?php the_permalink();?>"><?php the_post_thumbnail(array(180,180)); ?>
<?php the_title();?>

             <?php         endwhile;     }     wp_reset_query();     ?>


Search Function on a plugin Wordpress User

I am using the plugin Wordpress User to display all the users in a single page. Now I am planning to create a search form which is not included in the plugin's function... But I'm having hard time to do it, that's why I am asking for a help now.   I pasted the code at pastebin because it's too long to paste here. The search form should work like "%like%" of SQL, meaning if I search "ad" it should display all the users that has "ad" on their username like "admin".


User fields that can be edited by administrator?

How can I add custom user fields for a user profile that an administrator can edit? I want the user to be able to see the value of the field on their profile, but I don't want them to edit it. How can I achieve this with WordPress?


get post attachments of a particular size

Is there a good way to know if a post has an image attachment of a particular size? I'm trying to fetch 5 random posts, but I only want results that have image attachments with a (custom) size of "extra_large". I'm trying:               $images = get_posts( array(       'post_type' => 'attachment',       'orderby' => 'rand',       'posts_per_page' => -1,     ) );     foreach ($images as $img) :       $image = wp_get_attachment_image_src( $img->ID, 'extra_large' );       if ( !empty($image) )         $carousel[] = array($img->post_parent, $image);     endforeach;      ...but I don't particularly like this as I have to grab every single image, and then loop through them to see if there's an extra_large version. I'm just using the first 5 items in $carousel[], but as my data set is very large there's a lot of un-needed processing. Also, I then have to do another call to get the parent from the ID. Is there a more elegant way to do this?


Dukapress jQuery("form.product_update").livequery is not a function

I have a wordpress site running Seduction theme and Dukapress. Once you add a product and reach the checkout page, the payment and discount button is not clickable. Chrome/Firebug throws the error jQuery("form.product_update").livequery is not a function The site is available at : http://sunshinemountainvineyard.com/wine-shoppe/ Can somebody help me out here... I have no clue what is happening. I updates livequery to the latest version 1.1.1 and still no effect


call my script only after loading UI library?

i want to add small effect (UI-jquery-draggable) to the navigation buttons in one of the WP slider plugins. what i did: 1 I have installed the slider plugin 2 know that UI is allredy registerd in wordpress but i have to call it (am i right?) so in my child theme functions.php,i added this:                  function my_enqueue() {        wp_enqueue_script( 'jquery-ui-draggable' );        }        add_action( 'wp_enqueue_scripts', 'my_enqueue' );             ?>      3 .the script itself is only one line so i included it directly in the my child theme page.php like this                      <?php if ( is_page(291) ) : ?>               <script>         jQuery( ".easingsliderlite-icon" ).draggable({ revert: true });              </script>            <?php endif; ?>      now what happens is that this line of script is loaded before the UI jquery library,when I look at the page in the browser (source code) the UI library is at the buttom of the page meaning its probebly loading after my script so the script doesnt work:( 4 i know you can create dependencies but only with wp-enqueue and only in function.php not for single line of script in page.php (am i correct?) ,


Recommendation for server config for Wordpress Staging servers

I've won a sweet managed VPS hosting package with Anchor (VPS D), and I'm looking for recommendations on how to set up the server. Anchor will setup apache or nginx for me - but which should I choose?! My considerations are:   * I'm concerned that there'll be a big configuration shift between my staging server and the clients' production servers: generally cheap shared hosting   * I'm hosting my own site here, so I want it fast (anything will be, compared to my old shared hosting!)   * my site, and my clients' are quiet low traffic sites   * I'll certainly be caching with WP-Supercache   * I use rewrites regularly for SEO purposes   * I'm familiar with .htaccess   * I won't have root access, but understand that I could edit non-root try files under nginx I'm leaning towards staying with apache, but want to be sure before passing up the opportunity to implement nginx, which seems superior for higher traffic setups. This question deals with hosting, but I'm interested in the experience of developers using WordPress in particular (and some business logic), so I believe it belongs here rather than on Serverfault. I appreciate any thoughts, Cheers, Tim


Custom Post Type Title by Slug

Is there a function which will get the title using the slug, For some reason I need to get the title of the custom post type using the slug Here is the PHP               if(isset($_GET["album"])){         $slug = $_GET["album"];         $slug = preg_replace("/[^a-zA-Z0-9-]/","", $slug);         $slug = esc_attr($slug);     }      I thought the function the_title would have worked but it won't because am using url variables to get the slug to another page. Here's what I tried               $page = get_page_by_path($slug);     $title = get_the_title($page->ID);


Add post tags to previously created custom post type

I am trying to add post tags to the custom post types bbpress creates, so that I can do some "related topics" kind of stuff. Is there a function that adds a post support like `'taxonomies' => array('post_tag')`, but to a post type that was previously created? My thought was I could just re create the custom post type on theme install or soemthing and hope it didnt mess anything up, but I really wanted to avoid doing that.


Best WP cache plugin for large site

I'm looking for WP cache plugin which is able to handle large number of pages. approx. 1 mil. I'm considering W3 total cache , WP super cache and few more , unfortunately I don't know which one is the best for large site. Can you suggest one ?