Using TinyMCE fiddle for node filter to add id attribute to anchors

I'd like to edit the code of the anchor-maker in TineMCE so it will paste into the code the following line: `<a name="#ANCHOR" id="#ANCHOR">` instead of: `<a name="#ANCHOR">` Where do I find a proper file with settings for this stuff? This is my code:               <script type="text/javascript">     tinyMCE.init({             // General options             mode : "textareas",             theme : "advanced",             plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",                  // Theme options             theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",             theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",             theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",             theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",             theme_advanced_toolbar_location : "top",             theme_advanced_toolbar_align : "left",             theme_advanced_statusbar_location : "bottom",             theme_advanced_resizing : true,         width: "100%",         height: "400",         init_instance_callback: function(ed) {           ed.serializer.addNodeFilter('a', function(nodes) {             tinymce.each(nodes, function(node) {                 node.attr('id', node.attr('name'));             });           });         }     });     </script>          <form method="post" action="dump.php">             <textarea name="content"></textarea>     </form>      I think I'm using TincyMCE Advanced version 3.5.8. All I see in the entire source code of the "Edit Post" page on the latest version of WordPress, is tinyMCEPreInit stuff... and I tried appending what's in the fiddle to the array:                   init_instance_callback: function(ed) {          ed.serializer.addNodeFilter('a', function(nodes) {            tinymce.each(nodes, function(node) {                node.attr('id', node.attr('name'));             });           });         }


Move jQuery to the bottom of the page whilst keeping the WordPress jQuery

I wish to move jQuery to the bottom of the page on my theme, to speed up loading times. Previously I was doing this by replacing it with Google's CDN version but I have been told that is a bad thing to do. How can I deregister and re-register the WordPress jQuery script and move it to the bottom without causing any problems?


Why do my offline development site and online live site behave differently?

I have two versions of my site - one live, the other a development site using DeskTopServer. I work on the development site - adding / editing posts etc. and making changes to the WP database, and playing around with templates, which are in a child theme. Periodically, I delete the live WP database and replace it with the development one. At the same time I ensure that the themes are in sync, adding any new templates and replacing amended ones. The only difference between the two sites (that I'm aware of) is that some plugins are installed and activated on the development site that are not present on the live site. These plugins only do things 'back-end' - i.e. to do with admin stuff to make my life easier when working from the dashboard. Although they're enabled when I export the WP database to the live site, once it's there they're automatically deactivated because they don't exist. This therefore shouldn't (and as far as I know to date doen't) affect how the live site works. I've just added a new custom taxonomy and a new template to display custom posts with that taxonomy. This works perfectly on the live site, but on the development site generates a 404 error. I've tried deactivating plugins on the development site that are not on the live so that the two should be completely identical, but that doesn't solve the problem. I have one plugin - active on both sites - which does occasionally lead to weird things happening, but it has a 'clear cache' facility which once cleared has always also cleared any problems in the past. The plugin is such an integral part of the site that I can't deactivate it without breaking most of the templates etc. (It creates custom post types, custom fields, etc.) If I switch to the standard theme, the development site still leads to a 404 error, the live site still works. The live page is here though as I can't also show the offline development page, the link probably doesn't help much! This isn't a catastrophe, at least it's the right way round. I can, if I have to, live with a slight hiccup on the development site, but it's bugging the hell out of me to not be able to work out why it should happen. Does anyone have any ideas?


wordpress qtranslate editor text is not working

I have installed qtranslate on my wordpress site, it all works fine, but sometimes the content editor does not show the text, When I force refresh the page a few times (Ctrl + r) **_eventually the text shows up_**. I was going to put images here to explain it but, this post already has the images I would put on, ( **however the questions differ** ) qtranslate is not working properly I have deactivated all of the plugins, and this problem it's still there, I have tried alot of other things to **Error** :               Uncaught TypeError: Cannot set property 'setup' of undefined     Line: 303, qtranslate_javascript.php          $q_config['js']['qtrans_hook_on_tinyMCE'] = "     qtrans_hook_on_tinyMCE = function(id) {          tinyMCEPreInit.mceInit[id].setup = function(ed) {         ed.onSaveContent.add(function(ed, o) {             if (!ed.isHidden())  {                 qtrans_save(switchEditors.pre_wpautop(o.content));             }         });     };     ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);         ed.render();     }     ";      **Console Logging ID:**               qtrans_textarea_content post.php:467     qtrans_textarea_acf_settings       **Other notes** I have also tried to add the `try{} catch(e){}` to avoid the script from breaking down, it does not seem to help at all, I have run out of options and I really need some help with this Cheers


Does Wordpress generate an automatic page for post formats?

I want a page to view only a specific post format (e.g. aside). Do I have to create my own page and run a custom query, or does Wordpress have an automatic page generated for me (like the categories)?


Custom meta box includes

I am having some problems including files for my custom meta boxes. I have a structure like so: post-meta.php   * cmb   *     * teaser_meta_box   *     *       * load.php   *     *       * initiate.php   *     *       * display.php   *     *       * save.php So within my post-meta.php I have the following includes:               // Load Meta Boxes     function add_custom_meta_box()     {         require_once dirname( __FILE__ ) . '/cmb/teaser_meta_box/load.php';     }     add_action('add_meta_boxes', 'add_custom_meta_box');          // Initiate Meta Box Fields     require_once dirname( __FILE__ ) . '/cmb/epteaser_meta_box/initiate.php';          // Display Meta Box Fields     require_once dirname( __FILE__ ) . '/cmb/epteaser_meta_box/display.php';          // Save Meta Box Fields     function save_custom_meta($post_id)     {     global $meta_fields_epteaser, $post; // Need to put name of each meta field here          // verify nonce       if (!wp_verify_nonce($_POST['custom_meta_box_nonce'], basename(__FILE__)))         return $post_id;     // check autosave       if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)         return $post_id;     // check permissions       if ('page' == $_POST['post_type']) {         if (!current_user_can('edit_page', $post_id))         return $post_id;     } elseif (!current_user_can('edit_post', $post_id)) {         return $post_id;     }              require_once dirname( __FILE__ ) . '/cmb/epteaser_meta_box/save.php';          }     add_action('save_post', 'save_custom_meta');      When I try this the meta boxes do not work how they should, however I do not get any errors saying includes are wrong etc. If I try to put the code directly into the file for initiating and displaying the meta box it then works. Any ideas as to why these two includes dont seem to work when included? Thanks Robert


How do I get the right permissions for WordPress running Apache on Debian

I'm trying to set up a WordPress site on a LAMP stack on Debian 6.0. From the WordPress documentation (and my experience on shared hosts) the correct permissions should be as follows > All files should be owned by your user account, and should be writable by > you. Any file that needs write access from WordPress should be group-owned > by the user account used by the webserver. I've managed to setup my server to have 755 permissions on all directories and 644 on all files. However, WordPress is still not able to create folders for uploads and upgrades. I'm guessing that this is because WordPress is not running as my user account, but as www-data and therefore it needs group write permissions. How do I make WordPress run as my account? Or am I on the wrong track? I'm new to this, having outgrown shared hosting and setting up my first VPS. I would really appreciate it if you could answer in as much detail as possible.


How to determine if a plugin affects your file-system

Anyone have a tried method of testing plugins to determine whether or not they make changes to your file-system, database, or both? I think this would be useful for larger websites where files may be handled in version control and changes to files on the server from a plugin need to be accounted for. Maybe plugin authors should be encouraged to be more explicit in how their plugin affects your site in the plugin descriptions, FAQs, etc...


Dynamic css file Server Error

my theme uses a dynamic css file 'custom-style.php' which is included through wp_enqueue_style(); This file includes some styles depending on the theme options (colors,fonts,...) On some installation there is no access to this file. Trying to access the file via the source code gets a "500 Internal Server Error". Changing file permissions to 777 does not solve it. **How can I solve this? Is there any other possibility to create dynamic css files?** Alternatively I could write a function to include this css in the head of the html but this is not the way I want go. There are some lines of css and I don't like css in html output.


Add <span> within the <li> output of <? wp_nav_menu() ?>

Im currently printing out:               <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>      Which outputs:

Frontpage

etc

      In my original HTML setup ive got an `<span>` within the `<li>` which looks like this:

                        Menu1
      Any ideas on how to adjust this?


Creating a menu that lists your custom post types with wp_list_pages()

I'm stumped on this, it is something I've gotten to work on other sites, but I must be overlooking something here. I'm trying to create a secondary menu for my custom post types ('staff') with wp_list_pages(). The function works fine if I'm tell it to return regular pages in the array parameter, but for some reason it doesn't return anything for my custom post type. Here is where I create the custom post type:                   $staff_args = array(         'public' => true,         'supports' => array(             'title', 'editor', 'thumbnail', 'custom_fields'         ),         'labels' => array(             'name' => 'Staff Pages',             'singular_name' => 'Staff Page',             'add_new' => 'Add new Staff Page',             'add_new_item' => 'Add new Staff Page',             'edit_item' => 'Edit Staff Page',             'new_item' => 'New Staff Page',             'view_item' => 'View Staff Page',             'search_item' => 'Search Staff Pages',             'not_found' => 'No Staff Pages found',             'not_found_in_trash' => 'No Staff Pages found in trash'         ),         'capability_type' => 'post',         'hiearchial' => true,         'rewrite' => array(             'slug' => 'team',         ),         'has_archive' => false,         'show_in_nav_menus' => true,         'query_var' => 'staff',         'menu_position' => 6,         'menu_icon' =>  $url . '/custom-plugin/standalone_page.png'     );          register_post_type('staff', $staff_args);      Here is where I run wp_list_pages():                   $secondary_menu_args = array(         'depth'        => 0,         'show_date'    => '',         'date_format'  => '',         'child_of'     => 0,         'exclude'      => '',         'include'      => '',         'title_li'     => _('Staff'),         'echo'         => 1,         'authors'      => '',         'sort_column'  => 'post_title',         'link_before'  => '',         'link_after'   => '',         'walker'       => '',         'post_type'    => 'staff',         'post_status'  => 'publish'     );      and
         <li <?php if($postID == $post->ID) echo 'class="current_page_item"'; ?>><a href="/<?php echo $menu_url; ?>"><?php echo $menu_title; ?>
         <?php wp_list_pages($secondary_menu_args); ?>
      Thanks in advance.


Integrating Tumblr with Wordpress

I have a project where I have to integrate my clients Tumblr into a Wordpress page. The idea is on the category page, the posts should show up in a Masonry format. Once you click a post it goes to the Tumblr format (Users like this, Users reblogged this). How will I go about doing this preferably without a plugin. Thanks!


Programatically add options to "add new" custom field dropdown

How can I add pre-defined options to the "add new" custom field dropdown? ![enter image description here](http://i.stack.imgur.com/WhvMS.png) Here's two examples of automatically adding and showing new custom fields:   1. WordPress: Adding Default Custom Fields on New Posts   2. Auto create custom field That's close to what I want to do; my goal is to add pre-defined options to the "add new" custom filed dropdown, but not have them show as fields until the blogger adds them. I'd like to know how to do this without using a plugin.


Are Drop-ins harmful for wordpress website?

In my wordpress plugins there is a new section, named Drop-ins. I am confused, these drop-ins can harm my website. Actually I am not sure. Can you help me, please. Are the Drop-ins are harmful? If harmful, how can I solve?


How to get Facebook comment plugin in blog?

I am trying to use Facebook social plugin to my blog. I tried few Wordpress plugins but getting error in it. Lastly, I tried using Flexo Facebook Manager(http://www.flexostudio.com/flexo- facebook-manager.html). But the problem still persists. The Facebook commenting tool is not coming in my blog. When clicked to Open graph it shows this error. Errors That Must Be Fixed Object Invalid Value: Object at URL 'http://buggingweb.com/2012/01/operating- system-in-your-browser-linux/' of type 'website' is invalid because the given value 'User ID' for property 'fb:admins' could not be parsed as type 'fbid'. Missing Required Property: The og:url property is required, but not present. Missing Required Property: The og:type property is required, but not present. Missing Required Property: The og:title property is required, but not present. Am not able to fix it. Thanks!


Add class to Categories Widget

I have a few default widgets which I am using in a custom sidebar and I'd like to edit its output in my functions.php file. Currently the categories widget and blogrolls are generating an unordered list of links as such:

     Uncategorized

      I would like to somehow pass a class name into the unordered list itself to something along the lines of:
...
      I am just learning about using filters within the functions.php file and figured this was how I need to go about it but don't really know how.. Is this possible? How could I find out how to do something like this? -- Bruno


Sending all emails using SMTP

I tried using both Configure SMTP and WP Mail SMTP to send all domain emails through my donotreply Google Apps email address, but neither plugin worked. Attempting to send test emails through either results in the error `SMTP -> ERROR: Failed to connect to server: Network is unreachable (101)`. I entered the information correctly (smtp.gmail.com, port 465 OR 587 [tried both], SSL [also tried TLS]), but it cannot connect. Is there something I may need to configure with my host or on the Apps dashboard to make it work properly? I had it working with this Google Apps account on a different domain with my same host, but that WordPress installation has been deleted.


Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?

I have on many occasions used `wp_enqueue_script` to pass some 'query variables' to scripts like this:               function my_enqueue_scripts(){         $tempurl = urlencode( get_bloginfo( 'template_url' ) );         wp_register_script( 'somescript', get_bloginfo( 'template_url' ) . '/js/somescript.php?url=' . $tempurl );         wp_enqueue_script( 'somescript' );     }     add_action( 'wp_enqueue_scripts', 'my_enqueue_scripts' );      And I am just wondering if this is a 'best practice' or 'safe' to do, I don't see why it wouldn't be but I guess you never know until you ask. I'm just wondering what are the downsides of doing this, or even if there is an alternative/better way to do this. I also notice if I pass more than 1 variable, only the first one will actually be retrievable in the script. Is there something I need to do to make that work? Some advice would be great, thanks.


edit comments capability for authors

I am using wp site where registered users have authors roles. I want authors to have permissions to **edit their own comments**. Now only admin user have capability to edit comments and even editors do not have this capability. I tried plugins like Role Scoper or Members but they don't have this capabilities


How to use Greek characters/letters in a query?

I have a problem with Greek characters in a query. Here is the code Using the Greek characters in the 'meta_value' => 'Ναι' the query can't work, because of the language. How can i make it work?


Use shortlink as permalink

I'm using Url shortener plugin with bit.ly API. When I use the bit.ly url, it's redirecting to my Wordpress permalink. How Can I use the bit.ly all the time ? I want the bit.ly url become the permalink or my posts. Thank you so much.


How to order posts of a custom post type by date DESC in dashboard Admin?

I created a new post type named "Video". When I create post for the post type, posts is ordered by `title ASC`. **Is it possible to order posts by date DESC please ?**               register_post_type('Videos', array(         'labels' => array(             'name' => _x('Videos', 'post type general name'),             'singular_name' => _x('Video', 'post type singular name'),             'add_new' => _x('Ajouter', 'Video'),             'add_new_item' => __('Ajouter une video'),             'edit_item' => __('Éditer une video'),             'new_item' => __('Nouvelle video'),             'view_item' => __('Voir le lien de la video'),             //'search_items' => __(' Video'),             'menu_name' => 'Video'         ),         'public' => true,         'show_ui' => true,         'capability_type' => 'post',         'hierarchical' => true,         'rewrite' => array('slug' => 'video'),         'query_var' => true,         'supports' => array(             'title',             'editor' => false,             'excerpt' => false,             'trackbacks' => false,             'custom-fields',             'comments' => false,             'revisions' => false,             'thumbnail' => false,             'author' => false,             'page-attributes' => false,         ),         'taxonomies' => array('post_tag')        )      );


Enqueue script inside IE conditional comments

I'm trying to include selectivizr.js inside conditional comments. What am I doing wrong here?               <!DOCTYPE html>     <html class="no-js" <?php language_attributes(); ?>>     <head>       <meta charset="utf-8">       <meta http-equiv="X-UA-Compatible" content="IE=edge">       <title><?php wp_title('|', true, 'right'); ?></title>       <meta name="viewport" content="width=device-width, initial-scale=1">              <?php wp_head(); ?>            <!--[if (gte IE 6)&(lte IE 8)]>       <?php         function blarg(){           wp_enqueue_script('selectivizr', get_template_directory_uri() . 'assets/js/vendor/selectivizr.js');         }         add_action('wp_enqueue_scripts', 'blarg', 101);       ?>       <![endif]-->            <link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> Feed" href="<?php echo esc_url(get_feed_link()); ?>">     </head>      Nothing appears between the comments. I'm using the Roots theme. They have a scripts.php where other scripts are queued. If I put the `wp_enqueue_script()` in that file it works, but then I can't do the conditional comments. UPDATE: OK, the real challenge seems to be getting a script inside conditional comments (or any other particular HTML) will still using the queuing system. What is the best way to do that? Or is there a way?


Remove all RSS from wordpress site

I have a site with copyright content and do not want any RSS on it! I cannot have the content distributed legally. Specifially all categories have a default /feed that can be added to the end of the URL. I just found google was indexing this feed, but more importantly anyone who knows wordpress structures can figure it out anyway. Is there a way to remove RSS functionality across all categories (/feed)? I looked around the internet and there are older solutions for removing one category found here: http://wordpress.org/support/topic/remove-certain- categories-from-site-rss-feed A more indepth question is how to completely remove all RSS. This solution How to remove feeds from WordPress totally? is not very sound from a maintenance perspective as quoted "It's also super hackish and will probably break at some point in the future". Also I'm not sure how this would impact SEO to have an active link go to your homepage. I would prefer that the links not exist versus doing a 302. Is this possible? Is editing the .htaccess to redirect the best solution? This is what I had in mind but it seems messy.


WordPress plugin changelog RSS

Is there a way to access a WordPress plugin's changelog RSS feed?


Differnt page template for page 2 of blog feed

Is there a way I can use one page template (A custom page template for example) for the first page of my blog and then another template (Index.php for example) for page 2, 3, 4, etc.?


List users with the most posts in the last 30 days

I'm trying to create a MySQL query to display a descending list of users with the most number of posts over the last 30 days. This is not working with me:               $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";     $top_users = $wpdb->get_results("SELECT COUNT(ID) AS post_count, post_author, post_date, user_id FROM $wpdb->posts, $wpdb->usermeta WHERE $wpdb->posts.post_author = $wpdb->usermeta.user_id AND post_type = 'post' AND post_status = 'publish' $where");


Query for all themes?

I am running Wordpress 3.1.3 Multisite and would like to find out all of the currently-activated themes. I know there is a feature in the admin to see plugins per-blog, but I have not been able to see a similar feature for themes.


Add extra menu to theme

What's the best way to add an extra menu location to a theme that already has one? I want to add an extra menu in a child theme of a theme that currently has a single custom menu (what is the correct terminology here?!). Do I just use `register_nav_menu()` to create an additional menu?


Featured Image VS Post_thumbnail -- has_post_thumbnail lies?

OK, I got a custom post type with thumbnail enabled which adds the "featured images" panel to that post-type just fine, but in my template when I do               if ( has_post_thumbnail() ) {         the_post_thumbnail();     } else {         echo 'none';     }      it just shows 'none' on each one even though I have a featured image set... I have `add_theme_support('post-thumbnails',array('post','custom_post_type'));` so it's supported by the theme but `has_post_thumbnail` always returns false what's going on here??? My template is : archive-custom_post_type.php :               <?php     $loop = new WP_Query(array( 'post_type' => 'clients', 'posts_per_page' => -1 ));     if($loop){     ?>     <ul>     <?php     while ( $loop->have_posts() ) : $loop->the_post();     ?>             <li>                 <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >                 <?php                      if ( has_post_thumbnail($post->ID) ) {                         the_post_thumbnail('thumbnail');                         echo get_post($post->ID)->post_excerpt;                     } else {                         echo 'broken ::' . $post->ID;                         echo get_post($post->ID)->post_excerpt;                     }                      ?>                 </a>             </li>     <?php      endwhile;     //wp_reset_postdata();     ?>     </ul>     <?php     }     ?>


problem with ajax and the path to the php page

i would like to call a php page from an Ajax method : the alert works fine, the code as well has been tested outside of wordpress, but here it seems that the php page is never called. I found some articles, among them : How to manage ajax calls and JSON in wordpress but i get more confused. Can you please tell me what should i do here? (with "diapo.php" it doesn't work, and like that neither) here is the call with jquery :                       $('.sous-cat').find('img').click(function(){                     var alt_p = $(this).attr('alt');                     //alert(alt_p);                          $.ajax({                         type: "POST",                         url: "<?php bloginfo( 'template_directory' ) ?>/diapo.php",                         data: {p:alt_p},                         success: function(data) {                             alert(data);                         }                     });                     return false;             });      and the php page for now :                       <?php             /*             $p = $_POST['p'];             query_posts( 'cat=3&p=$p' );             while (have_posts()) : the_post();                 $result = the_post_thumbnail('normal');             endwhile;             wp_reset_query();*/                  echo '$result';                  ?>      Thanks for your help


Theme Options page with tabs

I have a theme that I'm developing from an HTML template I have. I'm also designing an options page along with a plethora of plugins built-into the theme itself. I've chosen a tabbed interface and I'm trying to learn how to use WordPress' Settings API. I'm using a class structure for the theme's functions. The following is the declaration of registering settings and whatnot.               public function __admin_init()     {         register_setting( 'cncfps_twitter', 'cncfps_twitter_options', array( &$this, 'wp_cncfps_twitter' ) );         add_settings_section( 'cncfps_twitter', 'Twitter', array( &$this, 'wp_cncfps_twitter' ), 'cncfps' );         add_settings_field( 'cncfps_twitter_consumer_key', 'Consumer Key', array( &$this, 'twitter_consumer_key' ), 'cncfps', 'cncfps_twitter' );         add_settings_field( 'cncfps_twitter_consumer_secret', 'Consumer Secret', array( &$this, 'twitter_consumer_secret' ), 'cncfps', 'cncfps_twitter' );         add_settings_field( 'cncfps_twitter_apikey', 'API Key', array( &$this, 'twitter_apikey' ), 'cncfps', 'cncfps_twitter' );     }          public function wp_cncfps_twitter()     {         // TODO: wut. ?!?!         echo "what is this?";     }          public function twitter_consumer_key()     {         echo "Hello";     }          public function twitter_consumer_secret()     {         echo "World";     }      **When I want to display the fields as shownhere, I don't see a thing. The following is how I attempt to display them. I did follow a few tutorials but it's just not clicking in my brain for some reason.**               settings_fields('cncfps_twitter');     do_settings_sections('cncfps_twitter');      ![enter image description here](http://i.stack.imgur.com/2zZFW.png)


Custom post type archive 404's with paginate_links

im using **paginate_links function** to create pagination on my custom post type archives, no matter what i do im hitting 404 errors when going to view page 2 (ie clicking to go on one page in the pagination trail). I've checked and researched and dont seem to be getting anywhere with it all. heres my before the loop query inside archive-MY_CUSTOM_POST_TYPE.php:               <?php          global $wp_query;          $args = array_merge( $wp_query->query, array( 'post_type' => 'sales', 'posts_per_page'  => 1, ) );          query_posts( $args );               if (have_posts()) :     while (have_posts()) : the_post();        and lower down after the loops endif and above wp_reset_query i have               <?php endif; ?>

          <?php      global $wp_query, $wp_rewrite;     $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] :    $current = 1;          $pagination = array(     'base' => @add_query_arg('page','%#%'),     'format' => '',     'total' => $wp_query->max_num_pages,     'current' => $current,     'show_all' => true,     'type' => 'plain'     );          if( $wp_rewrite->using_permalinks() )     $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );          if( !empty($wp_query->query_vars['s']) )     $pagination['add_args'] = array( 's' => get_query_var( 's' ) );          echo paginate_links( $pagination );     ?>
        On my loop-index.php this works with no problem, but on a loop inside Custom Post Type its a no go, i have no clashes with duplicated slugs as i have read that this can be an issue, so im taking it that it is something to do with how im querying the posts before the loop, any pointers? regards   Martin


how to add multiple menu in custom menu widget? i am using this theme. I am new to wordpress and i am unable to sort it out.


Woocommerce get cart total price in a number format

Is it possible to get the cart total price without any markup. So without the € symbol? Right now I'm getting the amount with:               $totalamount = $woocommerce->cart->get_cart_total();        this will give €16.50 I tried this also:               $totalamount = number_format($woocommerce->cart->get_cart_total(), 2, '.', '');      But this always gives 0.00 Is there a woocommerce get function that will give a number format of the total cart price? Thanks!


TwentyTwelve child theme style.css?ver=3.8.1

I've created a child theme of TwentyTwelve. On the front end, the `<head>` section contains the line: > http://example.com/wp-content/themes/childtheme/style.css **?ver=3.8.1** Any changes I make to `childtheme/style.css` are not reflected in http://example.com/wp-content/themes/childtheme/style.css?ver=3.8.1 I've performed a search in TwentyTwelve and childtheme, and can't find any instance of enqueue_style which contains a version of 3.8.1, or any hard coding of style.css?ver=3.8.1 How do I either:   * Update style.css?ver=3.8.1   * or force the site to use http://example.com/wp-content/themes/childtheme/style.css instead of .../style.css?ver=3.8.1 Thanks **Update** : I added the following to .../childtheme/functions.php               function add_require_scripts_files() {      wp_enqueue_style('layout', get_stylesheet_directory_uri().'/style.css', array(), '1.0.0', "all");             }          add_action( 'wp_enqueue_scripts', 'add_require_scripts_files' );      But the front end contains code:               <link rel='stylesheet' id='layout-css'  href='http://example.com/wp-content/themes/childtheme/style.css?ver=1.0.0' type='text/css' media='all' />     <link rel='stylesheet' id='twentytwelve-style-css'  href='http://example.com/wp-content/themes/childtheme/style.css?ver=3.8.1' type='text/css' media='all' />      style.css?ver=3.8.1 is overriding style.css?ver=1.0.0 **Update 2:** In /childtheme/functions.php, I replaced               function add_require_scripts_files() {      wp_enqueue_style('layout', get_stylesheet_directory_uri().'/style.css', array(), '1.0.0', "all");             }      with               function add_require_scripts_files() {      wp_enqueue_style('twentytwelve-style', get_stylesheet_directory_uri().'/style.css', array(), '1.0.0', "all");             }      which meant the style.css?ver=3.8.1 was not loaded.


using hyperlink in wordpress plugin

Im developing wordpress plugin . I added a plugin to the admin menu . After clicking on the plugin is displayed user login. (I used parameter-magic func from the wrapper function `add_management_page()` to loading page- where is located user login). I dont know if its good solution but this isnt my problem . Under user login I have hyperlink- **_register new account_**. After clicking on this hyperlink I want to see only registration form in main window. I wrote my problem on stackoverflow http://stackoverflow.com/questions/22416804/redirect-to-wp-admin-after-using- hyperlinks-in-wordpress/22418377?noredirect=1#22418377. but this solution didnt help me . Im still redirect to wp-admin `php_project/wp- admin/tools.php?page=my_submenu_handle` Thanks for answer its for me very important. * ** _EDIT:_** *Im using this code. but this code wrong. I need only load page(content of file.php) into same page after clicking on this link. This code change url to plugin url .                <a class="hyper" href="<?php plugins_url('my_plugin/file.php') ?>">Register new account      RE:EDIT I use this code `<a class="hyper" href="<?php bloginfo('url') ?>/wp- content/plugins/nameplugin/file.php" target="_self">new register account </a>` but how can i open this file.php in wordpress because its opened in new window


add javascript files only when plugin is called?

I'm writing a WP plugin that might be called on any page using a simple function call:`getDeck(Deck_id)` - and i'd like to add my javascript files on pages where this function is called ONLY, as opposed to having it on every page... What do I do?


Non-threaded comment replies with link to original comment

I'll explain what I am trying to accomplish. I would like to have regular non-threaded (flat/classic) comments with a reply link to each comment. When someone replies to a comment the reply comment will end up at the top (or bottom) as the latest comment just as it would in the default non-threaded comments, but unlike the default non-threaded comment the reply should display a link to the original comment/author. There is a proposed solution over at the wordpress forum: http://wordpress.org/support/topic/reply-to-link-for-chronological-non- threaded-comments I just don't get it to work. I am not sure in what files the poster is placing the different pieces of code. I tried to use the code and hook a function to comment_post:               add_action('comment_post', 'print_reply_link', 10, 2);          function print_reply_link( $comment_id, $approved ){       if( $approved ){         $comment = get_comment( $comment_id );         if ( $comment->comment_parent ) {         $parent = get_comment( $comment->comment_parent );         $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );         printf( ' in reply to %2$s', $parent_link, $parent->comment_author );         }        }     }      This returned a blank page with "in reply to authorname". After reloading the post a reply comment shows up correctly but without any link to the original comment My coding skills are really very basic so I have no good idea how I should proceed. Would be very grateful for any help.


Max length of meta_value

I was wondering if anyone could tell me the max length of the meta_value field for posts and user meta. Thanks!


Would there be anything stopping me from removing both wp_head and wp_footer?

Some plugins rely on either wp_head or wp_footer or both to introduce their own stylesheets and JavaScript. Those scripts take time to load and slow down my website. Therefore, I would like manually control all the scripts on my site. I'm thinking of removing wp_head() and wp_footer() entirely. Would the sky falls down if I do so? I've read this.


menu hierarchy not working

I have created a theme from scratch and was using a custom menu with no problem. Somehow, I lost the ability to create a hierarchy in the menu -- all menu items show up at the same level. I have tried editing the order on the pages menu and I also have the correct Parent there. When I try to manipulate the order in the Appearance Menus page, I move the item to the second level. It looks fine but once I save it, the item goes back to the top level. Do you have any idea what is causing it? The other thing is that I have been using this code on several sites with no problem. It is only one implementation that is tripping me up. The code I use to call the menu is the following:               <ul> <?php wp_nav_menu( array( 'menu' => 'Main Nav') ); ?> </ul>


Trying to WP_Query a category

I am trying to output all the posts of a certain category but all that is happening is The page content is being outputted no posts? template page               <?php     /*     Template Name: Blog     */     ?>          <?php get_header(); ?>

                                       <?php $query = new WP_Query( 'category_name=blog' ); ?>                                        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                                  <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">
<?php the_title(); ?>

<?php                         printf(__('Posted <time class="updated" datetime="%1$s" pubdate>%2$s</time> by %3$s.', 'bonestheme'), get_the_time('Y-m-j'), get_the_time(__('F jS, Y', 'bonestheme')), bones_get_the_author_posts_link());                       ?>

                                     <?php the_content(); ?>

<?php the_tags('' . __('Tags:', 'bonestheme') . ' ', ', ', ''); ?>
                                                                             <?php comments_template(); ?>
                                   <?php endwhile; ?>                                    <?php else : ?>

<?php _e("Oops, Post Not Found!", "bonestheme"); ?>

<?php _e("Uh Oh. Something is missing. Try double checking things.", "bonestheme"); ?>

<?php _e("This is the error message in the page-custom.php template.", "bonestheme"); ?>

                                  <?php endif; ?>
                               <?php get_sidebar(); ?>

           <?php get_footer(); ?>


Tabbed navigation in widget backend

I have just created a widget and i am trying to implement a tabbed navigation in the wp backend but it just seems more difficult than writing all the php code! The categories metabox is an example of what i am trying to achieve: https://docs.google.com/file/d/0BwQTBas8n_7iOFllSG5QOFg5MTQ/edit?usp=sharing


Location of theme options page menu icon

Hi this may look a little silly question but can someone let me know where is the location for theme_path? is it inside my own theme or very top level of the directory?               'menu_icon'  => theme_path . '/images/product-icon.png',       **A** : www.awebsite.com/images/product-icon.png   **B** : www.awebsite.com/wp-content/themes/mytheme/images/product-icon.png


woocommerce-how can i get all products by their groups!

i have a wordpress site that uses woocommerce as an online shop plugin. what is want is listing all products in my woocommerce site grouped by their categories, how can i do this? i want the list sorted ASC and i want all empty categories hidden! thanks in advanced!


Double slash in upload URLs

Wordpress is automatically adding a trailing slash to my custom upload folder in Settings » Media. This is causing upload URLs (for example, for images uploaded through the Media Uploader) to get a double slash, as in example.com/files//myfile.jpg Here's what happens:   1. I go to Settings » Media   2. Under **Uploading Files** in the field labeled **Store uploads in this folder** , I type in `files`, with no trailing slash. (This is consistent with the example listed next to the text field: `Default is wp-content/uploads`)   3. Hit "Save Changes"   4. The page reloads, and the upload folder is now `files/`, with a trailing slash. I have tested other URLs (`files/myfiles`, `uploads`), and Wordpress always adds a trailing slash when I hit save. I have **Organize my uploads into month- and year-based folders** unchecked. What gives? How do I fix this? I am on 3.3.1, but this was happening in 3.2 as well.


Contact form 7 post loop

I am using contact form 7. It says to use the following               [contact-form-7 id="23" title="Contact form 1"]      In my post or page, I have placed it in my post. Now I am using this code to grab the post a spit it out on my custom-page.php file. However it just spits out the title of the page the date, and the content "posted in" No form to be seen. Also what's the best way to put a contact form on a page and be able to move it around with css and such with contact form 7.                      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                 <?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?>
        <?php the_content(); ?>
                 <?php endwhile; else: ?>
Sorry, no posts matched your criteria.
                 <?php endif; ?>


How to gain access to each menu item in wordpress?

I have some menu items in a menu at location "main-menu". By using `wp_nav_menu( array( 'theme_location' => 'main-menu' ) );` , i get all the 13 items in a div. Now i just need to show 10 menu items in present div and the remanining in other div (say id="new") just adjacent to it. Again if the div with id "new" has 10 menu-items in it, again a new div will be created and the remaining items are shown in it. So is there a way to access the array that contains these menu-items? Please help.


Getting posts from some categories plus some individual posts

I want to display list of all posts under a couple of categories and some individual posts. If I use the following code, it does not return anything, as it looks for those individual posts in the categories.               query_posts( array ( 'category__in' => array( 28, 34 ), 'post__in' => array( 8200, 3581, 38, 1562, 7613 )) );       How can I get list of all posts under a couple of categories plus some individual posts found under other categories?


How activate custom plugin in WordPress on virtual box “host only adapter” and no internet connection?

I'm running WordPress in Virtual Box CentOS 6.5 on a laptop without an internet connection. I am able to get the CMS in a web browser by running the virtual box using a "host only adapter". However, when I try to activate my plugin, it throws an error:               WordPress could not establish a secure connection to WordPress.org      Why does it even need to connect to WordPress.org? How do I stop this error and activate my plugin? It appears to have activated the plugin if I go back to the main CMS page. But why does the error occur at all?


jQuery is not defined, working on local server but not online

here's my problem: Chrome console:                   Uncaught ReferenceError: jQuery is not defined jquery-ui.min.js:6         Uncaught ReferenceError: jQuery is not defined slider.js:1         Uncaught ReferenceError: jQuery is not defined functions.js:1         Uncaught ReferenceError: jQuery is not defined menu_mobile.js:1         Uncaught Error: Bootstrap's JavaScript requires jQuery       I enqueue my scripts before wp_head() in header.php:               <?php             function frontEnd_scripts() {                 wp_enqueue_script("jquery");                 wp_deregister_script('jquery.mobile');                 wp_register_script('jquery.mobile', ("//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.js"),array('jquery'));                 wp_enqueue_script('jquery.mobile');                 wp_register_style('jqm_css',('//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.3/jquery.mobile.min.css'));                 wp_enqueue_style('jqm_css');                  }             add_action('wp_enqueue_scripts', 'frontEnd_scripts');          ?>         <?php wp_head(); ?>         <!-- My custom scripts here -->      I tried to enqueue my custom scripts with no results. js files wrapped like this:               jQuery(document).ready(function($j){         // Do some stuff     });      Everything works fine on a local MAMP server but it does not work on web server and the only way I can make it work is to hardcode the jQuery script tag before the wp-head(). Is it possible that my online version of wordpress don't have jQuery included or removed ? Thanks !


Assign classes to Custom fields

I have a post with 4 custom fields, and I am using `the_meta( )` to display these.   I want to add an image to the list items, but a different image for each item eg. key "Client" will have a small image of a person, key "Date" will have an image of a calendar... The only way I can think of doing this is to somehow give each key a class and then use CSS to add a background image to the list-item. How should I do this?


Where is the WP_Query instance instantiated (when working with themes)?

This may be a very basic question, but I could not find the answer. The following documentation http://codex.wordpress.org/Class_Reference/WP_Query shows the code               // The Query     $the_query = new WP_Query( $args );      but when I look at `wp-contents/themese/twentytwelve/index.php` I see calls to `have_posts()` and `the_post()` inside the loop with no reference to `$the_query` as though `index.php` was included from inside a `WP_Query` instance. Can someone please explain what is happening here? Thanks.


is_tax() function not working as expected

I'm facing an issue with the is_tax() function. I'm a class method that fetches a specific custom post types. These custom post types have taxonomy related custom fields (among other custom fields). If in these custom fields I find, for instance, a value for the category term "discografia", I want my method to return this custom post type if I'm currently seeing the archive page /category/discografia. This is an excerpt of my code:               // The Query     /** @var $query WP_Query */     $query = new WP_Query($query_args);          $results = false;     // The Loop     if ($query->have_posts()) {         if (!is_home() && !is_front_page()) {             $posts = $query->get_posts();             foreach ($posts as $post) {                 $add = false;                 //ServiceBoxes::getBox returns the $post object as Array_A                 //and adds a new key "meta" with the custom fields I want to use                 $box = ServiceBoxes::getBox($post->ID);                 if (is_archive()) {                     if (isset($box['meta'][self::$prefix]['taxonomies'])) {                         foreach ($box['meta'][self::$prefix]['taxonomies'] as $tax => $terms) {                             if ($terms) {                                 if (is_tax($tax, $terms)) {                                     $add = true;                                 }                             }                         }                     }                 }                 if ($add) $results[] = $box;                  }         } else {             $results = $query->get_posts();         }              return $results;     }     return false;      Some clarification about what happens here: 1. $box['meta'][self::$prefix]['taxonomies'] actually returns an array with "category" as key and an array of terms (including "discografia") 2. The url /category/discografia/ actually returns a series of posts 3. is_tax($tax, $terms) returns false 4. Also is_tax('category', 'discografia') returns false I suspect that the instance of WP_Query inside my method is overriding the global query, but I don't see why: it's a new instance, there is no reason for is_tax() to get confused. However, with some step-by-step debugging here's what happens in is_tax when called as `is_tax('category', array('discografia'))`:   * `$wp_query->is_tax( $taxonomy, $term )` is called by `is_tax()`   * in `$wp_query->is_tax()`, `if ( !$this->is_tax )` returns false I've been able to reach this point: after that, I don't know what else I can do to understand why the is_tax property is not set as expected. With the debugger on and some variables in the watch list, here is what I can see when calling "/category/discografia/" (an archive page that, I repeat, returns posts): http://www.evernote.com/shard/s6/sh/88f05447-edff-40c7-9670-902f0a92bc62/b50a28d39c9e55c7d404f912175975a4


Sub 'Page' Child Menu Order

I cannot seem to get the order of my sub-page Menu items in the correct order. They will only display in alpha or numerical order - even if I specify the menu order. To be clear - I am not referring to the 'Admin' page order but the order of the drop down page menu. The issue with numbering when you go over 9 items is the 10 appears under 1 (i.e. 1,10,11,12,13,14,15,16,17,18,19, 2,21, 23 etc). ![Menu Order](http://i.stack.imgur.com/WWtrU.jpg) Can anyone advise please as I have several instances of where this needs to be fixed up! Thanks. Jon


404 Error Problems with sCategory Permalink plugin

Seems throughout the day my blog seems to show 404 page errors with no pattern. I have to manually change the permalinks from /blog/%scategory%/%postname%/ to default, then back to /blog/%scategory%/%postname%/ in order to fix the permalink issue. This has been a problem for us for the past six months, and our site gets 10k views a day. While that is not a lot, it does give us a huge problem when at certain periods of the day we have a huge issue where none of our Posts work, yet Pages continue to work fine. I have extensive conversation on this issue at this post (http://stackoverflow.com/questions/3506130/wordpress-permalinks-not-staying) where I have narrowed a few things down, and at this point I believe the sCategory Permalink is the issue. I need help understanding what is causing this issue, and more importantly fixing this so it never happens again. ANY help would be greatly appreciated.


Custom Post Type Rewrite Rule for Author & Paging?

I'm using WordPress 3.0.1 and I have made custom post-type called `'dienasgramatas'`. My plugin also makes custom rewrite rules for displaying all posts from this post type and even custom permalink structure to query posts with this post type coming from defined author, but I can't create rule for pagination: This is the one that works:               $new_rules['dienasgramatas' . '/([^/]+)/?$'] =        'index.php?post_type=dienasgramata&author_name=' . $wp_rewrite->preg_index(1);      It gives this rewrite rule:               [dienasgramatas/([^/]+)/?$] => index.php?post_type=dienasgramata&author_name=$matches[1]      But this one:               $new_rules['dienasgramatas' . '/([^/]+)/page/?([0-9]{1,})/?$'] =        'index.php?post_type=dienasgramata&author_name=' . $wp_rewrite->preg_index(1).        '&paged=' . $wp_rewrite->preg_index(2);      Outputs this (faulty) rewrite rule:               [dienasgramatas/([^/]+)/page/?([0-9]{1,})/?$] =>        index.php?dienasgramata=$matches[1]&paged=$matches[2]      As you can see, `post_type` is ignored and this rewrite rule does not work as it should. Can someone tell me why it's not working or how to make it right? filter for funcion:               add_filter('generate_rewrite_rules', 'add_rewrite_rules');      Full function is as follows:               function add_rewrite_rules($wp_rewrite) {          $new_rules['dienasgramatas' . '/([^/]+)/?$'] = 'index.php?post_type=dienasgramata&author_name=' . $wp_rewrite->preg_index(1);     $new_rules['dienasgramatas' . '/([^/]+)/page/?([0-9]{1,})/?$'] = 'index.php?author_name=' . $wp_rewrite->preg_index(1) . '&paged=' . $wp_rewrite->preg_index(2) . '&post_type=dienasgramata';          $wp_rewrite->rules = array_merge($new_rules, $wp_rewrite->rules);     return $wp_rewrite;      } Basic need is that i want to go to               www.example.com/dienasgramatas/admin/page/2      and get posts by 'admin' with post_type = 'dienasgramata' and second page (e.g. 10 post offset). Rewrite rule without page/2 works fine. Maybe it's a regex issue or query vars issue or how rewrite rules are assigned. live site example: `http://dev.fiicha.lv/jb/dienasgramatas/juris/` - works ok `http://dev.fiicha.lv/jb/dienasgramatas/juris/page/2/` - does not work at the bottom there are all rewrite rules and query vars


What are all the Properties of the WordPress Post Object?

_( **Moderator's note:** Title was originally "What are all the variables in the wordpress post object?")_ Does anyone know the variables that are stored in the WordPress Post object?


Force Cron to run only on one server

Given a site running on server A and server B with a load balancer, shared database/etc, and a regular wp-cron task, how would I make sure that wp-cron only runs on server A, never on server B?


horizontal menu / 4-level depth

I need a 4-level horizontal menu. which is the best way to build, organize and style it? "Active" tabs should be highlighted.               <?php wp_nav_menu( array( 'theme_location' => 'header-menu' ) ); ?>      Or:               <?php wp_list_pages('include=137,693,139,147&title_li='); ?>      I am new to using `wp_nav_menu();`. I have built 2-level `wp_list_pages();` menus.


Checking return with WP Error

I've seen other people with similar problems, and I know that I need to check the return when calling for the child items in my custom taxonomy "hhie_artists". I'm not sure how to `echo` my output to incorporate `wp_error`. Here is my code:               <?php     $taxonomyName = "hhie_artists";     //Call top layer terms only (by setting Parent to 0).     $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'slug', 'hide_empty' => true));        echo '
';     foreach ($parent_terms as $pterm) {     //Get the Child terms     $terms = get_terms($taxonomyName, array('parent' => $pterm->term_id, 'orderby' => 'slug', 'hide_empty' => true));     foreach ($terms as $term) {     echo '
name, $taxonomyName ) . '">' . $term->name . '
';       }     }     echo '
';     ?>      From what I've found out, this is due to an empty taxonomy field being found. I've yet to populate all my custom taxonomy fields, so I'm not surprised by this error, I just need to solve it. Thanks.


Replicate network plugins without having to configure it for each subsite?

I was wondering if there is a simple way to replicate my configurations for all the subsites once i have activated a network plugin without having to go thru each and configure it manually ?   * Upgrade a set or single network plugin(s) with the same configuration to all subsites


How to get the clean permalink in a draft?

When I use `the_permalink` or `get_the_permalink` in a draft or scheduled post, the URL provided is not the "final" permalink—it is the unpretty `?p=xxxxx` version. How can I get the final, "clean" permalink to show up in a draft or scheduled post? I could do something involving `$post->post_name`, but I'd need the path as well, and that varies from post type to post type and depends on permalink structure. Is there a "universal" way to do this?


Creating WordPress Admin Themes

Is there any way to create our own admin theme rather than the default one. or do we have to override the default style sheets to get the desired look??


After adding add_role to functions.php and creating a user, can not login into admin

I'm trying to add a specific role to manage my custom post types and I'm stuck at the very beginning. I've added `add_role()` to the functions.php file as following:               add_role('resourcerer', 'Resourcerer', array('read_internal_jobs'));      and created a user with that role. However, when I try to login with a new user I would get an error `You do not have sufficient permissions to access this page.` I can't figure out what I'm doing wrong here :S When registering my Custom Post Type I've got the following settings:               'capability_type' => array('internal_job', 'internal_jobs'),     'map_meta_cap' => true,      which, if I understand the register_post_type() Codex correctly, by specifying `capability_type` the `capabilities` strings will be constructed respectively using the strings specified in the `capability_type`, for example: edit_internal_jobs, publish_internal_jobs and so on. I would really appreciate any help!


Posting via email, where do I start troubleshooting?

I host a site for a person that does everything via blackberry and wants to email posts to the site. She has sent one post to the designated mailbox, but 24 hours later the post is still not showing. Where do I start checking what is going wrong in the process?


How to prevent plugin, theme installation failures on Wordpress?

I didn't know this site exists. So, I asked it on WebApps I didn't get a solution still. :-( * * * I am unable to install any theme/plugin to my WordPress 3.0               Downloading install package from http://downloads.wordpress.org/plugin/contact-form-7.2.3.1.zip…         Unpacking the package…         Installing the plugin…         Could not copy file. /public_html/blog/wp-content/plugins/contact-form-7/languages/wpcf7-lt_LT.po         Plugin install failed.          Downloading install package from http://wordpress.org/extend/themes/download/piano-black.2.2.zip…     Unpacking the package…     Could not create directory. /public_html          Downloading install package from http://downloads.wordpress.org/plugin/contact-form-7.2.3.1.zip…     Unpacking the package…     Could not create directory. /public_html/blog/wp-content/upgrade/contact-form-7.tmp/contact-form-7      I get similar messages everytime. Is there any solution?


Existing Ecommerce plugins with Custom Post Types

I am developing a solution which is selling a service (can not be categorized as product) I have developed custom post types and taxonomies but I do not want to re-invent the wheel by adding payment gateways just for this purpose. Is there any way I can customize the "Product" post type in any existing ecommerce plugin available. Thanks for your support


Plugin action hook fires when it should not (unrelated admin screen)

I maintain a plugin which generates a PDF of a page or post when an icon or link is clicked. PDFs may be cached, and as such, when a page or post is edited, we refresh the cache by regenerating the PDF. In the admin section of the plugin, we do the following:               if (is_admin()) {     add_action('admin_init', array(&$this, 'on_admin_init'));     add_action('admin_menu', array(&$this, 'on_admin_menu'));     add_filter("plugin_action_links_" . WPPTOPDFENH_BASENAME, array(&$this, 'action_links'));     register_activation_hook(WPPTOPDFENH_BASENAME, array(&$this, 'on_activate'));     add_action('pre_post_update', array(&$this, 'on_pre_post_update'));     add_action('post_updated', array(&$this, 'generate_pdf_file'));     } else {     add_action('wp', array(&$this, 'generate_pdf'));     add_filter('the_content', array(&$this, 'add_button'));      } Oddly, when saving menus, we get triggered to refresh the cache, which leads to a:               Warning: Creating default object from empty value in /home/{site root}/public_html/wp-content/plugins/wp-post-to-pdf-enhanced/wp-post-to-pdf-enhanced.php on line ###.      I've implemented a rather ugly (I think) workaround, as I am at a loss to figure out why we get triggered when saving on the menu page:               if (is_admin()) {     add_action('admin_init', array(&$this, 'on_admin_init'));     add_action('admin_menu', array(&$this, 'on_admin_menu'));     add_filter("plugin_action_links_" . WPPTOPDFENH_BASENAME, array(&$this, 'action_links'));     register_activation_hook(WPPTOPDFENH_BASENAME, array(&$this, 'on_activate'));             // Ugly workaround to keep from firing when navigation menus are saved        $screen = get_current_screen();        if ( !empty( $screen ) && $screen->id != 'nav-menus' ) {            add_action('pre_post_update', array(&$this, 'on_pre_post_update'));            add_action('post_updated', array(&$this, 'generate_pdf_file'));        }     } else {     add_action('wp', array(&$this, 'generate_pdf'));     add_filter('the_content', array(&$this, 'add_button'));     }      Because screen.php is not yet loaded, earlier in the file we include it so that get_current_screen() is available:               require_once(ABSPATH . 'wp-admin/includes/screen.php');      Surely, there must be a more elegant solution? TIA Lewis


Query a Custom Post Type to another CPT via Metabox

I apologize in advance, I searched for an answer before posting this question but didn't see it, I saw some variations but couldn't quite figure it out. I have 2 custom post types: Buildings and Apartments. I would like to assign a building to every apartment via a metabox dropdown. This is what I have in my function.php file:               function get_myposttype_options( $query_args ) {          $args = wp_parse_args( $query_args, array(         'post_type' => 'buildings',     ) );          $posts = get_posts( $args );          $post_options = array();     if ( $posts ) {         foreach ( $posts as $post ) {             $post_options[ $post->ID ] = $post->post_title;         }     }          return $post_options;     }      This is my Metbox                $meta_boxes[] = array(     'id' => 'buildingdetails',     'title' => 'Add to Building',     'pages' => array( 'property' ),     'context' => 'normal',     'priority' => 'high',          // List of meta fields     'fields' => array(              array(     'name' => '',     'id' => $prefix . 'test_select',     'type' => 'select',     'options' => get_myposttype_options(),         ),               )     );      ![Apartment with building metabox](http://i.stack.imgur.com/6f2aa.png) Any help would be immensely appreciated.


Create a Static HTML Site from WordPress

A friend of mine is investigating the use of WordPress for a dynamic site with some hierarchy. Really, at the moment he just wants "nothing fancier than photos and links between pages," but knowing him, it's going to get more complex from there. The tricky requirement, though, is that he needs to be able to archive the site. As in, output a static HTML version with embedded resources (photos) to a CD for manual distribution from time-to-time. I'm pretty sure this is possible with WP, since that's actually how several caching systems work. But I don't know of any plugins that give you a simple "export site to disc" function. Is there such a plugin?


Moved WP into new folder. How to fix image links in posts?

I moved from Wordpress.com to my own Wordpress.org hosting. I had no problems importing all my posts over, and the images were all linked up fine. Since the import, I decided to move my WP install from the root of HTML_public, to a new folder called Wordpress. The posts are all still fine, but the picture links are still pointing to: http://www.dekhoforum.com/wp-content/uploads/2010/12/father-christmas-raymond- briggs.jpg   When they should be pointing to:   http://www.dekhoforum.com/wordpress/wp-content/uploads/2010/12/father- christmas-raymond-briggs.jpg I am assuming I must have missed out a step and should have not been so hasty in moving things around. Is there an easy way to automatically update all pics in all posts to point to the new URLs? i.e. Add the new wordpress folder into each of the link URLs dekho.com.au/blog/


if If i switch my current wordpress blog theme with a new one, will i lose the SEO i have built up for my site?


Category page doesn't use category.php, instead it redirects to homepage

I am currently modifying a theme. This theme doesn't had a category.php I needed a custom category page. So, I made one. It works on my local server, but when I uploaded it to a real server, this page doesn't work. It always redirect to frontpage. It has a front-page.php and other pages include archive.php, index.php, Some custom page template, single page templates, taxonomy-custom_cat.php etc. I mean everything is pretty normal. Everything else works fine, but on the main server category doesn't work anyway. Isn't it violating template hierarchy? By the way, the main server is wordpress multisite. I had to enable the theme in network admin and then use it in the current site. Thanks in advance. Edit: I found out something interesting. It redirects to frontpage or uses 404 page in the following condition No. not all 404 urls redirect to the front page. I am giving you a general idea               www.example.com/category/category-name -> redirects to front page     www.example.com/category/xxxxx         -> redirects to front page     www.example.com/xxxxx                  -> redirects to front page     www.example.com/xxxx/xxxx              -> goes to 404 page      *xxxx means garbage url It actually use 404 page, but not all the cases and by the way I'm using wpmudev


Multiple loop to display specific post at start of a list

I'm currently querying the following posts:               <?php      $args=(array(     'post_type'=>array( 'premium_content', 'post'),        'posts_per_page' => 3,     'orderby' => 'PREMIUM_CONTENT_FIRST!',     'meta_query' => array(     array(         'key' => 'feature_it_on_homepage',         'value' => '1',         'compare' => '=='         )     )     ));          $home_slide = new WP_Query( $args ); ?>          ?>      And this is how i wish to render the above:               <?php while ( $home_slide->have_posts() ) : $home_slide->the_post(); ?>
Premium_content Specifc Custom Post Type Item

Normal Post Item

Normal Post Item
          <?php endwhile; ?>          <?php wp_reset_postdata(); ?>      So essentially 3 items, with the first one always being a post from the custom post type "premium_content" I believe a multiple loop would be a good way to approach this? Any input is appreciated :)


Is it possible to have a custom post type with feed but without the archive?

In Wordpress 3.9.2 I couldn't find the way to have a custom post type which would have the feed permalink like this: > example.com/custom-post-type/feed/ But **didn't** show the archive (show 404) for: > example.com/custom-post-type/ Just for the sake of completeness it should display the single post: > example.com/custom-post-type/post-1 The relevant `$args` I've tried to change:                   $args = array(             'capability_type'     => 'post',             'has_archive'         => true,             'rewrite'             => array('slug' => 'custom-post-type', 'feeds' => true, 'feed' => true),      My research shows that when the `has_archive` is set to `false`, the feed doesn't work.


NextGen Gallery + GalleryView by John Brien Plugins

I've installed the NextGen gallery plugin (http://wordpress.org/extend/plugins/nextgen-gallery/) and also the galleryview plugin by John Brien (http://wordpress.org/extend/plugins/wordpress-nextgen-galleryview/) and wondered if anyone has used these plugins together. I've got my thumbnails running in a row underneath my main image and happy with this, but the plugin adds next and previous arrows to the left and right of the thumbnails (see image below) and I want to get rid of these and can't find a way of doing this. ![Next and Previous arrows to the left and right of thumbnails](http://i.stack.imgur.com/vey12.jpg) Can anyone point me in the right direction? I've looked through the css file and can't see anything in there.


How to add <button> to wp menu using bootstrap 3 framework

I need to figure out a way to add a `<button></button>` element to a link inside of the wp menu I currently have this markup:               $defaults = array(         'theme_location'  => '',         'menu'            => 'main-nav',         'container'       => 'ul',         'container_class'    => 'nav navbar-nav',         'before'          => '<button class="btn btn-warning">',         'after'           => '</button>',         'menu_class'      => '',         'menu_id'         => 'menu',         'echo'            => true,         'fallback_cb'     => 'wp_page_menu',         'link_before'     => '',         'link_after'      => '',         'items_wrap'      => '
%3$s
',         'depth'           => 0,         'walker'          => ''     );     wp_nav_menu( $defaults );      Here is an example of my site With the current structure in place above, it seems like the links work fine for chrome except for firefox and ie Any suggestions would be great!


Source of Pingbacks

I've replaced the default comments in WordPress with Facebook Comments plugin.      But I'm still getting comments in the form of Pingbacks my in wp-admin > Comments (http://mydomain.com/wp-admin/edit-comments.php).      How can I know the source of these pingbacks ?


How can I get RSS feed for a custom page?

I have a custom page on my blog that doesn't display RSS feed. You can see the code here for the custom page. I am not sure what I need to do to make rss feed for each individual post on that page. I am not much in php myself so any help is appreciated.


Is there an upper limit for users in WP?

Right now I use a single WP table to feed several sites. We have about 72K users and I have started noticing that to see the "Users" page it takes about 30 seconds on our otherwise pretty fast server. Are there any scalability issues I should worry about and anything I can do to get the user functions working quicker? Extra Info: The user table is added to each night using employee data. There is nothing writing to the user table. We do allow users to edit some extra fields that get put into the metauser table. However there is no sign-up or registration. All of the sites simply define the user/meta tables in the config.


error in getting post id

I am making a voting system The problem is that the post id Is returning blank I am sure that post id is returning blank Bcoz when I put a real post id value there it seems working For example               update_post_meta(123, "votes" , $newvotes)      Is Working properly But                update_post_meta($postid, "votes" , $newvotes)      isn't working properly here is the code                 add_action("wp_ajax_add_votes_options", "add_votes_options");        add_action("wp_ajax_nopriv_add_votes_options", "add_votes_options");       function add_votes_options() {     if (!wp_verify_nonce($_POST['nonce'], 'voting_nonce'))         return;          $postid = $_POST['postid'];     $ip = $_POST['ip'];          $voter_ips = get_post_meta($postid, "voter_ips", true);     if(!empty($voter_ips) && in_array($ip, $voter_ips)) {         echo "null";         die(0);     } else {         $voter_ips[] = $ip;         update_post_meta($postid, "voter_ips", $voter_ips);     }             $current_votes = get_post_meta($postid, "votes", true);     $new_votes = $current_votes + 1;     update_post_meta($postid, "votes", $new_votes);     $return = $new_votes>1 ? $new_votes." votes" : $new_votes." vote";     echo $return;     die(0);         }      AND ALSO I TRIED THIS               add_action("wp_ajax_add_votes_options", "add_votes_options");     add_action("wp_ajax_nopriv_add_votes_options", "add_votes_options");     function add_votes_options() {     if (!wp_verify_nonce($_POST['nonce'], 'voting_nonce'))         return;          $postid = $_POST['postid'];     $ip = $_POST['ip'];          $voter_ips = get_post_meta($_REQUEST["post_id"], "voter_ips", true);     if(!empty($voter_ips) && in_array($ip, $voter_ips)) {         echo "null";         die(0);     } else {         $voter_ips[] = $ip;         update_post_meta($_REQUEST["post_id"], "voter_ips", $voter_ips);     }             $current_votes = get_post_meta($_REQUEST["post_id"], "votes", true);     $new_votes = intval($current_votes) + 1;     update_post_meta($_REQUEST["post_id"], "votes", $new_votes);     $return = $new_votes>1 ? $new_votes." votes" : $new_votes." vote";     echo $return;     die(0);         }      But none of this codes are working EDIT#1 calling my action at jQuery               $("#vote").not(".disabled").click(function() {         var el = $(this);         el.html('');         var nonce = $("input#voting_nonce").val();         var data = {             action: 'add_votes_options',             nonce: nonce,             postid: '<?php echo $post->ID; ?>,',             ip: '<?php echo $_SERVER['REMOTE_ADDR']; ?>'                     };


Is there any way to tell when wp_postmeta has been updated?

I have a website for a client, where users can vote up or down certain things on a leaderboard. The up vote is stored within wp_postmeta as a field. What I'd like to be able to do is see what the league table looked like at a certain date & time, but as far as I can see there is no date/time stamp within that table to show when it was last updated. Am I missing something, or is there no way of telling when that field was amended? thanks Rob


Query Vars for the Homepage?

I'd like to make the homepage accept query vars for year, month and date while still keeping the custom permalink structure for the rest of the site. Basically the homepage needs to display several different links that are managed via custom posts. So my hope is that http://mysite.com - will display the links set for the current day but then also enable http://mysite.com/2013/08/10/ - will display the links associated from that day as a type of archives. I need these as variables so I can do several different queries to display the relevant info. Is this even possible, or am I attacking this the wrong way? Will this mess up other pages trying to use the permalink structure? I've attempted to set my own query vars                   add_filter( 'query_vars', 'wpse12965_query_vars' );     function wpse12965_query_vars( $query_vars )     {         $query_vars[] = 'a_year';         $query_vars[] = 'a_month';         $query_vars[] = 'a_day';         return $query_vars;     }          add_rewrite_rule(          '^/([^/]*)/([^/]*)/([^/]*)/?',          'index.php?page_id=5&a_year=$matches[1]&a_month=$matches[2]&a_day=$matches[3]',          'top');      My vars are recognized but it always redirects to the 404 not found page. Any suggestions would be greatly appreciated. Edit So anyone else who may be checking this out I'll just mention that using the date.php template sorted this out and then I am easily able to retrieve the needed date vars like so               $day = (get_query_var('day'));     $year = (get_query_var('year'));     $monthnum = (get_query_var('monthnum'));


How to change wordpress post title?

How to change just wordpress post title but not menu items.               add_filter('the_title', 'wordpress_title');     function wordpress_title(){       return 'New title';     }      ![enter image description here](http://i.stack.imgur.com/UtVPI.png)


How to finish this loop?

I had already asked a question of how to get only get the child pages of a parent page that belonged to a certain taxonomy. A very helpful user gave me the answer to this, however, I was not provided the code to go either side of the loop so that I could get: the title, featured image and excerpt. The code I was given is this:               $child_ids = $wpdb->get_col(     "SELECT ID FROM $wpdb->posts WHERE post_parent = $post->ID AND post_type = 'page' ORDER      BY menu_order"     );           $args = array(     'post__in' => $child_ids, // Only retrieve taxonomy posts that are children of this page     'tax_query' => array(         array(             'taxonomy' => 'top5',             'field' => 'name',             'terms' => $post->post_title         ),     ),     );      So if anyone could tell me how to use this to pull the title, excerpt and featured image that would be great thank you very much in advance!


trying to Change to wp_register_sidebar_widget

I got this in my theme:               register_sidebar_widget(array('Sidebar Login', 'widgets'), 'widget_sidebarLogin');      i want to change this to the updated Command aka               wp_register_sidebar_widget      But i seem to miss something cuz the widget doesent load after the change.. I tried this:               wp_register_sidebar_widget(     'SidebarLoginId',        // your unique widget id     'Sidebar Login',          // widget name     'widget_sidebarLogin',  // callback function     array(                  // options         'description' => 'Some description'     )      What am i missing? is that "widgets" in the original 'register_sidebar_widget' array has a meaning othere then description ?


WP_Query $gallerypage->the_post() giving Undefined offset: 0

When I do               $gallerypage = new WP_Query(array(         'post_type' => 'post',         'pagename' => 'gallery'     ));          $gallerypage->the_post();      the last line `$gallerypage->the_post();` is giving me errors. Why is that? It seems correct?               Notice: Undefined offset: 0 in /site/url/wp-includes/query.php on line 2719     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3491     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3493     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3495     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3496     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3503     Notice: Trying to get property of non-object in /site/url/wp-includes/query.php on line 3514     Notice: Trying to get property of non-object in /site/url/wp-includes/post-template.php on line 30     Notice: Trying to get property of non-object in /site/url/wp-includes/post-template.php on line 30      wp-includes/query.php line 2717 onwards               $this->current_post++;          $this->post = $this->posts[$this->current_post]; // error here?


Orderby custom field meta value ASC and then by date DESC

I need to allow post ordering in certain categories. One of the sorting options is a custom field meta value. First problem is that not all posts have that meta assigned and i need to order these by date (default). Another problem is that meta field should use ASC order and the rest DESC. My code so far In Template File:               $request = $_REQUEST;     global $query_string;     parse_str( $query_string, $qs_arr );          switch ( $request['sort'] ) {              case 'title':             $qs_arr['orderby'] = 'title';             $qs_arr['order'] = 'ASC';             break;         case 'publisher':             $qs_arr['meta_key'] = 'discography_publisher';             $qs_arr['orderby'] = 'meta_value';                  add_filter( 'posts_orderby', 'sort_posts_orderby' );             add_filter( 'get_meta_sql', 'sort_get_meta_sql' );             add_filter( 'posts_where' , 'sort_posts_where' );             break;     }          if ( isset( $request['sort'] ) ) { query_posts( $qs_arr ); }      functions.php               function sort_get_meta_sql( $meta_sql ) {         $meta_sql['join'] = " LEFT JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = 'discography_publisher') ";         return $meta_sql;     }          function sort_posts_where( $where ) {         //here i remove the last statement "wp_postmeta.meta_key = 'discography_publisher' " so query return all posts in category          $explode = explode( 'AND', $where );         array_pop( $explode );         return implode( 'AND', $explode );     }                    function sort_posts_orderby( $orderby ) {         $orderby = 'COALESCE(wp_postmeta.meta_value, wp_posts.post_date) DESC';         return $orderby;     }


Best tools for preparing and styling a table

What are the best tools for preparing and styling a table in Wordpress easily? Update: I want to prepare and publish the tables in any page or post. So I think it might be easier if they can be prepared with an easy to use shortcode.


Comments do not respect display_name setting, how to make plugin to overcome this

When I post something on Wordpress, it's posted with my display name. However if I change my display name, posts posted by me will be updated with the new author. Comments will stay with the old name. Since in my wordpress site comments are available only for registered users, and the display name field is hidden - they have custom profiles, I would like to overwrite the display_name used (it should always match first_name + last_name). So I've tried the the_author hook with no luck. Looking at the source code, I found that the name of the author in author_link is generated as follows:               function get_comment_author( $comment_ID = 0 ) {         $comment = get_comment( $comment_ID );         if ( empty($comment->comment_author) ) {             if (!empty($comment->user_id)){                 $user=get_userdata($comment->user_id);                 $author=$user->user_login;             } else {                 $author = __('Anonymous');             }         } else {             $author = $comment->comment_author;         }         return apply_filters('get_comment_author', $author);     }      This means that if the comment_author is written to the database, I cannot use it in any way. If not - the current user_login of the comment author will be passed to the get_comment_author hook, where I could query the DB to get the row and hence the first and last name. I don't like that new query will be needed, but I can live with this if it's the only way. But what steps I should perform to get it working. Right now the comment_author is always written to the database.


Wordpress ajax problem need wordpress expert?

i want to call a function using wordpress ajax and i have done a code for that also. but when i fire a ajax call it always retrun -1. i dont know what is the problem can any body help me to solve. Here is my code function.php                function my_AJAX_processing_function(){        //echo  $getLetter = $_GET['post_id'];        print_r($_GET);        exit;         global $wpdb;         global $post;              $result = $wpdb->get_results('SELECT * FROM wp_posts where post_title LIKE "'.$getLetter.'%" AND post_status = "publish" AND post_type="post"');         while($row = $result)         {           echo '' . $row['post_title'] . '
';         }         die();     }     add_action('wp_ajax_nopriv_download_track_resources', 'my_AJAX_processing_function');      footer.php                         Html code               <a href="javascript:void(0);" title="Download <?php the_title(); ?>" class="downloadtrack" name="<?php echo $post->ID;?>"><?php the_title(); ?>	      Thanks


Always display a picture even if the link is broken?

What I would like is to have a sort of fall back photo so I don't get red Xs.. Something like "photo unavailable please come back later" Is there a way to check if the image path is valid and if not display another photo. (I really only need the "link is valid" bit.. I can figure the rest out)